Hi all,

onActivate() is called twice on my page when I have following Javascript
code included. When I remove document.write() call, onActivate() is called
once. Any idea how can I solve this?

Sample.tml

...
<head>
<script type="text/javascript"
src="${asset:context:/js/styleloader.js}"></script>
...

styleloader.js

function loadBrowserStyle()
{
   ... handling routines, where specialCSS is filled with proper style
(different style for different browsers)
    document.open();
    document.write("<link rel=stylesheet type='text/css'
href='"+specialCSS+"' title='externe Styles'>");
    document.close();
}
loadBrowserStyle();

onActivate() is called twice even if I replace <link rel=... in
styleloader.js with something like this ...

"<link href=\"${asset:context:" + specialCSS + "}\" rel=\"stylesheet\"
type=\"text/css\" />"

Any idea how can I write to page from Javascript without calling
onActivate() twice?

Regards,
Robert
-- 
View this message in context: 
http://www.nabble.com/onActivate%28%29-called-twice-when-document.write-is-called-in-Javascript-tp20341486p20341486.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to