我需要你的幫助。 如何在名稱空間中使用變量? 事情是這樣的:jQuery:命名空間,在另一個使用變量
所有的$.MyScript = {
script: $("script")
, dataID: script.data("id")
, dataColor: script.data("color")
, Alerting: function alerting(){
alert(dataColor);
}
}
$.Myscript.Alerting;
好的,謝謝你dfsq – 2013-03-03 10:08:11
@JohnSmit標記您的提問。[接受這個答案](http://meta.stackexchange.com/a/5235/165614)作爲解決你的問題的解決。只需點擊該答案左上方的勾號(在投票下面)。 – Shef 2013-03-03 10:13:45