javascript - Replace error in IE10 but not in IE8 or Firefox -


i have form written in cold fusion. when test form in ie8 or firefox, have no problems. when test form in ie10, gives following error:

webpage error details

user agent: mozilla/4.0 (compatible; msie 7.0; windows nt 6.1; wow64; trident/6.0; slcc2; .net clr 2.0.50727; .net clr 3.5.30729; .net clr 3.0.30729; media center pc 6.0; .net4.0c; infopath.2; .net4.0e) timestamp: wed, 8 may 2013 18:15:47 utc

message: object doesn't support property or method 'replace'
line: 7
char: 10560
code: 0
uri: http://www.mysite.com/cfide/scripts/ajax/ext/adapter/yui/ext-yui-adapter.js

when @ code surrounding character 10560 in js file, shows

 {return this.replace(a,"")} 

why happening? ie10 buggy? (no, not rhetorical question.)

this not string.

to make sure work, can change from

this.replace(a,"") 

to

this.tostring().replace(a,"")` 

or use .tostring() in var when it's still on control, don't need change yui .js (bad because if need update someday, might forget , have problem again).

by way, if a not string, converted string no need worry it.

see this: http://jsfiddle.net/3cd4d/ (look @ dev tools' console)


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -