Jump to content

IE not executing javascript calls in ajax content


maxz_pc

Recommended Posts

Hi,

 

I'm trying to generate some javascript with ajax

 

<html>

<body>
......
......

<div id="ajax_here">
<script type="text/javascript">
  Calendar.setup(
    {
      inputField  : "data",         // ID of the input field
      ifFormat    : "%Y-%m-%d",    // the date format
      button      : "trigger"       // ID of the button
    }
  );
</script>
</div>


rest of site

</body>
</html>

 

the problem is that the code in the div "ajax_here" is not being executed in IE browsers.

 

is there any way to fix this problem?

this exemple might be easier to understand

 

I'm trying to generate some javascript with ajax

 

test.php

<html>
<head>
  <script type="text/javascript" src="ajax.js"></script>
</head>

<body>

  <img src="img/cal.gif" onmouseover="open_url('ajax.php', 'test');" />
  <div id="test"></div>

</body>
</html>

 

ajax.php

<?php
ob_start();
echo "AJAX test<br>";
echo "<img src='http://www.google.ca/intl/en_ca/images/logo.gif' >";
echo "<script type=\"text/javascript\">
alert('script test');
</script>";


header("Content-Type: text/html; charset=ISO-8859-1");
ob_flush();

?>

 

the problem is that the javascript code in the ajax file is not executed on internet explorer (IE)

 

is there any way to fix this problem?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.