Browse files

Fix for the mysterious "page is too large" error Todd and Scott were …

…seeing on Blackberry 5 prior to shipping jQM beta 1.

Turns out this little code was enough to invoke the error:

"/dir1/dir2".replace(/\/?/, "");

Rewrote the regexp in path.makePathAbsolute() that was stripping leading slash, and trailing filename/slash. This gets around the problem.

Special thanks to @adambiggs for helping me test 33 iterations when trying to narrow down what in jquery.mobile.navigation.js was choking BB5.
1 parent 9729dc9 commit aff87cc9f171cd12fb4b40f061cea12fc4cce45a @jblas jblas committed Jun 27, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 js/jquery.mobile.navigation.js
View
2 js/jquery.mobile.navigation.js
@@ -88,7 +88,7 @@
}
relPath = relPath || "";
- absPath = absPath ? absPath.replace( /^\/|\/?[^\/]*$/g, "" ) : "";
+ absPath = absPath ? absPath.replace( /^\/|(\/[^\/]*|[^\/]+)$/g, "" ) : "";
var absStack = absPath ? absPath.split( "/" ) : [],
relStack = relPath.split( "/" );

0 comments on commit aff87cc

Please sign in to comment.