0
在.Net MVC 3我尝试运行一个脚本..该脚本是在局部视图。如果我调用Html.RenderAction部分它的作品,但如果我通过jQuery的ajax调用页面中的部分视图它不工作。脚本不加载,如果部分视图通过jQuery的调用ajax
管窥
<script type="text/javascript">
document.write("<script src='http://ad.reklamport.com/rpgetad.ashx?tt=t_iddaa_habersayfalari_mac_detay_300x250&ciid=&rnd=" + Math.random() % 99999999 + "'></" + "script>");
</script>
查看
它的工作原理..
<html>
<head>
</head>
<body>
@{Html.RenderAction("Partial");}
</body>
</html>
它不工作...
<body>
@{Html.RenderAction("Partial");}
<script type="text/javascript">
$.ajax({
type: "post",
url: "/Home/Partial",
dataType: "html",
success: function (result) {
$("#content").html(result);
},
error: function (result) {
}
});
</script>
<div id="content">
</div>
</body>
我需要使用第二种方法..问题是什么?
我试过页的通话AJAX脚本结束,但它仍然没有工作。 –
仍然没有工作:( –
如果我只写在脚本警报(“你好世界”)它的工作..我认为脚本不加载? –