By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,932 Members | 1,291 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,932 IT Pros & Developers. It's quick & easy.

How to write complicated codes inline?

P: n/a
I need to convert some long codes inline. I want to know the generate
rules for doing that.

1 first remove <script></script>
2 use / in front of all "s
3 remove all newline characters.

Anything else? Is inline JS sharing varibles and function names in the
html?
I need that info so I can covert many scripts at once by writing some
shell or perl scripts.

Thanks.
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
i6*****************@yahoo.com.cn wrote:
I need to convert some long codes inline. I want to know the generate
rules for doing that.

1 first remove <script></script>
And if its <script type="text/javascript"> or <script
language="javascript"> or <script language="JScript"> or <script
language="VBScript"> ??

The simple answer is a search and replace with a regular expression.
PERL can very readily handle that.
2 use / in front of all "s
I think you actually want the \ as thats the escape character. Again,
its a search/replace.
3 remove all newline characters.
search and replace.
Anything else? Is inline JS sharing varibles and function names in the
html?
No, it shares variables and functions within the scripts, not in the HTML.
I need that info so I can covert many scripts at once by writing some
shell or perl scripts.


And now you have it.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.