> For the complete documentation index, see [llms.txt](https://javascriptuse.gitbook.io/javascript/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://javascriptuse.gitbook.io/javascript/recaptcha-javascript-ok.md).

# reCAPTCHA javascript (ok)

<figure><img src="/files/vsSTG2saMmeHOGeQtPl1" alt=""><figcaption></figcaption></figure>

<https://www.google.com/recaptcha/admin/site/603446135/setup>

```php
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/sweetalert2@11.4.33/dist/sweetalert2.min.css">
  <script src="https://www.google.com/recaptcha/api.js?onload=showSweetAlertRecaptcha"></script>
  <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="script.js"></script>
  <title>Document</title>
  <style>
    select:empty {
      display: none !important;
    }
  </style>
</head>
<body>
  <script type="text/javascript">
    function showSweetAlertRecaptcha() {
      Swal.fire({
        title: 'SweetAlert2 + Recaptcha',
        html: '<div id="recaptcha"></div>',
        willOpen: function() {
          grecaptcha.render('recaptcha', {
            'sitekey': '6Ld32_cjAAAAAFr7j8I4Jme1Z7JhxL3f_HSJ560E'
          });
        },
        preConfirm: function() {
          if (grecaptcha.getResponse().length === 0) {
            Swal.showValidationMessage(`Please verify that you're not a robot`)
          }
        }
      })
    }
  </script>
</body>
</html>

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://javascriptuse.gitbook.io/javascript/recaptcha-javascript-ok.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
