ajax响应运行javascript

时间:2012-07-05 12:29:54

标签: javascript jquery ajax

我希望在ajax响应之后运行相同的js代码。

js代码是

<script>
var wid = 2670, gid = 8412;
var rpHost = (("https:" == document.location.protocol) ? "https://" : "http://");
var tt = "t_reklamporttakip_Kozmetik_1x1_Uye_Takip";
var ciid = 4541454;
document.write(unescape("%3Cscript src='" + rpHost + "ad.reklamport.com/scripts/rpn.js' type='text/javascript'%3E%3C/script%3E"));
document.write(unescape("%3Cscript src='" + rpHost + "ad.reklamport.com/rpgetad.ashx?tt=" + tt + "&ciid=" + ciid + "&rnd=" + Math.random() % 99999999 + "' %3E%3C/script%3E"));
</script>

如何将此代码运行为

jQuery.get('url', function(response){
    // i want run here!
});

任何人的建议

1 个答案:

答案 0 :(得分:1)

如果要从服务器获取JavaScript,请使用getScript()