如果没有获得内部错误500,则无法检查变量是否为空

时间:2012-09-17 19:55:57

标签: javascript smarty

对象在控制台中显示为null:

console.log(document.getElementById("id"+"{$id_attribute}"));

给出null。 编辑:{$ id_attribute}是聪明的(服务器语言),并在.tpl文件中编码。 但后来我尝试检查它是否为空:

if (document.getElementById("id"+"{$id_attribute}") == null) {
    alert('something wrong');
}

我收到内部错误500,我的页面无法正确显示....

对我做错了什么的想法?

谢谢。

0 个答案:

没有答案