targetfeatuers attributes
targetfeatuers attributes
I have tried the targetfeatures -- but I can't figure out how to include to toolbars. Basically I would like a sizable "target=_blank"...
something that could include opening a new page with width / height attributes and possibly position.
Any suggestions??
Thanks in advance
Josh
something that could include opening a new page with width / height attributes and possibly position.
Any suggestions??
Thanks in advance
Josh
Code: Select all
url=http://www.whateversite.com/whateverpage.html;target=_new;targetfeatures=width=440 height=410 toolbar=no location=no directories=no status=no menubar=no scrollbars=no resizable=no copyhistory=no;");
Of course the code doesn't wrap in the file.

Ruth
the url bar/file/edit/view... refressh, back, forward icons... are the things that I am talking about. I tried target new and all of the targetfeatures, does this mean that I can't have a new window pop up with all of the url bar/file/edit/view... refressh, back, forward icons..., that can be set at an initial size eg. 600x600
Ok, thanks, got most of the menu items open a new page with:
Once I found the code that worked I then copied it to all the other menu items, I don't understand why this works for some and not others. I have gone through the code and each line, they all look the same. 
Code: Select all
aI("text=Test Equip.;url=http://www.url.com;target=_new;targetfeatures=width=820 height=650 toolbar=yes location=yes directories=yes status=yes menubar=yes scrollbars=yes resizable=yes copyhistory=yes");

You're missing a ; at the end of that line, but probably not the ultimate fix...dmj120 wrote:Code: Select all
aI("text=Test Equip.;url=http://www.url.com;target=_new;targetfeatures=width=820 height=650 toolbar=yes location=yes directories=yes status=yes menubar=yes scrollbars=yes resizable=yes copyhistory=yes");
Code: Select all
aI("text=Test Equip.;url=http://www.url.com;target=_new;targetfeatures=width=820 height=650 toolbar=yes location=yes directories=yes status=yes menubar=yes scrollbars=yes resizable=yes copyhistory=yes;");
How 'bout a URL so we can see what's up?
Last edited by John on Mon May 24, 2004 8:23 pm, edited 1 time in total.
John
i did have the " ; " at the end of the items. I got more items to open correctly omitting the " ; "
http://swlct.com
Josh
http://swlct.com
Josh
Can you post a url to your test page, or post the code for some of the items that don't work?dmj120 wrote:...I don't understand why this works for some and not others...
Actually, I believe the default state for most of those features (toolbar, menubar, location, etc.) is "no".Ruth wrote:I think, if you want all the features all you have to do is put the width and height and if you don't put anything else, all the rest will show by default
Position is another matter. You can control position by setting additional "features" in the window.open() method (which is what the targetfeatures in the aI() string are passed to), but these tend to be browser specific. For example, you could set top=100 and left=100, but that would only work in IE4+. You could set screenX and screenY, but those are specific to NS. So, the features Andy listed in the sample page John pointed to (sample11) are the features that are common across browsers, like width and height. Another approach would be to write a js function that would open a new window for you, with the size and other features you want, and then reposition the new window to the location you want using the moveTo() method.dmj120 wrote:something that could include opening a new page with width / height attributes and possibly position
Cheers,
Kevin
Kevin3442
the url were the code lies is http://swlct.com i think you are correct about the features (toolbar, menubar, location, etc.) is "no".
I am still puzzeled to why some items open a seperate 'sized' page and others don't. The position is not really an issue, was just wondering if it could be done. I mainly would like the links to open a sized window at 820x600, which about half do.
Putting the " ; " at the end of the aI's did not help, actually I can get more links to open in a sized window without the end " ; ".
Josh
the url were the code lies is http://swlct.com i think you are correct about the features (toolbar, menubar, location, etc.) is "no".
I am still puzzeled to why some items open a seperate 'sized' page and others don't. The position is not really an issue, was just wondering if it could be done. I mainly would like the links to open a sized window at 820x600, which about half do.
Putting the " ; " at the end of the aI's did not help, actually I can get more links to open in a sized window without the end " ; ".
Josh
Hi Josh,
This may be superstitious on my part, but instead of target=_new (which has a particular meaning in a standard <a> link), I'd try target=windowName, where windowName is a name to give to the new window. This functionality of the menu is undoubtedly using the js window.open() method, which normally takes three parameters, the name of the new window, the url for the wiondow, and the features of the window (width, etc.). If you use a different windowName for each menu item, then each item is guaranteed to open its link in a new window. If you use the same windowName for all or some menu items, and if the window is already open, then when you click an item that is supposed to open in that window (based on windowName), it'll ust replace the content in the already-opened window.
Let us know what happens.
Kevin
This may be superstitious on my part, but instead of target=_new (which has a particular meaning in a standard <a> link), I'd try target=windowName, where windowName is a name to give to the new window. This functionality of the menu is undoubtedly using the js window.open() method, which normally takes three parameters, the name of the new window, the url for the wiondow, and the features of the window (width, etc.). If you use a different windowName for each menu item, then each item is guaranteed to open its link in a new window. If you use the same windowName for all or some menu items, and if the window is already open, then when you click an item that is supposed to open in that window (based on windowName), it'll ust replace the content in the already-opened window.
Let us know what happens.
Kevin
Josh,
Use any name you like, but avoid spaces. I.e.,would be bad.
or
should be fine.
Kevin
Use any name you like, but avoid spaces. I.e.,
Code: Select all
target=my new window
Code: Select all
target=myNewWindow
Code: Select all
target=my_new_window
Kevin
Perhaps I spoke too soon, the new windows open once, then if you click the same or other menu items the page opens in the original window.
I works once, this is really becoming frustrating.
Any other suggestions??
Josh
the menu is at http://swlct.com
I works once, this is really becoming frustrating.
Any other suggestions??
Josh
the menu is at http://swlct.com