-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodal.html
32 lines (31 loc) · 1.01 KB
/
modal.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<style>
body {
margin: 0;
}
</style>
</head>
<body>
<script>
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var imageUrl = getParameterByName('url');
var image = document.createElement("img");
image.id = "id";
image.className = "class";
image.src = imageUrl; // image.src = "IMAGE URL/PATH"
document.body.appendChild(image);
</script>
</body>
</html>