Jump to content

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
https://forums.phpfreaks.com/topic/146898-ie-object-error/
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
https://forums.phpfreaks.com/topic/146898-ie-object-error/#findComment-771261
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
https://forums.phpfreaks.com/topic/146898-ie-object-error/#findComment-771488
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
https://forums.phpfreaks.com/topic/146898-ie-object-error/#findComment-771772
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
https://forums.phpfreaks.com/topic/146898-ie-object-error/#findComment-771983
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
https://forums.phpfreaks.com/topic/146898-ie-object-error/#findComment-772009
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
https://forums.phpfreaks.com/topic/146898-ie-object-error/#findComment-772011
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
https://forums.phpfreaks.com/topic/146898-ie-object-error/#findComment-772017
Share on other sites

ah ok have you tried adding in the if statement?  and the var variable before _uacct ???

 

also:

 

http://blog.martinlegris.com/?p=86

It is defined though as I have urchin.js included and the error isnt saying something is undefined...

 

Object issue..?

 

 

Link to comment
https://forums.phpfreaks.com/topic/146898-ie-object-error/#findComment-772046
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.