Head tag of ajax content ignored in Safari but nowhere else

Head tag of ajax content ignored in Safari but nowhere else

I just noticed that some javascript I put in the <head> section of a page that's later loaded via ajax isn't being run in safari. For example here's a page:

  1. <html>
  2. <head>
  3. <script type="text/javascript">alert("hi");</script>
  4. </head>
  5. <body></body></html>
If I load that page up via ajax:

  1. $(body).load("page.htm")
safari never fires the alert, but all other browsers do

Is this by design, maybe head sections are supposed to be ignored in ajax content? It's not a big deal, I can easily put the script into the <body> section which solves the problem

Just wondering if it's a bug or by design. Maybe I should stop including <html><head> and <body> tags in ajax content just because of potential problems like this
    • Topic Participants

    • mikew