Brent Eades wrote:
> On 15 Oct 98, Jack Killpatrick wrote:
>
> > Also note that you will have to escape %,@ and $ in your javascript when
> > it is PRINTed to the browser (unless you want Perl to recognize the %,@
> > and $ variable designators).
>
> Thanks for an informative and helpful post, Jack.
Well, sorta. I woke up this morning, rethunk what I wrote, ran a test and
found, in fact, the % symbol *will* be PRINTed in your HTML without escaping
it. The other symbols, @ and $, OTOH, *do* need to be escaped. Hence:
> This sounds
> like it could have quite possibly accounted for the glitch I
> was experiencing. Though it seems odd that it would only appear
> in NS 3.
Is still a mystery. Sorry 'bout that.
> It's odd, but I seem to have a terrible head for syntax -- having come to
> programming late in life, perhaps I just sort of "psych myself out" as to
> how easy/hard it all is. I can grasp the *conceptual* aspects of
> Perl and
> Javascript well enough -- this function calls these variables which
> calculate x,y,z, etc -- and can reason through the logic of other
> people's
> scripts fairly well, but when it comes time to write my own I quickly get
> lost in a sea of escapes, brackets and quote-marks.
If you look at most Perl books that have sample code, you'll probably see a
readable "style", much more so than I've seen in a lot of random scripts
that I've pulled down from the web. You could also look at modules that may
already be on your server. I've found that many modules tend to be fairly
well organized, notated, indented, etc. Take a look at the "easier to read"
styles and apply the same formatting techniques to what you are working on
(if they are not applied already). *Then* start working.
Working with a poorly formatted script is just like dealing with FrontPage
code that someone dumps on you. When that happens to me, I almost always
take the time to "stylize" the code to the format I'm used to working in
(indents, notes, etc), which makes it easier for me to read...*then* I can
start working with it. Less confusing.
Jack
____________________________________________________________________
--------------------------------------------------------------------
Join The Web Consultants Association : Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------