0

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.

4
  • I don't think we can help much, if y<ou don't show us the function.. Or: Have you tried replacing the function with a simple alert("test");? Did that not run either? Commented Jul 22, 2011 at 13:31
  • Please elaborate. How are you loading a page via Ajax? Is the script tag in which the js function was residing is getting replaced by the new content? Commented Jul 22, 2011 at 13:33
  • Are invoking your function? In your example it is just decleared. Commented Jul 22, 2011 at 13:33
  • I did try just the alert and that didn't work - but, I didn't see this before I posted: stackoverflow.com/questions/4787457/… But 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. Commented Jul 22, 2011 at 13:34

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.