www.webdeveloper.com
Results 1 to 7 of 7

Thread: How to execute HMML in JavaScript

  1. #1
    Join Date
    Mar 2010
    Posts
    50

    How to execute HMML in JavaScript

    I am trying to hide all my HTML in JavaScript so I can encrypt it with jscrambler.

    I used document.write like this:

    Code:
    document.write('<form action="http://www.facebook.com/ajax/connect/external_edge_comment.php?__a=1" target="_self" method="post">
        <input type="hidden" name="">
        <input type="hidden" name="">
        <input type="hidden" name="">
        <input type="hidden" name="">
        <input type="hidden" name="">
        <input type="hidden" name="">
    
        <input type="hidden" name="node_type" value="link">
    ');

    But in Dreamweaver it shows errors. It will still display fine when I preview from localhost, so it isn't too much of a problem, but when I upload it to jscrambler to encrypt the file it will not work because it has syntax errors.

    Any way to fix this? Thanks!
    Last edited by Quattro; 07-22-2011 at 10:11 PM.

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,373
    I don't know what you are trying to do
    but the syntax errors are probably from the missing '>' character
    at the end of the <input... tags.

  3. #3
    Join Date
    Mar 2010
    Posts
    50
    Oh sorry, those are included I just took them out when I deleted the other info so I could post it here. Like I said it works when I preview on local machine, just I cannot use jscrambler until I get the syntax errors fixed.

    Thanks

  4. #4
    Join Date
    Jul 2007
    Location
    Wisconsin
    Posts
    468
    what is the syntax error that it's giving? anything? I'm curious of the document.write() is tripping up over the un-concatenated multi-line.

    You might have to break it out into something like this:
    Code:
    document.write('<form action="http://www.facebook.com/ajax/connect/external_edge_comment.php?__a=1" target="_self" method="post">');
    document.write('<input type="hidden" name="">');
    document.write('<input type="hidden" name="">');
    document.write('<input type="hidden" name="">');
    document.write('<input type="hidden" name="">');
    document.write('<input type="hidden" name="">');
    document.write('<input type="hidden" name="">');
    document.write('<input type="hidden" name="node_type" value="link"');

  5. #5
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,373

    Lightbulb

    Quote Originally Posted by OctoberWind View Post
    what is the syntax error that it's giving? anything? I'm curious of the document.write() is tripping up over the un-concatenated multi-line.

    ...
    Alternatively...
    Code:
      var str = '';
      str += '<form action="http://www.facebook.com/ajax/connect/external_edge_comment.php?__a=1"';
      str += ' target="_self" method="post">';
      str += ' <input type="hidden" name="">';
      str += ' <input type="hidden" name="">';
      str += ' <input type="hidden" name="">';
      str += ' <input type="hidden" name="">';
      str += ' <input type="hidden" name="">';
      str += ' <input type="hidden" name="">';
    
      str += ' <input type="hidden" name="node_type" value="link">';
      document.write(str);

  6. #6
    Join Date
    Mar 2010
    Posts
    50
    Thank you both very much, both codes worked great! If there is any graphic design you would need or some way I could pay you back please let me know.

    Thanks again for the help!

  7. #7
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,373
    You're most welcome, I'm sure, from the both of us.
    Happy to help.
    Good Luck!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles