Пожалуйста, помогите мне с проблемой - get
функция не работает для http://wtfismyip.com/text или http://www.passwordrandom.com/query?command=ip
Код:
<span id="global_ip" class="global_ip">global ip - get test</span>
<script type="text/javascript">
$('#global_ip').click(function() {
alert('click!');
$.get({
type: "GET",
url: "http://www.passwordrandom.com/query?command=ip",
dataType: "text"
}).done(function (res) {
alert(res);
}).fail(function (jqXHR, textStatus, errorThrown) {
alert("Call failed: " + textStatus + ", " + errorThrown);
});
});
вы можете сделать что-то вроде этого http://jsbin.com/negatu/1/ – Dhiraj