Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with window.open in my .js file

    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.

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    A missing apostrophe or two...
    Code:
    window.open(URL+ID,'target01_window','menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=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.
    Last edited by liorean; 03-09-2005 at 04:08 AM.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #3
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks liorean,

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •