Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ http://mattkersley.com/responsive?google.com
- Navigate to the new subdirectory via a browser

Once you've uploaded, you can navigate your website from within the iframes, and the others will update.
This won't work for external sites however due to browser security restrictions.
This won't work for external sites however due to browser security restrictions.

## https:// and file:// URL Support added
- jayf added support for https:// and file:// URLs (9/17/2011)
14 changes: 9 additions & 5 deletions responsive.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var defaultURL = 'mattkersley.com'; //<---- CHANGE TO YOUR WEBSITE URL
//var defaultURL = 'mattkersley.com'; //<---- CHANGE TO YOUR WEBSITE URL

//show loading graphic
function showLoader(id) {
Expand All @@ -21,7 +21,10 @@ function allLoaded(){
};

function loadPage($frame, url) {
if(url.substr(0,7) != 'http://'){
if( url.indexOf('http://') != 0 &&
url.indexOf('https://') != 0 &&
url.indexOf('file://') != 0 &&
url.indexOf('..') !=0) {
url = 'http://'+url;
}
$('iframe').not($frame).each(function(){showLoader($(this).parent().attr('id'));})
Expand All @@ -35,9 +38,10 @@ $('.frame').each(function(){showLoader($(this).attr('id'))});
//when document loads
$(document).ready(function(){

loadPage('', defaultURL);

//query string
loadPage('', defaultURL);
$('#url input[type=text]').val(defaultURL);

//query string
var qsArray = window.location.href.split('?');
var qs = qsArray[qsArray.length-1];

Expand Down