SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Error HElp
-
Aug 22, 2006, 06:55 #1
- Join Date
- Mar 2005
- Posts
- 523
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Error HElp
Hi Guys
The Javascript code below gives an error when checking in Firefox Javascript console
Code:<SCRIPT language=JavaScript> <!-- Begin function expandingWindow(website) { var windowprops='width=100,height=100,scrollbars=yes,status=0,resizable=0' var heightspeed = 10; // vertical scrolling speed (higher = slower) var widthspeed = 10; // horizontal scrolling speed (higher = slower) var leftdist = 10; // distance to left edge of window var topdist = 10; // distance to top edge of window if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) { var winwidth = 800; var winheight = 600; var sizer = new Object( ); for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) sizer.resizeTo("1", sizeheight); for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) sizer.resizeTo(sizewidth, sizeheight); sizer.location = website; } else new Object( ); } // End --> </SCRIPT>
Please help
Niva
-
Aug 22, 2006, 10:23 #2
- Join Date
- Jul 2005
- Location
- West Springfield, Massachusetts
- Posts
- 17,290
- Mentioned
- 198 Post(s)
- Tagged
- 3 Thread(s)
The resizeTo method resizes "windows" but your code is applying it to an "object".
Is there any way to specify that sizer is a window object?Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
-
Aug 22, 2006, 10:55 #3
- Join Date
- Mar 2005
- Posts
- 523
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Mittineague
Thanks for the reply Here is how I call the script,is it incorrect.
Code:<input type="button" name="customer" value=" Customer / Agent Report " onClick="expandingWindow('doAgent.php')">
Niva
-
Aug 22, 2006, 11:48 #4
- Join Date
- Jan 2005
- Location
- Chertsey, London, England
- Posts
- 164
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi there nivashni,
does this help...
Code:<script type="text/javascript"> <!-- function expandingWindow(website) { windowprops='width=100,height=100,scrollbars=yes,status=0,resizable=0'; heightspeed=10; // vertical scrolling speed (higher = slower) widthspeed=10; // horizontal scrolling speed (higher = slower) leftdist=10; // distance to left edge of window topdist=10; // distance to top edge of window obj=window.open(); if(window.resizeTo&&navigator.userAgent.indexOf('Opera')==-1) { winwidth=800; winheight=600; sizer=new Object(obj); for(sizeheight = 1;sizeheight<winheight;sizeheight+=heightspeed) { sizer.resizeTo('1',sizeheight); } for(sizewidth=1;sizewidth<winwidth;sizewidth+=widthspeed) { sizer.resizeTo(sizewidth,sizeheight); sizer.location=website; } } else { new Object(obj); } } //--> </script>
Bookmarks