I need to invoke a ColdFusion function(present in a .cfm file) when the user clicks on a link. And I would like to do it using jQuery. I have a jQuery snippet which looks like-
<script type="text/javascript">
$(document).ready(function(){
$("td.ViewLink a").click(function(event){
event.preventDefault();
)}
I am new to both jQuery and AJAX, so I might sound naive here. Should I use AJAX to invoke the ColdFusion function? Something like requesting to execute a specific function on the server.
Any help in this regard is appreciated.
Cheers.
If you have multiple functions in your cfm(even if you don’t), put them in a cfc.
Then you can use the following url pattern to invoke a specific method.
cfc named myEntityWS.cfc
Javascript