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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.