Thursday, July 30, 2009

HTML Coding - How dHTML Coding - How do I send two different web pages to two different frames with one click?

To accomplish this, you'll need just a little bit of javascript. I've written a quick script for you that should do the job:





%26lt;script%26gt;


function bothFrames(firstURL, secondURL)


{


//Take out the space after ".replace" Yahoo! wouldn't


//display all of the code without the space in it.


parent.FRAME1.location.replace (firstURL );


parent.FRAME2.location.replace (secondURL );


}


%26lt;/script%26gt;





NOTE: Make sure that you replace "FRAME1" and "FRAME2" with the names of your Frames or it won't work! =)





Just insert the above code between the %26lt;/head%26gt; and %26lt;body%26gt; tag of the page that will have the link that people will click on.





To make it work, just insert a link onto the webpage like so:





%26lt;a href="#" onClick="bothFrames('http://www.yahoo.co... 'http://www.google.com');" %26gt;Please work!!%26lt;/a%26gt;

HTML Coding - How dHTML Coding - How do I send two different web pages to two different frames with one click?
using the onClick event, call window.open for each page. If you already have the windows open, pass their names in the target argument.

stalk

No comments:

Post a Comment