> -----Original Message-----
> From: Michael A. Peters [mailto:mpet...@mac.com]
> Sent: Monday, March 02, 2009 4:42 PM
> To: Boyd, Todd M.
> Cc: PHP General list
> Subject: Re: [PHP] Javascript question
> 
> Boyd, Todd M. wrote:
> > Before some of you newbies feel like being heroes and jump all over
> me:
> >
> > I KNOW THIS IS A PHP-RELATED LIST. IF YOU DON'T LIKE MY QUESTION,
> DON'T
> > ANSWER IT.
> >
> > Now that that's out of the way... I have a Javascript question (and
> > maybe a Browser/DOM question) for you folks. I'm not sure this is
> > anything they teach you in any online/in-seat/self-taught Javascript
> > course that I've ever seen before, so I figured I would bring it
> here.
> >
> > My boss asked me if I knew of a tool that would change the
<!DOCTYPE>
> of
> > a page on-the-fly to test validation in different schemes (i.e.,
> XHTML
> > Strict, Transitional, Loose, etc.).
> 
> The validators generally don't trigger javascript.
> 
> I use DOMDocument to create a valid xhtml page and then before sending
> it to the browser - if the browser does not report accepting valid
> xhtml
> (or I specify I want html) it filters the page to valid html 4.01.
> 
> That's probably what you want to do - code for valid xhtml and filter
> the output to other DTD's you want to make available server side
rather
> than trying to use JS to alter the DOCTYPE.
> 
> Remember, the proper header to send also relies on the DOCTYPE so if
> you
> sent a header for xhtml but send html (or vice versa) you are still
> breaking the standard regardless of how pristine your output is.
> 
> Another advantage to building the document ahead of time and doing any
> translations server side is you can also filter the output for XSS in
> case you missed validating some input.

I think you guys are missing the point--this is not for proprietary use
on our own server with our own pages. I wanted to write a bookmarklet
that would work for any page, on any server. I'm beginning to think
that's not necessarily possible (using just JS and the browser).

Thanks for all of your suggestions, anyway. :)


// Todd

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to