Skip to content

Instantly share code, notes, and snippets.

@tokkonopapa
Created June 11, 2011 09:07
Show Gist options
  • Save tokkonopapa/1020393 to your computer and use it in GitHub Desktop.
Save tokkonopapa/1020393 to your computer and use it in GitHub Desktop.
/* http://jsfiddle.net/echo/jsonp/ */
<div id="result"><p>本日の結果</p></div>
$(function() {
$.ajax({
type: 'GET',
cache: true,
dataType: "jsonp",
url: "http://jsfiddle.net/echo/jsonp/",
data: {
"1st": "ヤクルト",
"2nd": "中日",
"3rd": "巨人",
delay: 3
},
jsonp: "callback",
jsonpCallback: "somefunc",
}).success(function(data, textStatus, jqXHR) {
$("#result").append("<p>1st:" + data["1st"] + ", 2nd:" + data["2nd"] + ", 3rd:" + data["3rd"] + "</p>");
});
});
name: jsonp
description: jsonp のテスト
authors:
- tokkonopapa
resources:
- https://getfirebug.com/firebug-lite-debug.js
normalize_css: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment