Created
June 4, 2011 11:09
-
-
Save tokkonopapa/1007809 to your computer and use it in GitHub Desktop.
jsFiddleとの連携デモ http://jsfiddle.net/gh/gist/jquery/1.6/1007809/
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
body { | |
font-family: Helvetica, Verdana | |
} | |
p { | |
padding: 7px 10px; | |
} | |
#demo { | |
border: 1px solid #999; | |
} |
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="demo"><p>このメッセージは、3秒後に変わります。</p></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({ | |
type: "GET", | |
url: "/gh/gist/response.html/1007809/", | |
data: { | |
"delay": 3 | |
}, | |
dataType: "html" | |
}).success(function(data, textStatus, jqXHR) { | |
$("#demo").html(data); | |
}); | |
}); |
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: Sample 1 | |
description: Sample 1 | |
authors: | |
- tokkonopapa | |
resources: | |
- https://getfirebug.com/firebug-lite-debug.js | |
normalize_css: yes |
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
<p>この <span>コンテンツ</span> は Gist 上にあります。</p> | |
<p><span>JavaScript</span> コードが、幾つかの span の背景色を変えます。</p> | |
<script type='text/javascript'> | |
$('#demo span').each(function() { | |
$(this).css({backgroundColor: '#ffb'}); | |
}); | |
</script> |
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
self.onmessage = function(event) { | |
// from から to までの素数を見つける | |
var n = event.data.from; | |
var to = event.data.to; | |
for (; n <= to; n++) { | |
var found = false; | |
var n2 = Math.sqrt(n); | |
for (var i = 2; i <= n2; i++) { | |
if (n % i == 0) { | |
found = true; | |
break; | |
} | |
} | |
if (!found) { | |
postMessage(n); | |
} | |
} | |
} |
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
{ "test": "demo" } |
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
<demo>test</demo> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment