This problem is being a real ballache. Normally i dont have any problems getting jquery to run.
I am running a asp web site with c#.
Here is the html generated by the page. When i click the button with id test i get the error below.
Webpage error details
User Agent: Mozilla/4.0 (compatible;
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) Timestamp: Wed, 15
Jun 2011 17:08:03 UTCMessage: Object doesn’t support this
property or method Line: 236 Char: 1
Code: 0 URI:
http://localhost:53294/FluidataPortal/connections/macRequest.aspx
–HTML
Just showing the relevent html for clarity. I can show the full if needed
<button id="test" onclick="test()">
Click me to test
</button>
–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);
});
}
}
You are including your jQuery after your JavaScript.
jQuery needs to be loaded BEFORE your JavaScript.
EDIT:
The OP’s original HTML showed an Includes to an external JS file being loaded before his jQuery includes.
I put mine at the bottom of the
<body>element like this…HERE is why.