PDA

View Full Version : Javascript help



Invent
22-09-2007, 04:40 PM
Hi,

I'm trying to make a 'back' button for my AJAX Content Loader.

My idea was that the first time the site is loaded the var "pages" is set to '0' and then everytime a page loads its increases once.

Then after it is increased the var: page_<value of 'pages'> is set to the URL being loaded.

So then to make a back button I'd just have to do my 'dopage' function but using the var: 'page_<value of 'pages'>-1' instead of an URL.

My problem is I can't figure out how to set a var which has the value of another var in its name, if you get me :P

If you don't understand, I'll try and explain it more clearly.

Thanks to anyone who tries to help x

timROGERS
22-09-2007, 04:44 PM
Hmmm, I understand, but I'm not entirely sure that it's impossible :'(

Invent
22-09-2007, 04:48 PM
I tried doing liek:

pages[Number(pages)] = url;

so it'd set liek:

pages[1]= url;

But nope, didn't work :(

Want to hide these adverts? Register an account for free!