让jquery运行的问题

这个问题是一个真正的问题。 通常我没有任何问题让jquery运行。

我用c#运行一个asp网站。

这是页面生成的html。 当我点击带有id测试的按钮时,我得到以下错误。

网页错误详情

用户代理:Mozilla / 4.0(兼容; MSIE 8.0; Windows NT 6.1; Trident / 4.0; GTB7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)时间戳:2011年6月15日星期三17:08:03 UTC

消息:对象不支持此属性或方法行:236字符:1代码:0 URI: http:// localhost:53294 / FluidataPortal / connections / macRequest.aspx

–html

只是为了清晰显示相关的HTML。 如果需要,我可以展示全部

 

–Javascript

 /*! * jQuery JavaScript Library v1.6 * http://jquery.com/ * * Copyright 2011, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Mon May 2 13:50:00 2011 -0400 */ JQUERY CODE. REMOVED FOR CLARITY function test() { if (!busy) { $.get("ajax/RequestMac.aspx?user=Tomsquires&dsl=123", function(response, status, xhr) { alert(response); }); } } 

您在JavaScript之后包含了jQuery。

需要 JavaScript 之前加载jQuery。


编辑:

OP的原始HTML显示了一个包含在他的jQuery包含之前加载的外部JS文件。

我把我放在元素的底部,就像这样……

       

这就是原因。