Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6922235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:22:48+00:00 2026-05-27T10:22:48+00:00

I have been meaning to insert a small script into the DOM at runtime

  • 0

I have been meaning to insert a small script into the DOM at runtime in order to load a video player. but the player gets loaded in all different places except the <div> where i want it to be. i dont understand how to deal with this.
i am pasting the entire code here. please help me out.

<html>
<head><title>video test</title>
<script type="text/javascript" src="resources/js/jquery.js"></script>
<script type="text/javascript" src="swf.js"></script>
<script type="text/javascript">

$(document).ready(function(){
//  debugger;
    var template = $('<div class="sResult"><div class="figure"></div><div class="title"></div></div>');
    var url = 'http://player.ooyala.com/player.js?width=320&amp;height=240&amp;embedCode=thbXMxMzpq0RhOS82Hzx1lma8UMnFN-3&amp;callback=apicallback';
    var tempScript = document.createElement('script');
    tempScript.type = 'text/javascript';
    tempScript.src = url;

    $("#main").append(template);


    $("div.figure", $('#main')).html(tempScript);
    $("div.title", $('#main')).append("testkjdfnkjdb");

})
</script>   

</head>
<body>
    <div id="main"></div>
</body>
</html>

the append procedure for div.title is working fine. but the div in which i am trying to append the video player is not working correctly. the video player is getting appended to the <head>

EDIT: can some javascript guru please look into the player.js and tell me why isn’t it working for me?

the player <div> contains the following:

<div style="width: 320px; height: 240px; overflow: hidden;" id="ooyalaPlayer6764909_10qreejOoyalaPlayerOutterWrapper"><object width="320" height="240" type="application/x-shockwave-flash" id="ooyalaPlayer6764909_10qreej" class="OoyalaVideoPlayer" data="http://player.ooyala.com/static/cacheable/fb1a00342b9ec2d6df7c69946617dcee/player_v2.swf"><param name="allowScriptAccess" value="always"><param name="allowFullScreen" value="true"><param name="bgcolor" value="#000000"><param name="wmode" value="window">
<param name="flashvars"></object></div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:22:49+00:00Added an answer on May 27, 2026 at 10:22 am

    You can also provide the Ooyala player with a targetReplaceId=(element id) query string parameter to force it to replace an item on page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been meaning to make use of design pattern in PHP, such as
Strings are immutable, meaning, once they have been created they cannot be changed. So,
Has there been discussion around how to resolve equivalent openids? Meaning, I personally have
Have been studying the file system related classes of Adobe AIR 1.5, but so
I have been meaning to install ffmpeg as an extension to my PHP setup.
I have been trying to set-up Maven for use in our dev department but
The project I have been managing has ran into an issue of updating contents
I've recently taken the plunge into DirectX and have been messing around a little
I've done a lot of Flash development and have been meaning to try out
I have been looking for the meaning of the term SM diagram for over

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.