Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="http://www.web2generators.com/html/entities" id="html_entities_form" class="main_form" method="post">
- <label for="html_input">Text input:</label>
- <textarea name="html_input" cols="30" rows="10" id="html_input">
- </textarea><div id="html_form_buttons">
- <input name="submit" value="Encode text" id="html_encode_submit" type="submit">
- <input name="submit" value="Decode text" id="html_decode_submit" type="submit">
- <input name="reset" value="Clear" id="html_input_reset" type="reset">
- </div>
- </form>
- <script type="text/javascript">
- $(document).ready(function()
- {
- function attachEncodeDecode(sElement)
- {
- $(sElement).click(function(){
- $.post('http://www.web2generators.com/html/entities', {
- 'html_input': $('#html_input').val(),
- 'submit': $(sElement).val(),
- 'bAjax': 1
- }, function(sData){
- $("#html_output").animate({
- opacity: 0
- }, 1).animate({
- opacity: 1
- }, 500);
- $("#html_output").html(sData);
- });
- return false;
- });
- }
- // Attach to encode
- attachEncodeDecode('#html_encode_submit');
- attachEncodeDecode('#html_decode_submit');
- // Clear the field
- $('#html_input_reset').click(function(){
- $('#html_input').text('');
- });
- });
- </script>
- <h3>Output</h3>
- <div id="html_output" class="output_element">
- Input some data to be encoded or decoded. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement