Hi :
I've tried this in the perl script with no luck. Here is what I did. I
have this after reading replies I got.
$javascriptwin = "<script language=\"JavaScript\">
function openWindow(u, n, w, h)
{
var win = window.open(u, n, \"toolbar=no,location=no,\"+
\"status=no,menubar=no,scrollbars=yes\"+
\"width=\"+w+\",height=\"+h);
}
</script>";
In the hash that has the <a> is pasted below:
%hashdata = (
...
'key_data' => ["<a href=\"\"
onclick=\"openWindow(\"http://www.domain.com/file.html\",\"win\", 400,
400); return false;\">?<\/a>"],
....
);
This does not open a new window at all. I also do not even see the
contents of the file as well.
Have I missed something here?
Cheers.
> [EMAIL PROTECTED] wrote:
>> Hi Sluggers:
>>
>> Objective:
>> When someone clicks on a link, I want a new browser window to open
>> with no toolbars, menubar. I want scrollbars. I know Javascript has
>> window.open() to achieve what I want. However the new window opens up
>> from a <a> tag from a script. I tried window.open() in the <a> tag but
>> it did not work. I have also tried this in the ".html" file I want to
>> open up in the new resized browser window with no menu and toolbars.
>>
>
> Javascript:
> window.open(<url>,<title>,<options>)
>
> <options> amongst other things could be:
> "menubar=no,personalbar=no,resizable=yes,scrollbars=yes,width=300,height=300,left="
> + l + ",top=" + t);
>
> where l and t are the calculated left and top coordinates to put a
> 300x300 window in the middle of the screen.
>
>
> To call a javascript function from an <a> tag, you MUST return false so
> that the link is not activated, eg:
>
> <a href="" onclick="openWindow(); return false;">Something here</a>
>
> Also, with window operations, particularly sizing, be careful what
> object parameters you use - Internet Explorer uses some non-standard
> ones.
>
>> I have this sample Javascript in the <head> tag
>>
>> <script>
>> function resizeWindow(width,height){
>> if (document.layers) {
>> // resizeTo sets inner size, so use this instead
>> window.outerWidth = width;
>> window.outerHeight = height;
>> } else window.resizeTo(width,height);
>> }
>> </script>
>>
>> Now in my <body> tag I have added this
>>
>> <body .... onload="resizeWindow(300,300);">
>>
>> This of course just resizes the window. But it still leaves the
>> toolbars and menu bars. Any ideas on how I can extend the above script
>> with a window.open() or something similar would be greatly
>> appreciated.
>>
>> Cheers.
>>
>>
>
>
> --
> Phil Scarratt
> Draxsen Technologies
> IT Contractor
> 0403 53 12 71
--
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug