>All Tutorials 
Ajax and .NET Ajax and .NET RSS XML
Ajax and ColdFusion Ajax and ColdFusion RSS XML
Ajax and Java Ajax and Java RSS XML
Ajax and PHP Ajax and PHP RSS XML
Ajax and SOA Ajax and SOA RSS XML
Ajax Goodies Ajax Goodies RSS XML
Ajax Tool Ajax Tool RSS XML
Facebook MockAjax Facebook MockAjax RSS XML
Google Web Toolkit Google Web Toolkit RSS XML
JavaScript Framework JavaScript Framework RSS XML
Ruby on Rails Ruby on Rails RSS XML
Technique Introduction Technique Introduction RSS XML
Without XMLHttpRequest Without XMLHttpRequest RSS XML
Yahoo! UI Yahoo! UI RSS XML

JSON and the Dynamic Script Tag: Easy, XML-less Web Services for JavaScript - web script tag json service function pathinfo javascript

 
Registered tutorials: 501
Registered Users: 33125



Rating: 4.67 out of 3 votes cast


  
Category: Without XMLHttpRequest

JSON and the Dynamic Script Tag: Easy, XML-less Web Services for JavaScript

Digg this   Post to del.icio.us

Abstract: This tutorial demonstrates the alternative to classic XMLHttpRequest - dynamic script tag approach.If you make web services requests using it you can have unfettered access to the web service in a seamless, cross-domain, cross-browser fashion.

aking requests to third-party web services from an AJAX application is a pain, but new web services that offer the option of returning JSON (JavaScript Object Notation) instead of XML can provide significant relief. In fact, if you make web services requests using the dynamic script tag approach -- and the web service lets you specify a JavaScript callback function -- you can have unfettered access to the web service in a seamless, cross-domain, cross-browser fashion.

Here's what you need to try out this dynamic script tag request:

  1. My JSONscriptRequest class
  2. Access to a web service that returns JSON and lets you specify a callback function

To create my class, I distilled a lot of existing information, and then adapted it to fit no. 2 above. Until recently, finding a web service that returns JSON and lets you specify a callback function was, well, darn near impossible unless you wrote one yourself. Fortunately, Yahoo recently has offered the option on many of their REST-ish web services. Notably, their many search web services, and their geocoding, map image, and traffic web services, now can return JSON wrapped in a callback function.


Read Full Tutorial...



Reviews:

Rate and Review This Site

No reviews yet


Statistic Information About this Resource:


Total Hits: 486
Unique Hits: 430


  Daily Weekly Monthly
  Unique Total Unique Total Unique Total
Average 0.7 0.8 3.5 4.3 20.4 23
Current 1 2 1 2 1 2
Previous 0 0 6 6 28 34
Nov 29 0 0 6 7 22 24
Nov 28 1 1 0 0 30 35
Nov 27 1 1 9 10 28 29
Nov 26 1 1 0 0 28 35
Nov 25 3 3 7 11 29 33
Nov 24 0 0 0 0 0 0
Nov 23 0 0 2 2 28 28
Nov 22 0 0 4 5 10 10
Highest 6 6 11 13 30 35


Script Execution Time: 4.59024 | SQL Queries: 10 | Members: 501
Ajax Tutorial Top List - Powered by Aardvark Topsites PHP 5.1.2