Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 角度部分内的Recaptcha(外部脚本)_Javascript_Angularjs_Recaptcha - Fatal编程技术网

Javascript 角度部分内的Recaptcha(外部脚本)

Javascript 角度部分内的Recaptcha(外部脚本),javascript,angularjs,recaptcha,Javascript,Angularjs,Recaptcha,请看这张照片 有两个recaptcha代码块,一个在partial_list.html中,另一个在index.html中。部分中的一个没有显示,我想可能是因为angular阻止加载外部脚本。我怎样才能使它在部分内部工作 编辑 作为注释,请参见下面的代码 index.html: partial_list.html 请在您的实际问题中发布一些代码-1不确定,但我猜您会更幸运地编写一个指令来处理在Recaptcha对象@DoorKnold上运行适当方法的操作。请查看内联代码。您可以使用来自的vcRec

请看这张照片

有两个recaptcha代码块,一个在partial_list.html中,另一个在index.html中。部分中的一个没有显示,我想可能是因为angular阻止加载外部脚本。我怎样才能使它在部分内部工作

编辑 作为注释,请参见下面的代码

index.html: partial_list.html
请在您的实际问题中发布一些代码-1不确定,但我猜您会更幸运地编写一个指令来处理在Recaptcha对象@DoorKnold上运行适当方法的操作。请查看内联代码。您可以使用来自的vcRecaptcha。您应该真正利用这些指令。我目前使用的指令使用它自己的提供程序,用Angular语言实现recaptcha API。你可以在这里读到:我在这里详细介绍了这一点
<!DOCTYPE HTML>
<html ng-app="myApp">
<head>
    <meta charset="utf-8">
    <script type="text/javascript" src="http://code.angularjs.org/1.0.1/angular-1.0.1.js"></script>
    <script type="text/javascript" src="app.js"></script>
    <script type="text/javascript" src="controllers.js"></script>
    <link rel="stylesheet" href="bootstrap.min.css">
</head>
<body>
<div class="container">
    <div ng-controller="FriendCtrl">
        <div ng-view></div>
    </div>
</div>

<h2>in index.html</h2>
<form name="editForm" class="form-horizontal" ng-submit="saveFriend()">
  <script type="text/javascript"
                src="http://www.google.com/recaptcha/api/challenge?k=6LfRgOMSAAAAAPRKoWemiQCZdhWBy2xgfWsZ_xUe">
        </script>
        <noscript>
            <iframe src="http://www.google.com/recaptcha/api/noscript?k=6LfRgOMSAAAAAPRKoWemiQCZdhWBy2xgfWsZ_xUe"
                    height="300" width="500" frameborder="0"></iframe><br>
            <textarea name="recaptcha_challenge_field" rows="3" cols="40">
            </textarea>
            <input type="hidden" name="recaptcha_response_field"
                   value="manual_challenge">
        </noscript>
</form>

</body>
</html>
var app = angular.module('myApp', []);

app.config(['$routeProvider', function($routeProvider) {
    $routeProvider.when('/edit/:friendId', {
        templateUrl: 'partial_edit.html',
        controller: FriendEditCtrl
    });
    $routeProvider.when('/list', {
        templateUrl: 'partial_list.html',
        controller: FriendListCtrl
    });
    $routeProvider.otherwise({ redirectTo: '/list' });
}]);
<h2>In partial</h2>

<form name="editForm" class="form-horizontal" ng-submit="saveFriend()">
  <script type="text/javascript"
                src="http://www.google.com/recaptcha/api/challenge?k=6LfRgOMSAAAAAPRKoWemiQCZdhWBy2xgfWsZ_xUe">
        </script>
        <noscript>
            <iframe src="http://www.google.com/recaptcha/api/noscript?k=6LfRgOMSAAAAAPRKoWemiQCZdhWBy2xgfWsZ_xUe"
                    height="300" width="500" frameborder="0"></iframe><br>
            <textarea name="recaptcha_challenge_field" rows="3" cols="40">
            </textarea>
            <input type="hidden" name="recaptcha_response_field"
                   value="manual_challenge">
        </noscript>
</form>
function FriendCtrl($scope) {
}

function FriendListCtrl($scope) {
}

function FriendEditCtrl($scope, $routeParams, $location) {

}