forked from Crisismap/winnie
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiframePreview.html
More file actions
34 lines (33 loc) · 1.26 KB
/
iframePreview.html
File metadata and controls
34 lines (33 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<head>
<title>Preview</title>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<script type="text/javascript">
var getQueryVariable = function(variable) {
var query = window.location.search.substring(1);
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (decodeURIComponent(pair[0]) == variable) {
return decodeURIComponent(pair[1]);
}
}
};
$(document).ready(function() {
var permalink = getQueryVariable('url');
var iframeWidth = getQueryVariable('width');
var iframeHeight = getQueryVariable('height');
$('body').append('<iframe' +
' src=\"' + permalink + '\"' +
' width=\"' + iframeWidth + '\"' +
' height=\"' + iframeHeight + '\"' +
'></iframe>');
});
</script>
</head>
<body>
</body>
</html>