相关疑难解决方法(0)

解决使用ajax发送阿拉伯字符的问题

我正在使用AJAX表单将数据发送到另一个名为"show.php"的页面.这是页面的来源:

form.html

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="ajaxsbmt.js" type="text/javascript"></script>
</head>
<div id="MyResult"></div>
    <form method="POST" action="response_norma.php" name="MyForm" onsubmit="xmlhttpPost('show.php', 'MyForm', 'MyResult', '<img src=\'indicator.gif\'>'); return false;">
      <input type="text" name="mytext" size="20">
      <input type="submit" value="Submit" name="ok">
    </form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

show.php

<?php
  echo $_REQUEST['mytext'];
?>
Run Code Online (Sandbox Code Playgroud)

ajaxsbmt.js

function xmlhttpPost(strURL, formname, responsediv, responsemsg) {
  var xmlHttpReq = false;
  var self = this;
  // xhr for Mozilla/Safari/Ie7
  if (window.XMLHttpRequest) {
    self.xmlHttpReq = new XMLHttpRequest();
  }
  // xhr for all other versions of IE
  else if (window.ActiveXObject) { …
Run Code Online (Sandbox Code Playgroud)

forms ajax encoding

6
推荐指数
2
解决办法
4680
查看次数

标签 统计

ajax ×1

encoding ×1

forms ×1