Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7680163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:03:01+00:00 2026-05-31T18:03:01+00:00

I perform an AJAX request to a PHP script in JavaScript and by using

  • 0

I perform an AJAX request to a PHP script in JavaScript and by using the jQuery library.
Here is my command which performs the AJAX request :

$.ajax({
    async: "false",
    cache: "false",
    data: {login: strLogin, password: strPassword},
    datatype: "text",
    error: connexionAjaxError,
    success: connexionAjaxSuccess,
    type: "POST",
    url: "./Connexion"
});

“.Connexion” is a URL redirection to my PHP script.
connexionAjaxError is a JavaScript function inevitably executed as soon as the HTTP response is received.
The reason : My PHP script results to a text/plain page with HTTP status code equal to 500.
Here is the most relevant part of my PHP script :

header("HTTP/1.0 500 Internal Server Error; 
        Content-type: text/plain; 
        charset=ISO-8859-1");

echo "été";

Here is the signature of the connexionAjaxError callback function :

function connexionAjaxError(jqXHR, textStatus, errorThrown)

My PHP results to the string “été”.
My PHP internal encoding is ISO-8859-1 so the result string is encoded [e9 74 e9] in hexadecimal notation.

But jqXHR.responseText in the connexionAjaxError callback function contains a 1-character string.
I have used the charCodeAt method of the JavaScript String object to get the unicode (UTF-8 ?) code for the character.
The character is encoded 65535 in decimal notation equivalent to [ff ff] in hexadecimal notation.

I do not understand why jqXHR.responseText does not contain the 3-character string “été”.
I am not an expert in JavaScript but I suppose jqXHR.responseText can only contains a string encoded in UTF-8.
So the string “été” in jqXHR.responseText would be encoded [c3a9 74 c3a9] in hexadecimal notation.
I have retrieve the UTF-8 code for the character “é” from the following web site : http://www.utf8-chartable.de/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T18:03:02+00:00Added an answer on May 31, 2026 at 6:03 pm

    I make a lot of development in Spanish and I’ve noticed a few things that might help you, since I’ve gone through this already:

    The charset in the header function should be UTF-8.

    Also, the FILE itself (the PHP script) must be saved in UTF-8, you can easily achieve this if you edit the file with Notepad++ and select the encoding to be UTF-8 without BOM.

    Same goes for your javascript and HTML files, they should all be encoded with UTF-8 without BOM rather than ANSI.

    Let me know!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using JQuery to perform form submission through an ajax request. I use
I was looking for way to perform form (post) request with SOAP using jQuery/AJAX.
What I'm currently doing is using jQuery to perform an ajax request on every
Is it even possible to perform a cross-domain POST Ajax request without using proxy?
When I perform an asynchronous request with jQuery Ajax, sometimes the response is returned
I want to perform an ajax request right before my form is submitted, and
I am trying to perform a nested AJAX call using the following code. The
Is it possible to load an html document using ajax and then perform a
The following code is supposed to perform an AJAX request after the page loads,
how can i know the readystates of an ajax request through jquery ? In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.