Say you have a link with a relative path that looks like this:
<a id="link" href="/folder/filename.php">Link Text</a>
and you try to grab that href using Mootools code like this:
$('link').get('href');
That will return /folder/filename.php in every browser but IE which literally inserts the domain for you, returning http://www.domain.com/folder/filename.php.
Is there a way around this? If not, how can I reliably grab everything but the domain in all browsers? String matching will be a pain because this site is currently being tested on three different domains, not to mention the different people doing local testing with who knows what combination of localhost, port number, and whatever else.
You’re probably best off testing to see if the URL starts with a URI scheme plus domain. This avoids the odd-but-perfectly-valid case where the domain exists in the path.