• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

ajax异步传递

php 搞代码 3年前 (2022-01-23) 15次浏览 已收录 0个评论
文章目录[隐藏]
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">                        	         </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>  
                        	     	  

这么写对不?

这里如果列表,你的名字不能重复,或者你改为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
有例子

txt.onblur = function(e)
{
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来&源gao@dai!ma.com搞$代^码%网搞gaodaima代码: “save_ajax.php”,
cache: false,
data: data_q,
success: function(msg){
obj.innerHTML = msg;
$(“#tipmsg”).hide();
}
});
}
else
{
obj.innerHTML = val;
}
} 套这个?


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:ajax异步传递

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址