Internet Explorer scripting question

Next
 From:  Dave Morrill (DMORRILL)
3325.1 
Michael,

I've been trying to integrate some canned 3rd-party Javascript packages into one of the MoI plug-ins I've been working on and have consistently run into problems trying to get the code to work. I can usually run the 3rd-party examples in a stand-alone copy of IE8 with no problem, but when I try integrating the code into my plug-in which runs in a pop-up MoI browser window, the 3rd-party code never seems to work.

The symptom is frustratingly simple: the plug-in seems to do nothing. I've tried instrumenting the 3rd-party code with 'alert(...)' calls here and there, and the code always seems to be executing OK as far as I can tell. And yet it never seems to do what it is supposed to do. The rest of my Javascript code seems to work OK, and I've (for the most part) been able to use the jQuery package with my code, but these other packages are all failing silently for unknown reasons.

My best guess is that it is an environmental or security issue with the IE ActiveX component, but since I'm not getting any error messages anywhere, it's very hard to tell what the problem is. Since you've been working with this a lot longer than I have, I was just wondering if you have any thoughts, suggestions or tips? For example, is there some way that you know of that I can enable more debugging information from IE via MoI?

Just FYI, the 3rd-party packages are both different implementations of a Javascript-based code editor widget (to use instead of a simple <textarea>). Both packages attempt to load additional .js and .css files on the fly (hence my security problem hypothesis), but for at least one of them, that actually seems to be working, since an alert() I added to one of the dynamically loaded .js files gets called OK.

My code currently lives in the MoI 'ui' directory, and I've placed the 3rd party code in subdirectories of that, and reference the files using a src="foo/somecode.js" reference.

Any help or suggestions will be appreciated...

- Dave Morrill
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
3325.2 In reply to 3325.1 
try putting your js files in a subdirectory named scripts in the MoI root.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3325.3 In reply to 3325.1 
Hi Dave, well it's pretty hard to say just from a general description of the problem....

Is it possible for you to make some kind of example that I could try over here to repeat the problem?

Maybe it has something to do with cross-domain security though, although if you're using a relative path like that in src="" then I would think you shouldn't run into that. But most moi pages use the moi:// protocol which is a pluggable protocol that looks in the ui folder to find files. If something else is getting loaded with some other protocol like file:// or something like that maybe you could be hitting cross-domain security.

Maybe the other possibility is the tools you are working with may require standards-mode (with a DOCTYPE declaration) rather than quirks mode which is what MoI happens to use instead?

Do the standalone projects in IE8 work if you remove the doctype declarations from the top of the pages so that they're in quirks mode?

You could also try adding a doctype to your problem page as well, like:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> at the very top.

If you can boil it down to the smallest possible example that I can try over here though, maybe I could take a look at it and see if anything jumps out.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Dave Morrill (DMORRILL)
3325.4 In reply to 3325.3 
OK, thanks for the input. I'll look into the protocol and doctype angles more. I know one of the packages dynamically builds a web page in Javascript within an <iframe> and includes a doctype at the beginning (along with some comments in the code saying that certain settings are to avoid some kind of an IE8 problem).

I guess I was hoping there was a flag somewhere I could set that says all errors should be logged rather than silently ignored.

I'll see if I can boil it down to a simple example for you. Thanks...

- Dave Morrill
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3325.5 In reply to 3325.4 
Hi Dave,

> I guess I was hoping there was a flag somewhere I could
> set that says all errors should be logged rather than silently ignored.

You may be able to find some things in the debug log - hold down Ctrl and click on the "MoI" text label in the upper-right corner of the window, and then pick "Show Log" on the menu that pops up.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3325.6 In reply to 3325.1 
Hi Dave, also do you know if the stuff you are trying to do works ok in MoI on a system with IE7 installed?

If so then that could point me to some extra security measure that was new in IE8 which I may need to disengage.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Dave Morrill (DMORRILL)
3325.7 In reply to 3325.6 
I didn't see anything in the log file.

I'll have to see if I have any machines with IE7 still installed. I know in the past it has been pretty hard to do a down-level install of IE, but maybe they've fixed that. I'll let you know if I find anything...

- Dave Morrill
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All