Welcome to the JavaScript™ Developer Center

Yahoo! Language centers have been deprecated. If you have any concerns or questions, please don't hesitate to contact us in General Discussion at YDN forum.

Do you eat, sleep and breathe JavaScript? This is your source for information for using JavaScript with Yahoo! Web Services APIs. Here you'll learn about:

  • Yahoo! Products and Services that provide JavaScript frameworks, access, or APIs.
  • Documentation & Articles we at the Yahoo! Developer Network have written just for you to help you understand our technologies and how you can use them better with JavaScript.
  • User Interface & Design Resources for dynamic, interactive web application development
  • Code Samples you can steal...er...learn from and make use of in your own web and client applications.
  • Other Resources out on the Web to help you use JavaScript and the Yahoo! APIs to their fullest.
  • Community Resources where you can join our mailing list and discuss the Yahoo! APIs with us and with other JavaScript developers.

Yahoo! Products

These Yahoo! properties and services include APIs or interfaces for JavaScript:

Yahoo! Maps - Create Macromedia® Flash®-based maps with JavaScript using our JS-Flash API. Or use DHTML and JavaScript to place maps on your web pages using the Maps AJAX API. In addition, the building block APIs (Geocode, Map Image, Traffic, Local Search) provide REST interfaces which can be accessed through a JavaScript XMLHttpRequest object (see our AJAX HOWTO for more info). With these APIs you can also use the optional request parameters output=json and callback=function to get JSON (JavaScript Object Notation) output from the search web services instead of XML. Don't know from JSON? Check out our basic JSON documentation.

Yahoo! Widgets - Yahoo! Widgets can be used for anything from alarm clocks to quick-access search boxes to tell you the weather. Widgets are written in XML and JavaScript. The XML defines the widget's structure; JavaScript its behavior. Visit the Widget Workshop to learn how to develop your own.

Yahoo! Search - All the Yahoo! Search Web services provide a REST interface. As with the Maps building block APIs you can use XMLHttpRequest to access these APIs, and get output in XML or JSON format.

Yahoo! Travel - As with Yahoo! Maps and Search, access the Yahoo! Travel Trip Planner API through a REST interface and use the output=json and callback=function parameters to get JSON output from the Yahoo! Travel Web Services request.

Documentation & Articles

We've written a whole bunch of stuff to help you get up to speed with our APIs if you use JavaScript. In this section are HOWTOs, tutorials, articles, and documentation for various web services topics as well as for specific Yahoo! Web services and APIs.

AJAX & XMLHttpRequest

HOWTO: Use a Web Proxy for Cross-Domain XMLHttpRequest Calls: Why do you need a web proxy to use XMLHttpRequest? How do you get one? This HOWTO explains describes cross-domain browser security restrictions and how to use our PHP Proxy sample.

HOWTO: Make Yahoo! Web Service REST Calls with JavaScript and XMLHttpRequest: Using the JavaScript XMLhttpRequest object with Yahoo! Web Services to build fabulous AJAX applications.

How To Build a Maps Mashup: Use the Yahoo! Maps AJAX API to create a mashup with maps, local search and traffic web services from Yahoo!. This tutorial shows how to set up a web proxy, make the web services calls and generate the maps as well as markers for additional information.

Fixing AJAX: XMLHttpRequest Considered Harmful: Various ways of working around around browser security issues with XMLHttpRequest calls made between domains.

JSON (JavaScript Object Notation)

Using JSON (JavaScript Object Notation) with Yahoo! Web Services: Our general JSON documentation tells you what JSON is and how to use it with the Yahoo! Web services.

Web Services + JSON = Dump Your Proxy: Use the Yahoo! Web Services, the dynamic <SCRIPT> tag and JSON to build client-side web apps and avoid cross-domain browser restrictions.

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

Yahoo! Maps

JS-Flash API Getting Started: Get up to speed fast generating Yahoo! Maps for Flash. Use the JS-Flash API to generate and manipulate Flash-based maps for your web site using JavaScript -- no Flash programming is required.

Flash API Reference Manual: Complete documentation for all the Yahoo! Maps Flash APIs, including JS-Flash.

AJAX API Getting Started: Yahoo! Maps also provides DHTML-based embeddable maps for your web site. Use the AJAX API to create and manipulate these maps. This Getting Started tutorial provides the basic introduction to the Yahoo! Maps AJAX API.

AJAX API Reference Manual: Complete documentation for the Yahoo! Maps AJAX API.

Yahoo! Widgets

How to Build a Widget (PDF): Get started building a Yahoo! Widget with this quick-and-dirty tutorial.

Konfabulator Reference Guide (PDF): The complete Yahoo! Widgets reference documentation.

User Interface & Design Tools & Resources

Yahoo! User Interface Library: our new framework of utilities and controls for building rich, interactive web applications in JavaScript.

Yahoo! Design Patterns: an evolving set of design guidelines for building web pages and applications. Using the Yahoo! UI Library can help you more easily implement the patterns described in these pages.

Yahoo! User Interface Blog: News, articles, advice and discussion from our UI engineers about using the UI Library and Design Patterns.

Code Samples, Tools, and Libraries

Sometimes it's easiest to learn by looking at what other people have done. In this section we've included code samples we've written to help you get up to speed with web services, JSON, and XMLHttpRequest, as well as tools written by us and by others for Widgets and YME Plugins.

Unless otherwise noted, all the following code samples are provided under the terms of the Yahoo SDK Software License Agreement.

Web Services

PHP proxy for XMLHttpRequest calls: Sample code for a simple proxy you can install on your web server to relay Yahoo! Web Services requests to your application. See the Proxy HOWTO for information on why you might need this. NOTE: You will need to change the extension of this file to .php (or another valid PHP extension) when you install it.

Proxy Test File (POST and GET): This HTML form tests the PHP proxy above to ensure that both HTTP GET and POST are working. NOTE: This form is not live. Use Save As... to save it to your own system.

Yahoo! Map Mashup: This example uses XMLHttpRequest and the Yahoo! Maps, Local search and traffic APIs. It is described in How To Build a Maps Mashup. View Source to see the code.

Yahoo! Search Web Services REST request: A sample HTML file containing JavaScript code that makes a Yahoo! Search Web Services request using XMLHttpRequest. The sample is cross-browser (it supports both Internet Explorer's XMLHTTP object as well as the XMLHttpRequest. It requires the PHP proxy above to be installed on your Web server. NOTE: This example is not live. View Source to see the code. When the sample is installed on your web server with the PHP proxy installed, a successful connection will result in an JavaScript alert box containing the raw XML response. See the AJAX HOWTO for information on using this example.

Simple Geocoder: This web form makes an XMLHttpRequest call to the Yahoo! Maps geocode building block API through a web proxy. View Source to see how it was done.


Yahoo! Search Web Services REST request (JSON output): Make a Yahoo! Search request using XMLHttpRequest through a proxy and get output back as JSON (rather than XML). Note that this example is identical to the one in the previous section except for the output parameter to the request.

Simple Geocoder (JSON output): The same example as the XML Simple Geocoder in the previous section, only with JSON output. View Source for more information.

JSONscriptRequest -- a simple JavaScript class for accessing Yahoo! Web Services using dynamic <script> tags and JSON.

Using Dynamic Script Tags: (Yahoo! Retro Maps) this example uses the JSONscriptRequest class, the dynamic <script> tag, JSON and the Yahoo! Maps APIs. View Source to see how it works.

Yahoo! Map Mashup with JSON: This is the same sample as in the previous section, implemented this time with JSON instead of XML. View Source to compare and contrast the differences.

Yahoo! Travel Trip Browser: A visual trip plan search browser that uses the Yahoo! Travel Trip Plan APIs and JSON.

Yahoo! Widgets

Widget Converter: Convert a widget from its bundled release format into a collection of code and resources. You can use this tool to examine the code of the sample Yahoo! Widgets.

JSLint: A JavaScript "lint" widget from Douglas Crockford. Drop a JavaScript (.js) or HTML (.html) file onto the widget and it will check the syntax of the JavaScript embedded in that file.

Other Resources

In this section you'll find links to external sites, articles and tools that may be useful as you work with Yahoo! APIs and Web Services with JavaScript.


Mozilla Developer Center: JavaScript (Mozilla): Documentation and articles about JavaScript from Mozilla.

JScript Center (MSDN): Microsoft's documentation for JScript, Microsoft's JavaScript implementation.

ECMA 262 (PDF): The core standard on which all JavaScript implementations are based

Migrate Apps from Internet Explorer to Mozilla (IBM): Article on differences between IE and Mozilla, particularly with JavaScript, which can help with cross-browser development.

comp.lang.javascript FAQ: Frequently Asked Questions file from the comp.lang.javascript Usenet group. Contains many common solutions to problems and JavaScript resources.

JavaScript Tutorials (w3schools.com): A self-paced JavaScript tutorial, examples, reference documentation, quizzes.

JavaScript Forums (webdeveloper.com): Get help with JavaScript here.


Ajax: A New Approach to Web Applications (Adaptive Path): The original AJAX article which provides an overview of the technologies that make up AJAX: Asynchronous JavaScript + XML.

XMLHTTP (MSDN): API Documentation for Microsoft's XMLHTTP object.

XMLHttpRequest (MozillaZine Knowledge Base): API documentation for Mozilla's XMLHttpRequest

AJAX: Getting Started (Mozilla): AJAX basics, with examples.

Mastering AJAX: Part 1: Introduction: A detailed getting started article from IBM DeveloperWorks.

How do I parse a string with XML markup into an XML DOM document? : An FAQ from faqts.com with sample code for Internet Explorer and Mozilla.

XML for <SCRIPT>: An open source XML Parser for JavaScript, with lots of other XML development tools.


Introducing JSON (json.org): An overview and technical description of of JavaScript Object Notation, from its author.

JSON in JavaScript (json.org): Using JSON in JavaScript programming.

JSON: A Fat-Free Alternative to XML (json.org): A comparison of JSON and XML as a data representation format.

JSON Yahoo! Group: Discuss JSON here.

RSS To JSON Converter: a general-purpose tool to convert any RSS or Atom feed into JSON, by John Resig.

Debugging & Other Developer Tools

Scripting Debugging in Internet Explorer: Microsoft debuggers for Internet Explorer.

Venkman: A JavaScript debugger extension for Mozilla and Firefox.

Console: Advanced JavaScript error console for Firefox.

JS Eclipse: A JavaScript plugin for the Eclipse IDE.


Discuss how to work with the Yahoo! Web Services and other APIs using JavaScript on the ydn-javascript mailing list. Please note that this is not a general JavaScript programming questions list; try to keep your questions focused to discussion about the Yahoo! APIs.

We also provide individual lists for each of the web services and APIs we support; your questions are always welcome there as well. See the Yahoo! Developer Network Community page for more information on these mailing lists.