Search code examples
javascriptjqueryinternet-explorerdebuggingpostmessage

Javascript Errors: "No relay set", only in IE 7, 8


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}

Solution

  • 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 ;-)