The main problem when writing a javascript inside a blogger post is that the editor interprets < and > as portions of html tags, even if they are inside the <script> tag. The solution presented as an example here is to create two string variables called lt and gt and use them instead. On the other hand, to write the code only once, it is put inside a string variable and then evaluated. To display it properly the two conflicting characters should be transformed again using a function that replaces their occurrences. You may also be aware that the code should be on a single line, because a new line creates html markup inside the script.
2009-11-25
Abonați-vă la:
Postare comentarii (Atom)




Niciun comentariu:
Trimiteți un comentariu