html - Javascript acessing script on other page -


i have question acessing javascript on other page. have 2 frames, 1 auto-reloading , other 1 playing video.

the codes below:

videoshow.html

 <html>       <head>        <script type="text/javascript">           window.onload = setuprefresh;            function setuprefresh() {               setinterval("refreshframe();", 1000);           }           function refreshframe() {              parent.right_frame.location.reload();           }       </script>       </head>       <frameset id="cntfrm" cols="*,100">         <frame name="left_frame" src="videoplayer.html" frameborder="0" />         <frame  name="right_frame" src="refresh.html" />       </frameset>     </html> 

videoplayer.html

<html> <head> <script type="text/javascript" src="java.js"></script>    </head>  <body bgcolor="#00000">  <div align="center"> <video id="myvideo" width="*" height="*" autoplay> <!-- controls ->se quiserem com cenas aparecer -->   <source src="movie.mp4" type="video/mp4">   <object   data="movie.mp4" width="*" height="*">   </object>   </video>  </div>  <div align="center"> <font color="white" id="fastforward" size="4"></font> <br> <button type="button" onclick="vid_play_pause()">play/pause</button> </div> </body> </html> 

refresh.html

<html>  <body bgcolor="#00000"> <button  onclick="javascript:parent.left_frame.vid_play_pause">play/pause</button> </body> </html> 

i want click play/pause on refresh.html , stop video @ videoplayer.html possible? don't worry javascript because works on videoplayer.html, need know how call function on refresh.

try on refresh.html

<script type="text/javascript">  function playpause(){ window.parent.parentplaypause(); } </script> 

then on videoshow.html

<script type="text/javascript">  function parentplaypause(){ document.getelementbyid('left_frame').contentwindow.vid_play_pause(); } </script> 

Comments