Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This code is incomplete, but will get you started: I have 2 files here... your main file, and then a very simple file to retrieve the data from the server. You can make a cfc to handle it any way you would like, but this will get you started.</p> <p>Main File:</p> <pre><code>&lt;div data-role="page" id = 'Student' data-add-back-btn="true"&gt; &lt;div data-role="header"&gt; &lt;h1&gt;Student Info Page&lt;/h1&gt; &lt;/div&gt;&lt;!-- /header --&gt; &lt;div data-role="content"&gt; &lt;div id="result"&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- /content --&gt; &lt;/div&gt; &lt;!--/Student --&gt; &lt;script type="text/javascript"&gt; $("#plates li").click(function() { var strLicense=$(this).text(); $.get("getDetails.cfm", { license: strLicense}) .done(function(data) { alert("Data Loaded: " + data); $("#result").text(data); }); }); &lt;/script&gt; </code></pre> <p>GetDetails.cfm</p> <pre><code>&lt;cfparam name="License" default=""&gt; &lt;cfquery name="q_sample" datasource="cars_live"&gt; SELECT FIRST 10 * FROM veh_rec WHERE LICENSE=&lt;cfqueryparam cfsqltype="cf_sql_varchar" value="#License#"&gt; &lt;/cfquery&gt; &lt;cfoutput query="q_sample"&gt; &lt;p&gt;License Plate Number: #license#, &lt;br&gt; Permit ID Number: #decal#, Student ID Number: #ID#&lt;/p&gt; &lt;/cfoutput&gt; </code></pre> <p>Your click method will pass your string (I made a variable called license) to jquery and then the .get function will call a new file, getdetails.cfm and pass the url.variable as license. Your query will then run and pass the results back to the <code>.get</code> function.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload