/    Sign up×
Community /Pin to ProfileBookmark

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”>
‘);[/CODE]

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!

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERJul 23.2011 — 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.
Copy linkTweet thisAlerts:
@QuattroauthorJul 23.2011 — 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
Copy linkTweet thisAlerts:
@OctoberWindJul 23.2011 — 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"');

[/CODE]
Copy linkTweet thisAlerts:
@JMRKERJul 23.2011 — 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.

...[/QUOTE]


Alternatively...
<i>
</i> var str = '';
str += '&lt;form action="http://www.facebook.com/ajax/connect/external_edge_comment.php?__a=1"';
str += ' target="_self" method="post"&gt;';
str += ' &lt;input type="hidden" name=""&gt;';
str += ' &lt;input type="hidden" name=""&gt;';
str += ' &lt;input type="hidden" name=""&gt;';
str += ' &lt;input type="hidden" name=""&gt;';
str += ' &lt;input type="hidden" name=""&gt;';
str += ' &lt;input type="hidden" name=""&gt;';

str += ' &lt;input type="hidden" name="node_type" value="link"&gt;';
document.write(str);
Copy linkTweet thisAlerts:
@QuattroauthorJul 24.2011 — 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!
Copy linkTweet thisAlerts:
@JMRKERJul 24.2011 — You're most welcome, I'm sure, from the both of us.

Happy to help.

Good Luck!

?
×

Success!

Help @Quattro spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...