|
Posted by Shawn Wilson on 09/21/05 01:14
"JDS" <jeffrey@example.invalid> wrote in message
news:pan.2005.09.20.13.54.06.511030@example.invalid...
> On Tue, 20 Sep 2005 12:39:21 +0200, Hilarion wrote:
>
>>> onMouseOver="switchit('Ginny's Wedding - Jun 11 2005');"
>
> I don't know what the switchit() function is doing, exactly, but does the
> apostophe *need* to be there? Meaning, is the switchit() function ever
> producing output that may be read by a human?
>
> If not, then why not just strip out all apostrophes and double-quotes
> before they get to the JavaScript part -- the JS parser won't care if it
> says "Ginny's Wedding" or "Ginnys Wedding" -- as long as the naming is
> consistent throuhgout the page.
>
> This is the technique I usually adopt to avoid the type of problem you are
> having.
>
> For example, if the switchit() function uses the passed in string as an id
> for, say, document.getElementById(), then just make sure the id of the
> item also has the apostrophe stripped out. Just an example.
>
> How to strip out? preg_replace() or str_replace() or similar.
>
> later...
>
> --
> JDS | jeffrey@example.invalid
> | http://www.newtnotes.com
> DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
>
Yeah, switchit() is replacing text on screen with the text specified. I'm
using it to switch a caption box to the captions for each picture in an
array of thumbnails.
--
Shawn Wilson
Navigation:
[Reply to this message]
|