无缓存,无错版 $.ajax({ type: GET, url: index.php, cache: false, data: con=Addact=_searchkey= + key+id=+id, dataType:json, success: function(msg){ bindGroupList(msg); } }); //绑定 function bindGroupList(result) { var eles = document.forms[
无缓存,无错版
$.ajax({
type: "GET",
url: "index.php",
cache: false,
data: "con=Add&act=_search&key=" + key+"&id="+id,
dataType:"json",
success: function(msg){
bindGroupList(msg);
}
});
//绑定
function bindGroupList(result)
{
var eles = document.forms['theForm'].elements;
eles['group_id'].length = 1;
for (i = 0; i {
var opt = document.createElement('OPTION');
opt.value = result.content[i].id;
opt.text = result.content[i].name;
eles['group_id'].options.add(opt);
}
}
会缓存
$.getJSON("?con=Add&act=_search&key=" + key+"&id="+id, function(data){
//bindGroupList(data)
});
=====php make_json_result=======
/**
* 创建一个JSON格式的数据
*
* @access public
* @param string $content
* @param integer $error
* @param string $message
* @param array $append
* @return void
*/
function make_json_response($content = '', $error = "0", $message = '', $append = array()) {
$res = array(
'error' => $error,
'message' => $message,
'content' => $content
);
if (!empty($append)) {
foreach ($append AS $key => $val) {
$res[$key] = $val;
}
}
$val = json_encode($res);
exit($val);
}
/**
*
*
* @access public
* @param
* @return void
*/
function make_json_result($content, $message = '', $append = array()) {
make_json_response($content, 0, $message, $append);
}
return make_json_result($list);

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

맨티스BT
Mantis는 제품 결함 추적을 돕기 위해 설계된 배포하기 쉬운 웹 기반 결함 추적 도구입니다. PHP, MySQL 및 웹 서버가 필요합니다. 데모 및 호스팅 서비스를 확인해 보세요.

Dreamweaver Mac版
시각적 웹 개발 도구

ZendStudio 13.5.1 맥
강력한 PHP 통합 개발 환경

MinGW - Windows용 미니멀리스트 GNU
이 프로젝트는 osdn.net/projects/mingw로 마이그레이션되는 중입니다. 계속해서 그곳에서 우리를 팔로우할 수 있습니다. MinGW: GCC(GNU Compiler Collection)의 기본 Windows 포트로, 기본 Windows 애플리케이션을 구축하기 위한 무료 배포 가능 가져오기 라이브러리 및 헤더 파일로 C99 기능을 지원하는 MSVC 런타임에 대한 확장이 포함되어 있습니다. 모든 MinGW 소프트웨어는 64비트 Windows 플랫폼에서 실행될 수 있습니다.

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.
