modal-on-click javascript的问题

modal-on-click javascript的问题,javascript,modal-dialog,Javascript,Modal Dialog,出于某种原因,一个通过以下URL的人只会出现一种模式 然而,当我使用我有两个模态加载一个似乎是404页 我使用的代码是贝娄我不确定我到底哪里出错了 `jQuery(document).ready(function() { console.log('modals start here'); if (location.hash === "#leaver, #newuser") { jQuery('#leaver-btn-anchor-toggle,#newus

出于某种原因,一个通过以下URL的人只会出现一种模式 然而,当我使用我有两个模态加载一个似乎是404页

我使用的代码是贝娄我不确定我到底哪里出错了

`jQuery(document).ready(function() {
console.log('modals start here');
  if (location.hash === "#leaver, #newuser") {
        jQuery('#leaver-btn-anchor-toggle,#newuser-btn-anchor-toggle').trigger('click');
  }
  
});`

location.hash==“#leaver,#newuser”
应该做什么??您希望它与leaver或newuser匹配吗?这是为了匹配精确的字符串,而不是一个或另一个。无法确定重复,但应该是
if([“#leaver”,“#newuser”].includes(window.location.hash))
问题是如果使用以下链接[link]则会在leaver模式顶部打开一个模式,由于某种原因,其中没有找到iframe页面
jQuery(“#leaver btn anchor toggle,#newuser btn anchor toggle”)
说同时查找……您可能想要查找一个。