I think the code is right, but I don't get any response in my second alert. When I go to the website given in the first alert, I get the text I want. Why doesn't it work?
<script type="text/javascript">
function getimages(q) {
bossimagesrequest = new XMLHttpRequest;
var requri = "http://boss.yahooapis.com/ysearch/images/v1/"+escape(q)+"?appid=yahoobosskey&filter=true&count=10";
bossimagesrequest.open("GET", requri, true);
bossimagesrequest.onreadystatechange = function() {
if (bossimagesrequest.readyState === 4) {
alert(requri);
alert(bossimagesrequest.responseText);
}
};
bossimagesrequest.send();
}
</script>
I did replace "yahoobosskey" with my API key, so that's not the problem.