
MovableType is Killing My ScriptsWhen I include some JavaScript code into one my blog entries, even with Text Formatting turned off, MovableType is still add Setting the Text Formatting option to Convert Line Breaks is the default setting for MovableType and, most likely, all other blog software also. It allows the author to ignore the needed HTML code to separate paragraphs. As you have discovered, sometimes you don't want the blogging software to automatically add the HTML code. It would seem that setting the Text Formatting option to None would do the trick, but it isn't quite that easy. Whether it is a bug or a feature, MovableType will look at the contents of your entry, especially any HTML tags and use that as the deciding factor as to whether or not to convert line breaks. MovableType will stop converting line breaks when it encounters any of the following HTML tags:
This means you could wrap your JavaScript code inside of a <div> or <center> element, but you must be careful. If you have one blank line, MovableType will start converting line breaks again. Also, be sure you put all of the JavaScript code inside of element, including the JavaScript header, as shown below:
<center>
<script language="javascript" type="text/javascript"> <!-- function myFunction() { myCode } // --> </script> </center>
Category is Internet/Web Services
(Article #100)
Comments
This site is incredible!
This site is incredible! It's amazing the questions you get asked and you always come up
with the answer. I've just got to help you stay cool by buying you a
Snoball!
I do have a comment, now that you mention it!
|
|