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 https://juliedawnfox.com.
I have created a form on Aweber and followed the instructions for inserting the code into the text editor of my WP.org 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: https://codex.www.ads-software.com/Using_Javascript
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”>
<!–
updatepage();
//–></script>
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=”https://forms.aweber.com/form/01/1675450401.js”></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?
- The topic ‘Need help inserting Javascript for an Aweber form into a post’ is closed to new replies.