Converting JavaScript to HTML

@amirev777 (4117)
India
February 7, 2011 10:05am CST
Hi Does anyone know of a free tool for converting a Javascript code into HTML? any widget where you paste the javascript code and it is conveted to HTML.
3 responses
@owlwings (43897)
• Cambridge, England
7 Feb 11
It depends on exactly what you want to do and why but, as a general rule, you cannot convert JavaScript to HTML - that is, make HTML which performs the same function as a JavaScript. Though JavaScript can do many things that you can also do in HTML, it has many functions which simply cannot be done in HTML (which is the main reason that it is used!)
1 person likes this
@owlwings (43897)
• Cambridge, England
7 Feb 11
If what you want to do is simply to convert the code to something which will display literally in an HTML page, then this may help. It is a PHP script which converts the characters which will not display properly (or at all) in HTML into their HTML equivalents: http://www.codingforums.com/showthread.php?t=98830
1 person likes this
@amirev777 (4117)
• India
7 Feb 11
Hi, Thank you very much for the reply. Yes, I have been given to understand from the other articles that Javascript cannot be converted to plain HTML.
@amirev777 (4117)
• India
7 Feb 11
BTW, Thank you very much once again for the link that you have posted.
@RamRes (1723)
• Argentina
25 Feb 11
They are different things, you can't convert between them. HTML is the universal languages to display webpages and is what all web servers show to our browsers. HTML is composed of the visible content of the page, the formating, all the text, links, images and so. JavaScript are small pieces of executable code built into the HTML code inside special tags for it. It's designed to produce some little visual effects, links and other animations. Generally speaking, there is no equivalent between them, however a few things can be done in both sections with the same results. So, HTML does some things, while JavaScripts takes care of others, they both are necessary to build a web page.
1 person likes this
@amirev777 (4117)
• India
25 Feb 11
Hi Thank you very much for your response. Yes I know now that these two are different things and I cannot convert javascript into HTML. Thanks!
@magtibaygom (4856)
• Philippines
7 Feb 11
I am not expert in programming and webpage design, but I do understand how these scripts work. I can edit HTML codes and place javascript to my website coming from other websites, just like with those banner codes that are in javascript. I also see javascript combined with ordinary HTML codes, particular to my website. I think, they are almost the same, but javascript is more advance than plain HTML. It is impossible to convert it to the other even if they almost similar.
@amirev777 (4117)
• India
7 Feb 11
Hi Thanks for your response. Yes thanks to you and Owlwings, i now know the basic difference between Javascript and HTML and now it is clear that you can convert a HTML code into Javascript but not vice versa.