Permalink
Browse files

Fixes #3714 and #3726

  • Loading branch information...
1 parent 5901bc2 commit f70717d9fff3fa80d45269d7eb7a30f53c885fc2 @Azuo committed Mar 7, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 js/jquery.mobile.navigation.js
View
8 js/jquery.mobile.navigation.js
@@ -767,20 +767,22 @@ define( [
&& RegExp.$1
&& dataUrlRegex.test( RegExp.$1 )
&& RegExp.$1 ) {
- url = fileUrl = path.getFilePath( RegExp.$1 );
+ url = fileUrl = path.getFilePath( $( "<div>" + RegExp.$1 + "</div>" ).text() );
}
if ( base ) {
base.set( fileUrl );
}
//workaround to allow scripts to execute when included in page divs
- all.get( 0 ).innerHTML = html;
+ //IE6-8 requires a non-empty element before <script>, otherwise ignores the script
+ all.get( 0 ).innerHTML = "<div style=\"display:none;\">&nbsp;</div>" + html.split( /<\/?body[^>]*>/gmi )[1];
page = all.find( ":jqmData(role='page'), :jqmData(role='dialog')" ).first();
//if page elem couldn't be found, create one and insert the body element's contents
if( !page.length ){
- page = $( "<div data-" + $.mobile.ns + "role='page'>" + html.split( /<\/?body[^>]*>/gmi )[1] + "</div>" );
+ all.children().first().remove();
+ page = all.attr( "data-" + $.mobile.ns + "role", "page" );
}
if ( newPageTitle && !page.jqmData( "title" ) ) {

0 comments on commit f70717d

Please sign in to comment.