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

133
Views
llamada ajax para un método de publicación sin formulario

Estoy usando un formulario simple para imprimir un archivo pdf usando tcpdf. Con el formulario se genera bien el pdf en una nueva página printOrder.php

 <form action="php_action/printOrder.php" method="POST" target="_blank"> <input type="text" name="orderId" id="orderId"> <input type="submit" name="submit_btn"> </form>

Ahora, en lugar de usar un formulario, me gustaría usar una función jquery en un evento de clic que publique los datos y abra el pdf en la nueva página printOrder.php. Lo he intentado pero esto no funciona. (Error: Advertencia: Variable no definida $pdf)

 function printOrder(orderId = null) { if (orderId) { $.ajax({ url: 'php_action/printOrder.php', type: 'post', data: { orderId: orderId }, dataType: 'text', success: function (response) { var w = window.open('php_action/printOrder.php'); w.document.open(); w.document.write(response); }// / }); // / } // /if orderId } // /
about 4 years ago · Juan Pablo Isaza
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!