Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: window.open  (Read 3735 times)

0 Members and 1 Guest are viewing this topic.

PinkCadilac

    Topic Starter


    Starter

    window.open
    « on: October 07, 2008, 05:00:32 PM »
    I am creating a Web application that with one of the links on the default.aspx page I am using javascript to open the window and limit the size and scroll bar and so on. The script itself is working with one small bug. The default.aspx window goes blank, this is something that I do not wish to happen.  Below is the script that I am using

    Code: [Select]
    <head>
    <script type="text/javascript">
        function openNewWindow(newPageURL) {
            window.open(newPageURL, "_blank", "height=500px width=500px " +
            "resizable=no scrollbars=no menubar=no location=no status=no");
        }
    </script>


    </head>

    Code: [Select]
    <br /> Please read our <a href="http://fa-iwp-01.macomb.edu/asmarl/itwp2300/MichiganTalentBank/employer.aspx" onclick="javascript:openNewWindow('/asmarl/itwp2300/MichiganTalentBank/policy.aspx');"><b><u>Privacy Policy</u></b> </a>
    Thanks in advance for your time and help,

    michaewlewis



      Intermediate
    • Thanked: 26
      • Yes
      • Yes
    • Experience: Expert
    • OS: Unknown
    Re: window.open
    « Reply #1 on: October 08, 2008, 10:15:32 AM »
    If you're trying to open two pages at the same time, I would suggest using javascript for both of them. It's probably confusing the browser. get rid of the href="" and put it in another openLink function like the other link is. And then use your onclick to trigger both events.

    kpac

    • Web moderator
    • Moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: window.open
    « Reply #2 on: October 08, 2008, 02:13:45 PM »
    Code: [Select]
    <head>
    <script type="text/javascript">
        function openNewWindow(newPageURL) {
            window.open(newPageURL, "_blank", "height=500px width=500px " +
            "resizable=no scrollbars=no menubar=no location=no status=no");
        }
    </script>


    </head>

    Code: [Select]
    <br /> Please read our <a href="#" onclick="openNewWindow('/asmarl/itwp2300/MichiganTalentBank/policy.aspx');"><b><u>Privacy Policy</u></b> </a>

    That work?

    PinkCadilac

      Topic Starter


      Starter

      Re: window.open
      « Reply #3 on: October 08, 2008, 05:41:36 PM »
      Thankyou so very much, that worked!
      Lori

      kpac

      • Web moderator
      • Moderator


      • Hacker

      • kpac®
      • Thanked: 184
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 7
      Re: window.open
      « Reply #4 on: October 09, 2008, 12:21:02 PM »
      No problem... ;D

      Call back if you need any more help. :)