Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[How-to] Edit Websites [JavaScript]
#1
This is very simple javascript, which allows you to edit websites. NO, it won't be edited, only you can see it. After refresh everything's back to normal.

Here's the code:

Code:
javascript: document.body.contentEditable = 'true'; document.designMode = 'on'; void 0

Just paste it in the website you want to edit in the URL.

Enjoy. Oui
Reply
#2
There are way better ways to use this function, one is a rich text editing...
Here is a small rich text editor I wrote in 5mins.... You can take a look at it...

Code:
<html>
    <head>
        <title>RichText using contentEditable</title>
        
        <style type="text/css">
            #richTextBox {
                width:500px;
                height:200px;
                overflow:scroll;
                border:1px solid black;
                padding:5px;
            }
        </style>
        <script language="javascript" type="text/javascript">
            function rtbFormat(command, value) {
                document.getElementById("richTextBox").focus();
                document.execCommand(command, false, value);
            }
        </script>
    </head>
    
    <body>
        <input type="button" name="boldText" onclick="rtbFormat('Bold', '');" value="Bold" />
        <input type="button" name="fontName" onclick="rtbFormat('FontName', 'Georgia');" value="Font: Georgia" />
        <input type="button" name="fontSize" onclick="rtbFormat('FontSize', 22);" value="Font: 22" />
        <input type="button" name="textAlign" onclick="rtbFormat('JustifyCenter', '');" value="Center Text" />
        <div id="richTextBox" contenteditable></div>
    </body>
</html>

And here a little preview:
[Image: QCJOY.png]

It's just that the use of the function you're showing is simply pointless and not needed.
Reply
#3
Java and Javascript are two different things. Dont confuse the two.
My SMF Modifications:
http://anthony.vibrantvps.com/smf
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need html/javascript help TalishHF 2 375 02-20-2012, 06:17 AM
Last Post: Crystal
  Your usernames [Other Websites] Laughynose 12 1,131 06-05-2011, 05:47 AM
Last Post: BlackChaos
  Motivation When Creating Websites groovybluedog 8 942 02-22-2011, 07:13 PM
Last Post: AceInfinity
  edit randomusername1234 7 504 02-03-2011, 12:16 PM
Last Post: randomusername1234
  unblocker websites? haphazard 3 1,474 01-25-2011, 03:28 PM
Last Post: Resistance

Forum Jump:


Users browsing this thread: 1 Guest(s)