PDA

Click to See Complete Forum and Search --> : reading other pages with javascript


tZ
12-04-2006, 08:49 PM
Is there a way to read to other pages using javascript without using a htmlrequest or database?

Basically, what I have is a portfolio section which I would like to load in text about each piece. Currently, it works using a case statement, but if javascript is not turned on then the text would fail to show.

So what I would like to do is for the seven pieces(for now) on this page create seven replicate pages with the text included. So that when you click on a thumbnail on one page a new page loads in with the piece… that is if the user does not have javascript.

However, using javascript if possible what I want to do is have the inital page containing the thumbnails load on the images dynamically along with the text. However, have the text load on in based on javascript reading what is in the 'container' div of another file… if that makes sense. So that I don't have to use cases with the text in them I want to swab out. Instead say someone clicks on piece one then javascript will read the whats in the paragraph tag of another page and swab it out dynamically on the current page.

So is this possible… or would my only option be using ajax or something simular?

ecsyle
12-04-2006, 08:53 PM
I am not sure to be honest. I think you are going to have to use ajax.

However, why not just use php (asp?) to include the separate pages? You could hijack the behavior with javascript and ajax once you have your base worked out. This way you only update one file for each piece, instead of multiple places.

tZ
12-05-2006, 10:01 PM
I didn't think there was a way besides for using something serverside also.

I'm not all that fluent in serverside languages so I'll prombly just keep the case statements and create the alternate pages as well.

thanks