我需要一些帮助,这一点,我试图生成一些HTML与JavaScript,但总是得到相同的,这是我的javascript代码我总是得到相同的HTML
var datePickerHTML = function(id){
var html = "<div id='"+id+"' class='ui-datepicker'>";
html += "Hello World, my ID is "+id;
html += "</div>";
return html;
}
var UhmaCalendar = function(config){
var dpID = 'dp'+config.inputField;
this.dpID = dpID;
jQuery('#'+config.inputField).after(function(){
return datePickerHTML(dpID);
});
jQuery('#'+config.btn).click(function(){
jQuery('#'+dpID).toggle('slow');
}
}
现在,在我的html我写
UhmaCalendar({
btn : 'countday_pick',
inputField : 'countday'
});
UhmaCalendar({
btn : 'sartday_pick',
inputField : 'startday'
});
这是2 diferent输入和按键,但他们总是表现出与相同的文本同一div和ID我检查HTML任意不等阶萤火虫,只创建一个DIV,广告,我想2格与不同的ID 我也尝试与
new UhmaCalendar({
btn : 'sartday_pick',
inputField : 'startday'
});
,但都是一样的,我在做什么错在这里 感谢
引用的代码中有几个错误导致它不可解析。你得到的任何答案都可能因为它而有点偏离目标。例如,'jQuery('#'dbID)'是一个语法错误(并且还有几个非语法错误)。 – 2010-09-06 15:56:04
您的其他八个问题都没有收到可接受的答案?没有? – 2010-09-06 15:56:35
是的,我收到了非常好的回复,但是,这必须通过我的问题来解决吗? – 2010-09-06 16:22:44