On May 23, 12:03 am, kangax <[EMAIL PROTECTED]> wrote:
> Why can't you just use 
> "document.location.pathname"?http://developer.mozilla.org/en/docs/DOM:window.location

Instead of DOM 0 properties, it may be better to use DOM 2 HTML
standard properties instead.  Consider the URL and domain properties
of interface HTMLDocument:

<URL: http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268 >

Paste this into the address bar (please excuse wrapping):

javascript:var re=new RegExp('^.+' + document.domain);
alert((document.URL).replace(re,''));

If the OP wants to remove the filename, that is pretty easy too.


--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to