href getting changed, when using .click()

22 views
Skip to first unread message

eyeyen

unread,
Aug 25, 2010, 6:50:41 PM8/25/10
to FuncUnit
Hi, sorry for another post, but I can't solve this issue.

I have a link, which responds to a click event that I've written in
jQuery.

Here is the HTML:
<a href="#edit-group-54">edit group</a>

So when this gets clicked we're able to edit a group.

However, when trying to use FuncUnit to test, I use .click() on the
element to simulate the click, however, it doesn't open up the groups
as expected.
S('#group54 span.tlinks a').click() //this references that link

I looked at the HTML again, and noticed that the href is changed from
"#edit-group=54" to "javascript://"
<a href="javascript://" class="on">edit group</a>

And my click event *needs* that href info to function properly. Is
this a bug in FuncUnit, or is it normally supposed to swap out the
href like that? Thanks guys.

Justin Meyer

unread,
Aug 25, 2010, 7:05:33 PM8/25/10
to func...@googlegroups.com
It should be setting href back to normal immediately following the click.

Here's where it's changing it, commented with why.

//remove b/c safari/opera will open a new tab instead of changing the page
element.setAttribute('href','javascript://')

I will explore another fix for this safari / opera issue.


Justin Meyer

Jupiter Consulting
\Development\Training\Support
847-924-6039
justin...@gmail.com

eyeyen

unread,
Aug 25, 2010, 7:55:42 PM8/25/10
to FuncUnit
Thank you for that, I'll be sure to check the source next time. That
works with it commented out, cheers!

On Aug 25, 4:05 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> It should be setting href back to normal immediately following the click.
>
> Here's where it's changing it, commented with why.
>
> //remove b/c safari/opera will open a new tab instead of changing the page
> element.setAttribute('href','javascript://')
>
> I will explore another fix for this safari / opera issue.
>
> Justin Meyer
>
> Jupiter Consulting
> \Development\Training\Support
> 847-924-6039
> justinbme...@gmail.com
Reply all
Reply to author
Forward
0 new messages