0

Is it possible? - this is my try, i have a bunch of thumbs on a page, while the user click on the thumb, i suppose to open a new page, and i should load the slide image, based on thumb, what the user clicked.

what i tried is, when a user click on thumb, i store the data as text in the some hidden element ( replacing text), and with the new page opens, i am loading the element to retrieve the data, what i was assigned. but the dynamic content is event updated, i am only getting the static data, what the element has... is it not possible to get the dynamic data? - as a sample example :

thumb page js :

var i=0;
$('a').click( function (e) {
        e.preventDefault();
        i++;
        $('strong').text(i);    
    })

i am updating the strong's value each time on click.. the new page loading the prev, pages strong element.

   $(document).ready(function(){
                $('body').load('index.html strong', function (data) {
                    console.log('loaded');    
                })   
            })

but i see, only the static data. not dynamic data i assigned. any clue to fix this? or any other way to pass data, apart from get and post method?

3gwebtrain
  • 14,640
  • 25
  • 121
  • 247

1 Answers1

0

You're loading the data from the remote page, which won't have your local changes. http://api.jquery.com/load/#loading-page-fragments

You could try passing in the argument as part of the url and get the data using something like Get escaped URL parameter.

Community
  • 1
  • 1
Royce Feng
  • 1,663
  • 1
  • 10
  • 6
  • but in case of get method, the url show the data... how can i hide that. i can't use the post method as well. since this is static page – 3gwebtrain Aug 22 '12 at 07:35