Forum Moderators: open
I have a problem, ive been searching this for so long but still can't find the solution...
I have two pages:
page1 and page2
in page1 there's a link where when you click it, a pop-up window will appear[page2].
Where a pop-up window is divided into two frames: contents frame and mainframe
what i want to do?
1. when you click the link [page1], you will automatically in the specific page[page2] in mainframe no need for you to click any links in the contents frame. eh? getz?
please help.... ASAP
thank you.
Scroll down to Message #:1475958 with the title "FORCE MANY PAGES INTO FRAMES with one simple script".
Your pop-up links will link directly to the content url, not the frameset url. And then the script on each individual content page will take the url from the pop-up anchor tag and insert it into content frame of the "master" frameset.
where i put this code?
passpage = document.URL
if (top.location == self.location)
top.location.href="master.html?" + passpage
what is passpage?
document.URL = do i have to replace the word URL with the right url (ex. example.html)? eh.. please don't get mad at me... yeah i'm such naive
what im going to do with this one?
===============================================================
origURL = parent.document.URL
contentURL = origURL.substring(origURL.indexOf('?')+1, origURL.length)
document.write('<frameset cols="20%,80%"><frame src="leftnav.html" name="nav"><frame src=\"' + contentURL + '\" name="content"><\/frameset>')
===============================================================
just copy as it is? or replace the word "origURL" with the right url? and how should i know what is the origURL? is that the "master.html" (based from your example)
contentURL? just copy as it it or replace?
im confused with this code <frame src=\"' + contentURL + '\" name="content"><\/frameset>')
meaning in
+contentURL+ ---------- i should code the right url for contentURL (ex. content.html)?
if that would be the case "contentURL" is the mainframe, the 80%?
and the "leftnav.html" is the 20%? and that's where all the links located? (just imagine the "HELP" or the tutorial appearance in adobe photoshop/ macromedia) something like that...
oh please bear with me...
thank you very much
If you are struggling with basic javascript syntax -- for instance, what terms are native to all javascript and what are just variable names that I defined for this one specific case -- then I'd suggest you spend just a few hours learning those basics. W3Schools is a good resource for this. Then come back to work with this script.
And please trust me, I'm far from a javascript ace and I wrote this script myself. It's one of just a handful that I ever wrote! Adding just a little bit of javascript to your personal toolkit is a really good thing -- you will suffer much less copy and paste slavery.
The other thing I'd suggest you do after you have the very basics of js under your belt, is to take my code and experiment with some html pages to see what happens. There's nothing like hands-on work to make something new really gel.
Here's the link for W3Schools tutorials: [w3schools.com...]