open new sized window for wav file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dottiel
    New Member
    • Apr 2012
    • 2

    open new sized window for wav file

    I need to open a wav file in a new small sized window while keeping the current page open. However, currently the javascript I pasted in is opening a new page AND a popup small page and playing the wav file in both simultaneously.

    This is the javascript in the head section:
    Code:
    <SCRIPT TYPE="text/javascript">
    function popup(mylink, windowname)
    {
    if (! window.focus)return true;
    var href;
    if (typeof(mylink) == 'string')
       href=mylink;
    else
       href=mylink.href;
    window.open(href, windowname, 'width=400,height=100,scrollbars=yes');
    return false;
    }
    
    </SCRIPT>
    
    And this is the link:
    
    <p id="u363-9"><a class="nonblock" href="/audio/2012-04-01.wav" target="_blank" onClick="return popup(this, 'notes')">April 1, 2012</a></p>
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    i would suggest to adapt the link to this:

    Code:
    <a class="nonblock" href="#" 
        onclick="return popup('/audio/2012-04-01.wav', 
        'notes')">April 1, 2012</a>
    and the function (for this case) should be:

    Code:
    function popup(mylink, windowname) {
        window.open(
            mylink, 
            windowname,
            'width=400,height=100,scrollbars=yes'
        );
    
        return false;
    }
    Last edited by gits; Apr 11 '12, 08:34 AM.

    Comment

    • dottiel
      New Member
      • Apr 2012
      • 2

      #3
      That worked perfectly! Thank you so much!!!

      Comment

      Working...