2016-04-28 50 views

回答

2

你可以在你的腳本的開頭做的事:

// You can retrieve the id in 'matches' variable if needed 
if (matches = window.location.href.match(/#delete-([0-9])+/)) 
{ 
    $('#my-modal').modal('show'); 
} 
+0

的console.log(window.location.href.match(新的RegExp('/#刪除 - ([0-9])+ /'))); 爲空。 –

+0

適用於沒有「新RegExp」的我,我更新了我的答案 – soywod