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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:10:01+00:00 2026-05-21T17:10:01+00:00

My goal is to create an personal application out of my ActionScript3 video player.

  • 0

My goal is to create an personal application out of my ActionScript3 video player. I want to be able to hold keep the single .swf file in my browser and through AJAX, pass the .swf the url to my videos. I’ve chosen to use JSON as my data.

I’m new to JSON and I’ve hit a wall. It seems completely easy, but at first I wasn’t even able to even get my locally hosted .json file into my webapp. It was working when I tried to do this with XML. After a bunch of trouble shooting, it is now in fact getting my XMLHttpRequest.

I’m trying to keep with backwards compatibility as much as possible, and thus I’m using the json2.js library to secure that notion.

My current issue is not being able to parse my XMLHTTPRequest. To be honest, I’m not even sure if what I’m doing is right as everywhere I look for examples, they’re almost all pointing to a solution that writes the JSON into the actual webpage.

My external JSON file: test.json.

{ "video":"test.f4v", "thumb":"test.jpg", "title":"The test", "caption":"TEST TEST TEST TEST TEST", "minutes":01, "seconds":43 }

I’m positive the JSON file is valid.

Here is my html/javascript:

<script type="text/javascript" src="js/json2.js"></script>
    <script type="text/javascript">
    window.onload = initAll();

    function initAll(){
        var jsonData = {};
        var xhr = false;

        if(window.XMLHttpRequest){ //Chrome, Firefox, Opera, Safari, IE7+
            xhr = new XMLHttpRequest();
        } else if(window.ActiveXObject){ //IE5 + IE6
            try{
                xhr = new ActiveXObject("Msxml2.XMLHTTP");
            } catch(e){
                try{
                    xhr = new ActiveXObject("Microsoft.XMLHTTP");
                } catch(e) {
                    alert("Could not make XMLHttpRequest");
                }
            }
        }

        if(xhr){
            xhr.open("GET", "js/ajax/test.json", true);
            xhr.onreadystatechange = function () {
                if (xhr.readyState == 4 && xhr.status == 200){
                    try{
                        jsonData = JSON.parse(xhr.responseText);
                        alert(jsonData.title);
                        document.getElementById("vidtitle").innerHTML = xhr.responseText.title;
                        document.getElementById("vidcaption").innerHTML = jsonData.caption;
                    } catch(e){
                        alert("Unable to parse jsonData.");
                    }
                }
            };
            xhr.send(null);
        }
    }
</script>   
</head>
<body><div class="vidcontent">
<h2 id="vidtitle"></h2>
<p id="vidcaption"></p>

I’m doing this locally on my server, but I have uploaded the files to my web host and still get the same issues.

Firebug tells me it has the data and I can even read it through the console. Now, The code works in Firefox, but not Chrome or IE8 (IE8 Works occasionally when I put it into compatibility mode, but not always <.< ) I can’t test on Safari or Opera right now.

Is there any way I can get this working in these browsers? I have attempted $.parseJSON in the JQuery library, but I was having issues with that as well. I am interested in JQuery as well if anyone can explain the solution with it.

  • 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-21T17:10:02+00:00Added an answer on May 21, 2026 at 5:10 pm

    Your JSON is invalid: http://www.jsonlint.com/

    Leading 0’s are not allowed in numbers apparently.

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

Sidebar

Related Questions

High Level Goal: Create a single Maven Web Application project that can be used
This is proof of concept project - The goal is to create an application
Goal: Create Netbean project and put on repository (any). When other developers check out
My goal is to create a C# winform application which has rounded panel, rounded
My goal is to create a XML file on internal storage and then send
My goal is to create a sqlite database file that would be downloaded by
My goal is to create a Chirper class. A chirper should be able to
My goal is to create a single object in powershell that shows the AD
My goal is to create a system monitoring application using Java. I would like
Goal: to create a percentage column based off the values of calculated columns. Here's

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.