on 06-17-2009 4:33 PM
Hello all.
This is a strange one. Using MII v12. When setting parameters for a SQL query from Javascript, the query executes properly on IE7 but generates errors on IE6. The errors are JDBC errors having to do with "Conversion failed when converting datetime from character string." and "Error converting data type varchar to numeric." I don't get any browser errors, only Java errors and NetWeaver log entries.
What is the source of this data typing error?
There are some differences in how IE6 and IE7 parse javascript. without seeing your code its hard to see what the issue is.
May I suggest using an applet do the dateformatting for you?
formatDate(String strDate, String fromFormat, String toFormat)
That way you take it out of the hands of IE's javascript parser.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well the error you are getting is a data formatting issue (I assume you are trying to pass a datetime to SQL) so SQL is not liking what you are sending it. As a test why not look at what the output of your js function is. say in an alert box or text form. That way you can compare what IE6 puts out vs IE7.
Hi, Sparks.
Actually, IE was always an anomaly when it came to proper typing of objects in Javascript, so it let you get away with things that really shouldn't work.
In general, you should use the Number Javascript type for number properties (e.g. setRowCount(), setXAxisMinRange(), etc) and strings for just about everything else. If I recall, Javascript will handle most of the type conversions to a String property, but not necessarily to a Number property.
You can use the parseInt() and parseFloat() methods to convert from strings to numbers in Javascript.
In general, it's a good practice to be "type aware" in your Javascript code anyway, and this will ensure that it runs in other browsers and future browsers.
Rick
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.