WordPress.org

Forums

Adding html with javascript in a post (2 posts)

  1. asa3000
    Member
    Posted 4 years ago #

    How can I embed html with javascript in a post?

    I need to put a page like this one:

    http://perso.wanadoo.es/autoenglish/gr.posadpro.i.htm
    in my post. I want to put the script without having to use iframe.

    Thanks in advance.

  2. David Ollenberger
    Member
    Posted 4 years ago #

    Hello,

    I'll do my best to help you out. You can put your javascript in a separate file and call it in the post like this (be sure to use HTML view in the editor):

    <script src="http://www.yourdomain.com/wp-content/themes/yourtheme/myfile.js" type="text/javascript"></script>

    Alternatively, you can create a page template and include the code above or below the loop. In this case the result will always appear above or below your content but it's a much more flexible way to include javascript. For more information on creating page templates go here:

    http://codex.wordpress.org/Pages#Page_Templates

    Cheers,
    David

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags