Solved

window attributes...how they work (or don't work!)

Posted on 2004-10-29
129 Views
Last Modified: 2013-12-24
I want this link to open a new window with specified dimensions and attributes.  It won't work for some reason.


<a href="Home.cfm" target="_blank" onClick="window.open("Home.cfm", "HR - Training Database WEbsite", toolbar=1,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=648,height=800)">Training Website Home Page</a>
0
Question by:nau2nd
    5 Comments
     
    LVL 8

    Expert Comment

    by:sigmacon
    Try

    <a href="Home.cfm" target="_blank" onClick="window.open("Home.cfm", "HR - Training Database WEbsite", 'toolbar=1,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=648,height=800')">Training Website Home Page</a>
    0
     
    LVL 8

    Expert Comment

    by:sigmacon
    I should have explained: The last parameter needs quotes around it - its a STRING of a list of settings.
    0
     
    LVL 17

    Accepted Solution

    by:
    1. use single quotes
    2. create  a handle to the new window so you can close it

    <a href="Home.cfm"
       target="_blank"
       onClick="newWin = window.open('Home.cfm', 'HR - Training Database WEbsite', 'toolbar=1,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=648,height=800')">Training Website Home Page</a>

    newWin is the handle, and you can close it like so
    newWin.close()
    0
     

    Author Comment

    by:nau2nd
    I continually get error message saying that the parameters are not legitimate with certain browsers.  Also, it plainly doesn't work.  I tried adjusting the width to see a change, but it doesn't matter what i have in it, the window stays the same .

    Any other suggestions..........
    0
     
    LVL 8

    Expert Comment

    by:sigmacon
    try the following

    <a href="home.cfm" target="_blank" onClick="window.open('Home.cfm', 'HR - Training Database WEbsite', 'toolbar=1,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=648,height=800'); return false;">Training Website Home Page</a>

    You WILL have to change your double quotes to single quotes, as Tacobell777 pointed out, or use &quot; instead. Also add a return false; to the end of the onClick call.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    This video Micro Tutorial is the second in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 (http://www.experts-exchange.com/articles/17490/). But the ability to create custom scanning profiles a…
    In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…

    933 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now