Bulldog13
Golden Member
Basically,
I have a webpage that uses the following function :
var setInnerHTML = function( id, str ){
if(!document.getElementById) return; // Not Supported
if(document.getElementById){
document.getElementById(id).innerHTML = str;
}
When the user clicks on a certain link on the page, the page is dynamically changed. It allows me to keep all information on a certain topic on a single .html file.
Here is an example of the actual function call.
onclick="setInnerHTML('contentalt1',foo);"
It works great. I can click on a link and change whatever I want inside of a given html page. Thought I was being clever, shrinking the number of html files.
The problem now is how do I link to abc.html and run setInnerHTML('contentalt1',foo2) as soon as the page loads (essentially changing the default text for abc.html)? Obviously, I could just drop it in the <body> tag, but then that would break it everywhere else because I don t want that text displayed first, except when the certain link on a different page is clicked.
Thoughts ?
I have a webpage that uses the following function :
var setInnerHTML = function( id, str ){
if(!document.getElementById) return; // Not Supported
if(document.getElementById){
document.getElementById(id).innerHTML = str;
}
When the user clicks on a certain link on the page, the page is dynamically changed. It allows me to keep all information on a certain topic on a single .html file.
Here is an example of the actual function call.
onclick="setInnerHTML('contentalt1',foo);"
It works great. I can click on a link and change whatever I want inside of a given html page. Thought I was being clever, shrinking the number of html files.
The problem now is how do I link to abc.html and run setInnerHTML('contentalt1',foo2) as soon as the page loads (essentially changing the default text for abc.html)? Obviously, I could just drop it in the <body> tag, but then that would break it everywhere else because I don t want that text displayed first, except when the certain link on a different page is clicked.
Thoughts ?