You are here: Re: <? print .. DIV> + InnerHTML question, thank you « All PHP « IT news, forums, messages
Re: <? print .. DIV> + InnerHTML question, thank you

Posted by Rik on 08/25/07 19:32

On Sat, 25 Aug 2007 20:24:41 +0200, <encepif@gmail.com> wrote:

> Hopefully someone can give me definitive answer:
>
> What steps can I take to do this process, so no breakdowns in
> presentation occurs when I use,
>
> <script>
> document.getElementById("somewhere").innerHTML =3D '<?print
> $someblog[0];?>'


'<?php print..' you mean?

> </script>
>
> <div id=3Dsomewhere></div>
>
> So, someblog[0] might have weird characters, un-escaped whatevers,
> that clog of the div presentation. I am not sure what to catch or
> what converters to use. What are basic considerations & science do I
> need to apply to the string prior to presentation in the div? :-)

(If no html is allowed, either htmlspecialchars or striptags.)

Replace linebreaks with literal '\n'. Escape quotes. And finally: make =

sure it's in the right character set.
-- =

Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация