-
Couldn't load subscription status.
- Fork 22
js-based view-source #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
js-based view-source #106
Changes from all commits
151d660
b719325
a84bdc5
2d36a35
526e0f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| window.onload = function(){ | ||
| console.log("loaded") | ||
| window.location="#!" | ||
|
|
||
| var sourceEl = document.getElementById("view-source") | ||
| sourceEl.removeAttribute("href"); | ||
| sourceEl.onclick = function(){ | ||
| var client = new XMLHttpRequest(); | ||
| client.open('GET', 'https://hashbang.sh/'); | ||
| client.onreadystatechange = function() { | ||
| console.log(client.responseText) | ||
| var div = document.createElement("div"); | ||
| var sourceText = document.createTextNode(client.responseText) | ||
| div.appendChild(sourceText) | ||
| div.id = "source" | ||
| document.getElementsByTagName("html")[0].appendChild(div); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of |
||
| } | ||
| client.send(); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug log left over?