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 7 of 7
  1. #1
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts

    onClick="openPages('url','_frame') expandability question

    Hello all.

    This script was designed to be able to open multiple links in multiple iframes with one mouseclick (atleast i was told so)

    Code:
    <script>
    function openPages(){
      for (var i=0;i<arguments.length;i+=2){
         if (arguments[ i + 1]) window.open(arguments[ i ], arguments[ i + 1] )
      }
    }
    </script>
    The activation is this:
    Code:
    onClick="openPages('orders.htm','_menu2')"
    My question is what seperation do i use to add another open statement to this code?

    in suedo code, i want this
    Code:
    onClick="openPages('orders.htm','_menu2';'ingredients.htm','_mainFrame')"
    whats the proper delimiter in JS to make this work?
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #2
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    Code:
    onClick="openPages('orders.htm','_menu2');openPages('ingredients.htm','_mainFrame')"
    Basscyst
    Helping to build a bigger box. - Adam Matthews

  • #3
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    awesome, thanks
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,030
    Thanks
    0
    Thanked 247 Times in 244 Posts
    This is the more correct way.

    onClick="openPages('orders.htm','_menu2','ingredients.htm','_mainFrame')"

    You just separate all parameters with commas as you do in the normal way.

  • #5
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by glenngv
    This is the more correct way.

    onClick="openPages('orders.htm','_menu2','ingredients.htm','_mainFrame')"

    You just separate all parameters with commas as you do in the normal way.
    odd, when i use this
    Code:
    onClick="openPages('inventory.htm','_menu2','blank.htm','_mainFrame);
    it gives me an "unterminated string constant" error
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #6
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nothing odd about it.
    You are missing a single quote.

  • #7
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    heh... doh.

    thanks willy
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)


  •  

    Posting Permissions

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