LaVOZs

The World’s Largest Online Community for Developers

'; javascript - What can be done to focus the .mht file to open in iframe? What am I doing wrong? - LavOzs.Com

I'm trying to use the below code but it is not working.

$('li.link').click(open() { 
    var value = $(this).attr('id');
    $container.cycle(id.replace('pager_', '')); 
    window.open(value + ".mht", 'myFrame');
    return false; 
});
<iframe allowtransparency="true" frameBorder="2" src="https://www.example.com" name="myFrame"> </iframe>

<li onclick="open()" id="xyz" class="link">xyz</li>
<li onclick="open()" id="abc" class="link">abc</li>
<li onclick="open()" id="mac" class="link">macro sed</li>
<li onclick="open()" id="asf he" class="link">asf he</li>

I found a simple solution using a href sorry to bother you guys..

<ol class="side">

  <li> <a href="http://example.com/" target="myFrame">example.com</a></li>
  <li> <a href="https://w3schools.com/" target="myFrame">w3schools.com</a></li>
  <li> <a href="http://test.com/" target="myFrame">test.com</a></li>

</ol>

<center><iframe allowtransparency="true" id="myiframe" frameBorder="5" src="http://example.com" scrolling="yes" name="myFrame"> </iframe>
</center>