Connecting Tech Pros Worldwide Help | Site Map

inline javascript blocked when loading asynchronously

Newbie
 
Join Date: Jul 2008
Posts: 2
#1: Jul 9 '08
Hi,

In a multiuser environment the following happens:

  • for one user I load a page that contains external, internal and inline javascript; all runs well. If I load new internal or inline script into that page asynchronously using AJAX I can also run everything well
  • for another user using the same client I load all the same things; the external, internal and inline javascript of the original page (so not the AJAX part) works perfect. When I load the AJAX part into the page only the internal javascript works (that's the code in the body of the <script> tag); the inline javascript (eg <button onclick="doSomething();">) is not responding; it seems as if the event doesn't get triggered
Does anyone have a clue how this setting could be different among two users on the same client (its not due the security zone settings since most javascript does work). We think it could be a registry setting but have no idea which one; or maybe we have it completely wrong and it's due to something else.

So if you have an idea, your help would be appreciated,

regards, PJ
iam_clint's Avatar
Forum Leader
 
Join Date: Jul 2006
Location: Oklahoma
Posts: 1,076
#2: Jul 9 '08

re: inline javascript blocked when loading asynchronously


may be a different browser subversion that fixed this error not really too sure on that part.. however sometimes the layout of your actual page affects people differently are your functions above the code that tries to make that call aka the button you have.
Newbie
 
Join Date: Jul 2008
Posts: 2
#3: Jul 10 '08

re: inline javascript blocked when loading asynchronously


Clint,

I have to mention a few more things to make it clear:
The different users are working on exactly the same system and loading the same web page, but one is connected directly to the client, the other through Remote Desktop (RDP) so they should both be using the exact same browser (IE 6...).
If I try the same with FireFox (so two users, one on the client the other trough RDP trying to show the same page) all is well, both users can activate internal and inline javascript...
rnd me's Avatar
Expert
 
Join Date: Jun 2007
Location: Urbana IL
Posts: 411
#4: Jul 11 '08

re: inline javascript blocked when loading asynchronously


try changing the way you declare the functions in your additional script:

instead of :
Expand|Select|Wrap|Line Numbers
  1. function doSomething(){ alert("somthing"); }
  2.  
try:
Expand|Select|Wrap|Line Numbers
  1. var doSomething = function (){ alert("somthing"); }
  2.  

there is something about the way the browser closes undefined functions in event handlers that's funny.

or you can re-apply all of the event handlers once the new script is loaded.
Reply