Forum Moderators: open
i also have a front page:
index.htm
there is a menu on index.htm that needs to href to internal.htm and at the same time activate the javascript function to showdiv the correct content related to the link that was clicked on the index page.
(ex [mgccc.edu...] )
hopefully this clears things up. thanks again for any help on this.
1. Pass certain info to the new page.
2. Emulate a click on the appropriate button on the new page.
I had to do that a while ago, and used the solution outlined in this post:
[webmasterworld.com ]
(Forget the complicated version)
That method certainly works, but, as it appears in the address bar, it's not 'invisible' in the way that a cookie-based approach might be. I do favour it though, because - if developed a little further - can allow for the state of the page (ie: which div is shown) to be bookmarkable.
The second part is very easy if the browser supports click emulation method for elements.
In ie, you can do: document.getElementById('id').click()
and you're there. This is especially useful if your menu buttons need to change their appearance when their pages are currently in view (not yours at present).
I'm not sure that all browsers support a click method, so the function that you use to interpret the passed search string will have to call all the functions that you have in your HTML 'onclick' attributes, with the correct parameters - while you're at it, you could replace all those calls in those 'onclick'-s with this function.
Am I making any sense?