Last active
July 31, 2018 00:30
-
-
Save prokizzle/0ee2af5b73bae099bf4da676a64fde1c to your computer and use it in GitHub Desktop.
Adds a textarea to the top of the page that can execute javascript within the page. Useful for testing code on mobile browsers.
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
javascript:var%20codeEval%3Ddocument.createElement(%22div%22)%2CinputBox%3Ddocument.createElement(%22textarea%22%2C%7Brows%3A200%2Ccols%3A800%7D)%2CevalButton%3Ddocument.createElement(%22button%22)%2CbuttonText%3Ddocument.createTextNode(%22Eval%22)%3BevalButton.appendChild(buttonText)%2CcodeEval.appendChild(inputBox)%2CcodeEval.appendChild(evalButton)%2Cdocument.body.insertBefore(codeEval%2Cdocument.body.firstElementChild)%2CevalButton.addEventListener(%22click%22%2Cfunction()%7Beval(inputBox.value)%7D)%3B |
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
var codeEval = document.createElement('div'); | |
var inputBox = document.createElement('textarea', { rows: 200, cols: 800 }); | |
var evalButton = document.createElement('button'); | |
var buttonText = document.createTextNode('Eval'); | |
evalButton.appendChild(buttonText); | |
codeEval.appendChild(inputBox); | |
codeEval.appendChild(evalButton); | |
document.body.insertBefore(codeEval, document.body.firstElementChild); | |
evalButton.addEventListener('click', function () { eval(inputBox.value)}); |
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
var codeEval=document.createElement("div"),inputBox=document.createElement("textarea",{rows:200,cols:800}),evalButton=document.createElement("button"),buttonText=document.createTextNode("Eval");evalButton.appendChild(buttonText),codeEval.appendChild(inputBox),codeEval.appendChild(evalButton),document.body.insertBefore(codeEval,document.body.firstElementChild),evalButton.addEventListener("click",function(){eval(inputBox.value)}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment