Last active
August 29, 2015 14:23
-
-
Save autos/e9e2aa33b96e0cb2e7b4 to your computer and use it in GitHub Desktop.
images.weserv.nl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>input</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.min.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script> | |
function myFunction() { | |
var input = document.getElementById('input').value; | |
var output=""; | |
//if( input.search("https") > 0) | |
if( input.match(/https/gi).length > 0 ) | |
output = input.replace("https://",""); | |
else | |
output = input.replace("http://",""); | |
//alert(output); | |
var res = "https://images.weserv.nl/?url="+output+""; | |
//alert(res); | |
var win = window.open(res, '_blank'); | |
win.focus(); | |
} | |
</script> | |
</head> | |
<body> | |
<center> | |
<br /> | |
<br /> | |
<br /> | |
<h2>Paste</h2> | |
<br /> | |
<br /> | |
<br /> | |
<br /> | |
<br /> | |
<input type="text" value=".jpg" class="form-control input-s" id="input" style = "width:300px;" /> | |
<button class="btn btn-primary" onclick="myFunction()">Click</button> | |
</center> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment