OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Javascript Image Url Verify

  • Thread starter Thread starter John Preston
  • Start date Start date
J

John Preston

Guest
I need to verify an image url to check whether the url is an image of any of these extensions:- jpeg, jpg, gif, png. Example:- when we verify this url http://www.example.com/asdf.jpg it should give us true value and with url like this http://www.example.com/asdf.php should return false. How can we do this in javascript and also i want to check the content type of url. So that we can say whether the url is an image or not.

<p>I need to verify an image url to check whether the url is an image of any of these extensions:- jpeg, jpg, gif, png. Example:- when we verify this url <a href="http://www.example.com/asdf.jpg">http://www.example.com/asdf.jpg</a> it should give us true value and with url like this <a href="http://www.example.com/asdf.php">http://www.example.com/asdf.php</a> should return false. How can we do this in javascript and also i want to check the content type of url. So that we can say whether the url is an image or not.</p>
 

Latest posts

Top