Coldfusion 执行存储过程而不刷新页面?
我有一个带有“选择”参数的存储过程
<cfstoredproc procedure="MyProcedure" datasource="MyDataSource">
<cfprocparam type="in" cfsqltype="cf_sql_integer" value="#selection#" null="no">
</cfstoredproc>
我有一个选择框,用户可以在其中选择该框,我想使用 jquery 来“调用”存储过程:
$(document).ready(function(){
$('#selectbox').change(function() {
// update my #selection# variable
// run the stored procedure again (the one above)
});
});
有没有办法做到这一点?我知道它混合了客户端和服务器端代码,但我无法刷新页面,因为页面上有多种表单......
I have a stored procedure with a "selection" parameter
<cfstoredproc procedure="MyProcedure" datasource="MyDataSource">
<cfprocparam type="in" cfsqltype="cf_sql_integer" value="#selection#" null="no">
</cfstoredproc>
I have a select box where the user can select the box, and I would like to use jquery to "call" the stored procedure:
$(document).ready(function(){
$('#selectbox').change(function() {
// update my #selection# variable
// run the stored procedure again (the one above)
});
});
Is there a way to do this? I know it's mixing client and server side code but I can't refresh the page because there are multiple forms on the page...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要创建一个包含存储过程的 .cfm 页面,并使用 AJAX 调用来执行存储过程。
存储过程.cfm
You'll need create a .cfm page with stored procedure in it and use an AJAX call to execute the stored proc.
storedProc.cfm
您需要将 Stored Proc 调用放入单独的 CFM 文件中,以供 jquery 调用。您无法返回页面上调用的那个。
You will need to put your Stored Proc call into a seperate CFM file for your jquery to call. You can't reference back to the one called on your page.