jquery selectors problem - JavaScript Help


$("a[name^=del_comment]").click(function() { $.ajax({ type: "GET", url: "index.phpuserid={$core->input['userid']}&CODE=delete_comment&id="+$(this).attr('id'), context: document.body, success: function(msg){ alert(msg); $('#all_comments').fadeOut('slow').load("index.phpuserid={$core->input['userid']}&CODE=get_comments").fadeIn('slow'); } }); return false; });
all i trying to do is to set an "onclick" event to all tags which there names starts with "del_comment"

this code works fine, but for some reason, when i hit one of the links, this works, but if i try to hit again one of them, this will not work,
i mean this works only one time and i have to reload the page to get it wrok again...
hope you understand...

sorry for my poor english...


Posted On: Wednesday 2nd of January 2013 12:22:49 AM Total Views:  255
View Complete with Replies

Related Messages:

remove a list item   (193 Views)
I would like to know how can i remove a selected item from an ordered list which was dynamicaly created Thanking you in advance!!
submit button working fine in i.e but giving error?   (159 Views)
Thanks a lot Graphix
Any advice on how to build a simple javascript form?   (179 Views)
Any help would be appreciated
form verification using regular expressions   (169 Views)
I keep getting an error that says item is null. I'm a little lost because once I got my regExp to start working this actually worked for a little bit. When I came back i was getting an error. I have no idea what i did. var creditExp = /^([345])(\d{3})\-(\d{4})\-(\d{4})\-(\d{4})$/; var creditNumber = document.getElementById("creditnum").value; var item = creditExp.exec(creditNumber); document.getElementById("creditnum").value = item[1] + item[2] + "-" + item[3] + "-" + item[4] + "-" + item[5]; if (item[1] == 4 && document.getElementById("card1").checked == true) { return true; } else if (item[1] == 5 && document.getElementById("card2").checked == true) { return true; } else if (item[1] == 3 && document.getElementById("card3").checked == true) { return true; } else { alert("You must enter a valid credit card number."); document.getElementById("creditnum").focus(); return false; } var billingName = document.getElementById('creditname').value; if (billingName == null || billingName == "") { alert("You must enter your first name as printed on your credit card!"); document.getElementById('creditname').focus(); return false; }
script slows down IE   (78 Views)
Hi Is there any way that I can make my javascript run faster in IE cause it works normally in other browsers but there is almost a one second delay in IE (the latest version, the one with automatically blocked ...
Showing/Hiding Attributes of the Window Using Javascript   (116 Views)
I would like to hide certain parts of a window such and the menu bar, toolbar, status bar, etc. However, the following properties of the window object give an error saying they do not exist in Internet Explorer (whether any ...
screen center   (96 Views)
Could someone help me with how I could move the box, in the body portion of this page, to center of the screen I was wondering if the "screen.availHeight, screen.availWidth" would be a possibility: