User 138d6f42d5
25-03-2010 14:19:43
Hi;
I try to use smiles code generated by marvin sketch in jdbc postgres db consults.
Some very simples smiles can pass the process but when it has a backslash character I get errors.
I experiment change the javascript replace to change "\" to "\\" but in this case the applet don´t run.
================code I changed=====================
function exportSmiles() {
if(document.queryForm.MSketch != null) {
var s = document.queryForm.MSketch.getMol('smiles');
s = s.replace("\", "\\");
s = unix2local(s); // Convert "\n" to local line separator
document.queryForm.smiles.value = s;
} else {
alert("Cannot import molecule:\n"+
"no JavaScript to Java communication in your browser.\n");
}
)
================================================
ChemAxon 990acf0dec
30-03-2010 15:39:22
Hi,
Sorry for the late respond here; we are still investigating this issue. Will come back with an answer soon.
Best regards,
Akos
ChemAxon 7c2d26e5cf
02-04-2010 16:08:16
Please see the following example.
https://www.chemaxon.com/marvin/examples/applets/sketch/js_io.html
It demonstrates how to retrieve structure from applet and how to import molecule stream (from a form) into applet.
In this case, you do not have to escape backslash characters.
Escaping backslash is important when smiles string is embedded explicitly into the html code. For example:
<script type="text/javascript">
msketch_begin("/marvin",400,400);
msketch_param("mol","ON\\C=C\\NCl");
msketch_end();
</script>
ChemAxon 7c2d26e5cf
02-04-2010 16:16:26
User 138d6f42d5
05-04-2010 12:46:47
Hi Tamas;
The page related to the link can be used as example.
If I add a line in the javascript function exportMol
the applet don´t work properly.
In my case I tried to use s = s.replace("\", "\\")
I need this second backslash for my jdbc querry work.
Jair
Tamas wrote:
|
Please see the following example.
https://www.chemaxon.com/marvin/examples/applets/sketch/js_io.html
It demonstrates how to retrieve structure from applet and how to import molecule stream (from a form) into applet.
In this case, you do not have to escape backslash characters.
Escaping backslash is important when smiles string is embedded explicitly into the html code. For example:
<script type="text/javascript"> msketch_begin("/marvin",400,400); msketch_param("mol","ON\\C=C\\NCl"); msketch_end(); </script>
|
ChemAxon 7c2d26e5cf
08-04-2010 17:40:45