prototype into jquery migration problem
i try to migrate prototype to jquery. i start with
if (visible) {
$(name + "_area").setStyle1({ display: 'block' });
}
else {
$(name + "_area").setStyle1({ display: 'none' });
}
and i chnage to
function SetAreaVisibility(visible, name) {
if (visible) {
$(#' + name + '_area').css('display', 'block');
}
else {
$(#' + name + '_area').css('display', 'none');
}
开发者_Go百科
which not working like i thing. is this correct code?
what is name+"area" ? if it's an id you'll have to write:
$('#'+name+'_area')
or
$('.'+name+'_area')
for classes. just like css.
精彩评论