SORU
18 ŞUBAT 2011, Cuma


jQuery POST parametre olarak string gönderme

Ajax Post bir parametre olarak bir dize göndermek istiyorum.

Aşağıdaki kodu:

$.ajax({
   type: "POST",
   url: "http://nakolesah.ru/",
   data: 'foo=bar&ca$libri=no$libri',
   success: function(msg){
     alert('wow' msg);
   }
});

Çalışma değil. Neden?

CEVAP
18 ŞUBAT 2011, Cuma


Böyle deneyin:

$.ajax({
    type: 'POST',
    // make sure you respect the same origin policy with this url:
    // http://en.wikipedia.org/wiki/Same_origin_policy
    url: 'http://nakolesah.ru/',
    data: { 
        'foo': 'bar', 
        'ca$libri': 'no$libri' // <-- the $ sign in the parameter name seems unusual, I would avoid it
    },
    success: function(msg){
        alert('wow'   msg);
    }
});

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • CZTUTORIALS

    CZTUTORIALS

    28 Ocak 2011
  • paikimchung

    paikimchung

    12 Mayıs 2006
  • JeezyVEVO

    JeezyVEVO

    12 Mayıs 2009