I have a few jquery and ajax functions which work in google chrome perfectly. When I use them in firefox though on my live server it does not work. Is this a known issue in firefox or is there a simple solution I have missed? I think that it mainly is having an issue with the AJAX code but I am not sure.
Here is my jquery code....
$(document).ready(function(){
$("a[id ^= 'toggle']").live("click", function(){
event.preventDefault();
$("div [id='replypost_"+$(this).attr('id').replace('toggle_','')+"']").toggle();
});
});
Note: It also does not work in internet explorer. It only works in google chrome!
What version of jquery are you using?
no event
defined?
Try this?
$(document).ready(function(){
$("a[id^='toggle']").live("click", function(event){
event.preventDefault();
$("div [id='replypost_"+$(this).attr('id').replace('toggle_','')+"']").toggle();
});
});
As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().
$(document).ready(function(){
$("a").on("click", "a[id^='toggle']", function(event){
event.preventDefault();
$("div [id='replypost_"+$(this).attr('id').replace('toggle_','')+"']").toggle();
});
});