摘要:
利用FormData实现附件上传(两种方式)var reg=document.getElementById(’reg’);var fd = new FormData(reg);send(fd); // fd里边有普通表单信息和附件信息第二种方式var mypic = document.getElem... 阅读全文
摘要:
向服务器ajax传入数据可以:1.利用dom获取表单值传入(f1) 2.利用FormData发送传递ajax数据(f2)(没有form表单,这使用append()方法添加数据参考f3) 用户名: 密码: 邮箱: 阅读全文
摘要:
首先在php页面生成xml文档并输出,然后在js中处理xml数据: var xhr = createXhr(); xhr.onreadystatechange = getinfo; xhr.open("get",'./07.php'); xhr.send(n... 阅读全文
摘要:
在php生成json数据(json_decode())参数为索引数组生成的数据格式为js数组$fruit = array('apple','banana','pear','orange');$fruit_jn = json_encode($fruit); //['apple','banana'... 阅读全文