Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

target a frame using onClick

12 views
Skip to first unread message

Ken Landreaux

unread,
Mar 17, 2001, 11:53:50 PM3/17/01
to
Have a question:

Assuming I am using multiple frames...

The following does work...
<A HREF="webpage.html" TARGET="otherFrame"><img src = clickme.gif></A>

However, I need to do the following
<A HREF="#" TARGET="otherFrame" onClick="????????????

Can someone finish this for me? Please.

Thank you, Ken

GalaSoft Laurent Bugnion

unread,
Mar 18, 2001, 3:12:59 AM3/18/01
to
Hi,

ONCLICK="parent.otherFrame.location='pagename.html';"

No need for a target in this case.

Laurent
--
GalaSoft Laurent Bugnion
Webdesign, Java, JavaScript: http://www.galasoft-LB.ch
Darjeeling teas: http://www.galasoft-LB.ch/indiantea
Support children in Calcutta: http://www.calcutta-espoir.ch

hrdLuck

unread,
Mar 18, 2001, 9:06:32 AM3/18/01
to
not sure what you mean, but if you're trying to call a function with the
onClick event then
try this...

<A Href="JavaScript:functionName( )" Target="otherFrame">

"GalaSoft Laurent Bugnion" <galas...@bluewin.ch> wrote in message
news:3AB46E0B...@bluewin.ch...

Ken Landreaux

unread,
Mar 18, 2001, 4:35:03 PM3/18/01
to
Thank you so much. :-)

GalaSoft Laurent Bugnion wrote in message <3AB46E0B...@bluewin.ch>...

Ken Landreaux

unread,
Mar 18, 2001, 4:35:53 PM3/18/01
to
The above post answered my question however I saved this info as well as
this will most assuredly come in handy and save me a post.

Thanks.

hrdLuck wrote in message ...

GalaSoft Laurent Bugnion

unread,
Mar 19, 2001, 2:30:38 AM3/19/01
to
Hi Ken,

Ken Landreaux wrote:
>
> The above post answered my question however I saved this info as well as
> this will most assuredly come in handy and save me a post.
>
> Thanks.
>
> hrdLuck wrote in message ...
> > not sure what you mean, but if you're trying to call a function with the
> >onClick event then
> > try this...
> >
> > <A Href="JavaScript:functionName( )" Target="otherFrame">
> >

Most experts recommend not using the pseudo-protocol "javascript:" for
different reasons. There have been numerous discussions about this in
this very NG, check Googles for more details.

Mark Johnson

unread,
Mar 19, 2001, 4:32:39 AM3/19/01
to
GalaSoft Laurent Bugnion <galas...@bluewin.ch> wrote:

>Most experts recommend not using the pseudo-protocol "javascript:" for
>different reasons. There have been numerous discussions about this in
>this very NG, check Googles for more details.

From what I saw there, it had to do with IE 5.5 kicking out some
warning message for even using javascript: .

Apparently there's no secure encoding for a page delivered by a
javascript: pseudo-protocol. But a lot of times . . . who cares? In
fact, since only IE 5.5 is kicking out this warning, supposedly, then
the backward compatibility of href=javascript: for those like NN4 that
can't handle onclick, doesn't matter. Use the onclick, and it won't
fall through in IE 5.5 . It will in earlier browsers, but that's just
what you want.

And, btw, why isn't a pop-up from a javascript call insecure but a
popup after a javascript: pseudo-protocol would be . .?


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----

GalaSoft Laurent Bugnion

unread,
Mar 19, 2001, 6:46:15 AM3/19/01
to
Hi,

Mark Johnson wrote:
>
> GalaSoft Laurent Bugnion <galas...@bluewin.ch> wrote:
>
> >Most experts recommend not using the pseudo-protocol "javascript:" for
> >different reasons. There have been numerous discussions about this in
> >this very NG, check Googles for more details.
>
> From what I saw there, it had to do with IE 5.5 kicking out some
> warning message for even using javascript: .

Not only that. Another thing, for example, is that it will fail in
non-JS browsers. With ONCLICK, you can still use the HREF part to
specify the behaviour when JS is off. There was a huge discussion on
this very NG once, and the conclusion were really clear, IMHO.

There is not only the warning message problem when using secure
protocols, but also the fact that a window opened using javascript:
won't be able to communicate with the secure opener, because of the same
origin policy.

etc...

> Apparently there's no secure encoding for a page delivered by a
> javascript: pseudo-protocol. But a lot of times . . . who cares? In
> fact, since only IE 5.5 is kicking out this warning, supposedly, then
> the backward compatibility of href=javascript: for those like NN4 that
> can't handle onclick, doesn't matter. Use the onclick, and it won't
> fall through in IE 5.5 . It will in earlier browsers, but that's just
> what you want.

ONCLICK works fine in IE4+ and NS4+. It is not defined on all objects in
Netscape (for example on IMG tags), but it is in links, so you can
easily use a link tag wrapped around the IMG, for example.

As for the "who cares"... since you have a possibility to use ONCLICK to
solve all the problems that javascript: has, I really don't see the
point of still using it.

> And, btw, why isn't a pop-up from a javascript call insecure but a
> popup after a javascript: pseudo-protocol would be . .?

Simply because the protocol specifies if the window is secure or not,
and javascript: is not secure. https: is secure.

0 new messages