I'm a JavaScript beginner. I want to retrieve some data from Steam Market using the following URL:
https://steamcommunity.com/market/priceoverview/?country=PL¤cy=3&appid=730&callback=?&market_hash_name=Operation%20Vanguard%20Weapon%20Case#
I get this response in my browser:
{"success":true,"lowest_price":"0,09\u20ac","volume":"1,017","median_price":"0,10\u20ac"}
But I can't get it to work in JS.
var amount = prompt("How many cases do you have?\t");
$.getJSON("http://steamcommunity.com/market/priceoverview/?country=PL¤cy=3&appid=730&callback=?&market_hash_name=Operation%20Vanguard%20Weapon%20Case#",
function(json) {
var raw_price = json.lowest_price;
var price = raw_price.split('&')[0];
var price_total = price*parseInt(amount);
alert(price_total + '€');
});
It just throws me:
Uncaught SyntaxError: Unexpected token :
What's wrong with this code?