Hey guys, I'm building a website and using a small javascrpit, such that I have one html file containing the entire site. page1.
At the moment, the script is used to edit various div's making them either visible or not, as the user navigates.
I'm quite happy with that function, but ... with growth, I need something more.
The code is visible at the bottom of the post.
Currently I call the code such that obj='this', allowing the script to run through the html on the users computer and edit the site in front of them.
This has worked well while my site has been small, but it's growing such that in some instances I need to open a new page. page2.
Simple enough, but is there a way to open page2, AND instruct the code to edit page2, all still from page1?
Logic tells me that the trick involves replacing 'this' when I call the code in page1 with ... the url of page2.
Or that adding an href for page2, and then also replacing 'this' with 'new' (or something else), would run the code on the new page...
I'm still playing with google to find the answer, but I've been coming up dry.
I'm not a professional programmer, but did pass the coding exams back in school (we used object pascal).
Even this code I am using is frankencode, stitched together from something I found in a code bank.
Any help would be greatly appreciated.
This is the html call.
<a onclick="return showTab(this, 6, 3, 13, 0, 0);">
function showTab(obj, ctabid, tab, framepid, fs, sp) { par = obj.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; divs = par.getElementsByTagName("div"); for (i=0;i<divs.length;i++) { c = divs[i]; if (c.className.match(/ctab/gi)) { if (c.className == "ctab"+ctabid) c.style.display = ""; else c.style.display = "none"; } }