How to use ajax to update and fresh asp/sql results

ainsley

New Member
I am using jquery to get the value of the hash in the URL. I now need to use that value to change the results executed with asp and sql. I need to update the results based on the state selected.Basically I need to use the value in sql and refresh the asp code.Jquery Code below:\[code\]<script>$(document).ready(function() { $("#state").click(function () { var hash = window.location.hash.substring(1); alert (hash); });});</script>\[/code\]SQL below:\[code\]<% Dim connectString, connect, conDB, con, src_st connectString = "Driver={Microsoft Text Driver (*.txt; *.csv)}; DBQ=" & Server.MapPath("data") src_st = Request.QueryString("state") set connect = Server.CreateObject("ADODB.connection") connect.open connectString if src_cat = "" then conDB = "SELECT * FROM travel.csv" else conDB = "SELECT * FROM travel.csv where state = '" & src_st & "'" end if set con = connect.execute(conDB)%>\[/code\]Whole code below:\[code\]<%@ LANGUAGE="VBSCRIPT" %><% Dim connectString, connect, conDB, con, src_st connectString = "Driver={Microsoft Text Driver (*.txt; *.csv)}; DBQ=" & Server.MapPath("data") src_st = Request.QueryString("state") set connect = Server.CreateObject("ADODB.connection") connect.open connectString if src_cat = "" then conDB = "SELECT * FROM travel.csv" else conDB = "SELECT * FROM travel.csv where state = '" & src_st & "'" end if set con = connect.execute(conDB)%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Seminars & workshops - AvSafety Seminars</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link rel="stylesheet" type="text/css" media="screen" href="http://stackoverflow.com/style/screen.css" /><link rel="stylesheet" type="text/css" media="screen" href="http://stackoverflow.com/style/avsafety.css" /><link rel="stylesheet" type="text/css" media="handheld" href="http://stackoverflow.com/style/handheld.css" /><link rel="stylesheet" type="text/css" media="print" href="http://stackoverflow.com/style/print.css" /><meta name="MSSmartTagsPreventParsing" content="true" /><style type="text/css"><!--.style2 {color: #666666 }--></style><!----></head><body><div id="printtitle">Civil Aviation Safety Authority</div><div id="outer_wrapper"><div id="wrapper"> <div id="container"> <div id="title"><h1>&nbsp;</h1></div> <img src="http://stackoverflow.com/questions/14449586/images/windsock.jpg" alt="" width="166" height="500" align="right" /><div id="content"> <!--Start of main content area--><div id="right"> <img src="http://stackoverflow.com/wcmswr/_assets/main/seminars/images/AVSAFETY-LOGO.GIF" alt="AVSafety logo" border="0" width="250px" height="50px"></div> <h1>AvSafety Seminars</h1><p>CASA is continuing with the Safety Seminar program, targeting pilots in regional Australia and run in partnership with the local aviation industry. </p><p>We also hold seminars targeted at engineers.</p><p><a href="http://stackoverflow.com/scripts/nc.dll?WCMS:STANDARD::pc=PC_100841">View further information on safety issues and topics</a>.</p><h2>Request a seminar</h2><p> If you would like to request an AvSafety seminar in your local town, use the <a href="http://stackoverflow.com/scripts/nc.dll?WCMS:STANDARD::pc=PC_100683">AvSafety request from</a>.</p><h2>2013 Seminar schedule</h2><p>In 2013 CASA ASAs will be focusing on visiting organisations to discuss the forthcoming aviation regulatory changes. They will be in all regions of Australia and individuals or organisations are welcome to contact their local region ASA to arrange an appointment time. The approximate travel schedule for each region is shown below. ASAs are available and active each month for visits within capital city environs (approximately within 2 hours driving of a capital city).</p><p>Aero clubs and other aviation organisation are welcome to run Aviation Safety Seminars with ASAs presenting topics, however CASA will not be financially supporting the events. If you would like to run a seminar with ASA attendance, please use the <a href="http://stackoverflow.com/scripts/nc.dll?WCMS:STANDARD::pc=PC_100683">AvSafety request from</a> and complete the details of the request. Every effort will be made to provide support however it will be advantageous to consider timings when an ASA is visiting a local region.</p><p><a href="http://stackoverflow.com/questions/14449586/#ACT">ACT</a> | <a href="http://stackoverflow.com/questions/14449586/#NSW">NSW</a> | <a href="http://stackoverflow.com/questions/14449586/#QLD">QLD</a> | <a href="http://stackoverflow.com/questions/14449586/avsafety?src_st=ACT">SA</a> | <a href="http://stackoverflow.com/questions/14449586/avsafety?src_st=ACT">TAS</a> | <a href ="http://stackoverflow.com/questions/14449586/avsafety?src_st=ACT">VIC</a> | <a href="http://stackoverflow.com/questions/14449586/#">WA</a> | <a id="state" href="http://stackoverflow.com/questions/14449586/#">Submit</a></p> <table> <tr> <th>Location</th> <th>State</th> <th>Date</th> </tr> <%if NOT con.eof then while (NOT con.EOF) %> <tr> <td><%=con("location")%></td> <td><%=con("state")%></td> <td><%=con("date")%></td> </tr> <% con.MoveNext() Wend %> </table> <% else %> <p>No seminars available.</p> <% end if con.close %><script>$(document).ready(function() { $("#state").click(function () { var hash = window.location.hash.substring(1); alert (hash); });});</script><!--End of main content area--></div> <!-- content --></div> <!-- container --><div id="sidebar"><h2 id = "sidebarhome"><a href="http://stackoverflow.com/index.htm">CASA home</a></h2><h2><a href="http://stackoverflow.com/seminars/index.htm">Seminars & workshops</a></h2><ul><li><a href="http://stackoverflow.com/seminars/avsafety.asp">AvSafety Seminars</a> </li> <li> <a href="http://stackoverflow.com/seminars/eng.htm">Maintenance seminars</a></li> <li><a href="http://stackoverflow.com/seminars/archerfield.htm">Archerfield chief pilots</a></li><li><a href="http://stackoverflow.com/seminars/cbt/index.htm">Competency Based Training Education</a></li><li><a href="http://stackoverflow.com/seminars/manufacturing.htm">Manufacturing & certification workshop</a></li></ul><form action="http://agencysearch.australia.gov.au/search/search.cgi" name="agencysearch"> <input type="text" name="query" size="13" maxlength="50" value="" alt="Search field" /> <input type="hidden" name="collection" value="http://stackoverflow.com/questions/14449586/agencies" /> <input type="hidden" name="form" value="http://stackoverflow.com/questions/14449586/simple" /> <input type="hidden" name="profile" value="http://stackoverflow.com/questions/14449586/casa" /> <input type="submit" value="http://stackoverflow.com/questions/14449586/Search" name="Search" alt="Search button" /> </form></div><div class="clearing">&nbsp;</div></div><!-- wrapper --></div> <!-- outer_wrapper --> <div class="extras"> <a href="http://stackoverflow.com/tools/contacts.asp">Contact CASA</a> </div><div class="footer"> <a href="http://stackoverflow.com/tools/siteinfo.htm">Site&nbsp;help</a>&nbsp; |&nbsp;<a href="http://stackoverflow.com/tools/cpyright.htm">Copyright </a>&nbsp; |&nbsp; <a href="http://stackoverflow.com/tools/privacy/index.htm">Privacy</a></div></body></html>\[/code\]
 
Back
Top