i'm using instructure canvas—a learning management system—to code web page. can use javascript has in external file, not embedded in html.
i want have few buttons linking videos show in iframe on current page so:
<a class="iframelink" href="https://player.vimeo.com/video/90612" target="vimeobox">watch</a>
the problem learning management system changes links pop in external tab so:
<a class="external" target="_blank" href="https://player.vimeo.com/video/90612">watch</a>
is there way prevent this?
after learning management system has generated video links, run following javascript function:
function changelinks() { var links = document.getelementsbytagname('a'); (var = 0; < links.length; ++i) { var link = links[i]; if (link.classname == 'external') { link.classname = 'iframelink'; link.target = 'vimeobox'; } } } changelinks();
<a class="external" target="_blank" href="https://player.vimeo.com/video/90612">watch</a>
this script takes anchor tags on page have class="external"
, modifies them changing class , target.
Comments
Post a Comment