开发者

Javascript function does not work after page loaded via Jquery Ajax request

开发者 https://www.devze.com 2023-03-22 01:20 出处:网络
But here\'s the crazy thing, this only happens with Safari. The function works as it should on Chrome, IE< and开发者_运维技巧 Firefox.

But here's the crazy thing, this only happens with Safari. The function works as it should on Chrome, IE< and开发者_运维技巧 Firefox.

I tried adding:

$(document).ajaxComplete(function() {
    var myfunctionhere = function()
      {
      //my function
      }
});

Anyone got any ideas what is going on with Safari here and how I can get it to play nice.


The solution was to get rid of everything but the script and the content inside of the body - remove the html, head, and body tags.

This was also addressed here JavaScript doesn't execute in Safari when loading entire page via jQuery's load() method

0

精彩评论

暂无评论...
验证码 换一张
取 消