Support » Fixing WordPress » Need help inserting Javascript for an Aweber form into a post

  • I want to write an explanatory post about the free ebook I’m offering subscribers to my blog

    I have created a form on Aweber and followed the instructions for inserting the code into the text editor of my blog post but it keeps disappearing.

    From trawling the forum posts, it seems that the problem could be related to Javascript according to this page:

    JavaScript in Posts
    To use JavaScript inside of posts in WordPress, you need to take a few more steps. Odds are that this usage is for one or only a few instances, so adding the script to the header would be unnecessary.

    For the occasional or one time use of JavaScript, you need to put the script into a JavaScript file and then call it out from within the post. Make sure that each script is defined by its function name such as:

    function updatepage(){var m=”Page updated “+document.lastMo…….}
    To include a Javascript inside a post, you need to combine both the call to the script file with the call to the Javascript itself.

    <script type=”text/javascript” src=”/scripts/updatepage.js”></script>
    <script type=”text/javascript”>
    If the src attribute of your JavaScript tag is being stripped out you need to turn off the rich editor (from the dashboard go to Users > Personal Options). If you are using the rich editor the JavaScript tag’s src attribute may be stripped out even when manually editing in the HTML popup window.

    I have tried my best to make sense of this and to insert all manner of combinations of code but I have no idea what I’m doing with either HTML or Javascript.

    I am able to add the Aweber form using the code they gave me
    <script type=”text/javascript” src=””></script>
    to create sidebar widgets but I still want to be able to add the form to at least one post and possibly a page at some stage.

    Can anyone explain, in very simple terms, what I should do?

Viewing 4 replies - 1 through 4 (of 4 total)
  • You may want to consider just making another page template and another header template and tie them together. Reserve these template for anytime you want to embed an aweber form assuming the javascript is always the same.

    You may be able to just do another page template and put the javascript inside the PHP template itself. This will save a lot of frustration dealing with WordPress’ editor.

    Thanks, Tier3 but I don’t know how to make page or header templates either!

    I don’t know what PHP is or how to tinker with it.

    Can anyone help me with this? For now, I’d just be happy to get the form onto one blog post so if someone can tell me exactly what code to put where, I’d be extremely grateful.

    The link below has everything you need to create a page template

    Thanks for that. I’ve ended up using Magic Box as a work-around but when I have more time, I’ll have a go at making sense of page templates.

    I appreciate your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Need help inserting Javascript for an Aweber form into a post’ is closed to new replies.