Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-22-2011, 09:10 PM   PM User | #1
tomdbs98
New to the CF scene

 
Join Date: Jul 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
tomdbs98 is an unknown quantity at this point
Question Load applet in page on function call

Hi, I'm making a page and I'd like to start an applet (Jmol) and display it near the button of the current page when a button is clicked. However, I get a syntax error: "missing ; before statement"
(Note: this javascript is part of a cgi page)
The code I have is as follow:
Code:
<script type="text/javascript" SRC="../jmol-12.0.48/Jmol.js"></script>
<script 
type="text/javascript" 
language="Javascript">
function loadJmol(SMILES)
{
        document.getElementById("viewMol").innerHTML = 'jmolInitialize("../jmol-12.0.48", true); jmolAppletInline(300, \'\', "load \$' + SMILES + '");' ;
}
</script>
...
print "<a href=javascript:loadJmol(\"SomeString\")>View</a>";
print "<script id=\"viewMol\"></script>";
The syntax error occurs at the single quote in ...").innerHTML = 'jmolInitialize("...

I have been able to get this applet to run when not in a function.

Has anyone run into this before and can give me a hand?

Thanks, Tom

Last edited by tomdbs98; 07-22-2011 at 09:13 PM.. Reason: forgot to add something
tomdbs98 is offline   Reply With Quote
Reply

Bookmarks

Tags
innerhtml, jmol, missing, script, statement

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:17 PM.


Advertisement
Log in to turn off these ads.