Twitter BootStrap Modal Window fallback link

后端 未结 2 794
日久生厌
日久生厌 2021-02-13 13:43

I am using Twitter Bootstrap modal windows. Just incase the modal windows dont work because of the js error - have a fall back pages. How can i make sure the page is loaded if t

2条回答
  •  一向
    一向 (楼主)
    2021-02-13 14:27

    Looking at line 223 in bootstrap-modal.js revealed what's happening:

    , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
    

    When using the data api the modal checks if the href attribute is not an id and sets that as the value for the remote option. This causes the page to load the data-target content initially and then load in the href content after as remote content.

    So to avoid the href content getting loaded into the modal you need to specify data-remote="false" on your link:

    Login
    

提交回复
热议问题