How to write complicated codes inline?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • i6033162556-signup1@yahoo.com.cn

    How to write complicated codes inline?

    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.
  • Randy Webb

    #2
    Re: How to write complicated codes inline?

    i6033162556-signup1@yahoo.c om.cn wrote:[color=blue]
    > I need to convert some long codes inline. I want to know the generate
    > rules for doing that.
    >
    > 1 first remove <script></script>[/color]

    And if its <script type="text/javascript"> or <script
    language="javas cript"> or <script language="JScri pt"> or <script
    language="VBScr ipt"> ??

    The simple answer is a search and replace with a regular expression.
    PERL can very readily handle that.
    [color=blue]
    > 2 use / in front of all "s[/color]

    I think you actually want the \ as thats the escape character. Again,
    its a search/replace.
    [color=blue]
    > 3 remove all newline characters.[/color]

    search and replace.
    [color=blue]
    > Anything else? Is inline JS sharing varibles and function names in the
    > html?[/color]

    No, it shares variables and functions within the scripts, not in the HTML.
    [color=blue]
    > I need that info so I can covert many scripts at once by writing some
    > shell or perl scripts.[/color]

    And now you have it.

    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    Working...