You are not logged in.
I see that Xinha normally launches using an HTML onload command:
window.onload = xinha_init;
I'm trying to get Xinha to work with an HTML page that uses the onload command in the body tag:
<body onLoad="document.forms[0].title.focus();set_catlink();" >
It looks like the onload command in the body tag is replacing the one Xinha is using, and preventing it from launching Xinha.
Is there a way to modify the command used to launch Xinha, so that Xinha still launches, even if the body tag of the HTML page uses the onload command?
Offline
Two ways (maybe there are more, better ones, but these are the first that came into my head ):
1.
Delete line:
window.onload = xinha_init;
and change line:
<body onLoad="document.forms[0].title.focus();set_catlink();" >
to
<body onLoad="document.forms[0].title.focus();set_catlink();xinha_init();" >
2.
Change line:
<body onLoad="document.forms[0].title.focus();set_catlink();" >
to
<body>
and instead of
window.onload = xinha_init;
put
function loader(){
document.forms[0].title.focus();
xinha_init();
}
window.onload = loader;
Now put into the function loader whatever you need to do on page load. This way is better because it makes <body> section cleaner and as it was said somewhere in these forums, window.onload is better than <body onload="">
Cheers
Offline
Thanks RBW. This is very helpful.
Offline
Thanks RBW. This is very helpful.
No problem. Started 'playing' with Xinha couple days ago, trying to adapt it to CMS. So there's no problem about sharing things that I learned
Offline