Created
June 11, 2011 08:46
-
-
Save tokkonopapa/1020376 to your computer and use it in GitHub Desktop.
/echo/html/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* /echo/html/ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="msg"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
// Ajax 通信の結果を Promise インターフェースで受ける | |
$.ajax({ | |
type: "POST", | |
url: "/echo/html/", | |
data: { | |
html: "<p>3秒後に変わります</p>", | |
delay: 0 | |
} | |
}).success(function(responseText) { | |
$("#msg").append(responseText); | |
}).error(function() { | |
alert("error!"); | |
}); | |
// id='contents' から class='news' の要素をフィルタし、 | |
// innterHTML で id='new-nav' に挿入する | |
$("#msg").load("/echo/html/ #contents p[class=news]", { | |
html: "<div id='contents'><p class='news'>変わりました!</p></div>", | |
delay: 3 | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: /echo/html/ | |
description: /echo/html/ のテスト | |
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