Language          
Site.Index Enter.Forum Login Hot.Collection Url.Collection Ebook.Collection Download Blogs
Site.Index Forum.Home Registe Login Recently RecentRpl Rank Hot
 Location  论坛首页  ColdFusion.Udfs.Cfcs.Tags  帖子浏览
  Post New  Post Poll     Visitors Of No.363 Last  刷新当前主题  Next  加入收藏夹
Topic:ColdFusion的Ajax调用(使用JQuery框架)


天机
Logins:373  Total:10780
Post:367  Reply:196
Poll:0  Top:6
Soul:24  Spec:0
Reg:2005-11-25
楼主   Reply  Email
本站内标注为[原创]的作品若要转载请首先和管理员取得联系,获得授权后方可转载。

Cfm文件代码

<script type="text/javascript" src="/template/action/jquery.js"> </script>
<script type="text/javascript">
 function clean() {
  $.ajax(
  {
   type: "get",
   url: "/cfc/browser_attention.cfc",
   data: {
   method: "clean",
    userid: 1
   },
   dataType: "json",   
   success: function(objResponse){
    alert(objResponse);
   },
   error: function( objRequest, strError ){
    alert("error");
    }
  });
 }
</script>

 

Cfc文件代码

<cfcomponent output="false">
 <cffunction name="clean" access="remote" returnformat="json">
  <cfargument name="userid" type="String">
  <cftry>
   <cfreturn true>
  <cfcatch type="any">
   <cfreturn false>
  </cfcatch>
  </cftry>
 </cffunction>
</cfcomponent>



[由于本人签名过于华丽,被斑竹屏蔽了,正在协商中]

Post At:2009-12-29 21:57:27  
Creative Commons License 创作共用协议(中文版)