Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This sounds like a race condition where a variable is not getting properly initialized before getting used. Considering this is not an AJAX issue according to your comments, there will be a couple of ways of figuring this out, listed below.</p> <p><strong>Hookup a Javascript exception Logger</strong>: this will help you catch just about all random javascript exceptions in your log. Most of the time programmatic errors will bubble up here. Put it before any scripts. You will need to catch these on the server and print them to your logs for analysis later. This is your first line of defense. Here is an example:</p> <pre><code>window.onerror = function(m,f,l) { var e = window.encodeURIComponent; new Image().src = "/jslog?msg=" + e(m) + "&amp;filename=" + e(f) + "&amp;line=" + e(l) + "&amp;url=" + e(window.location.href); }; </code></pre> <p><strong>Search for window.location</strong>: for each of these instances you should add logging or check for undefined concats/appenders to your window.location. For example:</p> <pre><code>function myCode(loc) { // window.location.href = loc; // old typeof loc === 'undefined' &amp;&amp; window.onerror(...); //new window.location.href = loc; //new } </code></pre> <p>or the slightly cleaner:</p> <pre><code>window.setLocation = function(url) { /undefined/.test(url) ? window.onerror(...) : window.location.href = url; } function myCode(loc) { //window.location.href = loc; //old window.setLocation(loc); //new } </code></pre> <p>If you are interested in getting stacktraces at this stage take a look at: <a href="https://github.com/eriwen/javascript-stacktrace" rel="nofollow">https://github.com/eriwen/javascript-stacktrace</a></p> <p><strong>Grab all unhandled undefined links</strong>: Besides window.location The only thing left are the DOM links themselves. The third step is to check all unhandeled DOM links for your invalid URL pattern (you can attach this right after jQuery finishes loading, earlier better):</p> <pre><code>$("body").on("click", "a[href$='undefined']", function() { window.onerror('Bad link: ' + $(this).html()); //alert home base }); </code></pre> <p>Hope this is helpful. Happy debugging.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload