WordPress.org

Ready to get started?Download WordPress

Forums

How to insert inline javascript? (2 posts)

  1. andrewpeacock
    Member
    Posted 9 years ago #

    Hi all,
    I'm trying to insert some javascript into my posts (the posts themselves, not the templates), and hitting problems with the code being reformatted and hence breaking.

    I know that one solution is to put all the JS into a remote script and call that. But that's kind of defeating the point of having a CMS tool to do all the file management stuff for you! And it also means I'll have loads of JS to debug if I'm looking for something specific.

    Does anyone know a way where I can turn off the formatting between the SCRIPT and /SCRIPT tags?

    Regards,
    Andy

  2. Lorelle
    Member
    Posted 9 years ago #

    First of all, don't forget that WordPress does not claim to be a CMS. It is blogging software that is slowly growing to become a CMS but it is in no way ready for CMS status.

    Okay, I have javascript in a couple of my pages, though I'm slowly removing them because they are better replaced with other things, but I have no problems with formatting between the script tags. Just don't but the script info into the post, call it from a script link.

    You can also use TextControl plugin which allows you to force which kind of formatting, or non-formatting, on a post by post or global basis.

Topic Closed

This topic has been closed to new replies.

About this Topic