ajax post问题
js:$('#tblist').change(function(){
var value=$('#tblist').val();
$.ajax({
url:"http://localhost/index.php/get/bgbh",
type:"post",
dataType:"json",
data:value,
success:function(){
$('#bgbhstart').val(由数据库获得);}
});
请问一下上面这样子写对吗?哪里要改一下,还有控制器那要怎么样写能把数据返回来 ajax 返回数据和普通页面没区别。
看需要什么格式,json 就返回 json 字符串,xml 就返回 XML 字符串,这个和 CI 无关,以前 PHP 怎么写 CI 还怎么写。
页:
[1]