Opened 13 years ago
Closed 13 years ago
#5542 closed bug (worksforme)
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.
Note: See
TracTickets for help on using
tickets.
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.