Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Javascript misbehavior in Safari

Hi,

I have the following code on a .jsp page:

var molstruct = parent.responseframe.document.ansApplet.getMol("mrv");
alert('molstruct = \n' + molstruct
+ '\n + molstruct.indexOf(\'mrvAlias\') = '
+ molstruct.indexOf('mrvAlias'));

When I access this page in Safari 2.0.4 in MacOS 10.4.8, I get the following alert:

molstruct =
<?xml version="1.0" ?>
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray
atomID="a1"
elementType="Cl"
mrvAlias="C"
x2="-2.117500066757202"
y2="1.1549999713897705"
/>
<bondArray>
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>

+ molstruct.indexOf('mrvAlias') = -1

If I do the same in Netscape 7.2, the last line of the alert says:

+ molstruct.indexOf('mrvAlias') = 157

Any ideas why the standard Javascript String method indexOf() works in Netscape but not in Safari?

-- Bob

iBook, Mac OS X (10.4.8), Safari 2.0.4

Posted on Apr 11, 2007 8:31 PM

Reply

There are no replies.

Javascript misbehavior in Safari

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.