Hello,
This is a weird one. It's probably an IE problem really, but if I use
prototype's insert() to insert html into the document, inline
javascript (or at least onclick and mouseover) will not work when
using Internet Explorer 7 through Remote Desktop. The reason I'm
posting this here is that if I use innerHTML to insert the HTML, it
works okay.
I discovered this when our web application's context menus refused to
register mouse clicks when I accessed it via remote desktop (this was
necessary due to vpn and nat rules preventing direct access).
You can recreate the problem with this code:
<html>
<head>
<script type="text/javascript" src='/include/prototype.js'></script>
</head>
<script>
function test()
{
var html = "<p><a href='#' onclick='alert(0);'>This link will
work
through Remote Desktop...</a></p>";
$('body').innerHTML += html;
html = "<p><a href='#' onclick='alert(0);'>...but this one
won't!</
a></p>";
$('body').insert({bottom:html});
}
</script>
<body id='body'>
<p><a href='#' onclick='test();'>Click Me!</a></p>
</body>
</html>
Obviously, it's pretty easy to work around this problem, and I can't
imagine it's one that arises very often! But it confused me for a
while. I couldn't find any other references to this through Google, so
I thought I'd put it out there. I wonder if anyone knows what causes
this problem...
Matt.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---