I'm using "AJAX" to basically get data from another php page onsubmit and return that data to the parent page.
The problem is that the page I am receiving data from, has some javascript that I need to include.. but it seems that because it is loading in a span tag or that it just simply does not support javascript...
Not sure if this is enough info, but if anyone happends to know a work around.. that would be great!
Using AJAX to get data
Moderator: General Moderators
Im including javascript...
Basically im using this script http://www.captain.at/howto-ajax-form-post-get.php
and the "get.php" file that im using, has javascript in it... but it wont process..
Basically im using this script http://www.captain.at/howto-ajax-form-post-get.php
and the "get.php" file that im using, has javascript in it... but it wont process..
You should prob. show some code...Have you looked into file_get_contents()?
first, file_get_contents is not what he needs. that will just confuse the him even more...hawleyjr wrote:You should prob. show some code...Have you looked into file_get_contents()?
secondly, there are a number of things that would cause this to not work (and yes, I'll even state the obvious ones that you will find useless, but hey, it never hurts...)
1) You may not have php installed, or apache for that matter.
2) You may not have created the files correctly.
3) You may not have javascript enabled on your browser.
I say this because the example on the URL you gave works exactly how it is suposed to.
The thing that you may doing wrong is you may not be creating the new DOM element (or span tag) correctly, and thus it will not be available for javascript to deal with.
As was stated above, please show us your code. 9 times out of 10 it is probably just a small typo. Usually if it was a problem with the xml request object, it would have generated an error (that is of course if error reporting was properly written for the functions..).
No, the code on that page works perfect... Everything works just as it should from the given example. The problem is that the content I am retreiving has javascript within it.. and THAT javascript will not work.. because it is being loaded through HTTPxmlrequest, so im wondering if there is a way so that it will except and parse the javascript that is being loaded from the "get.php" page...
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
You might need to eval the javascript that you load. It depends on the browser and to what kind of visiblity you get based on the order things are loaded. There was some discussion about here in this thread that pointed to an article. You may want to Google something like "eval javascript HTTPxmlrequest,"GeXus wrote:The problem is that the content I am retreiving has javascript within it.. and THAT javascript will not work.. because it is being loaded through HTTPxmlrequest, so im wondering if there is a way so that it will except and parse the javascript that is being loaded from the "get.php" page...
Obviously you want to be very paranoid about evaling loaded javascript,
(#10850)