Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Converter</title>
- <script language="JavaScript">
- function showCode()
- {
- var inValue = document.getElementById('input').value;
- var charValue = "javascript:String.fromCharCode(";
- for(var i = 0; i < inValue.length; i++)
- {
- if(i==0)
- charValue += inValue.charCodeAt(i);
- else
- charValue += ("," + inValue.charCodeAt(i));
- }
- charValue += ");";
- document.getElementById('charcode').value = charValue;
- document.getElementById('url').value = encodeURIComponent(inValue);
- }
- </script>
- </head>
- <body>
- <form>
- <h1>String</h1>
- <p>
- <textarea id="input" cols="80" rows="3"></textarea>
- </p>
- <input type="button" value="Go" onClick="showCode()" />
- <h1>CharCode</h1>
- <p>
- <textarea id="charcode" cols="80" rows="3"></textarea>
- </p>
- <h1>URL Encodage</h1>
- <p>
- <textarea id="url" cols="80" rows="3"></textarea>
- </p>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement