...

View Full Version : onClick="openPages('url','_frame') expandability question



canadianjameson
06-01-2004, 06:28 PM
Hello all.

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



<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:


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


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


whats the proper delimiter in JS to make this work?

Basscyst
06-01-2004, 07:23 PM
onClick="openPages('orders.htm','_menu2');openPages('ingredients.htm','_mainFrame')"


Basscyst

canadianjameson
06-02-2004, 09:20 PM
awesome, thanks

glenngv
06-03-2004, 04:00 AM
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.

canadianjameson
06-04-2004, 04:46 PM
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


onClick="openPages('inventory.htm','_menu2','blank.htm','_mainFrame);


it gives me an "unterminated string constant" error

Willy Duitt
06-04-2004, 04:54 PM
Nothing odd about it.
You are missing a single quote.

canadianjameson
06-08-2004, 02:10 PM
heh... doh.

thanks willy



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum