Jecht
New Member
Picture this:
The function navLinkClick(tgt) change the clicked button bg and load the HTML into div#container:
On page load navLinkClick(getByID('nav_login')) is performed (the getByID function is my version of getElementByID, working with any browser)
Everything works fine in IE, Firefox, Safari, mobile Safari (iPhone), but not on Opera for Wii (the Nintendo console)... The script works if the content to load is plain text, so i'm sure the issue is all about quotes...
i tried to replace with ' (single quotes), \\", \", " without success...
\\" and " load something but misformatted (for instance, in text inputs you see \\" or "" respectively, probably due to value=\\"\\" or value="" and the input fields are one-under-another instead of side-by-side)
replacing < and > with < and > transform the content into plain text, and it is loaded into div#container as plain text, not html elements... useless!
I need your help!
HTML:
[...]
<div id="container">Ooops...! Looks like your browser doesn't support JavaScript</div>
[...]
<div id="navigator">
<div id="nav_login" onclick="navLinkClick(this)">Login</div>
<div id="nav_lostpw" onclick="navLinkClick(this)">Lost PW</div>
<div id="nav_register" onclick="navLinkClick(this)">Register</div>
</div>
[...]
<div id="hiddenForms"> /* visibility:hidden; */
<div id="login"><form name="login" ...>[...]</form></div>
<div id="lostpw"><form name="lostpw" ...>[...]</form></div>
<div id="register"><form name="register" ...>[...]</form></div>
</div>
The function navLinkClick(tgt) change the clicked button bg and load the HTML into div#container:
Code:
function navLinkClick(tgt){
var navLink=getByID('navigator').getElementsByTagName('div');
var navLinkDiv=tgt.id.replace('nav_','');
for(i=0;i<navLink.length;i++){
if(navLink[i].className=='navButton'){
if(navLink[i]==tgt){
navLinkBuffer='bottom';
tgt.style.backgroundPosition='bottom';
}else{
navLink[i].style.backgroundPosition='top';
if(getByID(navLink[i].id.replace('nav_','')).innerHTML==''){
getByID(navLink[i].id.replace('nav_','')).innerHTML=getByID('container').innerHTML.replace(/"/g,'"');
}
}
}
}
if(getByID(navLinkDiv).innerHTML!=''){
getByID('container').innerHTML=getByID(navLinkDiv).innerHTML.replace(/"/g,'"');
getByID(navLinkDiv).innerHTML='';
}
return;
}
On page load navLinkClick(getByID('nav_login')) is performed (the getByID function is my version of getElementByID, working with any browser)
Everything works fine in IE, Firefox, Safari, mobile Safari (iPhone), but not on Opera for Wii (the Nintendo console)... The script works if the content to load is plain text, so i'm sure the issue is all about quotes...
i tried to replace with ' (single quotes), \\", \", " without success...
\\" and " load something but misformatted (for instance, in text inputs you see \\" or "" respectively, probably due to value=\\"\\" or value="" and the input fields are one-under-another instead of side-by-side)
replacing < and > with < and > transform the content into plain text, and it is loaded into div#container as plain text, not html elements... useless!
I need your help!
Last edited: