checking JSON Data contains media or not..?
<p>I am rendering the summary with JSON Data, in that i am checking for media.,
if media(image,audio,video) exist in JSON Data, it should render corresponding media to screen. so i am checking every value that contains media or not based on filetype. i've facing the problem while checking different data values</p>

<p><strong>Here My JS Code</strong></p>

<pre><code>        var disp=[
                  {
                    "Session_ID": 1,
                    "column1": "http://dev.starport.in/phpupload/dentist.jpeg",
                    "Session_Name": "0",
                    "Session_Code": "0",
                    "Start_Time": "09:30",
                    "End_Time": "09:30",
                    "Staff": 0,
                    "Date": "/Date(-2188013400000)/",
                    "Status": 1,
                    "RowNumber": 1
                  }
                ];
        var mediatype;
        var media;
        var fname;
        $.each(disp[0],function(key,value)
        {
            fname=value;
            media=0;
            var filetype;

            if(fname.indexOf(".")&gt; -1)            // problem
                filetype = fname.split('.').pop();
            else
                return true;

            if($.inArray(filetype, ['gif','png','jpg','jpeg']) &gt;= 1) {
                media=1;
                mediatype="image";
                return false;
            }
            else if($.inArray(filetype, ['mkv','mp4','vob']) &gt;= 1) {
                media=1;
                mediatype="video";
                return false;
            }
            else if(filetype == "mp3") {
                media=1;
                mediatype="audio";
                return false;
            }
            else
            {
                media=0;
            }
        });
        console.log(mediatype);
</code></pre>

<p>Hence my code works for string and also render appropriate item, when its comes to other format occurs errors..</p>

<p>Awaiting Responses <em>Thanks in Advance</em></p>