I have the following code (part of it): ajax.onCompletion = createList; ajax.runAJAX(); function createList() { var obj = document.getElementById('myList'); eval(ajax.response); } Code (markup): I am trying to only display the second drop down only if there were actual options returned from the PHP file. I can not figure out what to test for to see if there was no response or not from the request. It looks like even if I pass nothing from the php file, that the ajax.response returns something. I have not done JS in a while, so any help is much appreciated.
As I understand from your code, the ajax.response must be a javascript code string. Please let me know the ajax.response content in 2 cases: 1 . When there is option sent from server 2. When there is no option sent from server