Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6948573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:50:27+00:00 2026-05-27T13:50:27+00:00

I have URLs in JSON feed n each URL contains one image. I want

  • 0

I have URLs in JSON feed n each URL contains one image. I want to validate those URLs which have image or not (NULL). How to validate this using javascript.
since I’m a beginner, i don’t know, how to validate this. thanks

      JSON feed with image n NULL
        {

         previewImage:"http://123.201.137.238:6060/feed/videoplay/Jackie.png",

        }, 
        {

        previewImage:"http://www.snovabits.net/feed/ImageMI/WarCraft.jpg",

        },
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:50:27+00:00Added an answer on May 27, 2026 at 1:50 pm

    Interesting question!

    Try to add the images to a div (use jQuery, the div can be hidden using display:none;).
    Then test the properties of the images regularly (use a setInterval loop) whether they indicate a successful load. Define some timeout after which the setInterval will kill itself.

    This property works for testing successful img load in Chrome and Firefox:

    naturalHeight != 0
    

    This property works for testing successful img load in IE7,8,9:

    fileCreatedDate != ''
    

    Test both to make it work in all major browsers.

    Here is a fiddle to see how the props change in 10ms steps during the load process. Try it in different browsers!:
    http://jsfiddle.net/xGmdP/

    In Chrome and FF you can even replace the timeout for the setInterval loop by checking the complete property of all images. But unfortunately this does not work in IE (complete always stays false in IE for images that cannot be loaded).

    Finally here is the complete code of the fiddle:

    <html>
    <head>
      <script src="http://code.jquery.com/jquery-latest.min.js" type="text/JavaScript"></script>
      <script type="text/JavaScript">
        $(function(){
          $('#images').prepend('<img id="img1" src="http://123.201.137.238:6060/feed/videoplay/Jackie.png">')
          $('#images').prepend('<img id="img2" src="http://www.snovabits.net/feed/ImageMI/WarCraft.jpg">')
          setInterval(test, 10);
        })
    
        function test(){
          var props=['naturalHeight', 'complete', 'fileCreatedDate', 'clientHeight', 'offsetHeight', 'nameProp', 'sourceIndex'];
          for(i in props){
            var pr = props[i];
            $('#testresults').append('1:'+pr+' = ' + $('#img1').prop(pr)+'<br>');
            $('#testresults').append('2:'+pr+' = ' + $('#img2').prop(pr)+'<br>');
          }
          $('#testresults').append('---<br>');
        }
      </script>
    </head>
    <body>
      <div id="images"><div>
      <div id="testresults"></div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have JSON data which contents Strings and Image URLs, and I already parse
Okay, so I have a JSON array of image URLs. I want to load
I have URLs which always end on a number, for example: String url =
I have an array which includes URLs of JSON feeds. I am using ASIHTTPRequest
I have a URL like this for each record: http://localhost:3000/items/3/stuff.json http://localhost:3000/items/1/stuff.json http://localhost:3000/items/4/stuff.json http://localhost:3000/items/9/stuff.json when
I have limited experience with JSON, and am trying to extract image URLs from
I have few Services- with clean-URLs and while calling each service, the URL pattern
I want to have URLs like this: some-company-name-deal-id-6.htm So the rewrite rule should ignore
Running SQL Server 2008 (not R2). I have a few reports that have URLs
I have a site that collects URLs. A full HTTP URL is entered into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.