當我運行這個功能:爲什麼jQuery不接受這個字符串?
onUnCheck: function(el) {
var thenames = "icon-"+el.find("label:first").text().replace(/ /g,'').toLowerCase();
alert(thenames);
$("'."+thenames+"'").hide("fast");
}
我生成的字符串。我可以在alert()中看到它確實是正確的字符串。例如:
icon-jira
但是,當我傳遞字符串作爲jQuery選擇器它不起作用。
我知道該函數的邏輯是合理的,因爲粘貼alert()的結果會使其工作。
爲什麼jQuery不接受我的字符串?
你是對的:-)謝謝 – 2010-09-21 17:31:48