![](/img/trans.png)
[英]Passing map location values in modal to parent page which is already opened. using rails, ruby and bootstrap
[英]Modal to be opened after page reload in Ruby on Rails
在我的ruby應用程序中,我希望在頁面重新加載后打開我的模式。
我已經嘗試了以下代碼...
:javascript
$(document).ready( function() {
$(".minus").click(function(){
location.reload();
$('#memberModal').modal('show');
});
} );
請幫我解決。
提前致謝
您無法在location.reload()
之后調用模式信息,因為該頁面已被解構。
我建議添加不使用重新加載。
如果確實需要,請嘗試將屬性添加到位置並根據其打開模式。
$(".minus").click(function(){
// change it according to your use case
document.location = document.location + "#memberModal";
}
$(document).ready(function(){
if (window.location.hash != null){
$(window.location.hash.substr(1)).modal('show');
}
})
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.