Карта сайта Интеллектуальная поисковая системаДобавить свою ссылку по ключевому запросуПоисковая система v3.kz поможет ускорить индексацию вашего сайта выводит в Топ |
|
NOTE: These are simple examples of JSONP usage, these are not production ready scripts. RAW JavaScript demonstration (simple Twitter feed using JSONP) What is JSONP? Short version: it’s an alternative to ajax. Long version(with example) below: I guess most of you know what is JSON. Where to use JSONP. JSONP is mostly used to get data using RESTFull APIs(like Flicker). Example - getting the latest updates from the flicker regarding tag "dogs" using Jquery and JSONP. A particularly great source of JSONP-formatted data is the Yahoo! Query Language, which well use in the following example to fetch news about cats. jQuery’s JSONP Explained with Examples. Sam Deering. March 21, 2012. ExampleCross domain ajax with jsonp. Source Code Expand. A Simple JSONP Example. On many occasions, you may come across a requirement to request data from a remote website. JSONP is a way to fetch JSON data from a different domain, often in an asynchronous way, but without being restricted by the browser’s same-origin policy like you would be with XMLHttpRequest. But perhaps you only know it via a library like jQuery, which auto-magically handles JSONP URLs. Here is a simple example of jsonp which fetches json data from a different domain Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor. Информация взята v3.kz |
загрузка...
|