ใช้เว็บเบราว์เซอร์เป็น Notepad ออนไลน์

ขณะอ่านฟีด RSS ผมได้เจอบทความหนึ่งในMuyComputerซึ่งนำผมไปสู่โพสต์ของ José Jesús Pérez Aguinaga ที่เขาแสดงให้เราเห็นวิธีการใช้ รูปแบบ Data URIซึ่งเมื่อรวมกับพลังของ HTML5 และองค์ประกอบใหม่ที่เรียกว่า ' contenteditable ' จะช่วยให้เราสร้างหน้า HTML ที่สามารถใช้งานได้เหมือน Notepad

เราต้องใส่ในแถบที่อยู่:

data:text/html, <html contenteditable>

ในโพสต์ ของ José Jesús Pérez Aguinaga ยังมีตัวอย่างอื่นๆ ที่น่าสนใจปรากฏอยู่ในส่วนความคิดเห็น:

data:text/html, <textarea style="font-size: 1.5em; width: 100%; height: 100%; border: none; outline: none" autofocus />
data:text/html, <html><head><link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'><style type="text/css"> html { font-family: "Open Sans" } * { -webkit-transition: all linear 1s; }</style><script>window.onload=function(){var e=false;var t=0;setInterval(function(){if(!e){t=Math.round(Math.max(0,t-Math.max(t/3,1)))}var n=(255-t*2).toString(16);document.body.style.backgroundColor="#ff"+n+""+n},1e3);var n=null;document.onkeydown=function(){t=Math.min(128,t+2);e=true;clearTimeout(n);n=setTimeout(function(){e=false},1500)}}</script></head><body contenteditable style="font-size:2rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;">
data:text/html, <body contenteditable style="font-size:2rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;">
data:text/html, <title>Text Editor</title><body contenteditable style="font-size:2rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;">

ฉันทดสอบในFirefoxและChromiumแล้วใช้งานได้ดีเยี่ยม ฉันคิดว่ามันน่าจะใช้งานได้ในเบราว์เซอร์อื่นๆ ที่รองรับ HTML5 ด้วยเช่นกัน


เพิ่มเป็นแหล่งข้อมูลที่ต้องการใน Google