Forums

Javascript just not wanting to work.. (5 posts)

  1. satya87
    Member
    Posted 2 years ago #

    as Simple as this: (Trying to add this in a post)

    <div id="MediaDiv"></div>

    <script type="text/javascript" src="http://www.bwstream.com/wp-admin/js/SWFObject.js"></script>

    <script type="text/javascript">
    <!--
    var so = new SWFObject("http://drive.heartinternet.co.uk/Assets/Applets/MediaPlayer.swf","MediaPlayer","450","370","7");

    so.addParam("allowfullscreen","true");

    so.addVariable("file", encodeURIComponent('http://drive.heartinternet.co.uk/P/9948607-281475034542307?mode=view&auth=Y2FhMTU2MmRlNWZhMzlmY2U0ZDhmN2UyYmE3YjhjMTc=&ext=PlayList.xml'));
    so.addVariable("usefullscreen","true");
    so.addVariable("backcolor", '0x525252');
    so.addVariable("lightcolor", '0x82AF14');
    so.addVariable("width", 450);
    so.addVariable("height", 370);

    so.write("MediaDiv");
    //-->
    </script>

    just refuses to not show anything in my post..but on a simple HTML editor it works..can someone guide me please.

    using wordpress 2.8.6

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Are you using the Visual or HTML tab? Have you tried adding this code via a custom page template?

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

  3. songdogtech
    Member
    Posted 2 years ago #

    If you want javascript in a post, I'm had some luck with using the html editor and then carefuly removing all whitespace and returns in the script, like this below. If not, put it in a page template, as esmi recommends.

    <script type="text/javascript" src="http://www.bwstream.com/wp-admin/js/SWFObject.js"></script><script type="text/javascript">var so = new SWFObject("http://drive.heartinternet.co.uk/Assets/Applets/MediaPlayer.swf","MediaPlayer","450","370","7"); so.addParam("allowfullscreen","true"); so.addVariable("file", encodeURIComponent('http://drive.heartinternet.co.uk/P/9948607-281475034542307?mode=view&auth=Y2FhMTU2MmRlNWZhMzlmY2U0ZDhmN2UyYmE3YjhjMTc=&ext=PlayList.xml')); so.addVariable("usefullscreen","true"); so.addVariable("backcolor", '0x525252'); so.addVariable("lightcolor", '0x82AF14'); so.addVariable("width", 450); so.addVariable("height", 370); so.write("MediaDiv"); </script>
  4. satya87
    Member
    Posted 2 years ago #

    that worked all in 1 line thanks

  5. songdogtech
    Member
    Posted 2 years ago #

    Add the div and try it. Or use a flash embedding plugin: WordPress › WordPress Plugins.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags