1

I have a popup which will gets called when a button clicked and it contains the video from external link.

<object style="width: 696px; height: 360px;;display:block;" 
                id="educational-info-video-widget"
                name="educational-info-video-widget" data="https_URL" type="application/x-shockwave-flash">
                <param name="movie" value="https_URL">
                <param name="flashvars" value="&amp;autoPlay=false">
                <param name="wmode" value="transparent">
                <param name="allowFullScreen" value="true">
                <param name="allowNetworking" value="all">
                <param name="allowScriptAccess" value="always">
                <param name="bgcolor" value="#000000">
            </object>

what i am trying to do is attaching play and pause events to it, to do so i saw that it needs to implemented in load event from this link.

How to add event listeners to objects in a svg?

I wrote this in my .js file

constructor() {
   this.handleBodyClick = function() {
            alert()
        };
}

 attached() {
        document.getElementById("educational-info-video-widget").addEventListener("load", this.handleBodyClick);
    }

but load event is not being fired. i don't know what i am doing wrong.

Any help is greatly appreciated.

Community
  • 1
  • 1
Vallabha
  • 1,591
  • 3
  • 13
  • 21
  • Are you sure your content is not cached in browser? Then your load event may have fired before you attached your handler. Try to set again the `data`attribute after you've attached the event. – Kaiido Aug 07 '16 at 15:14

1 Answers1

0

The load event is only supported with the following tags.

  • <body>
  • <frame>
  • <frameset>
  • <iframe>
  • <img>
  • <input type="image">
  • <link>
  • <script>
  • <style>
Jonathan Lam
  • 16,831
  • 17
  • 68
  • 94