此示例中的顶部按钮在 IE 8 中不起作用。底部的按钮可以。我必须添加/更改此示例以使顶部按钮也可以在 IE8 中使用?
<html ng-app>
<head>
<script>
function form_controller($scope) {
$scope.my_submit = function() {
alert("Using angular");
document.my_form.method = document.my_form.method_x.value;
document.my_form.action = document.my_form.action_x.value;
alert(document.my_form.method);
alert(document.my_form.action);
alert("submitting");
document.my_form.submit();
}
}
function my_submit() {
document.my_form.method = document.my_form.method_x.value;
document.my_form.action = document.my_form.action_x.value;
alert(document.my_form.method);
alert(document.my_form.action);
alert("Using normal form : submitting");
document.my_form.submit();
return(false);
}
</script>
</head>
<body>
<form ng-controller="form_controller" name="my_form">
<input type="button" value="testing" ng-click="my_submit()"/><br/>
<input type="button" value="testing" onclick="my_submit()"/><br/>
<input type="hidden" name="method_x" value="post"/>
<input type="hidden" name="action_x" value="http://www.yahoo.com"/>
</form>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.js"></script>
</body>