recaptcha未在Firefox和Safari中显示



我在Firefox(VER 50.0.2)和Safari浏览器(VER 9.1)中遇到困难。它在IE和Chrome中表现良好。我使用的代码是Google Recaptcha文档中的示例代码。我将以下示例代码保存到HTML文件中(并将其命名为myrecaptcha.html)。我已经用自己的站点密钥替换了" my_own_site_key"。我试图用此链接显示" 127.0.0.1/myrecaptcha.html"。它在IE和Chrome中表现良好,但在Firefox和Safari中不显示。请帮忙。谢谢。

<html>
  <head>
    <title>reCAPTCHA demo: Simple page</title>
     <script src="https://www.google.com/recaptcha/api.js" async defer></script>
  </head>
  <body>
    <form action="?" method="POST">
      <div class="g-recaptcha" data-sitekey="my_own_site_key"></div>
      <br/>
      <input type="submit" value="Submit">
    </form>
  </body>
</html>

P.S。这是我在Chrome浏览器中看到的。但是我看不到Firefox。

经过几天的挣扎,我想我想到了为什么会发生。我正在公司的Intranet上运行Recpatcha。在我的FF中, *.google.com的证书显示为我公司发行的。因此,如果我在公司的Intranet上运行recaptcha代码,我将不会看到recaptcha。但是,如果我在互联网上运行recaptcha,我会看到它。因此,是我公司的安全策略阻止了Recaptcha的出现。

显然这是一个已知问题,带有窗口小部件的https:版本。这个演示在Firefox

中对我来说很好

https://secure.jotformpro.com/form/50145268709963

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="alternate" type="application/json+oembed" href="https://www.jotform.com/oembed/?format=json&amp;url=http%3A%2F%2Fwww.jotform.com%2Fform%2F50145268709963" title="oEmbed Form"><link rel="alternate" type="text/xml+oembed" href="https://www.jotform.com/oembed/?format=xml&amp;url=http%3A%2F%2Fwww.jotform.com%2Fform%2F50145268709963" title="oEmbed Form">
<meta property="og:title" content="Google - Recaptcha demo" >
<meta property="og:url" content="http://www.jotformpro.com/form/50145268709963" >
<meta property="og:description" content="Please click the link to complete this form.">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="HandheldFriendly" content="true" />
<title>Google - Recaptcha demo</title>
<link href="https://cdn.jotfor.ms/static/formCss.css?3.3.15949" rel="stylesheet" type="text/css" />
<link type="text/css" rel="stylesheet" href="https://cdn.jotfor.ms/css/styles/nova.css?3.3.15949" />
<link type="text/css" media="print" rel="stylesheet" href="https://cdn.jotfor.ms/css/printForm.css?3.3.15949" />
<style type="text/css">
    .form-label-left{
        width:150px !important;
    }
    .form-line{
        padding-top:12px;
        padding-bottom:12px;
    }
    .form-label-right{
        width:150px !important;
    }
    body, html{
        margin:0;
        padding:0;
        background:false;
    }
    .form-all{
        margin:0px auto;
        padding-top:20px;
        width:690px;
        color:#555 !important;
        font-family:"Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Verdana, sans-serif;
        font-size:14px;
    }
</style>
<script src="https://cdn.jotfor.ms/static/prototype.forms.js" type="text/javascript"></script>
<script src="https://cdn.jotfor.ms/static/jotform.forms.js?3.3.15949" type="text/javascript"></script>
<script src="https://js.jotform.com/vendor/postMessage.js?3.3.15949" type="text/javascript"></script>
<script src="https://js.jotform.com/WidgetsServer.js?v=1481065067325" type="text/javascript"></script>
<script type="text/javascript">
   JotForm.init(function(){
      setTimeout(function() {
          $('input_5').hint('ex: myname@example.com');
       }, 20);
    JotForm.clearFieldOnHide="disable";
    JotForm.onSubmissionError="jumpToFirstError";
   });
</script>
</head>
<body>
<form class="jotform-form" action="https://submit.jotformpro.com/submit/50145268709963/" method="post" name="form_50145268709963" id="50145268709963" accept-charset="utf-8">
  <input type="hidden" name="formID" value="50145268709963" />
  <div class="form-all">
    <ul class="form-section page-section">
      <li class="form-line" data-type="control_textbox" id="id_4">
        <label class="form-label form-label-left form-label-auto" id="label_4" for="input_4"> Name </label>
        <div id="cid_4" class="form-input jf-required">
          <input type="text" class=" form-textbox" data-type="input-textbox" id="input_4" name="q4_name" size="20" value="" />
        </div>
      </li>
      <li class="form-line jf-required" data-type="control_email" id="id_5">
        <label class="form-label form-label-left form-label-auto" id="label_5" for="input_5">
          E-mail
          <span class="form-required">
            *
          </span>
        </label>
        <div id="cid_5" class="form-input jf-required">
          <input type="email" class=" form-textbox validate[required, Email]" id="input_5" name="q5_email5" size="30" value="" />
        </div>
      </li>
      <li class="form-line jf-required" data-type="control_widget" id="id_6">
        <label class="form-label form-label-left form-label-auto" id="label_6" for="input_6">
          Recaptcha
          <span class="form-required">
            *
          </span>
        </label>
        <div id="cid_6" class="form-input jf-required">
          <div style="width:100%; text-align:Left;">
            <iframe onload="widgetFrameLoaded(6)" frameborder="0" scrolling="no" allowTransparency="true" data-type="iframe" class="custom-field-frame" id="customFieldFrame_6" src="" style="border:none;width:310px;height:85px;" data-width="310" data-height="85">
            </iframe>
            <div class="widget-inputs-wrapper">
              <input id="input_6" class="form-hidden form-widget widget-required " type="hidden" name="q6_recaptcha" value="" />
              <input id="widget_settings_6" class="form-hidden form-widget-settings" type="hidden" value="%5B%7B%22name%22%3A%22theme%22%2C%22value%22%3A%22light%22%7D%2C%7B%22name%22%3A%22fallback%22%2C%22value%22%3A%22false%22%7D%5D" data-version="2" />
            </div>
            <script type="text/javascript">
            setTimeout(function()
{
  var _cFieldFrame = document.getElementById("customFieldFrame_6");
  _cFieldFrame.src = "//dev-data-widgets.jotform.io/kenneth/noCaptchaRecaptcha/?qid=6&ref=" + encodeURIComponent(window.location.protocol + "//" + window.location.host);
  _cFieldFrame.addClassName("custom-field-frame-rendered");
}, 0);
            </script>
          </div>
        </div>
      </li>
      <li class="form-line" data-type="control_button" id="id_2">
        <div id="cid_2" class="form-input-wide">
          <div style="margin-left:156px;" class="form-buttons-wrapper">
            <button id="input_2" type="submit" class="form-submit-button" data-component="button">
              Submit
            </button>
          </div>
        </div>
      </li>
      <li style="display:none">
        Should be Empty:
        <input type="text" name="website" value="" />
      </li>
    </ul>
  </div>
  <input type="hidden" id="simple_spc" name="simple_spc" value="50145268709963" />
  <script type="text/javascript">
  document.getElementById("si" + "mple" + "_spc").value = "50145268709963-50145268709963";
  </script>
  <script src="https://cdn.jotfor.ms/js/widgetResizer.js?REV=3.3.15949" type="text/javascript"></script>
</form></body>
</html>

最新更新