未捕获的错误:语法错误,无法识别的前pression:#/ angularjs和jQuery [英] Uncaught Error: Syntax error, unrecognized expression: #/ angularjs and jquery

查看:277
本文介绍了未捕获的错误:语法错误,无法识别的前pression:#/ angularjs和jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

继在我的控制台中显示了错误,每当我的页面加载。

Following error shown up in my console whenever my page loads.

未捕获错误:语法错误,无法识别的前pression:#/关于

"Uncaught Error: Syntax error, unrecognized expression: #/about"

我的code是如下:

                <li class="active">
                    <a href="/">Home</a>
                </li>
                <li class="">
                    <a href="#/about" title="About Us">About</a>
                </li>
                <li class="">
                    <a href="#/pricing">Pricing</a>
                </li>

它显示的全部初始实例。最初,它显示了#/有关,因为它是第一个,如果我删除关于我们标签,它会显示为定价页面的链接。

It shows for all initial instance of . Initially, it shows for #/about as it is first, If I remove about us tab it will show up for pricing page link.

它不是引导选项卡上的问题,这是简单的导航只有

Its not bootstrap tab issue, This are simple navigation only

路由code在app.js:

Routing Code in app.js:

$routeProvider.when('/', {
        templateUrl: 'partials/home.html'
    }).when('/account', {
        templateUrl: 'partials/account.html',
    }).when('/terms', {
        templateUrl: 'partials/terms.html'
    }).when('/about', {
        templateUrl: 'partials/about.html'
    }).otherwise({
        redirectTo: '/'
    });

我已经调试它引导的问题,引导资产净值造成这个问题:NAV导航栏,导航
此修复是数据目标=#,但各地要适当的工作,为这个

I have debug its issue of bootstrap, bootstrap nav causing this issue: "nav navbar-nav" fixes for this is data-target="#" but wants proper work around for this

推荐答案

这是最有可能一个引导的问题。尝试使用您的链接像这样

This is most probably a Bootstrap issue. Try using data-targetattribute on your links like this

<a href="#/about" data-target="#about" title="About Us">About</a>

这篇关于未捕获的错误:语法错误,无法识别的前pression:#/ angularjs和jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆