Stackoverflow でこの問題を検索する方法がわかりません。さまざまな解決策があり、私の問題とは関係ありません。だから私は再び皆さんの助けが必要になります.
変数 obj の値:
item.title = Title1 and Title2
item.description = Description1 and Description2
HTML ファイル:
function test_pop() {
var fb_id = "xxxxxxxxxxxx";
var v_id = "xxxxxxxx";
$.post('http://mysite.com/myfile.php', {fb_id: fb_id, v_id: v_id}, function(data) {
var obj = $.parseJSON(data);
$.each(obj,function(index, item){
achievement = "You Obtained " + item.title + " " + item.description;
achievement_pop(achievement);
});
});
}
achievement_pop 関数:
function achievement_pop(data) {
$("#achievement_popup").html(data).show(); //DIV that should show up
}
したがって、問題は、div が表示されると、次のようにしか出力されないことです。
<div> <!-- Imagine that this content is inside a DIV -->
**You Obtained Title2 Description2**
</div>
しかし、私の欲望の出力は次のとおりです。
<div> <!-- Imagine that this content is inside a DIV -->
**You Obtained Title1 Description1**
**You Obtained Title2 Description2**
</div>
皆さんが私を助けてくれることを願っています、ありがとう。