How do I open a window from the outside?

How do I specify window size in a window.open operation?

  • function openWindow(srcFile) { window.open(srcFile,'newWnd','width=800,… } I want to open a popup window, but I can only specify the dimensions manually, is there any way to insert a variable into the parameter string ie function openWindow(srcFile, srcWidth, srcHeight) { window.open(srcFile,'newWnd','width=*src… } thanks!

  • Answer:

    Take a look at the example in this site. http://www.devguru.com/Technologies/ecmaScript/quickref/win_open.html To pass height and width value to the function you do -: function openWindow(srcWidth, srcHeight) { mywindow=window.open("", "tinyWindow", 'toolbar,width=' +srcWidth +',height=' + srcHeight); } copy and paste this code and try it out to see the result hope this helps

ryandebr... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

window.open("page.html","width=600, height=400, scrollbars=yes");

rob

in javascript you can refrence variables by using a terminated constant and the plus opperator for example: "mike" + " roth" = Mike Roth so you can then do it through that mechanism by setting the third parameter as 'width=' + width + ',height=' + height

Michael R

You will find other examples at this web site as well, if this is not the programming language you wanted

Lue

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.