Does the 2k length limit for URLs on IE still exist for IE 7 and IE 8?
Does the 2k length limit for URLs on IE still exist f开发者_如何学JAVAor IE 7 and IE 8? (the post IE 6 era)
http://support.microsoft.com/kb/208427
Seems like it still exists, because IE8 is the shipped browser on Windows 7.
All IE requests go through Wininet. Have a look at the Win7 SDK header files:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include>findstr /spin /c:"INTERNET_MAX" *.h
WinInet.h:85:#define INTERNET_MAX_HOST_NAME_LENGTH 256
WinInet.h:86:#define INTERNET_MAX_USER_NAME_LENGTH 128
WinInet.h:87:#define INTERNET_MAX_PASSWORD_LENGTH 128
WinInet.h:88:#define INTERNET_MAX_PORT_NUMBER_LENGTH 5 // INTERNET_PORT is unsigned short
WinInet.h:89:#define INTERNET_MAX_PORT_NUMBER_VALUE 65535 // maximum unsigned short value
WinInet.h:90:#define INTERNET_MAX_PATH_LENGTH 2048
WinInet.h:91:#define INTERNET_MAX_SCHEME_LENGTH 32 // longest protocol name length
WinInet.h:92:#define INTERNET_MAX_URL_LENGTH (INTERNET_MAX_SCHEME_LENGTH \
WinInet.h:94: + INTERNET_MAX_PATH_LENGTH)
WinInet.h:1712:#define MAX_GOPHER_HOST_NAME INTERNET_MAX_HOST_NAME_LENGTH
WinInet.h:1720: + INTERNET_MAX_PORT_NUMBER_LENGTH \
Winineti.h:1511:#define URL_LIMIT INTERNET_MAX_URL_LENGTH
So, yes, that length limitation applies.
Yes, according to Microsoft.
The length limit for IE7 and IE8 is currently 2083 characters.
If you think you are going to go over this limit, you can use a a frame with a short url and contain the page with the long url inside that frame.
According to this knowledge base article it applies to IE7 and IE8:
I have Javascript successfully executing a GET request successfully up to to 4096 characters in Internet Explorer 8. Requests longer than this will execute, but the parameters beyond that length are truncated off. I can't find that documented anywhere, but that's what I've found empirically.
精彩评论