background preloader

Appy Pie

Facebook Twitter

FREE App Creator. Create Apps for Android. No Coding Required. App Creator, App Generator, Mobile App Creator Software: Login.

Mobiloud - Wordpress

Firebase - Build Extraordinary Apps. Calendar. DATABASES. AWS Mobile Hub – Desarrolle, pruebe y lance aplicaciones móviles. Cross Domain XML using JQuery. Ok, I’m sure by now many have tried to ask this question in forum and stackoverflow.

Cross Domain XML using JQuery

“How do you parse a cross domain xml, using jquery ajax?” Many would have answered try “jsonp”, which is a json like cross domain solution then, later you tried it and the xml returned is giving you an error of illegal token. Why? This is because, jsonp is only meant to process and parse incoming json data. It cannot be used to parse xml especially cross domain ones (It cant process the “<” and “>” from xml) . To do this, there’s 2 solutions You can use backend script to act as a proxy to do parse the crossdomain xml and your ajax to retrieve it’s json in return.Use some kind of proxy script involving google api and yahoo’s YQL In this tutorial I’m gonna show about how do we use a proxy script using yahoo’s YQL.

To start this, you will need the followings In this sample tutorial, we are going to make use of some o’Reilly xml sample which is located in a “different domain” here. Html - How to parse an RSS feed using JavaScript? Displaying RSS feeds easily using Google Ajax Feed API. Displaying RSS feeds easily using Google Ajax Feed API Displaying RSS feeds from other sites (ie: CNN or Digg) on your own is a nice way to show constantly updated content automatically.

Displaying RSS feeds easily using Google Ajax Feed API

However, for the novice web developer, setting this up can be daunting, requiring both knowledge from you and your server's ability to host remote files. Google's Ajax Feed API changes all that, by basically enabling any webmaster to display RSS feeds on their sites using some JavaScript code. It hosts the desired RSS feeds on their servers for you, caches them, and returns the data in either JSON or XML format for you to utilize.

All that's left is for you to use some JavaScript to parse this data and output it on your page. In this tutorial, I'll show you how to harness Google Ajax Feed API to fetch a RSS feed and display it on your site. The 3 minute setup Step 1: Get your own (free) Google API key instantly, by going to their signup page, and entering your site's domain. Output:   API Client Library for JavaScript (Beta)   Basic ideas This section provides a basic explanation of how your code can use the JavaScript client library to interact with a Google service (such as Calendar, Books, or Analytics).

  API Client Library for JavaScript (Beta)  

How an application makes an API request using the JavaScript client library There are many ways to use the JavaScript client library to make API requests, but they all follow the same basic pattern: The application loads the JavaScript client library. The application references its API key, which authenticates the application with Google services.If the application needs access to the user's personal information, it opens a session with a Google auth server.

The next section describes shows how these tasks could be handled in a web page's JavaScript.   API Client Library for JavaScript (Beta)   This page provides two detailed examples which demonstrate the library's functionality.

  API Client Library for JavaScript (Beta)  

Browse the project source for additional samples. Loading an API and Making a Request This snippet shows how to load an API and make a request. In this case, the request is going to Google's URL Shortener service. It's an example of "simple access", which means it does not require authorization from the user. <html> <head> <script> function appendResults(text) { var results = document.getElementById('results'); results.appendChild(document.createElement('P')); results.appendChild(document.createTextNode(text)); } function init() { gapi.client.setApiKey('YOUR API KEY'); gapi.client.load('urlshortener', 'v1').then(makeRequest); } </script> <script src=" </head> <body> <div id="results"></div> </body></html> Let's break this down.

This is the init function: