Good evening.

I have been working on a small project over the last 2 days to help me learn Javascript. I managed to solve most of the problems I ran into with a bit of googling and reading some books.

However, there is one problem that I just can not figure out. I have 3 arrays storing information on page1.htm, this is all well and good, but I want to use the data stored in those 3 arrays when the user moves to page2.htm. Is there anyway of doing this?

Many thanks. Jake.

Jake,

Is there anyway of doing this?

The simple answer is yes, but I have to ask if you have considered encompassing all of page2's functionality within page1?

Even if the server does some complex database stuff or grabs some XML feed before serving page2, and even if page2.htm has a completely different appearance from page1, it should still be possible for all that to be coordinated from page1 without the need to serve another page.

The advantages would be (a) that page1's javascript environment would remain intact and there would be no need to pass arrays from page to page and (b) there's a good chance that the transition from "page1" to "page2" would be smoother and quicker.

The techniques you would need to do this are DHTML and AJAX, or you may be able to get away with an old fashioned iframe.

The only serious obstacle might be if page1 and page2 were served from different domains because certain browser serurity constraints would start coming into play.

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.