Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8197135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:40:45+00:00 2026-06-07T05:40:45+00:00

I have a page with a placeholder content block. Once the page is loaded

  • 0

I have a page with a placeholder content block. Once the page is loaded I’m replacing the default block with some AJAX content, which is either loaded by default or by user interaction.

I’m replacing the loaded content like so:

// inside AJAX success handler
// data is JSON string sent via AJAX
// target is the element containing my default content

var makeUp = data;

target.addClass('fade out').html( makeUp ).trigger('create')
        .removeClass('fade out').addClass('fade in')

This works nicely and I can replace the content whenever the user does something on the page.

However if the user leaves the page and comes back when it’s still in the DOM, I want to show the default content. Right now, the last AJAX content is visible. So I’m looking at binding to page hide and restoring the default content from somewhere.

Question:
What’s the best way to store the default content on the page. It’s not much ( 1 controlgroup, 2 text blocks), but I’m reluctant to add this to the wrapper container as a data-default-string. There must be a better way.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:40:46+00:00Added an answer on June 7, 2026 at 5:40 am

    According to this CanIUse page, you should be able to use HTML5’s web storage feature to store some values – I am looking specifically at a few mobile browsers that may be relevant to you.

    The values could be a few keywords which will allow you to retrieve the textblocks and populate the placeholder, or if it’s small enough, you could store and retrieve the two textblocks themselves.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Ajax to dynamically populate a DIV. I have each page content stored
I have 4 content placeholder from my master page and I am using the
I have a content placeholder on my master page; <title> CompanyName - <asp:ContentPlaceHolder ID=TitleContent
I have a textarea which already contains some content (haml code below) //haml code
I have A single page that has the following structure <form runat=server><placeholder></placeholder></form> I have
I have added placeholder to a page as below. <tr > <td > <asp:PlaceHolder
I have page where I use model which can have different types (depending by
I have page named page--news.tpl.php, which i created for my news page. But after
I have page (Default1.aspx) in which I am redirecting to another page (Default2.aspx) using
I have page which is redirected from htaccess. now I can pass the German

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.