[thelist] IE versus Mozilla Tip...

Anthony Baratta Anthony at Baratta.com
Fri Nov 8 15:33:01 CST 2002


<tip subject="JS pathname: IE vs Mozilla" author="Anthony Baratta">

When using the pathname property, IE (5.5) and Mozilla (1.1) return the
string differently. For example:

    <a href="/path/to/page.html"
	onclick="PathAlert(this.pathname);"
	class="Headline"
	style="text-decoration: none;">

    <script language="JavaScript">

    function PathAlert(varPathName) {
	alert("HREF Path = " + varPathName);
	return true;
    }

    </script>

With IE, you get: "HREF Path = path/to/page.html"

With Mozilla, you get: "HREF Path = /path/to/page.html"

Sigh. Hope this helps someone.

</tip>
---
Anthony Baratta
President
Keyboard Jockeys

"Conformity is the refuge of the unimaginative."




More information about the thelist mailing list