2016-10-21 5 views
0

問題のあるモデリングhtmlを選択してください。 .mainBody後のvarのhtmlの内容を挿入し、返される結果に.dispatchBodyの内容を設定します。dispatchBodyは」あなたがここでやろうとしているもののようjqueryから選択してくださいhtml

success: function (response) { 
     var result = omac.getJson(response); 
if (result.status.msg == "Success.") {var html = '<div class=\"modal right fade\" id=\"referenceModel\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\"> <div class=\"modal-dialog\" role=\"document\">  <div class=\"modal-content\">   <div class=\"modal-header\" style=\"background-color: #428bca;color:#fff;\">    <button type=\"button\" class=\"close\" id=\"btnCloseModel\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;<\/span><\/button>    <h4 class=\"modal-title\" id=\"myModalLabel\">Reference Center<\/h4>   <\/div>    <div class=\"modal-body dispatchBody\"> <\/div> <div class=\"modal-footer\">  <button type=\"button\" class=\"btn btn-primary\" data-dismiss=\"modal\">CLOSE<\/button><\/div><\/div><\/div><\/div>'; 
$(html).after(".mainBody"); 
      $('.dispatchBody').html(result.results.html); 
     }} 
+1

最初に 'if(result.status.msg =" Success。 ")'が代入の場合は、おそらく==が必要です。そうでない場合は、何をしようとしているのかについて詳しく調べてみてください。 –

+0

問題を理解できません。多分あなたは塊を作ることができますか? – Knostradamus

答えて

0

私の推測である選択したり、挿入しません.afterの誤った使用をあなたに残し

、それは

$(".mainBody").after(html);

後の詳細については http://api.jquery.com/after/を参照してくださいする必要があります

あなたの意思ではない場合は、それを反映するために質問を更新してください。

関連する問題