Home  >  Article  >  Web Front-end  >  What should I do if the jquery object does not support on attributes or methods?

What should I do if the jquery object does not support on attributes or methods?

藏色散人
藏色散人Original
2020-12-22 10:41:541892browse

The jquery object does not support the on attribute or method because "document.write" rewrites the entire web page. The solution is to use jQuery's ".html and .text" to print to a certain tag.

What should I do if the jquery object does not support on attributes or methods?

The operating environment of this tutorial: Windows 7 system, jquery3.2.1 version. This method is suitable for all brands of computers.

Related recommendations: "jquery Video Tutorial"

jquery object does not support this property or method?

Originally there was no problem calling $ and jQuery, and the console could also print out $ and jQuery. However, after calling document.write, an error occurred:

$ 对象不支持此属性或方法
控制台也打印不出$了,报同样的错。

Cause: document.write reset the entire web page. After writing, the $ will of course disappear. To print, you can only print the text into a certain label.

JQuery’s .html .text can be used to print to a certain tag.

Note: Versions before jquery 1.7 do not support on. If you want to continue to support the on attribute or method, please use jQuery 1.7 or later.

The above is the detailed content of What should I do if the jquery object does not support on attributes or methods?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn