목차
ajax异步传递
Jun 23, 2016 pm 01:24 PM
table width="100%" border="0" cellspacing="0" cellpadding="0" class="ttbb5"> <tr> <th scope="col"><strong>序号</strong></th> <th scope="col">国家</th> <th scope="col">省份</th> <th scope="col">地区</th> <th scope="col">操作</th> </tr> {if $list or $list|@count neq 0 } {foreach from=$list item=item key=index} <tr align="center"> <td>{$index}</td> {if $item.parent_tow_id eq 2} <td class="ttbb6">{$item.country}</td> <td class="ttbb6">{$item.province}</td> <td class="ttbb6">{$item.name}</td> {/if} {if $item.parent_tow_id eq 1} <td class="ttbb6">{$item.country}</td> <td class="ttbb6">{$item.name}</td> <td class="ttbb6"></td> {/if} {if $item.parent_tow_id eq 0} <td class="ttbb6">{$item.name}</td> <td class="ttbb6"></td> <td class="ttbb6"></td> {/if} <td align="center" class="ttbb6"> <div align="right"> <input name="p" type="text" id="p" value="{$item.paixu}" size="5" maxlength="3" /> <input type="button" class="anniu4" value="确定" onclick="foo()" /> </div></td> </tr> {/foreach} {else} <tr> <td align="center" colspan="5">--暂无数据--</td> </tr> {/if} </table> {include file=warning.tpl}</div> </td> </tr></table>
로그인 후 복사
input=text显示数据库排序的值 在文本框修改值点击确定 怎么传入数据库 改变paixu的值
帮帮忙给写一个ajax异步传递的代码吧
回复讨论(解决方案)
用表单提交你会吗?
如不会,请先学习一下
用表单提交你会吗?
如不会,请先学习一下
没明白什么意思啊 我写的不对么? 还是 ajax必须要用表单提交啊
用表单提交你会吗?
如不会,请先学习一下
<script type="text/javascript"> function modifyItem() { if (trim(document.getElementById("p").value) == "") { alert("不能为空!"); document.getElementById("p").focus(); return; } with (document.getElementById("itemForm")) { method = "post"; action = "item.do?command=modify&paixu=${itemForm.paixu}"; submit(); } } //返回 function goBack() { window.self.location = "item.do?command=list&paixu=${itemForm.paixu}"; } </script>
로그인 후 복사
<form name="itemform" id="itemform"> <input name="p" type="text" id="p" value="{$item.paixu}" size="5" maxlength="3" /> <input type="button" class="anniu4" onclick="modifyItem()" value="确定" /> </form>
로그인 후 복사
这里如果列表,你的名字不能重复,或者你改为name="p[]"
这里如果列表,你的名字不能重复,或者你改为name="p[]"
改成name="p[]"了 那ajax我写错了么? 我试验好几遍,不知道错在哪?
神呐 帮帮我吧 要死了 要死了 要死了
这个写个ajax很难么? 都不会啊?
不是很难。
不是很难。
服了,真心的。 我都关注你微信了大哥 你也不给帮忙 不够意思
http://bbs.phome.net/showthread-13-130691-0.html
有例子
http://bbs.phome.net/showthread-13-130691-0.html
有例子
这个例子很生动, 我先注册 然后下载了文件,看到代码发现其实我两不是一个类型的,对我这个他根本不适用啊,smarty都是那么写ajax的么? 我怎么感觉他这个文件缺点什么似的啊 ?那个save_ajax.php 我还能看懂 别的真是磕了
http://bbs.phome.net/showthread-13-130691-0.html
有例子
{
data_q = "actiontype=" + act + "&name=" + txt.value + "&id="+id+"&tid="+Math.random(10);
///document.write("save_ajax.php?"+data_q);
if(val != txt.value)
{
$("#tipmsg").show();
$.ajax({
type: "GET",
url: "save_ajax.php",
cache: false,
data: data_q,
success: function(msg){
obj.innerHTML = msg;
$("#tipmsg").hide();
}
});
}
else
{
obj.innerHTML = val;
}
} 套这个?
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

인기 기사
R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
1 몇 주 전
By 尊渡假赌尊渡假赌尊渡假赌
Repo : 팀원을 부활시키는 방법
3 몇 주 전
By 尊渡假赌尊渡假赌尊渡假赌
헬로 키티 아일랜드 어드벤처 : 거대한 씨앗을 얻는 방법
3 몇 주 전
By 尊渡假赌尊渡假赌尊渡假赌
스플릿 소설을이기는 데 얼마나 걸립니까?
3 몇 주 전
By DDD

인기 기사
R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
1 몇 주 전
By 尊渡假赌尊渡假赌尊渡假赌
Repo : 팀원을 부활시키는 방법
3 몇 주 전
By 尊渡假赌尊渡假赌尊渡假赌
헬로 키티 아일랜드 어드벤처 : 거대한 씨앗을 얻는 방법
3 몇 주 전
By 尊渡假赌尊渡假赌尊渡假赌
스플릿 소설을이기는 데 얼마나 걸립니까?
3 몇 주 전
By DDD

뜨거운 기사 태그

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

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

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제
Gmail 이메일의 로그인 입구는 어디에 있나요?
7308
9


자바 튜토리얼
1623
14


Cakephp 튜토리얼
1344
46


라라벨 튜토리얼
1259
25


PHP 튜토리얼
1207
29



Laravel Back End : Part 2, React가있는 React 앱 구축

PHP의 컬 : REST API에서 PHP Curl Extension 사용 방법
