NYCPHP Meetup

NYPHP.org

[nycphp-talk] Need some JS / HTML help

Andy Dirnberger dirn at dirnonline.com
Sun Dec 23 09:16:01 EST 2007


David,

The problem is actually an error in your code.  Remove the "javascript:"
part from var w=...

Andy

> -----Original Message-----
> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
On
> Behalf Of David Krings
> Sent: Sunday, December 23, 2007 8:49 AM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] Need some JS / HTML help
> 
> dirn at dirnonline.com wrote:
> > Here's an simplified example from a page I set up with a tabbed
inferface:
> >
> > <a href="/path/to/main/page/tab1" onclick="Browser.ActivateTab ('tab1');
return
> false;">
> >
> 
> Here is my link crafted accordingly
> <a
>
href="http://localhost:8080/file:/F:/piviviewer/include/help/en_us/Default_C
SH.htm#
> 100"
> target="HelpWindow" onClick="var
>
w=javascript:window.open('http://localhost:8080/file:/F:/piviviewer/include/
help/en_
> us/Default_CSH.htm#100',
> 'HelpWindow',
>
'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,c
op
> yhistory=no,resizable=yes,width=800,height=550');
> w.focus(); return false;">?</a>
> 
> While it works without JavaScript, it ends up to work the same with
JavaScript
> enabled...or better to say, the JavaScript code never gets executed even
when
> JavaScript is enabled. In your example you load either the tab or the
entire
> new page into the same window that is currently in use. I want to have a
JS
> popup and when JS is disabled a plain link into a new window )ends up to
be a
> new tab in the modern browsers, which is OK). In this constellation the JS
> popup never shows up. I guess that the browser gives href preference over
the
> onClick event.
> 
> I will see that I add a generic help link into the page header using an
href
> only. So when JS is disabled the user has at least a chance to get to the
> help, it just doesn't come with CSH and the extra window. I could find a
> better fix if there is a way to detect if the browser has JS enabled
without
> executing any JS. All solutions I've seen so far pass a value, have JS
update
> and return it. If you get the same value back then JS is disabled, but
that
> strikes as very ugly. I basically provoke a 'crash', catch it, then act
upon
> that. It would be much nicer if browsers send over what they can and can't
do
> in the response.
> 
> Thanks for your help.
> 
> David
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
> 
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php




More information about the talk mailing list