JQuery的:Visual Studio中,错误CS1056:意外的字符“$” [英] JQuery: Visual studio, error CS1056: Unexpected character '$'

查看:4163
本文介绍了JQuery的:Visual Studio中,错误CS1056:意外的字符“$”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试包括ThickBox时(从 http://jquery.com/demo/thickbox/ )在ASP.NET应用程序。

Trying to include ThickBox (from http://jquery.com/demo/thickbox/) in an ASP.NET application.

Visual Studio是失败的:
JS \\的ThickBox \\ jquery的-1.2.6.min.js(11):错误CS1056:意外的字符$

Visual Studio is failing when I try to run the application with the error: js\ThickBox\jquery-1.2.6.min.js(11): error CS1056: Unexpected character '$'

使用Visual Studio 2008
和jQuery 1.2.6

Using Visual Studio 2008 and jquery 1.2.6

推荐答案

也许是因为jQuery $和由asp.net脚本库定义的之间的矛盾。

Maybe is because of the conflict between jQuery $ and the one defined by the asp.net script library.

您可以调用jQuery.noConflict(),然后使用代替$ jQuery的。例如,而不是$(#测试),你将调用的jQuery(#测试)。

You can call jQuery.noConflict() then use jQuery instead of $. For example instead of $("#test") you will call jQuery("#test").

请参阅 http://docs.jquery.com/Core/jQuery.noConflict 获取更多信息。

这篇关于JQuery的:Visual Studio中,错误CS1056:意外的字符“$”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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