CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Ajax and Design (http://www.codingforums.com/forumdisplay.php?f=55)
-   -   http request don't keep the javascripts working (http://www.codingforums.com/showthread.php?t=127243)

alapimba 11-06-2007 02:17 PM

http request don't keep the javascripts working
 
Hello
I'm doing an http request of one page, and when that page loads the javascripts on that page don't work.
theres anyway to fix this?

my request code is:
Code:

function replace<?php echo $row_rs_anos['id']; ?>() {
  http.open("GET", "simple_accordions_with_src/Basic.html", true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('foo').innerHTML = http.responseText;
    }
  }
  http.send(null);
}

anyone can help me?

shyam 11-06-2007 03:01 PM

it won't innerHTML will only call the rendering portion of the browser and since the script tag is not something that will be part of the display it will be ignored. if u want scripts to execute u've to use DOM manipulation

alapimba 11-06-2007 03:03 PM

hum... i see.. can you help me a bit more? i really don't know how to search.

shyam 11-06-2007 03:11 PM

the simplest way out would be to use an iframe like
Code:

document.getElementById('foo').innerHTML = '<iframe src="simple_accordions_with_src/Basic.html"><' + '/iframe>';
to learn more about html dom http://www.w3schools.com/htmldom/default.asp


All times are GMT +1. The time now is 08:22 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.