jQuery UI Dialog how to hang up event on clicking a link inside it?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
12 views
Now the code looks like this:
Click

function searchSubmit() {$.ajax({ type: "POST",url: "gni_ajax.asp",data: "query=" + $("#search").val(),success: function(data){$("#results").empty();$("#results").append(data);return false;}});};$('#search').keypress(function(event) {if (event.keyCode == '13') {searchSubmit();}});$("#search-button").click(function () { searchSubmit(); });$("#dialog-form").dialog({autoOpen: false,height: 400,width: 400,modal: true,buttons: {"Отмена": function() {$( this ).dialog("close");}},close: function() {alert("i'm closing!");}});$("#address-select").click(function() {$( "#dialog-form" ).dialog( "open" );});$(".addr").click(function() {alert($(this).text());alert(this.id);$("#dialog-form").dialog("close");});


I had to when you click on one of the links returned by Ajax (different id numbers and texts of one class .addr, the text and the values inserted in the input. But to achieve that, I could not. Decided to at least see what will give alert. But he also showed no response to clicking no. If the hang up event on tap address-select, then everything works fine. But these links inside the dialog which is not working. Not that alert, but the dialogue is not closed. Even if you specify not ".addr", but simply "a" Checked in firebug, the elements are created normally:
Moscow g

What to do with it? It should work the same!
by | 12 views

1 Answer

0 like 0 dislike
for attaching events to not yet existing elements have this bind and live
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked Mar 25, 2019 by Mobyman
0 like 0 dislike
6 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
28,013 users