2016-03-23 12 views
0

javascript ile noob sorunu var. İnternette javascript'e nasıl bir url ekleyeceğimi araştırdım, ama bunu anlayamıyorum.javascript'te URL eklemek nasıl

Aşağıdaki öğelerim var, ancak arkasında bir URL ile tıklanabilir olmasını istiyorum. Aşağıdaki kodda bunu nasıl yapacağını bilen var mı? ILLUSTRATORNG.

+0

Olası kopyalar [jQuery kullanarak sayfa yönlendirme yapmak nasıl?] (Http://stackoverflow.com/questions/503093/how-can-i-make-a-page-redirect-using- jquery) – Rajesh

+0

$ .contextMenu'nuz ne yapar? HTML’yi ekliyor musunuz? –

+1

Belgelere göre (https://swisnl.github.io/jQuery-contextMenu/demo/callback.html) kullanabileceğiniz bir geri arama seçeneği vardır (window.location ile birlikte). – Maffelu

cevap

0

Bağlam menüsü bir geri arama sağlar.

items: { 
    "Ship": { 
     name: "Ship Expedite", 
     icon: "paste", 
     callback: function(key, options) { 
      // Do your page redirection here. 
      window.location.href('www.yoursite.com/shippingpage'); 
    }}, 
    "Request": {name: "Request information", icon: "edit", 
     callback: function(key, options) { 
      // Do your page redirection here. 
      window.location.href('www.yoursite.com/requestpage'); 
    }}, 
    "Reminder": {name: "Send reminder", icon: "reminder"}, 
    "Inbound": {name: "Request Inboud", icon: "copy"}, 
    "delete": {name: "Delete expedite", icon: "delete", 
     callback: function(key, options) { 
      // delete item or whatever using ajax possibly? 
      // eg. $.post('www.yoursite.com/deleteitem',{id:key}); 
    }} 
    }, 
    "sep1": "---------", 


} 
ait
+0

Çok teşekkür ederim. Bu benim için çözüm! – Marios

+0

Yardım için sevindim :) – KyleK