$.ajax関数を使用してコンテンツを取得し、そこから特別なタグを出力する必要がありますが、データがありません! 私はそうしています:
$(document).ready(function(){
$("button").click(function(){
$.ajax({
url:"http://127.0.0.1/demo/w/?p=97",
dataType: "html",
success:function(out){
mine = $(out).find(".especial");
$("body").html(mine);
}
});
});
});
もちろん内容を丸ごとプリントアウトしても問題ありません。このような:
$(document).ready(function(){
$("button").click(function(){
$.ajax({
url:"http://127.0.0.1/demo/w/?p=97",
dataType: "html",
success:function(out){
mine = out;
$("body").html(mine);
}
});
});
});
out
問題は、jQueryオブジェクトのように宣言できなかった$(out)
ため、find()
関数が機能しないことです。それとも、問題は別の何かにあるのでしょうか?