在IE7中document.getElementById('form').action=url会出错。 解决办法 document.getElementById('form').attributes['action'].value=url 这样就解决了。