This error appears when the core jQuery fie is not included, either
because there is no script tag with a src attribute pointing to it or
because the src attribute is pointing to the wrong place. It can also
appear when you include scripts that use jQuery before you include the
core jQuery file.
Since it looks like you have a reference to it, and the reference is
coming before any references to scripts that use it, my only other
guess is that it's pointing to an incorrect location. Try opening the
"Script" tab in Firebug and examining the jquery.js script. If it
shows you some html instead of javascript, then you're getting a 404.
Another way you could troubleshoot this is to paste this next line in
and use it instead of your "<script type="text/javascript" src="js/
jquery.js"></script>":
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js
" type="text/javascript"></script>
If that one works, then most likely your other one is getting a 404.
Hope that helps.
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Aug 20, 2008, at 7:13 PM, larksys wrote:
I'm trying to apply what I know so far to my CF page and an
autosuggest input field. The very first line of javascript give an
error;
$ not defined
$(document).ready(function(){
The java script files are included ( I checked that)
The css files are included (I checked that)
<link rel="stylesheet" type="text/css" href="js/
jquery.autocomplete.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.autocomplete.js"></
script>
And this script;
<script type="text/javascript">
$(document).ready(function(){
$('#suggest1').html('&& nbsp;');
$("#idm").change( function() {
var formval = { idm:$(this) .val()};
$.ajax({
type: "POST",
url: "panels/panelCandidates_1_db.cfm",
dataType: "json",
data: formval,
success: function(response){
$('#suggest1').fadeIn(2000).append(response.MAIN_DISH);
}
});
});
});
</script>
And this html;
<cfinput name="NewCandidate" type="text" />
<span id="suggest1"></span>
I'll be /1#%/1 if I can figure out how the input field is triggering
anything.