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

  • Home
  • SEARCH
  • 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 8091099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:57:09+00:00 2026-06-05T19:57:09+00:00

I have some problem to get the utf-8 string from PHP using jQuery $.load()

  • 0

I have some problem to get the utf-8 string from PHP using jQuery $.load() utility function.

File 1: myrecord.txt, saved in utf-8 encoding using Notepad++

<p>你好, jQuery Ajax with load method.</p>.

File 2: myrecord.php, saved in utf-8 encoding using Notepad++

<?php
  echo '<p>你好, jQuery Ajax with load method.</p>';
?>

File 3: loadTest.html, saved in utf-8 encoding using Notepad++

<html>
<head>
   <title>Load Example</title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <script type="text/javascript"           
        src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">
   </script>
   <script type="text/javascript" language="javascript">
        $(document).ready(function() {
    $('div').load('myrecord.txt');
    });
   </script>
</head>
<body>
      <div></div>
</body>
</html>

If I run loadTest.html as is, the result I got is correctly displayed as

你好, jQuery Ajax with load method.

However if I change the load method in file 3 to $(‘div’).load(‘myrecord.php’), then the display changes to

???jQuery Ajax with load method.

What’s wrong? Please help.

  • 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-06-05T19:57:12+00:00Added an answer on June 5, 2026 at 7:57 pm

    can you try loading that file using php file by using readfile function and that function should have header for utf-8 output?

    header ('Content-type: text/html; charset=utf-8');
    readfile('myrecord.txt');
    

    In addition see if following URL can be of additional help: http://www.phpwact.org/php/i18n/utf-8

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

Sidebar

Related Questions

i have a problem using some php functions on a string i get from
I have one problem , I want to get some data from XML file
I have been tackling this problem for some time. I get the image from
I have some buttons in an UIView. My problem is, that they get cut
I'm trying to get a regexp to solve the next problem: I have some
I have a problem wherein I get an AmbiguousMatchException in some of the samples
I have a problem that I'm hoping to get some direction in solving -
I have a small problem that I am hoping to get some help with.
Hi I have a problem with my css for some reason I can't get
I Have activity that get some data from the internet, and shows it to

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.