10

My javascript won't load because of errors it receives, only in IE. I used debugger to get the following errors. This page renders the javascript correctly in Safari, FF and chrome but not in IE and only on specific pages like this.

http://tsqja.deznp.servertrust.com/Lakeside_721_2_Shelf_Heavy_Duty_Utility_Cart_p/lak-721.htm

1) No relay set (used as window.postMessage targetOrigin), cannot send cross-domain message

2) Invalid argument. jquery.min.js

Any ideas what the first error implies? I have switched out my jQuery build with the latest and it still does the same thing.

UPDATE I have updated my jquery.min.js to the latest and it I figured out this is where the page stops loading...after the invalid argument pops up in the jquery-latest.min.js, line 16 character 15511 which is the following letter 'b':

finally{b=[e,f],c=0}}return this}
Luca Filosofi
  • 30,905
  • 9
  • 70
  • 77
ToddN
  • 2,901
  • 14
  • 56
  • 96
  • 1
    Looking through the source for that link I see you're using Google's +1 button. I'm currently trying to resolve a similar issue and Google Webmaster forums* doesn't appear to have a decent answer. Going to start a bounty for this. * http://www.google.com/support/forum/p/Webmasters/label?lid=1f91cc0e87a8ed93&hl=en – psema4 Jul 29 '11 at 20:21
  • 4
    Debug from the minified `jquery.min.js` is almost meaningless. Try including the full `jquery.js` and sharing the debug from that. – cheeken Jul 29 '11 at 20:35
  • 1
    IE7 does not support window.postMessage – epascarello Aug 04 '11 at 15:07

1 Answers1

10

DEMO https://so.lucafilosofi.com/javascript-errors-no-relay-set-only-in-ie-7-8/

  • 1) - No relay set (used as window.postMessage targetOrigin), cannot send cross-domain message

is caused by the <g:plusone /> button on your site: ( google is busy of this notice ) the only way i found to circumnvent this issue is by doing something like this:

$(function() {
    setTimeout(function() {
        gapi.plusone.render("plusone-div");
    },
    1500);

});

  • 2) - Invalid argument. jquery.min.js

looking into your source-code is a chaos! ;-) OMG

  • you have lot's of errors like ( missing http:// protocol specified ):

  • different folder case-name like /v/newsite/ and /v/Newsite/ this really matter if you are under nix but since you are using ASP...

  • code like this AttachEvent(window, 'load', store_init); while using jquery like jQuery(document).ready(function() {

  • multiple inclusion of the same file ( this file is included 3 times ) /a/j/product_details.js

  • massive use of $(function(){ & $(document).ready(function(){ & $(window).load(function(){ multiple times when just one needed;

  • js global's all around the page, at the top, in the middle and at the bottom, they should stay all on top IMHO...

  • different version of jquery loaded at same time like: jquery-1.4.4.min.js & jquery-1.6.2.js & 1.4.2/jquery.min.js together

  • minor but always crappy, you have <meta /> , <link /> and <script /> in mixed order just like a chicken salad, where they should stay in order meta, links and script preferably at the end of the page.

  • missing semi-colon ; all around;

  • non-sense/malformed code like below and much much more...


if (!/\/shoppingcart\.asp/i.test(window.location.pathname)) {
    jQuery(document).ready(function() {
        jQuery('a').each(AddCartLink)
    });
}

var global_Config_EnableDisplayOptionProducts = 'False';

var global_ImageSeed = 'test.jpg';
global_ImageSeed = global_ImageSeed.substring(...

your site with no errors: https://so.lucafilosofi.com/javascript-errors-no-relay-set-only-in-ie-7-8/

what i have done is:

  1. reordered main tags meta,links,script
  2. removed shitty widgets like addthis, google, facebook
  3. "tried" to place all the globals to the top;
  4. commented the part of the code that cause chrome problems in the TopScriptsTEST5.js this file is your main problem, ( you should see an huge chunk of code commented )
  5. removed duplicate file inclusion,
  6. removed latest version of jquery, cause i strongly doubt that all the rest of your code work with the latest jquery version, so use the 1-4-4 instead
  7. some other fix here and there... nothing special

hope this check-up help a little, but i think you need an exorcist ;-)

Luca Filosofi
  • 30,905
  • 9
  • 70
  • 77
  • 10
    Jut a nitpick on your first point: Starting a url with // is perfectly fine, it will use the same scheme as the page it's on. Very handy if you have both http and https versions of your page and want to make sure to include absolute urls on the same protocol. – Michael Stum Aug 04 '11 at 22:57
  • Good Stuff, thank you for the reply! I am using a Volusion shopping cart, and unfortunately they throw all kinds of stuff in there that I cannot remove or even modify. The ONLY code I have available which I myself created (which I edit basically everyday which is why it isnt MINIFIED right now) is the TopScripts (TopScriptsV2 right now). But that's on my main site, www.BASequipment.com. Most of the problems stated are Volusions own code and I cannot modify! Imagine that.. – ToddN Aug 05 '11 at 12:23
  • @ToddN: not quite true, ;) in your control-panel under `Design -> File Manager -> select-box -> vspfiles / templates / YOUR-THEME-ID / *.html, *.js` you can have some fun by editing the files theme ;) also remember that you should check and fix your TopScripts file as well. – Luca Filosofi Aug 05 '11 at 13:12
  • @Michael Stum 'perfectly fine' on `file://` urls, too ? ;) – c69 Dec 06 '11 at 13:44