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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:18:27+00:00 2026-06-08T09:18:27+00:00

I’m using jQuery for/with javascript in order to try to modify the inner HTML

  • 0

I’m using jQuery for/with javascript in order to try to modify the inner HTML code of a div in the .htm file. I’m using jQuery DOM ready event as recommended here (http://stackoverflow.com/questions/9856140/javascript-uncaught-typeerror-cannot-call-method-addeventlistener-of-null) in order to avoid the script to be run before the div is ready, but that doesn’t matter; I keep getting that error.

I must say it’s just a few days since I’m into Javascript and it is a very long time since I last used HTML so please don’t discard any noob-typical errors because most likely it may be that.

Here are the files I’m using, hosted in Skydrive:

AMPlayer.htm

playlister.js

As it can be guessed, I’m using videoJS as video player. The CSS and JS files of videojs can be referenced either online (http://videojs.com/#section5) or offline, as can be seen in AMPlayer.htm, but this is just circumstancial information since it looks more like a problem with javascript rather than a problem with videojs.

EDIT: What I think is the important part of the files:

AMPlayer.htm (I think the problem is here, so I’m pasting the whole file):

<!DOCTYPE html>
<html>

<head>
    <link href="video-js.css" rel="stylesheet" type="text/css">
    <script src="video-js.js"></script>
    <script src="jquery-1.7.2.min.js"></script>
    <script src="playlister.js" type="text/javascript"></script>
    <title>AMPlayer</title>
</head>

<body>
    <div id="the-video" class="video-js-box">
            <span>&nbsp;</span>
        </div>
</body>

</html>

playlister.js:

function postVideo()
{

    getNextVideo();
    document.write("NEXT VIDEO: "+videoNames[iNewVideoId]+"<br>");
    var video1 = '<video id="AMPlayer" class="video-js vjs-default-skin" preload="auto" width="650" height="365" data-setup="{}" autoplay> <source src="videos/AVANCE/vid.mp4" type="video/mp4" /><source src="videos/AVANCE/vid.webm" type="video/webm" /></video>';

    //document.write(video1); This writes the text so the video is played, but it drives me to an undesired behaviour
    document.write("BEFORE THE .SETUP<br>");
    //$("#the-video").html(video1); This doesn't work
    //document.getElementById("the-video").innerHTML=video1; This does neither work
    //window.VideoJS.setup($'video1'));
    document.write("AFTER THE .SETUP<br>");
    document.getElementById("AMPlayer").addEventListener('ended', postVideo, true);
    //$(".video-js")[0].player.play();
    document.write("AFTER THE .PLAY<br>");
    //postVideo();
}

Any provided help will be very useful for sure. Thanks in advance.

  • 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-08T09:18:29+00:00Added an answer on June 8, 2026 at 9:18 am

    You are trying to get the element with the id AMPlayer, but you don’t have one.

    You have a string containing the HTML to create one, but it hasn’t been added to the DOM.

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

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.