...

View Full Version : Problem with window.open in my .js file



Photoshop_god
03-08-2005, 10:34 PM
Hi All,

I have just recenently added a new print function to my .js file and deleted the older ones. The only problem is it does not work. I have tried moving, switching, and renaming parts, if not all, of the function in an attempt to fix it. As far as I can tell it should work. The following is the function that is located in my .js file.

//Open Misc
function openMiscWindow(TargURL,CID,W,H) {
ID = CID
URL = TargURL
WinW = W
WinH = H
popupWin = window.open(URL+ID,'target01_window,menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars =1,resizable=1,dependent=0,width='+WinW,'height='+WinH,'left=10,top=10')
}

Here is the javascript in the page that is calling this function.

javascript: openMiscWindow('wedding_clients_admin_print.asp?ClientID=',<%=RS("custID")%>,720,550);

Keep in mind that the <%= rs("custID") %> will be replaced with a number when the server processes the page, that is why it is not surrounded in quotes. All the other functions for these pages works fine. It's just this one that is giving me problems. I know I'm probably missing something obviouse, but I have been looking at this code for so long everything is starting to look the same. Any help would be appreciated.

liorean
03-08-2005, 10:46 PM
A missing apostrophe or two...

window.open(URL+ID,'target01_window','menubar=0,toolbar=0,location=0,directories=0,status=0,scrollba rs=1,resi zable=1,dependent=0,width='+WinW,'height='+WinH,'left=10,top=10');May I also suggest that you change the left and top values to correct for screen.availTop and screen.availLeft, if the user happens to have the taskbar on the top or left edge?

Also, you only need to list the features that you explicitly want to activate. Default is disabled for all that the browser allow disabling.

Photoshop_god
03-09-2005, 04:00 AM
Thanks liorean,

I knew it was something simple. Thanks for the suggestions, I'll definitely look into them.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum