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 7179235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:05:58+00:00 2026-05-28T17:05:58+00:00

I am trying to test a few ajax and JSON parsing examples using YUI3

  • 0

I am trying to test a few ajax and JSON parsing examples using YUI3 on localhost. The code is as follows:

<!doctype html>
<html>
<head>
    <title>YUI 3 Getting started</title>
</head>
<body>
    <p id="time">(what time is it?)</p>

    <button id="go">What time is it?</button>

    <script src="http://yui.yahooapis.com/3.3.0/build/simpleyui/simpleyui-min.js"></script>
    <script>

    function printTime(id, response) {
        try {
            var data = Y.JSON.parse(response.responseText);
        }
        catch (ex) {
            data = { time: "ERROR" };
        }

        Y.one("#time").setContent(data.time);
    }

    Y.one("#go").on("click", function () {
        Y.io("watch.php", {
            on: {
                success: printTime
            }
        });
    });

    </script>

</body>
</html>

This is watch.php:

<?php
header('Content-Type: application/json; charset=utf8');
echo(
    json_encode(
        array(
            "time" => date("g:ia l, M jS")
        )
    )
);

I have tried uploading the files to a webhost, and am still getting the same issue. The strange thing is that it works perfectly fine in firefox, but refuses to work in IE9 and other IE modes! IE is returning this error code: c00ce56e.

Any ideas?

  • 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-28T17:05:59+00:00Added an answer on May 28, 2026 at 5:05 pm

    Turns out IE9 is very very strict with JSON responses. To be sure, ensure that a proper header with encoding is sent for every JSON response. Also make sure that the JSON is well formed.

    This is the fix:

    header('Content-Type: application/json; charset=utf-8');
    

    Notice that the charset MUST be defined and must be a valid charset.

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

Sidebar

Related Questions

Using LINQPad, I am trying to test a few snippets with my own C#
I'm trying to test my new in-app purchase code. I have a few items
just trying to test for equality in this piece of code, but getting a
Im trying to test my successfully creates a new user after login (using authlogic).
I am trying to create a car make/model form using Javascript or AJAX, problem
I am trying to unit test a class that does SAX parsing and creates
I am trying to test a functionality, which inserts few details into the DB.
I am trying to test a WPF application using the UI-Automation framework that MSFT
I'm trying to access a 3rd party api over http using jquery .ajax (or
I'm trying to unit test a few .NET classes that (for good design reasons)

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.