• Hello,
    I have searched but most topics only have 1 post no replies.

    I want to load some JS into a post. The JS comes from Google AJAX API and loads news headlines from where ever you choose (lots of other things to choose from follow the link to see).

    I found this plugin for including JS in a post.

    So if I followed the directions (simple ones), when the post is saved WP inserts </br> after almost everything in the JS when viewing source.

    I do and always have the rich text editor turned off in my profile I’ll add here.

    So I figured I would see if I could load it in to a sidebar text widget. I did not take the code out of my test post and added the same code to my text widget (with out the [inline] code needed for the plugin). When I save it (the text widget)and load the test everything now shows up in the post but not in the side bar.

    The text widget code gets added to the page with out the WP formating and my div code to display the info in the post shows what I want in the post.

    Not a big problem I guess, the text widget, I have left with no title so nothing shows up in it and just loads the JS code correctly for the post to display it.

    Any idea how to get this to load the JS from the post with out the added WP insertions? I could load it in the header but only want the extra code in the one post displayed.

    Hope I make sense and have included enough info.

    This will be the first time I share my site link with anyone other then friends. Be kind please!!
    My site.

    Thanks and take care!

The topic ‘Javascript in posts…works but…’ is closed to new replies.