Questions about passing parameters to phpexcel on the page

Source: Internet
Author: User
An excel export button exists on the page for passing parameters to phpexcel. how can I upload the parameters on the page to the background by clicking the button (the front-end page does not jump to) to export the corresponding excel. & Lt; input & nbsp; typesubmit & nbsp; valueSave & nbsp; as & nbsp; Excel & nbsp; & gt; & amp; am page parameters passed to phpexcel
There is an excel export button on the page. how to click the button to upload the page parameters to the background (the front-end page does not jump) to export the corresponding excel.

          







《script》

$(document).ready(function(){
$("#excel").click(function(){
$.ajax({
type:"POST",
url:'excel_GlobalNetwork.php',
data:{area:$('#area').combobox('getValues').join(","),level:$('#level').combobox('getValues').join(","),bt:$('#bt').datebox('getValue'),et:$('#et').datebox('getValue')}
});
return false;
});

At present, I did this and found that the page does not jump or excel output, please master the instructions, how to modify the code.
------ Solution --------------------
Sao Nian. Your ajax just passes the data and does not get any output. How can I download the file.
In addition, download is an output file, so you do not need to add the passed parameters to ajax. a href = excel_GlobalNetwork.php.
And. Your excel button only downloads files and does not need to submit a form. Therefore, you only need to type = "button" instead of submit. Otherwise, the form will be submitted even if the click event is added, this is equivalent to refreshing the page.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.