How exactly are you loading HTML into the div? 

Does each page have its own JSmol.min.js? 

URL so we can see what it is doing?  

Iframes will take special consideration if the button calls are across frames. 

Sent from my stupid iPhone 

On Dec 26, 2013, at 1:42 PM, Romuald Poteau <romuald.pot...@univ-tlse3.fr> 
wrote:

> Dear Angel, thanks for answering, but your suggestion does not solve this 
> problem. See below
> Regards,
> Romuald
> 
> Le 26/12/2013 12:59, Angel Herráez a écrit :
>> Hello, Romuald
>> 
>> There may be several issues there, but there must be a simple solution.
>> 
>>> and a div container in which 
>>> external html pages are loaded. 
>> Is that an IFRAME? Otherwise, I am not sure how an external page may be 
>> loaded into a div, that could be donde by the jQuery library but it is not 
>> straightforward.
> Actually, loading an html file into a div  container does work, and it is is 
> still the case when I load external html pages that call jsmol. Every html 
> instruction is well interpreted, with the exception of the pages that contain 
> jsmol controls (buttons or checkboxes). 
> As far as I have read on forums, it seems to be possible to load external 
> html files inside div containers. I have seen other possibilities with 
> iframes, but I did not succeed either.
>> If you do use an iframe, then you can test your pages on their own before 
>> loading them as secondary pages. But there should be no difference.
> I have tested the external pages individually (adding the call to 
> jsmol.min.js, vide infra) and this case everything appears, including the 
> jsmol applet and the control buttons.
>> 
>> 
>> Important: where do you issue the Jmol commands/links from? From the 
>> main page or from the secondary ones?
> From the secondary one.
>> 
>>> with links (such as <a href="javascript:Jmol.script(JmolPG,'select 
>>> *;cartoons off;spacefill only')">spacefill</a>) 
>> There is a fundamental difference here. Script just sends instructions to 
>> Jmol, while the others create controls in the page. That may be why the 
>> first 
>> works for you but not the others.
>> 
>>> , the applet and the rest 
>>> of the external file appear in the div container, as desired. 
>> That's important, meaning your JSmol setup is correct.
>> 
>> 
>> I would have expected that you need to call Jsmol.min.js in the secondary 
>> page. I can see you found the contrary, don't know why.  Have you tested if 
>> the checkboxes etc work when you add that?
> - without the call to jsmol.min.js in the external file : everything works 
> fine with links only, but the checkbox is then the only thing that appears 
> when it is additionally used
> - with a call to jsmol.min.js in the external file : the links appear on the 
> page, but it not the case anymore of the jsmol applet (and of the checkbox, 
> of course)
>   
>> Anyway, the problem may be that the Jmol object is not created --so it 
>> seems-- until the page has finished loading, but the code for the controls 
>> is 
>> being run before, so maybe they fail because the Jmol object does not exist 
>> yet.
> That is the reason why I have tried to define an asynchronous loading, but I 
> am not sure that I really know how to do that
>> Oh, well, you have defined  JmolPG in advance, so that should not be the 
>> case. Maybe try these changes: give some value to the variable, then use 
>> the variable and not the text string:
>> 
>> var JmolPG = "JmolPG"; // within INITIALIZE JMOL
>> 
>>    $("#JmolappPG").html(Jmol.getAppletHtml(JmolPG, InfoPG))
>> // within $(document).ready(function() 
>> 
>> (Not sure about that, but could be the reason)
> Good try, but unfortunately it is not the reason. This does not change 
> anything.
>> 
> 
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT 
> organizations don't have a clear picture of how application performance 
> affects their revenue. With AppDynamics, you get 100% visibility into your 
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to