Click here to Skip to main content
15,896,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Experts,

I am in a Trouble...

I didn't get the jquery click event when i dynamically print the link...

But in the case of Harcoded , it is working fine.....


Please see the JsFiddle...

jsFiddle

Please Help me..

Thanks

Dileep
Posted

Hello,

try using live function like this :

C#
$(".add_to_cart_button").live("click", function (e) {
alert("Hello world");
});
 
Share this answer
 
Comments
dilzz 3-Jun-13 4:54am    
HO thank you sir.....

It's Perfectly working......
Thanks a lot..... :)
try this.

C#
$(document).ready(function () {

    $(".add_to_cart_button").click(function(){
alert("Hello world");
});


Hope this helps.
 
Share this answer
 
v2
Comments
Jameel VM 3-Jun-13 4:38am    
your jQuery syntax is wrong that's you are putting in jsFiddle
dilzz 3-Jun-13 4:40am    
It is not working sir...
Jameel VM 3-Jun-13 4:42am    
it's working. I have tested it in your jsFiddle..Please try..
Jameel VM 3-Jun-13 4:45am    
in which link your click event is not working? i have tried in the 'hardcoded link' it's working fine
dilzz 3-Jun-13 4:57am    
Hardcoded link is already working.. i need to work on Dynamic link....

An i got the solution.... Solution 2.

Any way thanks for your effort......

Thanks
Dileep
C#
$(".add_to_cart_button").live("click", function (e) {
alert("Hello world");
});



Change this it will run :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900