Hi Rolf and Hans,
You guys are my heroes!!
Rolf's suggestion helped me to get closer to the problem but, in the end,
it was that extra "+" after "+a" pointed out by Hans that saved my day.
The script is working beautiful now -- all credit goes to you guys.
Thank you both!
Amjad
On Fri, Aug 16, 2013 at 12:17 PM, Hans Horn <[email protected]> wrote:
> isn't there a + missing after variable a?
> i.e.
>
> "select " + a + ":" + b
>
>
> On 8/16/2013 9:06 AM, Rolf Huehne wrote:
> > On 08/16/2013 05:54 PM, Amjad Farooq wrote:
> >> Hi guys,
> >>
> >> I am trying to use javascripting below to prompt for selecting a
> RESIDUE in
> >> a given CHAIN within a PDB file but it is not working:
> >>
> >>
> ******************************************************************************
> >> <script type="text/javascript">
> >> function residue()
> >> {
> >> var a = prompt("Enter Residue")
> >> var b = prompt("Enter chain")
> >> if ((!a) && (!b))return
> >> jmolScript("select "+a":"+b)
> >> }
> >> </script>
> >> <button style='width:150' onclick="residue()">Select Residue</button>
> >>
> ******************************************************************************
> >>
> >>
> >> What am I doing wrong?!
> >>
> > What exactly doesn't work?
> > Have you checked if 'a' and 'b' are set correctly?
> >
> > If you build the Jmol command before using it you could directly check
> > if it is correct with an alert:
> >
> > var command = "select "+a":"+b;
> > alert("command='" + command + "'");
> >
> > Regards,
> > Rolf
>
>
>
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users