Search code examples
htmlcsslinejavascriptminimization

How Can I minimize the HTML code by making it one line of code?


So I have made a web page of HTML, Inline CSS and JS. Since this page will be produced through JS function

 opened.document.write();

I would like to put all the web page code into one line that can be taken in one of the previously mention function instead of repeating the same function for every new line. I can't affors doing this manually,because the page contains too many lines of code.

Is there a fast and clean way to do this?

Notice: I used SOME PROGRAM to replace all " with \" by one click, so I hope there is away to replace all the(Enter)s with (Backspace) or something like that.


Elaboration

I want to produce the whole page when the user click on a button which will call a JS function which will produce a new page and write it using the previously mentioned function.


Solution

  • Hmm, well the answer is "Yes", but it's slightly disturbing what you are doing.

    I don't know if you can replace special characters in Word, but in most text editors (Textpad, Notepad++) you can replace via a 'regex' so you can write "\r\n" to replace all instances of newlines with whatever you wish.

    I must say, though, that I wonder why you wish to write out the document like that. Can you elaborate?