Сообщение от dima85
|
Так я получаю alert с "success"
|
А я получаю
Цитата:
|
Uncaught ReferenceError: str is not defined
|
srcJson = {"status":"success","ip":"70.84.83.22","ip_version":"ipv4","country":{"alpha-2":"US","alpha-3":"USA","name":"United States","phone":"1"},"continent":{"code":"NA","name":"North America"}}
id = "status";
str = str.replace(new RegExp('('+id+')','g'), srcJson[id]);
alert(str);