snowieken
11-16-2004, 09:10 PM
Hello! First timer on this forum! I just started a webdevelopment course, and I have just encountered a little problem. I am fairly new to this stuff, so bear with me ;)
I wrote a function for a so-called "crumbs path". When you click on a certain <div> in the menu, it calls the function, which changes the innerHTML of a <span> somewhere on the page. So far, so good: it works perfectly in Netscape and Opera. Then I try it in IE 6. The code works, and it does exactly what it is supposed to do, but yet it gives me a syntax error. The innerHTML is changed to a pretty complicated contamination of strings, but I am pretty sure there is nothing wrong with that. Does anyone have an idea?
Here is the function:
function SwitchKruimel(text, submenu) {
if(document.getElementById) {
document.getElementById('kruimelpad').innerHTML =
' You are here: <a href="index.html">home</a>' +
' :: <a href="#" onClick="SwitchMenu(' +
'"' + submenu +
'");SwitchKruimel("' +
text +
'","' +
submenu +
'")">' +
text +
'</a>';
}
}
Here is the <span> which changes (in other words, the crumbs path):
<span id="kruimelpad">
You are here:
<a href="index.html">home</a>
</span>
And here is the function called:
<div class="menutitle" onClick="SwitchMenu('sub1');SwitchKruimel('my websites','sub1')">
- my websites -
</div>
The HTML of the crumbs path looks like this: You are here: home and it changes into You are here: home :: my websites, just as it is supposed to - but unfortunately with that nasty yellow triangle in the bottom left corner in IE. SwitchMenu() works and doesn't give me any problems, I have located the error to be in SwitchKruimel() - but that's about it. I can't find it, and some help is much appreciated! :)
I wrote a function for a so-called "crumbs path". When you click on a certain <div> in the menu, it calls the function, which changes the innerHTML of a <span> somewhere on the page. So far, so good: it works perfectly in Netscape and Opera. Then I try it in IE 6. The code works, and it does exactly what it is supposed to do, but yet it gives me a syntax error. The innerHTML is changed to a pretty complicated contamination of strings, but I am pretty sure there is nothing wrong with that. Does anyone have an idea?
Here is the function:
function SwitchKruimel(text, submenu) {
if(document.getElementById) {
document.getElementById('kruimelpad').innerHTML =
' You are here: <a href="index.html">home</a>' +
' :: <a href="#" onClick="SwitchMenu(' +
'"' + submenu +
'");SwitchKruimel("' +
text +
'","' +
submenu +
'")">' +
text +
'</a>';
}
}
Here is the <span> which changes (in other words, the crumbs path):
<span id="kruimelpad">
You are here:
<a href="index.html">home</a>
</span>
And here is the function called:
<div class="menutitle" onClick="SwitchMenu('sub1');SwitchKruimel('my websites','sub1')">
- my websites -
</div>
The HTML of the crumbs path looks like this: You are here: home and it changes into You are here: home :: my websites, just as it is supposed to - but unfortunately with that nasty yellow triangle in the bottom left corner in IE. SwitchMenu() works and doesn't give me any problems, I have located the error to be in SwitchKruimel() - but that's about it. I can't find it, and some help is much appreciated! :)