If an alert() makes it work, then it's a synchronization issue. Firefox5 might be too fast trying to make the call. As such, replace your alert() with a setTimeout() and delay the execution of the callServer() for half a second.
Thank you for your suggestion.Because setTimeout() does not pause the code but just schedules code to run after a set amount of time, the window closes before the code can run.