Rick,
So, lets crawl before we walk here. This should help you understand using
load() with CF basics.
-----------------------------------
On your form page:
<script src="js/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$("#realtor").change( function() {
var realtor_id = $(this).val();
$("#mycfpagecontent").load("mycfpage.cfm?realtor=" + realtor_id);
});
});
</script>
<select id="realtor">
<option value="1">Matt</option>
<option value="2">Jacqui</option>
<option value="3">Julie</option>
</select>
<div id="mycfpagecontent"></div>
-----------------------------------
Then on your query page: mycfpage.cfm
<cfquery name="get_realtor_info" datasource="myrealtordata">
SELECT fname, lname
FROM realtorsdb
WHERE id = #URL.realtor#
</cfquery>
<cfdump var="#get_realtor_info#">
-----------------------------------
Once you get this, then your doing Ajax on CF.
Then go to http://www.365labs.net/cf_jquery/jquery_coldfusion_quickstart.htm
After that, your to Rob Gonda's ajaxCFC.. Then you're all set!
Hope that helps!
Michael
_____
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Rick Faircloth
Sent: Thursday, February 22, 2007 7:49 PM
To: 'jQuery Discussion.'
Subject: Re: [jQuery] Best way to do AJAX... CF or jQuery?
Hmmm. trying to put this into action, but I'm not straight on how to do it.
I figured what you meant was to create two pages. one page would have
the ajax line you wrote out and the other would the mycfpage.cfm
I have a query on the mycfpage.cfm.
<CFQUERY Name="Get_Data" Datasource="Bodaford" MaxRows="1">
Select Title, Text
from announcements
</CFQUERY>
.along with the page HTML, body, head tags, etc. (or should it just have
the query?)
Now I'm not sure how you want me to put the jQuery code on a page that
I called ajax_test.cfm. Should the line you wrote out go in the body "as
is"
or should it be written out in the head section with the
$(document).ready(function() {, etc
around it?
You can tell, I'm new to both jQuery and ajax!
I appreciate your help!
Rick
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Michael E. Carluen
Sent: Thursday, February 22, 2007 9:01 PM
To: 'jQuery Discussion.'
Subject: Re: [jQuery] Best way to do AJAX... CF or jQuery?
Rick,
You need both. You use jQuery to send requests to a server side scripting
language like CF (or php, asp, cgi, etc) .
Perhaps the simplest way to introduce yourself to an "ajax" activity would
be to use jQuery's load() function.
Try this:
$("##displaycfoutput").load("mycfpage.cfm?param1=#something#¶m2=#somethi
ngelse#");
On your mycfpage.cfm, put a database query using the URL vars your passed.
Hope that helps.
Michael
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/