[jQuery] A newbie with an ajax-via-jquery question
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1">Hi folks,
Rey Bango turned me on to jQuery, and I'm trying to use it right now
pretty much for the first time. I'm trying to make an ajax call to my
ColdFusion server, and I'm a little confused by my results. Rey gave me
a bit of sample code on a different list. Regardless of what my
intended end result is, I'd just like the called page to return
properly. I don't think I'm calling it right. Here's my code:
</font><font size="-1"><tt><CFSet
ClientNumberList="172104|188549|111304|169080|028267|203347">
<CFOutput>
<html>
<head>
<script type="text/javascript"
src="/include/js/jquery.js"></script>
<script type="text/javascript">
// Your code goes here
$(document).ready(function(){
// Your code here
var i,IDList;
IDList = "#ClientNumberList#";
IDList = IDList.split("|");
for(i = 0; i < 1; i++){ // ignore the fact that I'm
only looping one time here.
$.ajax({
type: "POST",
url: "MyJQueryTest.cfm",
data: "ClientID=" + IDList[i],
dataType: "html",
success: function(msg){
$("##searchResults" ).append(msg);
}
});
}
});
</script>
</head>
<body>
<table width="100%" border="1" class="stripeMe"
id="searchResults">
<thead>
<tr><th>My Sample Table</th></tr>
</thead>
<tbody>
<tr><td>Row 1</td></tr>
</tbody>
</table>
</body>
</html>
</CFOutput>
</tt>
I keep getting an error in my logs that says: "variable ClientID is
undefined in URL". Okay so maybe I misunderstood the point of the
"data" parameter to the .ajax method. Can anybody see what I might be
doing wrong here?
Thanks,
Chris
</font>
</body>
</html>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/