jQuery synchronous Ajax request
Doing asynchronous Ajax request in jQuery is easy and can be achieved using the code posted below.
Synchronous request are a bit different. Why would you want to make such request? Because your code will wait for the result before executing rest of your code which can be very useful in some situations.
How to get HTTP headers of any remote file?
Want to check Content-Type or Content-Length of a remote file without downloading whole file?
Then you should just request headers and not whole file from a remote server using HTTP protocol.
Here’s how to do this in PHP using fsockopen or cURL.