search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

Table of Contents
a.htm
a.js
Home Backend Development XML/RSS Tutorial Solving the garbled problem of php_xmlhttp

Solving the garbled problem of php_xmlhttp

Feb 24, 2017 pm 03:24 PM

                                                                                                     but please indicate the source when reprinting: php_xmlhttp garbled code problem solution

Recently, I tested php_xmlhttp garbled code problem. There is no other reason. I just don’t want to use those messy frameworks, or I am too happy to organize a group. must.

resin actually started to support php in the new version. I think it is more fun, but I am too lazy to configure a set of apache_php_mysql and the like on my machine. After all, I mainly do things with java. So I put one of my php sites directly into resin for development. The overall feeling was pretty good, and no problems were found in the basic functions. However, while continuing to optimize, I thought of xmlhttp, so I wrote a few files to try, but there was no refresh effect. Well, I encountered garbled Chinese characters, so I spent the whole day on May 1st reading about some of the quarrels and quarrels on the earth from the website. China and the United States were playing chess, and Europe was watching the market. I followed it for a while. I'm talking about it this way, and I'm going to go that way for a while, and it's also interesting. I just thought about what these people in China after the late 1980s would look like, living on what people in the 60s and 70s earned, and taking pleasure as their own. Rong, the key is that they are still complacent. Aren't these people the legendary trash? Too lazy to say it, let’s just look at the garbled characters

There are three files, one is htm, one is php, and one is js. js is used in htm, and php is the server.

a.htm

<html>
<head><title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript" src="a.js" charset="utf-8"></script>
</head>
<body>
<span id="show"></span>
<form name="aForm">
<input type="text" name="name"><br>
<input type="button" name="btn" value="ok" onclick="aa()">
</form>
<script language="javascript">
<!--
function aa(){
var o = new Ajax();
o.url = "a.php";
o.parseParameters(document.all.aForm);
o.post();
}
-->
</script>
</body>
</html>

a.js

function getXMLHTTPRequest(){
var xmlHttp;if(window.ActiveXObject){    
try{      
xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");    
}catch(e){      
try{        
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");      
}catch(e){        
xmlHttp = false;      
}          
}}else{    
try{      
xmlHttp = new XMLHttpRequest();    
}catch(e){      
xmlHttp = false;    
}}if(!xmlHttp){    
return false;}else{    
return xmlHttp;}}
function Ajax(){this.url;
this.params = ""; 
this.parseParameters = function(thisform){    
for(var i = 0; i < thisform.elements.length; i++){      
var e = thisform.elements[i];      
this.params += (e.name + "=" + e.value);      
if(i != (thisform.elements.length - 1))         
this.params += "&";    
 }};AjaxObj = getXMLHTTPRequest();
 AjaxObj.onreadystatechange = processRequest;
 this.post = function(){ AjaxObj.open("post", this.url, true); 
 AjaxObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=utf-8'); 
 if(this.params.length > 0)AjaxObj.send(this.params);elseAjaxObj.send();}}
function processRequest(){ 
if(AjaxObj.readyState == 4){    
if(AjaxObj.status == 200){    
if(AjaxObj.responseText != ""){      
document.getElementById("show").innerHTML = "";      
document.getElementById("show").innerHTML = AjaxObj.responseText;     
}   
}else{   
 alert("Exception.");   
  } 
  }else{  
   document.getElementById("show").innerHTML="Loading......";}
    }

The above is the content of solving the problem of php_xmlhttp garbled code, more related Please pay attention to the PHP Chinese website (m.sbmmt.com) for content!


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

ArtGPT

ArtGPT

AI image generator for creative art from text prompts.

Stock Market GPT

Stock Market GPT

AI powered investment research for smarter decisions

Popular tool

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

AO3 official website entry method AO3 official entrance free access address AO3 official website entry method AO3 official entrance free access address Jan 19, 2026 pm 08:39 PM

The entrance to the AO3 official website is https://archiveofourown.org. Users can directly enter the address in the browser to access. It supports switching between Chinese and English, and free registration and login. The platform provides the function of publishing original and derivative works, and has features such as clear classification, bookmark comment interaction, and multi-condition filtering. It is recommended to enter the URL manually to ensure safety.

How to convert pdf to ppt on computer? These 3 methods are more efficient and must-have for professionals! How to convert pdf to ppt on computer? These 3 methods are more efficient and must-have for professionals! Jan 14, 2026 pm 07:33 PM

"Converting PDF to PPT may seem simple, but choosing the wrong tool may keep you up until two in the morning!" In the workplace, quickly converting PDF reports into PPT presentations is a necessary task that happens every day. However, more than 90% of workers have been frustrated by the dilemma of "the typesetting completely collapsed after conversion, the text disappeared, the diagrams became blurred, and repeated revisions" - this is not because you are not professional enough, but because you have chosen the wrong tool. So how to efficiently convert PDF to PPT on a computer? As a practical blogger who has been focusing on office software evaluation for 8 years, I have tested more than 30 tools. Today I will only focus on the truly reliable, time-saving and labor-saving conversion paths to help you avoid 99% of ineffective attempts. Don’t talk nonsense, it’s all practical stuff that can be implemented directly. 1. Why does converting PDF to PPT always fail? Let’s get to the bottom of things first. Many colleagues vomited

Smart Primary and Secondary Schools Web Version Official Login Platform - Smart Primary and Secondary Schools Computer Version Student Learning Portal Smart Primary and Secondary Schools Web Version Official Login Platform - Smart Primary and Secondary Schools Computer Version Student Learning Portal Jan 19, 2026 pm 08:24 PM

The official login platform entrance of the smart primary and secondary school web version is https://basic.smartedu.cn/, which covers the entire curriculum from primary school to high school and supports multi-terminal learning, personalized tools, barrier-free access and home-school collaborative services.

Blue Ocean Bookstore browser directly enters - Blue Ocean Bookstore does not need to download the web version Blue Ocean Bookstore browser directly enters - Blue Ocean Bookstore does not need to download the web version Jan 20, 2026 am 11:22 AM

There is no need to download the web version of Lanhai Sea Bookstore, just visit https://www.lanhaisea.net to use it; it has wide resource coverage, diverse themes, smooth operation, customizable interface, and supports bookshelf management and cross-end progress synchronization.

Google Chrome directly opens the Google Chrome web page access version link Google Chrome directly opens the Google Chrome web page access version link Jan 14, 2026 pm 10:18 PM

The link to enter the Google Chrome web page is https://www.google.com/chrome/. This page has five core features: simple interface, stable multi-device synchronization, rich extension ecosystem, complete security protection, and strong media playback compatibility.

115 Netdisk web version log in immediately_115 Netdisk web version official direct website 115 Netdisk web version log in immediately_115 Netdisk web version official direct website Jan 19, 2026 pm 11:42 PM

The official direct link to the 115 Netdisk web version is https://115.com. The interface is simple and ad-free, and supports multi-view switching, custom sorting, online preview, multi-terminal synchronization, drag and drop upload, fine permission management, historical version retention, duplicate file identification and intelligent resource recommendation.

Haitang Online Literature City starts a reading journey. Official web version login guide Haitang Online Literature City starts a reading journey. Official web version login guide Jan 20, 2026 am 09:27 AM

The official web page login entrance of Haitang Online Literature City is https://www.haitbook.com, which supports responsive design, multi-terminal synchronization, mainstream browser access, email registration verification and personalized reading recommendations.

Stable entrance to Quark Netdisk web version - Quark Netdisk's latest online channel Stable entrance to Quark Netdisk web version - Quark Netdisk's latest online channel Jan 20, 2026 am 06:39 AM

The stable entrance address of the Quark Netdisk web version is https://pan.quark.cn. The interface adopts a borderless card-style design and supports core functions such as drag-and-drop upload, intelligent filtering, multi-terminal synchronization, online preview and end-to-end encryption.

Related articles