Results 1 to 11 of 11
10-22-2002, 04:48 PM #1
I am trying to define a fucntion with three parameters, URL, height and width so that I can open windows, with different HTML pages, with different sizes. I did the following:
window.open(htmlpage,'mywin', mwidth, mheight,'toolbar=no,menubar=no')
Above defines the function with three variables.
Then at some appropriate point, I assign the variables as follows:
Then I call the function:
Click here to open the window
But the opened window size is not of the values in the variables! Help please! I am losing my mind and sleep!
10-22-2002, 05:09 PM #2
Two things to remember, the a href tag is just HTML, its not clever enough to figure out that you are usign variables. So first off, call your function like this -
window.open(htmlpage,'mywin', 'width=' + mwidth +', height=' + mheight + ',toolbar=no,menubar=no')
by the way, welcome to the forums!
10-22-2002, 05:59 PM #3
As you had pointed out, my format for window opening was indeed wrong - all I had to do was copy your tip into the page, and bingo! Everything works! Many many thanks! Glad I gave the bread to the baker!
10-29-2002, 10:12 PM #4
I have one more question to the Guru - if in the above function, I call an image as the file name (like xyz.jpg), the resulting window contains the image with an offset in both x and y directions, in the top left corber of the window. If on the other hand, I put the image in a html page and call that html page, the image appears flush with the top left corner of the window. But I hate to create multiple html pages containing tens of images. How can I call the image window and not have an offset at the top left corner? Many thanks in advance.
10-30-2002, 03:54 PM #5
Hmm. I do not get an offset, but then again, I use Mozilla, so maybe thats it.
The problem with calling direct to an image is that the control is then completely out of your control, and into the browsers.
Instead of hardcoding lots and lots of pages, how about using a server side script to achieve it?
For example, PHP would handle it like this -
Save a file called image.php with this code in -
<img src="<? echo $_GET['image']; ?>.jpg">
The only thing to watch would be not using the entire filename in the variable, as a user can change the url and end up accessing the servers file system if you are not careful.
This relies on your server having php, so have a look and see if it works (dontr forget to call the file .php !)
11-01-2002, 10:24 AM #6
Can't find the thread from yesterday where you gave the URL to the Mozilla download so will ask here.
11-01-2002, 01:42 PM #7
Sure, its -
Edit/Preferences/Advanced/Scripts & WIndows
If in doubt, try a very simple test script and see if it works.
11-01-2002, 07:25 PM #8
Have 'all' the boxes checked at
but neither inline nor .js file referenced SCRIPTs are being read. Guess my web sites are going to make sense only to IE users until I figure out an alternative to the .js referenced files.
11-02-2002, 05:40 AM #9
Yours is different to mine, I got the latest 'stable' release, Mozilla 1.0 .
Check out your version, compare, maybe download the stable release if your is different to mine.
11-02-2002, 10:26 AM #10
Thanks, will go back and get the 1.0 version and see. What I did download was supposed to be the stable version prior to the 1.2 beta now being tested.
Just installed version 1.0.1 and have same problem. Couldn't see where I could get just version 1.0. Also tried to access this forum to edit this messageand couldn't without logging in "under an unsecure" process according to the pop-up - mostly likely due to the new browser being used. Are there other Mozilla initialization steps I'm missing?
(This version has a readme.txt file - it not having anything in it but installation instructions. The prior download referenced that file but didn't include it.)
Last edited by benzden; 11-02-2002 at 10:52 AM.
11-02-2002, 01:23 PM #11
hmm. I just installed and ran