[Project_owners] How to find and strip TLDs' from URIs'

Pete Collins pete at mozdevgroup.com
Tue Oct 26 20:26:02 EDT 2004


> P.s. mozdevs TLD is .org ;)
>
js> var uri = jslibCreateInstance("@mozilla.org/network/simple-uri;1", 
"nsIURI");
js> uri.spec="http://www.mozdev.org/";
http://www.mozdev.org/
js> uri.path;
//www.mozdev.org/
js> uri = uri.path.replace(/\//g, "");
www.mozdev.org
js> uri = uri.substring(uri.lastIndexOf("."), uri.length);
.org
js>

-- 
Pete Collins - Founder, Mozdev Group Inc.
www.mozdevgroup.com
Mozilla Software Development Solutions 





More information about the Project_owners mailing list