jquery - javascript taking new id issue -


i have problem again codes. right menu click on image takes first id successfully, , click on second image right click not taking new second id, show first click image id.

how can fix issue.

$(document).ready(function() {             $("#sortable li").on("contextmenu", function(e) {                 id = $(this).attr("id");                 idbul = id.replace("galerisirala_", "");                   items = {};                 galeriduzenlelinki = ("galeri-duzenle&galeriduzenle=" + idbul);                 galerisilmelinki = ("sayfalarsonucu&galerisil=" + idbul);                 items[galeriduzenlelinki] = {name: "fotoğrafı düzenle", icon: "edit"};                 items[galerisilmelinki] =  {name: "fotoğrafı sil", icon: "delete"};                  $(function() {                     $.contextmenu({                         selector: ".context-menu-one",                         callback: function(key) {                             var m = "index.php?sayfa=" + key;                             $(location).attr("href", m)                         },                         items: items                     });                 });             });          }); 

i fix issue myself.

   $(document).ready(function () {     $("#sortable li").on("contextmenu", function() {         id = $(this).attr("id");         idbul = id.replace("galerisirala_", "");         //alert(idbul);          items = {};         galeriduzenlelinki = "galeri-duzenle&galeriduzenle=";         galerisilmelinki = ("sayfalarsonucu&galerisil=");         items[galeriduzenlelinki] = {name: "fotoğrafı düzenle", icon: "edit"};         items[galerisilmelinki] = {name: "fotoğrafı sil", icon: "delete"};          $(function () {             $.contextmenu({                 selector: ".context-menu-one",                 callback: function (key) {                     var m = "index.php?sayfa=" + key;                     $(location).attr("href", m + idbul)                 },                 items: items             });         });     }); }); 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -