Skip to content
Advertisement

Tag: content-type

Check url content type with javascript

In order to conserve server resources I’m looking for a way to retrieve the content type of a given url using javascript. It should not download the complete content from the url only the headers. Is this possible with the restrictions javascript has. Answer Make an Ajax call with a head request.

Advertisement