I am trying to write a website that allows a user to input a stock symbol(ie. APPL, GOOG) and get basic information back. I have a html/js file and how it looks is fine but I am running into trouble when doing an HTTP GET using the XMLHttpRequest. I've test the URL in the browser several times and it works great and displays the JSON that I would like to be getting. At this point I've looked at numerous tutorials and have asked others before and have not found a solution. I've done this before in Java and it worked like a charm so I don't understand what is so hard about this. Here is my breif code below. Does anyone see anything wrong or can you offer any tips? All suggestions would be greatly appreciated!
var textValue = document.getElementById("stockTextBox").value; var request = null; var urlEncoded = "http://www.finance.yahoo.com/webservice/v1/symbols/" + textValue.toString() + "/quote?format=json"; request = new XMLHttpRequest(); request.open("GET", urlEncoded, false); request.send(null); alert(request.status());