Jump to content

IE Object error


jaymc

Recommended Posts

A lot of my users (not all) get this IE alert when closing my website. The issue is, it does not give any indication to the function/line where the error is being triggered

 

Any ideas how to debug this. I have about 2000 lines of javascript in 5 files... so not feasible to do this manually

 

There is nothing wrong with LINE 1 or CHAR 1 and if I remove that line completely I still get the error

 

[attachment deleted by admin]

Link to comment
Share on other sites

Unfortunately, your request is a bit vague.

 

Is the error occurring with a certain version of IE?

Do you have any code that's supposed to fire when the page is unloaded?

Have you checked it with FireFox and FireBug?

Can you generate the error yourself?

Are you waiting to load the JS until after the HTML is fully rendered?

Link to comment
Share on other sites

Is the error occurring with a certain version of IE? - IE6 and IE7

 

Do you have any code that's supposed to fire when the page is unloaded? NO

 

Have you checked it with FireFox and FireBug? No ALERT error with firefox but I guess thats because this is an IE thing (alerting)

 

Can you generate the error yourself? NO

 

Are you waiting to load the JS until after the HTML is fully rendered? NO

 

 

Im just wondering why IE says its on LINE1 CHAR1.  Is that where I should be looking?

Link to comment
Share on other sites

Are you waiting to load the JS until after the HTML is fully rendered? NO

 

Without being able to see the code, this could be the root of the problem.  You need to ensure that the HTML is fully rendered before attempting to obtain element references.  If you're using a lot of inline JavaScript, then it won't be much of an issue as it's written at the same time as the markup.  But if you have element references placed within <script> tags, they may be null because JavaScript is attempting to obtain the elements before they exist.

 

So, something like:

<script type="text/javascript">
   window.onload = function()
   {
      /* script goes here */
   }
</script>

 

May fix the issue.

 

Again, this is without seeing any code, so there's definitely no guarantee that this will fix the issue.

Link to comment
Share on other sites

Here I have this

 

<script language="javascript" type="text/javascript"> 
var init_user = "";
var init_password = "";
</script>

 

<script type="text/javascript">Drag.init(document.getElementById("draglol"));</script>

 

 

<script type="text/javascript"> 

_uacct = "UA-272345490-1";
urchinTracker();

</script>

 

Link to comment
Share on other sites

Unfortunately, that doesn't really shed any light on the problem.  It looks like you have several 'islands' of JS in your code, but without seeing exactly where it's located in the document, and any code that provides context for what's going on, I can't really diagnose the problem.

 

Is this JS something you wrote yourself, or is it a 3rd party script?

Link to comment
Share on other sites

its a 3rd party script from google ads it keeps telling me urchintracker is 'undefined' :P

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
  _uacct = "UA-9999999-9"
  if (typeof(urchinTracker) != 'undefined')
    urchinTracker();
</script>

 

dont know if that will solve the problem

Link to comment
Share on other sites

Unfortunately, that doesn't really shed any light on the problem.  It looks like you have several 'islands' of JS in your code, but without seeing exactly where it's located in the document, and any code that provides context for what's going on, I can't really diagnose the problem.

 

Is this JS something you wrote yourself, or is it a 3rd party script?

I wrote a lot of it but I use things like SwfFlashObject

 

 

its a 3rd party script from google ads it keeps telling me urchintracker is 'undefined' :P

<script type="text/javascript>
var _uacct = "UA-9999999-9";
  if (typeof(urchinTracker) != 'undefined'){
    urchinTracker();}
</script>

 

dont know if that will solve the problem

Thats fine urchinTracker() is refferenced further up in the code

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.