简体   繁体   English

我收到jQuery [object Object]错误

[英]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.

相关问题 jQuery选择器在单击提交按钮后未显示复选框的选定值,并且出现错误[object Object] - jQuery selector not showing the selected value of checkbox after click on submit button and i am getting error[object Object] 我收到“Object Required”错误消息 - I am getting “Object Required” error message 为什么我在 UI 中没有收到验证 Flash 消息,我收到 flash 错误,如下所示 [object Object],[object Object],[object Object] - Why I am not getting Validation Flash Message in UI, I gets flash error like this [object Object],[object Object],[object Object] 为什么我变得未定义不是Vue JS中的对象错误 - Why am I getting undefined is not an object error in vue js 为什么我的对象方法出现“不是函数错误”? - why am I getting “is not a function error” for my object method? 为什么我的JavaScript Date对象出现此错误? - Why am I getting this error for JavaScript Date object? 为什么我在IE8中收到“对象预期”错误? - Why am I getting an “object expected” error in IE8? 尝试编写Javascript对象时出现意外错误 - I am getting an unexpected error when trying to write a Javascript object 在带有数组的对象上使用它时,为什么会出现$ parse错误? - Why I am getting $parse error when use it on object with array? 为什么我在IE中收到此“空或非对象”错误? - Why am I getting this “null or not an object” error in IE?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM