Skip to main content

Bug Tracker

Side navigation

#5542 closed bug (worksforme)

Opened November 22, 2009 03:07AM UTC

Closed November 22, 2009 06:29PM UTC

Using JQuery from <a href="Javascript:xxxxxx" >click me</a>

Reported by: meverett Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description

<div class="example">

<span id="expspan" class="examplespan"></span>

$('#expspan').addClass('blue')

  <a href="Javascript:$('#expspan').toggleClass('blue');">Try It!</a>

</div>

The jQuery code is carried out and then the page reloads with only

[object Object]

on it.

This link

<a href="Javascript:turnItBlue()">Try It!</a>

calling this function

function turnItBlue()

{

$('#expspan').addClass('blue')

}

with exactly the same jQuery command works as perfectly as expected.

Attachments (0)
Change History (1)

Changed November 22, 2009 06:29PM UTC by dmethvin comment:1

resolution: → worksforme
status: newclosed

If you don't cancel the default action by returning

false
from the event handler, the browser will "follow" the link. If you need more help with this, ask on the forums.