On Jun 18, 2009, at 3:42 PM, Daniel Friesen wrote:

>
> Another option you have is grabbing .attr('href') and using a regex to
> extract the portion you want.

Yeah, that's what I do. Something like this:

this.pathname.replace(/^\//,'')

removes the initial slash

or

this.pathname.replace(/(^[^/])/,'/$1')

adds an initial slash if it isn't already there.

--Karl

> pbcomm wrote:
>> I'm working with A elements and checking the pathname on click to
>> provide different actions depending on link (href) path.
>> But I do see what you mean, it will require setting the pathname
>> property on the element.
>>
>> On Jun 18, 3:24 pm, John Resig <jere...@gmail.com> wrote:
>>
>>> Unfortunately that would involve changing the property on the DOM
>>> object itself, which is something that jQuery doesn't handle.
>>>
>>> Which element(s) are you working with that have the pathname  
>>> associated with it?
>>>
>>> --John
>>>
>>>
>>>
>>> On Thu, Jun 18, 2009 at 2:06 PM, pbcomm<pbc...@gmail.com> wrote:
>>>
>>>
>>>> The pathname property of links is missing a leading slash on IE  
>>>> and I
>>>> was wondering if this should be the fix event functionality.
>>>>
>>>
>>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to