[英]I am getting jQuery [object Object] error
Hi I getting frustrated with this [object Object] thing. 嗨,我对此[object Object]感到沮丧。 I have googled for quite a while today, and haven't found anything to solve my thing.
我今天在Google上搜索了很长时间,但没有找到任何解决方法。 this the part of the code that is returning this
[object Object]
这是返回此
[object Object]
的代码部分
Thank you very much for your answer, time and consideration. 非常感谢您的答复,时间和考虑。 :)
:)
When you call .val
with an argument, it returns a jQuery object. 当您使用参数调用
.val
时,它将返回一个jQuery对象。 Your variables (lname, fname, mname) are objects. 您的变量(lname,fname,mname)是对象。 When you try to set the value of an element to an object, JavaScript will automatically convert it to a string.
当您尝试将元素的值设置为对象时,JavaScript会自动将其转换为字符串。
alert() also requires a string, so giving it an object produces the same result. alert()也需要一个字符串,因此给它一个对象会产生相同的结果。
alert({})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.