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

  • Home
  • SEARCH
  • 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 231399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:55:47+00:00 2026-05-11T19:55:47+00:00

I’m pretty new to javascript and programming and have run into a brick wall

  • 0

I’m pretty new to javascript and programming and have run into a brick wall with my project. I have a div which contains the javascript to embed a quicktime player, when the page is first loaded no .mov file is pointed at by the page so a placeholder div is ‘unhidden’ and the player div is set to style.display = 'none'.

So far so good, the user then enters the name of the new movie, the placeholder div is hidden and the player div is unhidden. My problem is that the javascript in the player div didn’t run when the div was made visible, if I make the script for the player into a seperate function then call it when the player div is unhidden then the player runs full screen and not in the div.

I’ve tried using jquery to add the javascript into the div after the div is made visible but can’t seem to get $("#player").load(somescript) or $("#player").html(htmlwithjavain) to add the script.

I know the player div contenst can be changed as I can use $("#player").empty(); and $("#player").html(); to manipulate it.

Thanks for reading, hope you can help

Here’s the relevant code:-

<html>
    <head>
        <title>Browse Media Player</title>


                <link rel="stylesheet" type="text/css" href="CSS/browser.css" />

        <script type="text/javascript">

        <!--

                var userinterrupt=false;
                var runonce=false;

                var currentfile;
                var basemediapath = "http://10.255.10.71/IsilonBrowse/movfiles/";

                var playerheight = 750;
                var playerwidth = 900;

                var currenttc;
                var basetime;
                var baseduration;
                var currentduration = "no tc available";
                var tcoffset = 35990;

                var playspeed = 1;
                var boolisplaying=true;
                var boolonslide=false;



                //function to fire off other methods when the DOM is loaded
                //Use in place of body onload, using jquery library
                //

            $(document).ready(function()
                {
                  //showEvents('jquery running');
                  showhideplayer(null);
                });




              //-->
             </script>


    </head>
    <body onload="forceslider(); timecode()">



      <div class="container">

           <div id="timecode_container">
                <div class="tc_overlay"></div>
                <div id="timecode" class="timecode"></div>
           </div>

           <div id="player" class="playerdiv" style="display:none;">

               **javascript for player goes here...**

           </div>

           <div id="noclipoverlay" class="playerdiv" style="display:none;">
           <p>No media loaded...
           </div>

           <div id="noclipoverlay2" class="playerdiv" style="display:none;">
           <p>loading media....
           </div>

      </div>


        <div id="loadstatus"></div>
        <div id="alerts"></div>

    </body>
</html>

Now the mainstuff.js file which should add the javascript code:-

         //function to switch the player div and mask div is no media file is
         //defined in the 'currentfile' variable
         //
         function showhideplayer(state)
         {

          if (!currentfile)
          {
                showEvents('wtf no media');
                document.getElementById("player").style.display = 'none';
                document.getElementById("noclipoverlay").style.display = 'block';
          }

          else if (currentfile)
          {

           document.getElementById("player").style.display = 'block';
           document.getElementById("noclipoverlay").style.display = 'none';
           showEvents('valid media file');

           }

           }

            //end of showhideplayer



         //function to change movie files, note SetResetPropertiesOnReload must be set to false
         //otherwise the B'stard player will default all attributes when setURL runs
         //
         function changemovie(newmovie)
         {
            oldfile = currentfile;
            if (newmovie == currentfile)
            {
              showEvents('same file requested so no action taken');
              return;
            }

            if (newmovie != currentfile)
            {
              showEvents('changing movie');
              //switch the divs around to hide the 'no media slide'
              document.getElementById("player").style.display = 'block';
              document.getElementById("noclipoverlay").style.display = 'none';
            }


            showEvents('movie changed to: '+newmovie);
            currentfile=newmovie;

            if (!oldfile)
            {
              $("#player").empty();
              showEvents('the old media file was blank');

              $("#player").load("/path/loadplayer.js");



            }

            document.movie1.Stop();
            document.movie1.SetResetPropertiesOnReload(false);
            document.movie1.SetURL(currentfile);

            //showEvents('movie changed to: '+newmovie);

            if (boolisplaying)
            {
              document.movie1.Play();
            }

         }

[EDIT] and here’s the contents of loadplayer.js:-

            var movie1 = QT_WriteOBJECT(
        currentfile, playerwidth, playerheight, "",
        "controller","false",
        "obj#id", "movie1",
        "emb#id","qt_movie1",
        "postdomevents","True",
        "emb#NAME","movie1",
            "enablejavascript","true",
        "autoplay","true",
        "scale","aspect",
        "pluginspage","http://www.apple.com/quicktime/download/"
            );
  • 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-11T19:55:47+00:00Added an answer on May 11, 2026 at 7:55 pm

    Without knowing the content of your loadplayer.js file, it will be difficult to give you a solution.

    For example, if the script attempts to do a document.write() after the page has loaded, it will create a new page, overwriting the current page. Is that what you mean when you say the quicktime movie is running full screen?

    Also it is generally not a good idea to load a SCRIPT element and insert it as HTML. When you add HTML to the page, jQuery finds all the SCRIPT elements and evaluates them in a global context, which might give you unexpected results.

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

Sidebar

Ask A Question

Stats

  • Questions 197k
  • Answers 197k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer However, I've heard ... murmurs from elsewhere in my company… May 12, 2026 at 7:27 pm
  • Editorial Team
    Editorial Team added an answer $('body').click(function(){ alert('test' )}) var foo = $.data( $('body').get(0), 'events' ).click… May 12, 2026 at 7:27 pm
  • Editorial Team
    Editorial Team added an answer No. See the Windows Installer documentation on Components... one of… May 12, 2026 at 7:27 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
In order to apply a triggered animation to all ToolTip s in my app,
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.