开发者

returns [object DOMWindow] instead of user input

开发者 https://www.devze.com 2023-04-02 08:54 出处:网络
ive been writing a w开发者_运维问答ebsite for about 3 days and i ran into a problem. i have a textfield that changes a span on the page using javascript, and this works fine on firefox and ie. but on

ive been writing a w开发者_运维问答ebsite for about 3 days and i ran into a problem. i have a textfield that changes a span on the page using javascript, and this works fine on firefox and ie. but on google chrome it just returns "[object DOMWindow]" no mater what i change. the code is way to long to post so i would just like to ask if anyone knows what causes this?

returns [object DOMWindow] instead of user input


My best guess without seeing code would be you're using the this keyword, which behaves differently in different browsers. this refers to the window element any time that it is not in a different context. Check to make sure you are either using a library that normalizes the this keyword (like jQuery) or are explicitly getting the text field every time.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号