0

我正在尝试集成 google recaptcha,但它没有在浏览器上加载 req iframe 并且什么也没显示。

我的contact.html:

<form ng-submit="processContactForm(contactForm.$valid)" name="contactForm"
       method="POST" novalidate style="width: 100%">
    <div class="form-group row">
        <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 res-padding-bottom-15" ng-class="{ 'has-error' : contactForm.firstName.$invalid && !contactForm.firstName.$pristine }">
            <input ng-model="contactFormData.firstName" name="firstName" style="border-radius: 0" type="text" class="form-control" id="name" placeholder="{{'fnph' | translate}}" required>
        </div>
        <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
            <input ng-model="contactFormData.lastName" name="lastName" style="border-radius: 0" type="text" class="form-control" id="contact" placeholder="{{'lnph' | translate}}" required>
        </div>
    </div>
    <div class="form-group row">
        <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 res-padding-bottom-15">
            <input ng-model="contactFormData.email" name="email" style="border-radius: 0" type="email" class="form-control" id="email" placeholder="{{'emailph' | translate}}" required>
        </div>
        <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12" >
            <input ng-model="contactFormData.number" name="number" ng-minlength="10" ng-maxlength="10" style="border-radius: 0" type="tel" class="form-control" id="contact" placeholder="{{'cnph' | translate}}" required>
        </div>
    </div>
    <div class="form-group row">
        <div class="col-12">
            <input ng-model="contactFormData.subject" name="subject" style="border-radius: 0" type="text" class="form-control" id="contact" placeholder="{{'subph' | translate}}">
        </div>
    </div>
    <div class="form-group row">
        <div class="col-12">
            <textarea ng-model="contactFormData.message" name="message" style="border-radius: 0" type="text" class="form-control" id="message" placeholder="{{'msgph' | translate}}"></textarea>
        </div>
    </div>
    <div class="form-group row">
        <div class="col-12">
            <!-- <div class="g-recaptcha" id="rcaptcha"  data-sitekey="site key"></div>
            <span id="captcha" style="color:red" /></span> -->
            <div id="recaptcha" class="g-recaptcha" data-sitekey="site key"></div>

        </div>
    </div>
    <div class="col-12" style="padding: 0;">
        <button style="border-radius: 0" class="btn btn-md btn-primary" type="submit" ng-disabled="contactForm.$invalid">{{'sendMsgBtn' | translate}}</button>
    </div>                            
</form> 

我在以下<head>块中添加了以下脚本index.html

<script src='https://www.google.com/recaptcha/api.js'></script>

<div class="form-group row">
    <div class="col-12">
        <div id="recaptcha" class="g-recaptcha" data-sitekey="site key">
        </div> 
    </div> 
</div>
4

0 回答 0