在这里,我开发了我的 Jquery 代码 我的 jquery 代码
<html>
<head>
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
</head>
<body>
<script>
$(document).ready(function(){
$("button").click(function(){
$.ajax({
type: 'GET',
url: "3.cfc?method=test",
success: function(data){
document.getElementById("demo").innerHTML = data
}
});
});
});
</script>
<div id="demo">
<button type="button" id="texts">GET college details by jquery</button>
<p id="urlPage"></p>
<div>
</body>
</html>
这里我的coldfusion组件代码 我的cfc代码
<cffunction name="test" access="remote" returnformat="JSON" returntype="query">
<cfquery name="jsresult" datasource="student" result="result" >
SELECT * FROM clg
</cfquery>
<cfreturn jsresult>
</cffunction>
最后我得到了这个输出 我的输出
{"COLUMNS":["COLLEGENO","COLLEGENAME","DEPT"],"DATA":[[1,"nec","cse"],[2,"kamaraj","mech"],[3,"voc","arts"],[4,"srm","It"],[5,"mitrah","cse"],[6,"mitrah","cse"],[7,"candy","it"],[8,"",""],[9,"fx","eee"],[10,"svs","eee"]]}
FFIVE
相关分类