Every line of 'bootstrap modal load external page' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
206 function initExternalJqmPagesOnLoad($rootScope, $compile, jqmNgWidget, $browser) { 207 jqmNgWidget.patchJq('page', function() { 208 if (!jqmNgWidget.preventJqmWidgetCreation() && !this.data($.mobile.page.prototype.widgetFullName)) { 209 if (this.attr("data-" + $.mobile.ns + "external-page")) { 210 correctRelativeLinks(this); 211 $compile(this)($rootScope); 212 } 213 } 214 return $.fn.orig.page.apply(this, arguments); 215 }); 216 217 function correctRelativeLinks(page) { 218 // correct the relative links in this page relative 219 // to the page url. 220 // For external links, jqm already does this when 221 // the page is loaded. However, normal links 222 // are adjusted in jqm via their default jqm click handler. 223 // As we use our own default click handler (see ngmRouting.js), 224 // we need to adjust normal links ourselves. 225 var pageUrl = page.jqmData("url"), 226 pagePath = $.mobile.path.get(pageUrl), 227 ABSOULTE_URL_RE = /^(\w+:|#|\/)/, 228 EMPTY_RE = /^(\#|#|\/)/; 229 230 page.find("a").each(function() { 231 var $this = $(this), 232 thisUrl = $this.attr("href"); 233 if (thisUrl && thisUrl.length > 0 && !ABSOULTE_URL_RE.test(thisUrl)) { 234 $this.attr("href", pagePath + thisUrl); 235 } 236 }); 237 } 238 }
74 function load_page(pageUrl) { 75 $(".layui-body").load(pageUrl); 76 }