By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,712 Members | 2,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,712 IT Pros & Developers. It's quick & easy.

inline javascript blocked when loading asynchronously

P: 2
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
Jul 9 '08 #1
Share this Question
Share on Google+
3 Replies


iam_clint
Expert 100+
P: 1,208
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.
Jul 9 '08 #2

P: 2
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...
Jul 10 '08 #3

rnd me
Expert 100+
P: 427
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.
Jul 11 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.