Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
function my(){
$('#mod')[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
}

What I have tried:

i was nt able to do so..so see if u can help me
Posted
Updated 12-Jul-18 1:50am
Comments
Dave Kreskowiak 12-Jul-18 8:53am    
jQuery is a library written in javascript, so you are already using "pure javascript".

1 solution

Document.getElementById() - Web APIs | MDN[^]
JavaScript
document.getElementById(id).contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');

But using contentWindow assumes that you are inside an iframe...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900