Created
January 19, 2016 03:24
-
-
Save ZacharyJacobCollins/b476f461d0c753c8c1ee to your computer and use it in GitHub Desktop.
Get text as text file from url - js - anchor method
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>text getter</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
</head> | |
<body> | |
<h3>click the button to get text file in both json and text format</h3> | |
<p>url : http://it.emich.edu/bannerfiles/sctnenrl_wi.txt</p> | |
<a onclick="http://it.emich.edu/bannerfiles/sctnenrl_wi.txt='data:text;charset=utf-8,'+encodeuricomponent(document.documentelement.outerhtml)" href="http://it.emich.edu/bannerfiles/sctnenrl_wi.txt" download="page.txt">download</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment