View Full Version : accessing the JSON document and parsing it

03-29-2009, 09:50 PM
Hello everyone,

I am not sur I am in the right category. Althought I do beleive I am please tell me if I'm not.

So here is my problem.
youtube gives the possibility for developpers to make queries on their videos database.

this address for exemple will get the 25 first results of the research matching pink floyd. All information such as artists and etc... are stored in a JSON document. The callback attribute will call a function(showMyVideos2) once the document is loaded.

What I am trying to is to find a way to load that document in my page so that I can parse it and get the information I need. I beleive I succeeded in doing that with this method:
type="text/javascript" src="http://gdata.youtube.com/feeds/api/videos?v=2&alt=json-in-script&q=pink+floyd&max-results=25&format=5&callback=showMyVideos2";>
later on I parse it

but the problem that I am facing is that I would like the "pink+floyd" part to be a variable that can be changed with a form for exemple...
so i would like the url to be in the following form:


but the problem is that this will not work since I am not in the script nodes but in the attributes..

Any one has any solution to this??
thank you