Andreas,

It looks to me like some kind of timing issue.  I've made a page with  
some jQuery stuff on it.  It works.  I add a Jmol applet.  Everything  
still works.  I then put a function that grabs data from the Jmol  
applet inside the (document).ready wrapper and put a call to that  
function after the load command and that doesn't work.  Even if the  
function I call after the load command is just a simple alert it  
doesn't work.  As soon as I move that function outside of the  
(document).ready wrapper it works but then any jQuery function calls  
don't.


Jeff


***********************************************
Jeff Hansen
Department of Chemistry and Biochemistry
DePauw University
602 S. College Ave.
Greencastle, IN 46135
[email protected]
***********************************************


On May 27, 2009, at 3:11 PM, Andreas Prlic wrote:

> And there is no errors on the javascript console?
> A
>
>
> On Wed, May 27, 2009 at 12:06 PM, Jeff Hansen <[email protected]>  
> wrote:
>> Well.  I would replace some of this with jQuery if it were  
>> working.  Had
>> planned to do that.  I've kind of been doing what you suggest.  I  
>> did a page
>> with just jQuery stuff.  I've done just Jmol.  I've done just svg.   
>> I've had
>> this working with Jmol, svg, and just javascript without the  
>> jQuery.  It is
>> only when I start putting in jQuery that I begin to get a problem.   
>> I'll try
>> to go back and start a little simpler and see what happens.
>>
>>
>> ***********************************************
>> Jeff Hansen
>> Department of Chemistry and Biochemistry
>> DePauw University
>> 602 S. College Ave.
>> Greencastle, IN 46135
>> [email protected]
>> ***********************************************
>>
>>
>> On May 27, 2009, at 3:00 PM, Andreas Prlic wrote:
>>
>>> Hi Jeff,
>>>
>>> so there are several things about your code:
>>>
>>> * some stuff does not look like jquery: e.g.
>>>
>>>
>>> parseFloat 
>>> (document.getElementById('graph').getAttributeNS(null,"width"));// 
>>> find
>>> the width of the svg graph
>>>
>>> I suggest to replace these bits of legacy javascript with jquery  
>>> code.
>>>
>>> * My general recommendation: Use firefox and the web developer  
>>> plugin.
>>> Then you will get an icon which will show you any javascript  
>>> errors on
>>> your page. Open the javascript console and look for any error
>>> messages.
>>>
>>> Then: to avoid the overall complexity: start simple. Build up your
>>> page step by step. Start with making sure jquery is installed
>>> correctly. do an independent test page to make sure the svn parts of
>>> your page work fine. Only then merge the two things together.  
>>> Finally
>>> add Jmol...
>>>
>>> Does that make help?
>>> A
>>>
>>>
>>>
>>>
>>> On Wed, May 27, 2009 at 10:08 AM, Jeff Hansen <[email protected]>  
>>> wrote:
>>>>
>>>> Andreas,
>>>>
>>>> Thanks for offering to take a look.  I've attached both the xhtml  
>>>> page
>>>> and
>>>> the js file.  If you can find anything I'm doing wrong I would  
>>>> really
>>>> appreciate it.  You'll notice that all my javascript code is  
>>>> outside of
>>>> the
>>>> $(document).ready(function(){ ... }) jQuery wrapper.  This is  
>>>> because
>>>> whenever I put anything in there it doesn't work.  Anything else  
>>>> that
>>>> calls
>>>> a jQuery function (like $("#circle0").toggleClass("selected"); )  
>>>> also
>>>> doesn't do anything.
>>>>
>>>>
>>>> Jeff
>>>>
>>>>
>>>>
>>>> ***********************************************
>>>> Jeff Hansen
>>>> Department of Chemistry and Biochemistry
>>>> DePauw University
>>>> 602 S. College Ave.
>>>> Greencastle, IN 46135
>>>> [email protected]
>>>> ***********************************************
>>>>
>>>>
>>>> On May 27, 2009, at 12:04 PM, Andreas Prlic wrote:
>>>>
>>>>> Hi Jeff,
>>>>>
>>>>> Now sure what's exactly the problem from your description,  
>>>>> perhaps you
>>>>> can send some example code?
>>>>>
>>>>> We are using a mix between JQuery and self written javacript on  
>>>>> the
>>>>> new RCSB-PDB web site:
>>>>>
>>>>> e.g. this page tracks the Jmol console output to a div and shows  
>>>>> the
>>>>> command history:
>>>>> http://www.rcsb.org/pdb/explore/jmol.do?structureId=1CDG
>>>>>
>>>>> This page maps sequence domains on the structure:
>>>>>
>>>>>
>>>>> http://www.rcsb.org/pdb/explore/remediatedSequence.do?structureId=1CDG&params.showJmol=true
>>>>>
>>>>> Andreas
>>>>>
>>>>>
>>>>>
>>>>> On Wed, May 27, 2009 at 8:11 AM, Jeff Hansen  
>>>>> <[email protected]> wrote:
>>>>>>
>>>>>> Does anyone have any experience using jQuery on a page with  
>>>>>> Jmol?  I
>>>>>> wanted to do this as it would greatly simplify some things I  
>>>>>> wanted to
>>>>>> do.  Unfortunately, none of the jQuery seems to be working.   
>>>>>> Let me
>>>>>> explain.  I can load a Jmol applet and structure and write  
>>>>>> javascript
>>>>>> to manipulate it in different ways but any calls to jQuery  
>>>>>> functions
>>>>>> simply do not execute.  When I played around with jQuery on a  
>>>>>> simple
>>>>>> test page (without Jmol) it was fine.  If anyone can help with  
>>>>>> this I
>>>>>> would really appreciate it.  My alternative is to return to some
>>>>>> kludgy code and I'd rather not.
>>>>>>
>>>>>> ***********************************************
>>>>>> Jeff Hansen
>>>>>> Department of Chemistry and Biochemistry
>>>>>> DePauw University
>>>>>> 602 S. College Ave.
>>>>>> Greencastle, IN 46135
>>>>>> [email protected]
>>>>>> ***********************************************
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Register Now for Creativity and Technology (CaT), June 3rd,  
>>>>>> NYC. CaT
>>>>>> is a gathering of tech-side developers & brand creativity
>>>>>> professionals.
>>>>>> Meet
>>>>>> the minds behind Google Creative Lab, Visual Complexity,  
>>>>>> Processing, &
>>>>>> iPhoneDevCamp as they present alongside digital heavyweights like
>>>>>> Barbarian
>>>>>> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
>>>>>> _______________________________________________
>>>>>> Jmol-users mailing list
>>>>>> [email protected]
>>>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC.  
>>>>> CaT
>>>>> is a gathering of tech-side developers & brand creativity  
>>>>> professionals.
>>>>> Meet
>>>>> the minds behind Google Creative Lab, Visual Complexity,  
>>>>> Processing, &
>>>>> iPhoneDevCamp as they present alongside digital heavyweights like
>>>>> Barbarian
>>>>> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat- 
>>>>> com
>>>>> _______________________________________________
>>>>> Jmol-users mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>
>>>>
>>>>
>>
>>


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to