Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
jQuery envía cadena como parámetros POST

Quiero enviar una cadena como un parámetro de publicación ajax.

El siguiente código:

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

No está trabajando. ¿Por qué?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Prueba así:

 $.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); } });
over 4 years ago · Santiago Trujillo Report

0

$.ajax({ type: 'POST', url:'http://nakolesah.ru/', data:'foo='+ bar+'&calibri='+ nolibri, success: function(msg){ alert('wow' + msg); } });
over 4 years ago · Santiago Trujillo Report

0

Veo que no entendieron tu pregunta.

La respuesta es: agregue el parámetro "traditional" a su llamada ajax de esta manera:

 $.ajax({ traditional: true, type: "POST", url: url, data: custom, success: ok, dataType: "json" });

Y funcionará con parámetros PASADOS COMO UNA CADENA.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!