javascript - Appended anchor link is not active on Safari / iPhone -


i've got function, used lot of different parts of site calls confirmation box. when it's called formats box various elements , appends body, so...

$('body').append("<div id=\"confirmation\"><a href=\"javascript:confirmed()\">confirmed</a> <a href=\"javascript:closeconfirm()\">cancel</a></div>"); 

now, works accept iphone safari browser, doesn't seem activate, or load anchor dom properly... it not clickable. problem, tho box appears correctly, touching anchor nothing. console.log proves this.

any ideas?

have tried doing

$div = $('<div>', { id : "confirmation"}); $aconfirmed =  $('<a>', { href : "#", class : "confirmed", text: "confirmed"}); $acancel =  $('<a>', { href : "#", class : "cancel", text: "cancel"}); $div.append($aconfirmed).append($acancel); $('body').append($div); 

and use event handlers (this assumes jquery > 1.7

$(document).on("click", "a.confirmed", function(){    confirmed(); });  $(document).on("click", "a.cancel", function(){    closeconfirm(); }); 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -