dojox.off.files._sameLocation
dojo.require("dojox.off.files");
defined in dojox/off/files.js
Usage
function (url) (view source)
if(!url){ return false; } // filter out anchors if(url.length && url.charAt(0) == "#"){ return false; } // FIXME: dojo._Url should be made public; // it's functionality is very useful for // parsing URLs correctly, which is hard to // do right url = new dojo._Url(url); // totally relative -- ../../someFile.html if(!url.scheme && !url.port && !url.host){ return true; } // scheme relative with port specified -- brad.com:8080 if(!url.scheme && url.host && url.port && window.location.hostname == url.host && window.location.port == url.port){ return true; } // scheme relative with no-port specified -- brad.com if(!url.scheme && url.host && !url.port && window.location.hostname == url.host && window.location.port == 80){ return true; } // else we have everything return window.location.protocol == (url.scheme + ":") && window.location.hostname == url.host && (window.location.port == url.port || !window.location.port && !url.port);
parameter | type | description |
---|---|---|
url |