Jump to content
  • Advertisement
Sign in to follow this  
Extrarius

[web] Help with JavaScript on IE5+

This topic is 4779 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

At work, I had to make a report generator that would create HTML pages that worked on Mozilla 1.0. No problem, follow the standards and it works great. Now, I need to make it work on IE5+. The script is very simple. Essentially, there is a set of images (with IDs of IMG1, IMG2, etc) that start out hidden and a set of divs that acts as containers for other stuff. When you mouse over the first DIV, IMG1 should appear and track the mouse (so the image appears a few pixels above the mouse - the image size is fixed so that is a simple offset) and the background color of the DIV should change. Then you mouse out the first DIV, IMG1 should disappear and the DIV's normal background color (also fixed) should return. When you mouse over the second DIV, IMG2 should appear, etc. For some reason, I'm having a really hard time getting anything like this to work in IE at all. I would post the mozilla code, but it's for work so I'm not allowed to. Basically, there is a global mouse move event that stores the mouse x and mouse y in global variables, and a global image storing (well, pointing) to the currently displayed image (only one at a time ever) is updated to have the proper coordinates through it's style properties. The DIV tags have an onMouseOver and onMouseOut that call the proper function with the string ID of the proper image and 'this'(for changing the background color). IE gives an error on practically every line, pointing to a the first non-whitespace character on the line. I've looked at several scripts from DHTML sites and my code seems to match theirs fairly well, so I have no idea what is wrong in my 30 short lines of code. Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
Advertisement
I can understand you can't post it, but no code at all makes it kinda hard to come up with anything. And there's no point in providing you links to other scripts, since you have already looked at those.

Maybe you could at least tell us what the error is?

Share this post


Link to post
Share on other sites
I've gotten several errors. I don't work today, so I can't post them verbatim, but the kinds of things I'm getting are 'Object Expected' (in code where the only variable being used HAS to be an object, because there is an if statement around the code that ensures that) and 'Invalid Arguments'(in code where no functions are called).

[Edited by - Extrarius on August 26, 2005 4:31:55 PM]

Share this post


Link to post
Share on other sites
Just in case anybody cares, the problem was that my document was XHTML strict, while the demos I d/led were not, and apparently the javascript is differnt between the two. I eventually found a place that had the xhtml strict entities/properties and then got my code to work easily.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!