How to solve the problem of too much data in URLs in Window.location.href

Source: Internet
Author: User

  This article is mainly to introduce the next window.location.href in the URL in the amount of data is too large, the need for friends can refer to the following

Let's talk about today's problems   an export Excel processing, in the button after the need to pass a large data to the background, the first practice is as follows: The code is as follows: var actionurlsetdata = "****action! Exportdatas.action "+" "now=" + New Date (). GetTime (); window.location.href= ActionURL + "&" + data; The data in     above is a very long string.     So in Firefox and Google browsers are no problem, but in IE9 (other IE did not try, should be the same) can not be normal export   cause this problem is the various browsers on the length of URL resolution is different, IE is the smallest one, so there is a problem         Microsoft Internet Explorer (Browser) IE browser has a maximum limit of 2,083 characters for URLs, and if this number is exceeded, the submit button has no response.   Firefox (Browser) limits the length of the Firefox browser URL to 65,536 characters   Safari (Browser)     URL with a maximum length limit of 80,000 characters.   Opera (Browser)     URL Maximum length limit is 190,000 characters.   Google (chrome)     URL Maximum length limit of 8,182 characters   here also note that the Web server to the length of the URL is also limited!!   therefore can not use Get method, can only find ways to use the post to pass the value, so that the following scheme, do not know, also please master, in short, the function is to realize the   idea is to use post to the long string to the background, save to the session, In the callback method of the post, use the Window.location.href   code as follows: The   code is as follows: $.post (actionurlsetdata,maplist, function () {        var actionurl = path +/***action!eXportdatas.action "+" "now=" + New Date (). GetTime ();         window.location.href= ActionURL + "&" + (data);    });    
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.