คืออยากจะดึงค่าข้อมูลจาก class นะครับ ประมาณว่าผมเคยเหนใน jquery สามารถ get ค่าได้จาก class ประมาณ ('.c')
ใน gajax สามารถทำได้ป่าวครับ คือจะเอา get ทั้ง เว็บนะครับ
ใน gajax สามารถทำได้ป่าวครับ คือจะเอา get ทั้ง เว็บนะครับ
ดูบทความนะ
ลองทำดูแล้วครับประมาณนี้
หน้า html ผมมี <span class="price">{PRICE}</span>
ที่ js เขียนประมาณว่า
var rate_currency = function(e){
forEach(document.body.getElementsByTagName('span'), function() {
if (this.hasClass('currency')) {
alert(this);
}
});
};
มันฟ้อง error ว่า this.hasClass is not a function
ปล ทำผม gcms5 นะครับ
หน้า html ผมมี <span class="price">{PRICE}</span>
ที่ js เขียนประมาณว่า
var rate_currency = function(e){
forEach(document.body.getElementsByTagName('span'), function() {
if (this.hasClass('currency')) {
alert(this);
}
});
};
มันฟ้อง error ว่า this.hasClass is not a function
ปล ทำผม gcms5 นะครับ
ใช้ $G(this).hasClass() แทนครับ