I wrote a basic program in Angular that uses the router functionality to present two pages as a single page application. So far, that is all it does. I have a page that contains two buttons for navigation, and a wrapper div (ng-view) that is filled with the content of the two pages when the respective button is clicked.
When I try to load the larger of the two pages, I get the following error:
SyntaxError: Unexpected token <
This error is thrown from angular.js:11594 (I am using version 1.3.9). After debugging, I found that an exception is thrown in jQuery, from the code:
this.empty().append( value );
I looked at the input parameter 'value', and it is very large. It contains more than 11,000 lines, and is 1.59 MB large.
I ran the input string in an html format checker ( http://www.freeformatter.com/ ). The format is fine and there is no extra opening tag.
Is it possible that jQuery's method cannot handle such a large string? I searched Google for such a limitation, but all I could find was suggestions for applying limitations using jQuery, and the documentation ( http://devdocs.io/jquery/append ) did not mention such a limit.
Notes:
Thanks.
First limit you will face is that if the string's over 512 bytes then the dom fragments created by it aren't cached. Next limit is the limit of .innerHTML in the browser is. But it is pretty huge (high)... But while appending lots of content you will face huge lags (It will take very long time to load propably).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.