javascript - Problem with opening window with js
淡淡烟草味
淡淡烟草味 2017-05-19 10:29:47
0
2
423

Why can't I open a window after ajax returns?
Code:

$.ajax( { url: '/fb/index.php', data:{data: 1}, type:'post', success:function(data) { window.open("http://www.jb51.net"); }, error : function() { console.log("error2"); } });

Why is there no new window opened? Please give me some advice? ?

淡淡烟草味
淡淡烟草味

reply all (2)
曾经蜡笔没有小新

I have encountered this pitfall before.异步AJAX回调中使用window.open,会被浏览器拦截,把AJAXIt can be solved by changing it to synchronization. The questioner can give it a try.

    左手右手慢动作

    I didn’t enter the if, so it didn’t pop up. Try to output data

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!