I am trying to create a facebook application, all is working fine except the ajax part that I am using to populate a second box from the item selected in first select box.
You are not allowed to request data from other sites than the domain the script is running on. For example, if you are running the script www.example.com/script.js, then you can only ajax files under the www.exaple.com domain, not www.facebook.com.
There are a few ways to do it:
There is a limitation when using ajax that the xmlhttp request may not be cross-domain. See https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript
A common workaround for this is to make the ajax request to a backend script that will actually make the cross-domain request i.e. cURL.
Using FBML you can use FBJS to send JSON data type to your own script:
Here is the documentation: http://wiki.developers.facebook.com/index.php/FBJS/Examples/Ajax