SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    derrrp
    Join Date
    Aug 2006
    Location
    earth
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    window.open question

    Hi all,

    Here's my jQuery/javascript

    Code JavaScript:
    $(function()
    {
    	$('a.new-window').click(function(){
            window.open(this.href, "printCoupon", "status=0, toolbar=0, location=0, menubar=0, directories=0, resizable=0, scrollbars=0, width=400, height=300");
            return false;
        });
    });

    However, the new window is still resizable and the address bar is still showing. What am I doing wrong?

    Thanks for any help.
    No, I REALLY dislike having to use Joomla.

  2. #2
    SitePoint Zealot bgil's Avatar
    Join Date
    Apr 2009
    Location
    So. California
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Learning jQuery is on my ToDo list, but I'm wondering if it maybe should be:
    toolbar=no
    -Brad

  3. #3
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure your browser settings allow JavaScript to do these window manipulations.

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,872
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Most browsers don't allow the address bar to be turned off for security reasons. Whether JavaScript can stop a window being resized depends on the browser settings. When people have window.open requests open in a new tab instead of a new window the entire third parameter (which is only suggestions to start with) gets ignored.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    derrrp
    Join Date
    Aug 2006
    Location
    earth
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Indeed. I ran it on Safari and it looked as it was supposed to.

    Thanks for the info guys!
    No, I REALLY dislike having to use Joomla.


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
  •