i am using multiple getjson inside a javascript. I want to use the response of first getjson call which is a string like seasonID=44567 in another get json call as shown beleow (using code variable in second getJson)but unfortuently i keep getting bad request error. Could you guys help me fix this problem.Thanks
<script>
$.getJSON('http://www.site1.com/ok1.php&callback=?', function(data){
//$('#output').html(data.contents);
var siteContents = data.contents;
var start = siteContents.indexOf('seasons=');
var end = siteContents.indexOf('&width=385&height=230', start);
var code = siteContents.substring(start, end);
$.getJSON('http://www.site2.com/ok1.php?send="+code&callback=?', function(data){
var siteContents2 = data.contents;
document.myform2.outputtext2.value = siteContents2 ;
});
});
</script>
Use this