views:

142

answers:

3

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.

+4  A: 

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?

Noon Silk
thanks Silky, but what If I want to replace it with nothing? meaning get rid of it?
MAK
In those editors, you just leave the thing to replace it with as blank. It deletes it.
Noon Silk
It's not working!!!! :(
MAK
MAK: And which editor are you using?
Noon Silk
I tried notepad and Wordpad!I can't install any programs on this machine, Any Suggestions?
MAK
Neither Notepad or Wordpad will do it.
Noon Silk
+3  A: 

You could use an online text editor with regex, paste your code in and fix up some regex to replace \r and \n with a whitespace or no spaces. I don't know regex so you'll have to do it or ask for it yourself.

Jonno_FTW
Thanks, but not what I'm looking for :(
MAK
Why not? It's a perfectly acceptable solution...
adam
+1  A: 

Changing your HTML pages to be generated by Javascript is a Very Bad Idea. You're making your entire website virtually invisible to Search Engines, users with javascript off, and those using screen readers, and for what benefit? Saving a couple of hundred bytes? Set up your webserver with gzip compression and proper cache control and leave the source as is.

nickf
Hi nickf, 1- It's not meant for this page to be found on Search engines.2- Size was never an issue.I need to do this task as I specified, because this is the best solution for my case. No point of me explaining the whole case if all what I need is what i mentioned in my question...So...Any suggestions?
MAK
I still think the point still stands that there's no excuse for hiding your content.
nickf