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 8673509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:28:36+00:00 2026-06-12T19:28:36+00:00

I have some JS from an external JS file that I want to insert

  • 0

I have some JS from an external JS file that I want to insert inside of a JS function in the HTML file. I can not touch the JS script in the HTML file, so I am wondering if this method can be done.

Here is the JS I want to insert inside of the JS function in the HTML file.

// FIRST JS TO INSERT
if (OS == "mobile"){
        killVideoPlayer();
    }

// SECOND JS TO INSERT
if (OS == "mobile"){ 
        loadHtmlFiveVideo();
        if (!document.all){
            flvPlayerLoaded = false;
        }
    }else {
        loadVideoPlayer();
    }

Then I want to insert it into here.

<script>
function mediaTypeCheck() {
if (bsiCompleteArray[arrayIndex].mediaType == "video") {
// INSERT FIRST JS HERE
    document.getElementById("bsi-video-wrap").style.display = "block";
    document.getElementById('pngBsi').style.display = "block";
    document.getElementById("frame_photo").style.display = "none";
    document.getElementById("relativeFrame").style.display = "block";
    document.getElementById("buy-me-photo-button-bsi").style.display = "none";
// INSTER SECOND JS HERE    
    loadVideoPlayer();
} 
if (bsiCompleteArray[arrayIndex].mediaType == "photo") {
    killVideoPlayer();
    document.getElementById("bsi-video-wrap").style.display = "none";
    document.getElementById('pngBsi').style.display = "block";
    document.getElementById("relativeFrame").style.display = "block";
    document.getElementById("frame_photo").style.display = "block";
    document.getElementById("buy-me-photo-button-bsi").style.display = "block";
    if (!document.all){
        flvPlayerLoaded = false;
    }   
}   
}
</script>

Thank you!

  • 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-06-12T19:28:38+00:00Added an answer on June 12, 2026 at 7:28 pm

    In JavaScript, you can overwrite variables with new values at any time, including functions.

    By the looks of it, you could replace the mediaTypeCheck function with one of your own that does what you need and then calls the original function.

    E.g.

    (function(){
      // keep track of the original mediaTypeCheck 
      var old_function = mediaTypeCheck;
      // overwrite mediaTypeCheck with your wrapper function
      mediaTypeCheck = function() {
        if ( conditions ) {
          // do whatever you need to, then ...
        }
        return old_function();
      };
    })();
    

    The above can be loaded from any script, so long as it happens after the mediaTypeCheck function is defined.

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

Sidebar

Related Questions

I have a swing application that uses some datas coming from an external mysql
HI, I have some string from XML file, and I I want to replace
I have some html returned from an ajax call that contains blocks of html.
I have a php file which pulls some data from external API's, and I
I have some external Javascript files in my GWT app that I only want
We have an external .js file that we want to include in a number
I have an external JAR signpost-core-1.2.1.1.jar (from http://code.google.com/p/oauth-signpost/ ), that I want to include
I have some data from a external party which is encrypted according to them
I have to download some data from external source but I have to submit
I have some data from JQGrid that should be exported to excel. So, we

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.