SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member blade007's Avatar
    Join Date
    Aug 2007
    Location
    Ontario, Canada
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Javascript: Opening a New Window: Help needed

    ok, i have this, but its not working..

    Code:
    <a href="javascript:void(0)" onclick="window.open('URL','Shipping Terms','resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no')">Shipping Terms</a>
    I want to have a script in my header as the reference to pop-ups instead of having to re-type attributes on every page i want a popup, wat would be the code for this, thanks

  2. #2
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this in an external JS file:

    Code:
    function openWindow(url)	{
    	window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=500,left=30,top=80");
    	}
    you can of course add any variables you want to pass to the function as needed

  3. #3
    SitePoint Member blade007's Avatar
    Join Date
    Aug 2007
    Location
    Ontario, Canada
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i was thinking about something like this..

    code top put in HEADER
    Code:
    <SCRIPT LANGUAGE="javascript">
    <!--
    window.open ('', 'newwindow', config='height=100,
    width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,
    location=no, directories=no, status=no')
    -->
    </SCRIPT>
    code to put on any page..
    Code:
    ?????????????
    what would be the code to reference the javascript in the header


Bookmarks

Posting Permissions

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