Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
320 views
in Technique[技术] by (71.8m points)

javascript - reCaptcha appears on mobile device but not on desktop/laptop

I have come through a weird issue. Normally it's the other way around. My recaptcha appears on mobile device browser but does not appear in any browsers on my computer.

Below is my code. I'm using angular-recaptcha for my site.

<div class="row">
   <div class="col-xs-12">
        <div class="form-group">
            <div vc-recaptcha ng-model="registration.recaptcha" key="'therecaptchapublickey'"></div>
         </div>
    </div>
</div>

Below is my angular code. var app = angular.module('myapp',['ui.toggle','vcRecaptcha']);

app.controller('checkoutCtrl', function($scope, $http, $timeout){
   if($scope.registration.recaptcha != null || $scope.registration.recaptcha != undefined){
                $scope.emailmatch = 1;
                console.log('recaptcha ok');
            } else {
                $scope.emailmatch = 0;
                console.log('recaptcha invalid');
            }
});

I do not get any errors on the console or anything. The recaptcha is simply not displayed in any of the browsers. Clearing cache didn't help at all. But the captcha is displayed on mobile devices.

Any help is greatly appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It turns out that this happens because I am loading the recaptcha.js from google as well as the angular-recaptcha.js file. Seems like the angular-recaptcha.js loads the recaptcha so removing the google recaptcha.js did the trick.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...