| 目次 |
|---|
|
・説明 ・サンプルソース(test.htmlを取得して<div id="test_html">の中に表示する) ・実行例 |
jQuery.get( ファイルのURL, コールバック関数 )コールバック関数とはファイルの取得完了後呼び出される関数です。
<html>
<head>
<title></title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("jquery", "1.3");</script>
<script type="text/javascript">
$(document).ready(function(){
$("#button").click(function () {
jQuery.get('test.html', function(data){
$("div#test_html").html(data);
});
});
});
</script>
</head>
<body>
<input type="button" value="サンプル実行" id="button" /><br /><br />
<div id="test_html"></div>
</body>
</html>