Note that there are some explanatory texts on larger screens.

plurals
  1. POI add 10 functions to a code, I don't even call any of them, but the code stops working!
    primarykey
    data
    text
    <p>Alone, this code works:</p> <pre><code>CustomButton = { 1: function () { alert("Just testing") }, } </code></pre> <p>I add the code below and the code above stops working:</p> <pre><code>function getvisitingnow() { return document.location; } function getcontents(uri) { var req = new XMLHttpRequest(); req.open('GET', uri, true); req.onreadystatechange = function (aEvt) { if (req.readyState == 4) { if(req.status == 200) { return req.responseText; } } }; req.send(); } function regexforsitefound(uri, searchcontents) { var re = new RegExp("\\&lt;div class=g\\&gt;.*?(?:\\&lt;a href=\\\"?(.*?)\\\"?\\&gt;.*?){2}\\&lt;/div\\&gt;", "mi"); var sitefound = searchcontents.match(re); if (sitefound[0]) return sitefound[0] else return null; } function regexforcategoryfound(uri, searchcontents) { var re = new RegExp("\\&lt;div class=g\\&gt;.*?(?:\\&lt;a href=\\\"?(.*?)\\\"?\\&gt;.*?){2}\\&lt;/div\\&gt;", "mi"); var categoryfound = searchcontents.match(re); if (categoryfound[1]) return categoryfound[1] else return null; } function regexfordomainname(uri) { var re = new RegExp("http://(?:[A-Za-z0-9-]+\\.)?[A-Za-z0-9-]+\\.[A-Za-z0-9-]+/?", "si"); var domainname = uri.match(re); if (domainname) return domainname; } function regexforparentdir(uri) { var re = new RegExp("http://(?:[A-Za-z0-9-]+\\.)?[A-Za-z0-9-]+\\.[A-Za-z0-9-]+/?", "si"); var parentdir = uri.match(re); if (parentdir) return parentdir; } function getcomparisonlink(visitingnow) { var searchuri = null; var searchcontents = null; var uri = visitingnow; while(true) { searchuri = 'http://www.google.com.br/search?'; searchuri += 'q='+ uri +'&amp;btnG=Search+Directory&amp;hl=en&amp;cat=gwd%2FTop'; searchcontents = getcontents(searchuri); var sitefound = regexforsitefound(searchcontents); if (sitefound) { var categoryfound = regexforcategoryfound(searchcontents); if (categoryfound) { return categoryfound; } } else { var domainname = regexfordomainname(uri); if (!domainname) { var parentdir = regexforparentdir(uri); uri = parentdir; } else { return null; } } } } function clickedlink(event){ var visitingnow = getvisitingnow(); if (visitingnow) { getcomparisonlink(visitingnow); if (comparisonlink) { tab.open(comparisonlink); }; } } function createBookmarkItem() { const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var item = document.createElementNS(XUL_NS, "toolbarbutton"); item.setAttribute("id", "Testing-Doit-Button2"); item.setAttribute("class", "bookmark-item pagerank"); item.setAttribute("tooltiptext", "Do it!"); item.setAttribute("oncommand", "testing_doit();"); return item; } function placeBookmarkItem() { var toolbar = document.getElementById("PersonalToolbar"); var button = createBookmarkItem(); toolbar.appendChild(button); } </code></pre> <p>Why?</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.
 

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