dynamic API URL feed - reading cross domain feed content

Posted on 2012-03-19
Last Modified: 2012-07-16

I am trying to read a cross-domain feed URL using the following code,

<script type="text/javascript">
            function processStateChange(){
                    statusDiv = document.getElementById("feed");
                    if (req.readyState == 0){ statusDiv.innerHTML = "UNINITIALIZED"; }
                    if (req.readyState == 1){ statusDiv.innerHTML = "LOADING"; }
                    if (req.readyState == 2){ statusDiv.innerHTML = "LOADED"; }
                    if (req.readyState == 3){ statusDiv.innerHTML = "INTERACTIVE"; }
                    if (req.readyState == 4){
                      statusDiv.innerHTML = "COMPLETE";
                      statusDiv.innerHTML = req.responseText;
            function getXMLObject() //XML OBJECT
                        xmlHttp=new XMLHttpRequest();
                  catch (e)
                              xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
                        catch (e)
                                    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
                                    catch (e)
                                          return false;
                  return xmlHttp;
$(document).ready(function() {
            req = new getXMLObject();
            if (req) {
                req.onreadystatechange = processStateChange;
      "GET", "", true);

The above code reads the feed correctly in IE (Msxml2.XMLHTTP), but FF and other browsers does not pull up the feed data.

Can any one of you help me in fixing this.

Question by:Perumal_RM
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 11

Accepted Solution

Amar Bardoliwala earned 500 total points
ID: 37737608

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question