I have the below code from The Dynamic Duo web site. It works great! It loads an external page in both IE and NN. Also verifies the load is complete. HOWEVER...I would like the code to load 2 (or more) pages into 2 (or more) DIVs. How do I change the code?
ANY IDEAS? Thanks for the help!
I know what you mean...my steelers lost to a last min FG
What about passing the URLs to an array and cycling through it. ie, click link--> http://www.a.com, http://www.b.com... Then the array opens each file. I am a newbie to JS so I have no idea how to do it. Food for thought.
1) Do you want the text to appear as one document? In other words, can a 'Load Next' button do?
No...the intent is to load 2 or more at the same time into adjacent DIV/SPANs.
2) Do the documents have to be html documents? Can they be written as document.write()s and included as a js file?
No...they can be html or text. There will be text and gifs/jpgs. It needs to work in IE 4+ and NN 4+.
3) Are these local pages? Or, are you importing pages from another site?
NO...I am using pages ONLY from my web or sub webs.
The links would change both the content AND PICs. So clicking on link1 would have content 1a and pic 1b, while link2 would have 2a and 2b.
Ok. I'm still a little confused as to why you are trying to load the data as pages, especially since you say that you want: "content 1a and pic 1b, while link2 would have 2a and 2b".
The easiest solution would be to create the pages you want by combining the data (text & images) and then loading one source (eg: page1.html = content1a + pic1b)
Another possibility is to put everything into arrays either within the page's header or an included js file and then use the links to swap DIV content & visibilities (see the "dHTML: an Introduction" script/tutorial at my site)
The process could look something like:
function loadDiv(content1, divID)
var content = (content1) ? myContent : myContent;
var picSrc = (content1) ? myPics : myPics;
<DIV id='Div1' style='position:absolute; visibility:hidden;..blahblah....>
Some text as a placement holder, mainly for netscape<img src="pic1.gif">
If the above doesn't solve your problem, I'm going to need a url to see what it is you are attempting.
The top, bottom and left remain constant. The page is in 3 columns. Left column is 150px the middle is 470px and the right is 150px.
The middle area, located in the 470 column and the right 150 (between the top and bottom) column, contain content that must change depending on the link clicked. Normally I would use FP2K but not this time. Instead of having 50 or more pages, I wanted to only alter the content. That is possible and doable. The problem is the code only changes 1 DIV/SPAN.
The right column is an advertising area that is directly related to the content in the middle. So if a restaurant page is shown then the right should show restaurant ads.