代码中的第二个语句:
var $this = $(this).children('div.submenu1').children('a.subtile')[0],
title = $this.text(),
name = $this.attr('node').val;
产生了这个错误:
Uncaught TypeError: $this.text is not a function
当我在Chrome调试器中悬停在$this.text()
上时,我可以看到我想要放入title
中的值。如何修复这个错误?