Reply to Re: PHP function to compact javascript code?

Your name:

Reply:


Posted by Dr John Stockton on 08/18/05 00:40

JRS: In article <1124248528.581041.43440@g44g2000cwa.googlegroups.com>,
dated Tue, 16 Aug 2005 20:15:28, seen in news:comp.lang.javascript, rh
<codeHanger@yahoo.ca> posted :
>Dr John Stockton wrote:

>> Another approach would be to remove all //-to-line-end, then all /** ...
>> **/ comment, then all leading and trailing whitespace, then all blank
>> lines.
>
>[...]
>
>Curious. That approach would select the "//-to-line-end" based on what,
>e.g. in the following statement? :
>
> var test = /test////test/ is a RegExp literal followed by //
> .test("test");

You missed remembering an earlier paragraph, which read :

It would be easier if the author used a subset of javascript :
for example, no eval, no literal // in a string (use /\/
instead).

The effect of your slightly-hard-to-read statement can easily be
obtained, in a manner compatible with my suggestion, by preceding the
comment with a space, which also makes it more legible.


Please don't quote sigs.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация