Skip to content
Permalink
Browse files

Demos: Fixed #3852: Add in extra directory level for href and src att…

…ributes when demos are loaded from demos/index.html.
  • Loading branch information
scottgonzalez committed Jan 18, 2009
1 parent f375f05 commit bf73f8c5bec7c097fe0cf36c000328c40423641d
Showing with 2 additions and 0 deletions.
  1. +2 −0 demos/index.html
@@ -150,6 +150,7 @@
}
function loadDemo(path) {
var directory = path.match(/([^\/]+)\/[^\/\.]+\.html$/)[1];
$.get(path, function(data) {
data = data.replace(/<script.*>.*<\/script>/ig,""); // Remove script tags
@@ -159,6 +160,7 @@
data = data.replace(/<\/?head.*>/ig,""); //Remove head tag
data = data.replace(/<\/?!doctype.*>/ig,""); //Remove doctype
data = data.replace(/<title.*>.*<\/title>/ig,""); // Remove title tags
data = data.replace(/((href|src)=["'])(?!(http|#))/ig, "$1" + directory + "/");
$('#demo-frame').empty().html(data);
$('#demo-link a').attr('href', path);

0 comments on commit bf73f8c

Please sign in to comment.
You can’t perform that action at this time.