How Long Can Same-Page Anchor Links (#) Be?
What is the maximum number of characters that a same-page anchor tag link can be on all mainstream platform browsers released from IE6 on up?
For instance, a link like:
http://example.com/#a789c4d8ecb0ec2201444bfa64b04696aa2bbaa41eb331535d1dd6d219558a02968d5af97ae74359973163337ef9b09c65dd70d40c3c79a4169355ea92db45e21fe30550dce4987987237652a347b97759f2753b412ee50d4121d0f6382580b5a62d1e02921c39c252c5e4731e38fc295ad6abcb22613513c4fd7599ab10d3f9c970b9eb3ddf5b2cf233af25005298590ce798b28092cecdc6756c8205e9a0650826e42a184267d0bfb5e3d7b3d1c25开发者_JAVA技巧e324fe6329cf7681ffae7c01c86d4a70
Note the # symbol above.
Note I'm using XHTML transitional, if that matters any.
The better question is "how long can my url be?"
Unfortunately, we must build to the weakest link, internet explorer, which limits the url to about 2000 characters.
So, the max length you can use on an anchor tag would be: length of anchor = 2000 - (size of url)
精彩评论