Skip to content

Instantly share code, notes, and snippets.

@peerax
Created March 11, 2015 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peerax/d7b62e25312c69a47a3a to your computer and use it in GitHub Desktop.
Save peerax/d7b62e25312c69a47a3a to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="httpreq.js"></script>
<script>
function chkTxt(){
var str = $("#txt").val();
var b = str.replace(/[^a-z0-9_-]/gi,'');
$("#txt").val(b);
}
</script>
</head>
<body>
<input id="txt" type="text" onkeyup="chkTxt();" />
<button>Get External Content</button>
<button onClick="window.location = 'test2.html'" />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment