Ajax

Ajax POST コールバック関数を使ってみる。

<script> $(function(){ $("#ajax-post").load("news.php", {"http":"200","keyword":"<h3>こんばんは</h3>"}, function(text, status) { $(this).css("background-color", "#aaaaff").css("border","1px solid #000000").css("padding","2em"); }); }); </script> </head> <body> <div id="ajax-post"></div> コール</body>…

Ajax GET してみる。

+htmlのiframe エレメントを使って外部ファイルを表示 phpの echo file_get_contents("http://…"); 等と類似した作業になる。まずは、わからないので、普通のjavascriptの書き方(?)の中に、$("#test").load("text.txt"); id=testに、text.txtをロードして頂…

Ajax POST してみる

<script> $(function(){ $("#news").load("news.php",{ keyword: "やっとこさ", category: "test" }); }); </script> <body> <p id="news"></p> 【news.php】 ADD 20080110「keyword: "やっとこさ"」…</body>