基于URL中的HASH打开Bootstrap模式

时间:2016-04-28 14:32:30

标签: javascript jquery twitter-bootstrap

如果网址的delete带有HASH参数,如何在页面加载后打开id引导模式?

示例:

http://example.com/properties#delete-86

1 个答案:

答案 0 :(得分:2)

你可以在你的剧本开头做:

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