|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help needed with prototypes Ajax.Updater with php
Hello all,
I need some help on using prototypes Ajax.Updater with data from a php file. Basically I need to update the content of an html form element AND obtain the value of a single php variable after the ajax update has completed. I've been able to update the content of the html form but I can't figure out how to retrieve the php variables data from within the javascript function. Here is the simple javascript function getNewSong(). This function populates the html form correctly with data from the php form. But I've added a variable 'unknownName' that I need to populate from the php file that I call. function getNewSong() { var unknownName; var url = '/Scripts/load_song.php'; var myAjax = new Ajax.Updater( { success:'popup', failure: 'errors' }, url, { method: 'get', onSuccess: function(transport) { unknownName = ???? }, insertion:Insertion.Bottom }); return unknownName; } Now here is an example of the php file load_song.php <?php echo 'Lots of data that is populated into the html form'; // I need this file name within the javascript function $file_name = getFileNameFromDb(); return $file_name; ?> Does anyone know how I can retrieve the data from the php variable $file_name in the js function after it has successfully completed? All I seem to be able to access is the data that is echoed by the php file and populated within the form. Any help is much appreciated. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Good PHP book recommendation? | ObiWayneKenobi | Web | 1 | 10-13-2007 06:51 PM |
| Flex + PHP | Hickeroar | Web | 0 | 05-13-2007 12:16 AM |
| cannot connect flash xml client socket to php socket server | doc | XML | 0 | 03-20-2007 01:13 PM |
| PHP and ASP authentication problem | blakej | ASP.NET | 2 | 01-30-2007 11:58 AM |
| Connecting to java chat server from php | prasad | Java | 0 | 05-15-2006 10:45 AM |