jquery - Sending Contents of a HTML page to a PHP file -
how send contents of html file php file. have got total html content in jquery variable using below code
$(document).ready(function(){ $("#btnexportpdf").click(function(){ var html= $("#tblexport").html(); }); });
i stuck here, how can send such big string new php page? please provide me sample example or link
you have post .php file. using jquery post function.
var html = 'here <b>some</b> text!'; $.post( "example.php", html, function() { alert( "success" ); }) .done(function() { alert( "second success" ); }) .fail(function() { alert( "error" ); }) .always(function() { alert( "finished" ); });
more information @ jquery docs:
https://api.jquery.com/jquery.post/ && https://api.jquery.com/jquery.ajax/
Comments
Post a Comment