CodeIgniter Forums
DOMPDF with AJAX JQuery - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: DOMPDF with AJAX JQuery (/showthread.php?tid=34201)



DOMPDF with AJAX JQuery - El Forum - 09-22-2010

[eluser]reidz[/eluser]
Hi i have this problem about how i suppose to do, when i want to generate a PDF with domPDF, but i want some data in that PDF comes from my POST variables
I've tried to use some JQuery to post my variable but it just wont work, this is some of my code

JQuery to post my variable task_id
Code:
$.post("/qa/scoring/printDOMPDF", {"task_id": task_id},
        function(data){},"json");

Function in my controller to accept that "task_id" then send it to DOMPDF
Code:
function printDOMPDF()
{
$task_id = $this->input->post('task_id'); // all went wrong went i tried to accept this POST variable
$data['task_id'] = $task_id
$html = $this->load->view('/qa/to_pdf/scoring_lec', $data, true);
pdf_create($html, 'untitled');
}
that POST variable just wont work

now im just using this to call printDOMPDF() function from my Javascript
Code:
location.href= '/qa/scoring/printDOMPDF"';

any help will be appreciated, thanks before


DOMPDF with AJAX JQuery - El Forum - 09-22-2010

[eluser]reidz[/eluser]
in the meanwhile i've made it to send some variable, but in COOKIES, if there is some help about sending some variables in POST, please post it , thanks