0

我在 IE8 中遇到以下错误

Object doesn't support this property or method 

我在下一行收到此错误

fieldName.form.action = 'some action url';

我已经提醒 fieldName 如下

alert(typeof(fieldName));

它提醒“对象”

有人对此有任何想法吗?

4

3 回答 3

1

通过替换以下行解决了问题

fieldName.form.action = 'some action url';

fieldName.form.setAttribute('action','some url');

这里得到答案

于 2012-09-03T10:22:17.660 回答
0

试试这个代码

document.form_name.action='some url';
于 2012-09-03T07:24:49.017 回答
0
document.getElementById('IdOfForm').action='some action URL';
于 2012-09-03T07:33:17.540 回答