0

I'm writing code with jquery. The code is not working to localhost and server.

    $.post("http://www.example",function(reply){

alert(23);

        });

The same problem applies to the get, ajax functions.

I tried it with ajax. It happened. The Ajax command does not work at all. url wants to attract information from different site. Could this be the reason for not working?


my problem is still going on. I am no getting its data. The code I wrote is below.

var url="http://example.comm?city=london";//this site is get the data I sent. it return as text.

    $.ajax({
        url:url,
        type:"get",
        dataType:"jsonp",
        jsonp:"callback",
        success:function(value){

    $("#abc").text(value);
        },
        error:function(reply){
        alert(reply);//alert reslut:"<object></object>"

        },


    });
atm10
  • 1
  • 3
  • For jQuery >= 1.6 , try using `.fail(function(data) { console.log(data); });` chained to your post and check for errors – SubjectDelta Sep 29 '17 at 15:56
  • Please define _The code is not working_. And also have you read [this](https://stackoverflow.com/questions/11736431/make-cross-domain-ajax-jsonp-request-with-jquery/11736771#11736771)? – EhsanT Sep 29 '17 at 17:10
  • my problem is still going on. I am no getting its data. I've added up the codes. – atm10 Oct 01 '17 at 00:02

0 Answers0