Ajax problems. Online Posting

Source: Internet
Author: User
Ajax problems. Paste online. I have a quick search function. But pass the test. Found & nbsp; Chinese characters that I entered into the text box. It is garbled. I used a function to convert & nbsp. But I forgot the function. I posted the approximate code. Help me ;. Urgent & lt; select & nbsp; name = "suppler_id" & nbsp; st ajax problem. Paste online.
I have a quick search function. But pass the test. The Chinese characters that I entered into the text box are found. It is garbled. I used a function to convert it. But I forgot the function. I posted the approximate code. Please help me. Urgent



Select supplier

" >


Quick search for customers:



Select customer

" >









$(document).ready(function () {
    $(function(){
        $("#username").live('keyup',function(){
var username = $(this).val();
if(username != ''){
$.post('../userajax.php',{'username':username},function(msg){
                    $("#userdiv").html(msg)
                });
}
})
    })
});
《script》 

------ Solution --------------------
First, check the character set encoding of your page to ensure that the html page is consistent with the php encoding, which should be caused by inconsistent encoding.
------ Solution --------------------
String iconv (string $ in_charset, string $ out_charset, string $ str)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.