diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index c9b6f1ac..6ed95f3c 100644 --- a/js/jquery.mobile.listview.js +++ b/js/jquery.mobile.listview.js @@ -279,6 +279,11 @@ $.widget( "mobile.listview", $.mobile.widget, { }); }, + //create a string for ID/subpage url creation + _idStringEscape: function( str ){ + return str.replace(/[^a-zA-Z0-9]/g, '-'); + }, + _createSubPages: function() { var parentList = this.element, parentPage = parentList.closest( ".ui-page" ), @@ -290,7 +295,7 @@ $.widget( "mobile.listview", $.mobile.widget, { var list = $( this ), parent = list.parent(), title = parent.contents()[ 0 ].nodeValue.split("\n")[0], - id = parentId + "&" + $.mobile.subPageUrlKey + "=" + $.mobile.idStringEscape(title + " " + i), + id = parentId + "&" + $.mobile.subPageUrlKey + "=" + self.idStringEscape(title + " " + i), theme = list.data( "theme" ) || o.theme, countTheme = list.data( "counttheme" ) || parentList.data( "counttheme" ) || o.countTheme, newPage = list.wrap( "
" )