{"id":536,"date":"2025-10-17T17:27:43","date_gmt":"2025-10-17T15:27:43","guid":{"rendered":"https:\/\/staging.creativosmp.com\/?page_id=536"},"modified":"2025-10-17T17:30:55","modified_gmt":"2025-10-17T15:30:55","slug":"domains","status":"publish","type":"page","link":"https:\/\/staging.creativosmp.com\/?page_id=536","title":{"rendered":"Domains"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"536\" class=\"elementor elementor-536\">\n\t\t\t\t<div class=\"elementor-element elementor-element-793712e e-flex e-con-boxed e-con e-parent\" data-id=\"793712e\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-4b72178 elementor-widget elementor-widget-html\" data-id=\"4b72178\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<div id=\"domain-checker\" style=\"max-width: 400px; margin: 20px auto; font-family: sans-serif;\">\n  <h3>Verifica si tu dominio est\u00e1 disponible<\/h3>\n  <input type=\"text\" id=\"domain-input\" placeholder=\"ejemplo.com\" style=\"width: 100%; padding: 8px; margin-bottom: 10px;\">\n  <button id=\"check-btn\" style=\"width: 100%; padding: 10px; background-color: #0073e6; color: white; border: none; cursor: pointer;\">Verificar<\/button>\n  <p id=\"result\" style=\"margin-top: 10px; font-weight: bold;\"><\/p>\n<\/div>\n\n<script>\n  const checkBtn = document.getElementById('check-btn');\n  const domainInput = document.getElementById('domain-input');\n  const result = document.getElementById('result');\n\n  checkBtn.addEventListener('click', async () => {\n    const domain = domainInput.value.trim();\n    if(!domain) {\n      result.textContent = \"Ingresa un dominio.\";\n      result.style.color = \"red\";\n      return;\n    }\n\n    result.textContent = \"Verificando...\";\n    result.style.color = \"black\";\n\n    try {\n      const response = await fetch('<?php echo admin_url(\"admin-ajax.php\"); ?>', {\n        method: 'POST',\n        headers: { 'Content-Type': 'application\/x-www-form-urlencoded' },\n        body: `action=check_domain&domain=${domain}`\n      });\n\n      const data = await response.json();\n\n      if(data.available) {\n        result.textContent = `\u2705 \u00a1El dominio ${domain} est\u00e1 disponible!`;\n        result.style.color = \"green\";\n      } else {\n        result.textContent = `\u274c Lo sentimos, ${domain} no est\u00e1 disponible.`;\n        result.style.color = \"red\";\n      }\n\n      if(data.error){\n        result.textContent = \"Error: \" + data.error;\n        result.style.color = \"red\";\n      }\n\n    } catch(err) {\n      console.error(err);\n      result.textContent = \"Error al verificar el dominio.\";\n      result.style.color = \"red\";\n    }\n  });\n<\/script>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Verifica si tu dominio est\u00e1 disponible Verificar<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-536","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/staging.creativosmp.com\/index.php?rest_route=\/wp\/v2\/pages\/536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.creativosmp.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/staging.creativosmp.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/staging.creativosmp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.creativosmp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=536"}],"version-history":[{"count":4,"href":"https:\/\/staging.creativosmp.com\/index.php?rest_route=\/wp\/v2\/pages\/536\/revisions"}],"predecessor-version":[{"id":541,"href":"https:\/\/staging.creativosmp.com\/index.php?rest_route=\/wp\/v2\/pages\/536\/revisions\/541"}],"wp:attachment":[{"href":"https:\/\/staging.creativosmp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}