href具有主题标签时如何解决jquery异常

时间:2018-07-29 16:55:32

标签: jquery html

我正在从Jquery中获得此异常:

jquery.js:2 Uncaught Error: Syntax error, unrecognized expression: #/register
    at Function.db.error (jquery.js:2)
    at ob (jquery.js:2)
    at xb (jquery.js:2)
    at Function.db [as find] (jquery.js:2)
    at n.fn.init.find (jquery.js:2)
    at new n.fn.init (jquery.js:2)
    at n (jquery.js:2)
    at HTMLAnchorElement.<anonymous> (jquery.nav.js:119)
    at Function.each (jquery.js:2)
    at n.fn.init.each (jquery.js:2)

这是html

 <nav id="mainmenu" class="collapse navbar-collapse navbar-right">
    <ul class="nav navbar-nav">
      <li class="active"><a href="#home-section">HOME</a></li>
      <li><a href="#whatsit">What is Traken</a></li>
      <li><a href="#features">Benefits</a></li>
      <li><a href="#screenshots">SCREENSHOTS</a></li>
      <li><a href="#price">Pricing</a></li>
      <li><a href="https://traken.app/#/register">Free Trial</a></li>
      <li><a href="#call-to-action">Contact</a></li>
    </ul>
  </nav>

如果我从href="https://traken.app/#/register中删除了主题标签,那么它将正常工作。

我该如何解决?

0 个答案:

没有答案