Thanks for the pointer -solves my problem perfectly On Aug 7, 2007, at 2:55 AM, [EMAIL PROTECTED] wrote:
> Quoting Rajarshi Guha <[EMAIL PROTECTED]>: > >> Hi, this is not really a Jmol question, but it is part of a Jmol >> based app and the Jaavscript guru's are here! So, I have a web page >> within which is an image map. >> >> When I click on an area of the image map I would like to popup a >> window and fill it with some contents. I have so far got something >> like this: >> >> <img src="junk.gif" usemap="#G" border=0/> >> <map id="G" name="G"> >> <area shape="rect" onclick="showSingle('CCC')" title="0" alt="" >> coords="117,8,189,56" /> >> ... >> >> now showSingle() is a Javascript function which right now just brings >> up an alert box. Instead what I'd like to do is open a window and fil >> it automatically with the result of calling a URL. So in pseudocode: >> >> showSingle(smiles) { >> var url = 'http://some.where/something.cgi?smiles'; >> openWindow with the result of calling url; >> } >> >> Any pointers would be appreciated >> > > This doesn't look like a problem that should be solved with > Javascript. > For me it looks like a plain old image map: clicking on a defined > region of an image opens up an URL. > > If you replace > onclick="showSingle('CCC')" > with > href="http://some.where/something.cgi?CCC" target="_blank" > you should get what you described: a new window (or tab, depending on > your browser configuration) with the content returned by the URL. > > This plain old method has two advantages and you should consider if it > is really necessary to involve Javascript here: > > 1) no trouble with popup blockers > 2) no trouble with deactivated Javascript > > Regards, > Rolf > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Jmol-users mailing list > Jmol-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jmol-users ------------------------------------------------------------------- Rajarshi Guha <[EMAIL PROTECTED]> GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE ------------------------------------------------------------------- "355/113 -- Not the famous irrational number PI, but an incredible simulation!" ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users