I wrote a jquery function . um calling to a coldfusion query to dynamically append elements to a spam but this is not working . can any one tell what s wrong?
$('a.clikceble',$this).click(function(){
<cfloop query="GET_ALL_STUDENT_INFO_QUERY">
alert("inside");
$(".quick_time_dl a").attr("href", "index.cfm?event=location.index§ion=download&topic_id=<cfoutput>#URLDecode(url.topic_id)#</cfoutput>&video_id=<cfoutput>#URLDecode(url.video_id)#</cfoutput>&video_name=<cfoutput>#URLDecode(url_mov)#</cfoutput>&video_type=lif_mov");
$(".win_media_dl a").attr("href", "index.cfm?event=location.index§ion=download&topic_id=<cfoutput>#URLDecode(url.topic_id)#</cfoutput>&video_id=<cfoutput>#URLDecode(url.video_id)#</cfoutput>&video_name=<cfoutput>#URLDecode(url_wmv)#</cfoutput>&video_type=lif_wmv");
<cfif len(url_pdf)>
$("#url_pdf").attr("href", "../assets/teaching_notes_pdf/<cfoutput>#URLDecode(url_pdf)#</cfoutput>");
$(".pdf_desc").append($("#url_pdf"));
alert($(".pdf_desc").append($("#url_pdf")));
$("#url_pdf").show();
</cfif>
<cfif len(pdf_transcript)>
$("#pdf_transaction").attr("href", "../assets/teaching_notes_transcripts/<cfoutput>#URLDecode(pdf_transcript)#</cfoutput>");
$(".pdf_desc").append($("#pdf_transaction"));
alert($(".pdf_desc").append($("#pdf_transaction")));
$("pdf_transaction").show();
</cfif>
</cfloop>
The best way to do this, when you click your tab, call your coldfusion page via ajax method. Just create a coldfusion page with the query, and returs the results via JSON format. You can use jquery ajax function with json data type, then loop over your result set and finally append it to your DOM. A simple google search for ‘jquery coldfusion’ returns lot of results, such as “Easy AJAX using ColdFusion, jQuery and CFCs“.