Jump to content

What is wrong with this ?


Mesh3L

Recommended Posts

Hello,I'm working an a google maps API V3 and using AJAX to get data from an XML. Every thing works fine and i get all the data properly. The problem happens when i attach a variable to the XML link.Here is the map :http://69.167.189.144/~meshalw/g/indexg.phpPlease check the page with Firebug.When it first loads from the XML (with no variables attached) it works fine. However, try to insert an input and submit, Firebug will show the link with RED and it wont bring any thing.I find it strange that if you copy the red link that Firebug shows, and go it through your explorer than it will show you the result without problem. (e.x : http://69.167.189.144/~meshalw/g/xml.php?rooms=6 )It seems that for some reason it happens when OnSubmit i call the function meshal() that has the DownloadUrl function. I need to have the DownloadUrl included in a function so i call that function OnSubmit whenever the user changes the search value.I'm a Javascript newbie and have spent 4 days trying to fix this !Any help will be appreciated. Thanks

Link to comment
Share on other sites

The error is in your xml.php script. With ajax scripts, it's easiest to use error logging with PHP so that you can see the errors after they happen. Add this to the top of your xml.php script:

ini_set('log_errors', 1);ini_set('error_log', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'error.log');ini_set('html_errors', 0);ini_set('display_errors', 0);error_reporting(E_ALL);

That will save all errors to a file called error.log in the same directory as the PHP script. Make sure PHP has write permission for that directory or file, and try it again to see what shows up in the log.

Link to comment
Share on other sites

The error is in your xml.php script. With ajax scripts, it's easiest to use error logging with PHP so that you can see the errors after they happen. Add this to the top of your xml.php script:
ini_set('log_errors', 1);ini_set('error_log', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'error.log');ini_set('html_errors', 0);ini_set('display_errors', 0);error_reporting(E_ALL);

That will save all errors to a file called error.log in the same directory as the PHP script. Make sure PHP has write permission for that directory or file, and try it again to see what shows up in the log.

Thanks justsomeguy, this is surly a good suggestion.However, amazingly after posting this thread and if it was like w3schools inspiration :) i thought maybe it was becasue i'm calling the function from inside a form that has no action (default action might be applied) so i just removed that form and done some code re-arrangements. And every things is working fine !http://69.167.189.144/~meshalw/g/indexg2.php
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...