Skip to content

Instantly share code, notes, and snippets.

@tokkonopapa
Created June 11, 2011 08:46
Show Gist options
  • Save tokkonopapa/1020376 to your computer and use it in GitHub Desktop.
Save tokkonopapa/1020376 to your computer and use it in GitHub Desktop.
/echo/html/
/* /echo/html/ */
<div id="msg"></div>
$(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
});
});
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