473,385 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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:
Expand|Select|Wrap|Line Numbers
  1. <SCRIPT TYPE="text/javascript">
  2. function popup(mylink, windowname)
  3. {
  4. if (! window.focus)return true;
  5. var href;
  6. if (typeof(mylink) == 'string')
  7.    href=mylink;
  8. else
  9.    href=mylink.href;
  10. window.open(href, windowname, 'width=400,height=100,scrollbars=yes');
  11. return false;
  12. }
  13.  
  14. </SCRIPT>
  15.  
  16. And this is the link:
  17.  
  18. <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>  
  19.  
Apr 4 '12 #1

✓ answered by gits

i would suggest to adapt the link to this:

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

Expand|Select|Wrap|Line Numbers
  1. function popup(mylink, windowname) {
  2.     window.open(
  3.         mylink, 
  4.         windowname,
  5.         'width=400,height=100,scrollbars=yes'
  6.     );
  7.  
  8.     return false;
  9. }

2 1837
gits
5,390 Expert Mod 4TB
i would suggest to adapt the link to this:

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

Expand|Select|Wrap|Line Numbers
  1. function popup(mylink, windowname) {
  2.     window.open(
  3.         mylink, 
  4.         windowname,
  5.         'width=400,height=100,scrollbars=yes'
  6.     );
  7.  
  8.     return false;
  9. }
Apr 11 '12 #2
That worked perfectly! Thank you so much!!!
Apr 12 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ben Smeets | last post by:
Hi folks, Have been trying to figure out a solution for the following problem by reading lots of threads here, but doesn't work out. Hope someone can help me. I have a parent window which...
1
by: Ed Brandmark | last post by:
I want to be able to open a window in the background of my page - without that flicker you see if you just open the window and then blur it (or focus the main window). The reason I want to do this...
0
by: | last post by:
I'm using this code to export the crystal report file into pdf format and stream the file to the browser: ReportDocument oRpt = new ReportDocument(); oRpt.Load(MapPath("MyReport.rpt"));...
3
by: ACaunter | last post by:
Hi all, I need to set a session variable and open a new window with a single click of an asp.net button. My problem is that it always takes two clicks.. one sets the session and the other opens...
6
by: slacker | last post by:
In my jsp I have: <Script langauge="Javascript"> window.location.replace("first url"); window.close(); window.open("second url"); </Script> The child window opens from the parent window...
1
by: sathyanrockie | last post by:
Plase tell me what is the difference between window.open and window.showmodelessdialog. Can we use window.showmodelessdialog in place of window.open?
19
by: Sonnich | last post by:
Hi! I have used JS, but I am still new to it. I have something like this: oNewWindow = new Object(); oNewWindow = open("sonnich.xls","Qopen","resizable=yes,scroll=yes, status=yes,...
1
by: Sonnich | last post by:
Hi! I have a asp file, which opens a document into excel ( Response.ContentType = "application/vnd.ms-excel") The point is, that it creates my excel document well, but I need: 1) to open...
3
by: Cindy H | last post by:
Hi I have a webpage with a link to a pdf file on it. Right now the user has to click on the pdf file link to open and display the file. Does anyone know how I can get the web page to just open...
1
by: fatima.issawi | last post by:
Hello, I would like to open a pdf file in a new window from my code behind page. The code I have currently doesn't seem to work: Response.Write("<script language='javascript'{...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.