I'm sorry maybe my question is confusing to anyone..Actually I am not getting a right way to say is the following code is an javascript code or it is a json..
see this sample code which I made and it is working perfectly:
var txt = '{ "title" : "Asian Dad: B Again!? (you die)", "image" : "http://i.ytimg.com/vi/IN7o2Iy89WQ/default.jpg", "length" : "2", "status" : "serving", "progress_speed" : "", "progress" : "", "ads" : "", "pf" : "", "h" : "a80b4ceb1ad73a0222ca7a78dc448213" }';
var obj = eval ("(" + + ")");
document.getElementById("fname").innerHTML=obj.title
document.getElementById("lname").innerHTML=obj.h
This code is printing the value of the title & h.
But my actual problem is the code which is given inside var txt = "....." ! Is actually coming from an external website ...I'm posting that url here :
http://www.youtube-mp3.org/a/itemInfo/?video_id=IN7o2Iy89WQ
You can see it is little bit strange..
it seems like a json which but it is also contains executable javascript code...
Hope you'll notice that..
My problem is I want to get the var txt = '......' value from that external url whatever logic I tried got failed. nothing is working. I'm new with this executable javascript code and not able to find a way to load it thru that external url..
Can anyone help me to know how to parse that .title & .h data directly thru the url ?
Please any help or suggestion will be appreciated..
EDITED :
Friends, I am not getting a way to connect that external url in my script for getting the value of obj.title ...Do you got me ? the present script is using a sample code inside var txt = '{....}'; I want to replace it with the url http://www.youtube-mp3.org/a/itemInfo/?video_id=IN7o2Iy89WQ because I want to get obj.title value from that external url. it is a part of my program.
Hope that will help.