{"id":5210,"date":"2021-09-27T02:00:00","date_gmt":"2021-09-27T00:00:00","guid":{"rendered":"https:\/\/alvarotrigo.com\/epa\/javascript-alert\/"},"modified":"2024-02-08T00:31:17","modified_gmt":"2024-02-07T23:31:17","slug":"javascript-alert","status":"publish","type":"post","link":"https:\/\/alvarotrigo.com\/blog\/javascript-alert\/","title":{"rendered":"JavaScript Alert [Examples And Usage]"},"content":{"rendered":"<p><strong>The JavaScript <code>alert()<\/code> function is a function available on the global <code>window<\/code> object. It commands the browser to display a modal dialog with a message and an &#8220;OK&#8221; button.<\/strong><\/p>\n<p>Here&#8217;s a basic example of usage:<\/p>\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">alert(<span class=\"hljs-string\">\"Hello world!\"<\/span>);\n\n<span class=\"hljs-comment\">\/\/ Which is quivalent to:<\/span>\n<span class=\"hljs-built_in\">window<\/span>.alert(<span class=\"hljs-string\">\"Hello world\"<\/span>);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Note that, when executed, the <code>alert<\/code> function will get the focus and prevent the user from interacting with the reset of the website until the modal gets dismisssed.<\/p>\n<\/blockquote>\n<h2 class=\"wp-block-heading\" id=\"examples-using-alert\">Examples using alert<\/h2>\n<h3 class=\"wp-block-heading\" id=\"1.-alert-message-on-click\">1. Alert message on click<\/h3>\n<p>A very common use case for the <code>alert<\/code> fuction is to use it when filling a form and then trying to submit it by clicking a button.<\/p>\n<p>Let&#8217;s say we want to make sure the user is over 18 years old when filling the following form:<\/p>\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">form<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\">\"myForm\"<\/span> <span class=\"hljs-attr\">action<\/span>=<span class=\"hljs-string\">\"\"<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">label<\/span> <span class=\"hljs-attr\">for<\/span>=<span class=\"hljs-string\">\"age\"<\/span>&gt;<\/span>Age<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">label<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"number\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\">\"age\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"age\"<\/span> \/&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"submit\"<\/span>&gt;<\/span>Submit<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">form<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>All we have to do is attach an event listener to the button, checking for the value of the input field and then displaying the modal with the <code>alert<\/code> function of JavaScript:<\/p>\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">var<\/span> checkAge = <span class=\"hljs-function\">(<span class=\"hljs-params\">e<\/span>) =&gt;<\/span> {\n    <span class=\"hljs-keyword\">if<\/span>(<span class=\"hljs-built_in\">document<\/span>.querySelector(<span class=\"hljs-string\">'#age'<\/span>).value &lt; <span class=\"hljs-number\">18<\/span>){\n    \n        <span class=\"hljs-comment\">\/\/ Preventing the submit of the form<\/span>\n        e.preventDefault();\n        \n        <span class=\"hljs-comment\">\/\/ Displaying the modal window<\/span>\n        alert(<span class=\"hljs-string\">\"You have to be older 18!\"<\/span>);\n    }\n};\n\n<span class=\"hljs-comment\">\/\/ Listening to the click event on the button<\/span>\n<span class=\"hljs-built_in\">document<\/span>.querySelector(<span class=\"hljs-string\">'button'<\/span>).addEventListener(<span class=\"hljs-string\">'click'<\/span>, checkAge);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_powQyNN\" data-src=\"\/\/codepen.io\/anon\/embed\/powQyNN?height=450&amp;theme-id=1&amp;slug-hash=powQyNN&amp;default-tab=js,result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed powQyNN\" title=\"CodePen Embed powQyNN\" class=\"cp_embed_iframe lazyload\" style=\"width:100%;overflow:hidden\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" data-load-mode=\"1\">CodePen Embed Fallback<\/iframe><\/div>\n\n<h3 class=\"wp-block-heading\" id=\"2.-alert-box-before-closing-the-window\">2. Alert box before closing the window<\/h3>\n<p>It&#8217;s also a common practise in websites that require saving changes to display an <strong>alert message<\/strong> when the user tries to close the browser&#8217;s window or tab.<\/p>\n<p>To do this, we have to first detect when the user is about to close the window. We can achieve this in two different ways, but it&#8217;s usually recommended to use event listeners when possible.<\/p>\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-comment\">\/\/ Using event listeners<\/span>\n<span class=\"hljs-built_in\">window<\/span>.addEventListener(<span class=\"hljs-string\">\"beforeunload\"<\/span>, showDialog);\n\n<span class=\"hljs-comment\">\/\/ Overwriting the window default property function<\/span>\n<span class=\"hljs-built_in\">window<\/span>.onbeforeunload = showDialog;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Now all we have to do is show them a dialog. But in this case, we won&#8217;t be using the <code>alert<\/code> function for this scenario.<\/p>\n<p>Unfortunately we can not customise the message that gets displayed on the dialog anymore. We still have to return a text for old browsers compatibility, but the message will most likely not get displayed on modern browsers. They&#8217;ll show a default message telling the user that changes won&#8217;t get saved.<\/p>\n<p>So, here&#8217;s how we tell the browser we want to show a message, but returning a string on the event function:<\/p>\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">var<\/span> showDialog = <span class=\"hljs-function\">(<span class=\"hljs-params\">e<\/span>) =&gt;<\/span> {\n    <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-string\">'Dialog text here.'<\/span>;\n};\n<span class=\"hljs-built_in\">window<\/span>.addEventListener(<span class=\"hljs-string\">\"beforeunload\"<\/span>, showDialog);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h3 class=\"wp-block-heading\" id=\"3.-alert-box-on-page-load\">3. Alert box on page load<\/h3>\n<p>In some very specific cases, websites might want to show an alert message on page load. To do this all we need to do is fire the alert message on the <code>&lt;head&gt;<\/code> section of our HTML. This way, the alert will be shown before loading any elements on the page.<\/p>\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">&lt;head&gt;\n  <span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span>&gt;<\/span><span class=\"actionscript\">\n    alert(<span class=\"hljs-string\">\"Displayed before page loads\"<\/span>);\n  <\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span><\/span>\n&lt;<span class=\"hljs-regexp\">\/head&gt;\n&lt;body&gt;\n Your page content.\n&lt;\/<\/span>body&gt;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h3 class=\"wp-block-heading\" id=\"4.-alert-message-using-a-variable\">4. Alert message using a variable<\/h3>\n<p>Using a variable to display different messages based on its content can also be done quite easily. Simply pass the variable to the <code>alert<\/code> method instead of a string text.<\/p>\n<p>Here&#8217;s an example:<\/p>\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">var<\/span> myVariable = <span class=\"hljs-string\">'I love alert boxes!!'<\/span>;\nalert(myVariable);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h3 class=\"wp-block-heading\" id=\"5.-alert-a-message-requiring-confirmation\">5. Alert a message requiring confirmation<\/h3>\n<p>Perhaps you want to show an alert that requires the visitors confirmation and that allows them too also cancel or ignore it by displaying a &#8220;Cancel&#8221; and an &#8220;OK&#8221; buttons. For these cases we will use the <code>confirm<\/code> function, which can be seen as a variant of the <code>alert<\/code> function.<\/p>\n<p>The <code>confirm<\/code> function will just add a &#8220;Cancel&#8221; button on top of the &#8220;OK&#8221; one added by the <code>alert<\/code> method.<\/p>\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">confirm(<span class=\"hljs-string\">'Do you want to continue?'<\/span>);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>We can catch the visitor&#8217;s decision by checking the result of the method. It will be <code>true<\/code> if the visitor clicks on &#8220;OK&#8221; and <code>false<\/code> otherwise.<\/p>\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">if<\/span>(confirm(<span class=\"hljs-string\">\"Do you want to continue?\"<\/span>)){\n    <span class=\"hljs-comment\">\/\/ continue heree    <\/span>\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_bGRQpxe\" data-src=\"\/\/codepen.io\/anon\/embed\/bGRQpxe?height=450&amp;theme-id=1&amp;slug-hash=bGRQpxe&amp;default-tab=js,result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed bGRQpxe\" title=\"CodePen Embed bGRQpxe\" class=\"cp_embed_iframe lazyload\" style=\"width:100%;overflow:hidden\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" data-load-mode=\"1\">CodePen Embed Fallback<\/iframe><\/div>\n\n<h3 class=\"wp-block-heading\" id=\"6.-alert-a-message-showing-input-field\">6. Alert a message showing input field<\/h3>\n<p>In some occassions we might want to capture the user input directly on the alert message. In this cases we will also move away from the <code>alert<\/code> function and use the alternative function <code>prompt<\/code>. This function creates the same dialog box but adds a text field to it and the &#8220;Cancel&#8221; button too.<\/p>\n<p>It admits twoo parameters. The first one is the text to show on the dialog (for the input) and the second one is the default value for the input (if any).<\/p>\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-comment\">\/\/ Showing a dialog box with a text input containing \"Steve\"<\/span>\nprompt(<span class=\"hljs-string\">\"Enter your name, please:\"<\/span>, <span class=\"hljs-string\">\"Steve\"<\/span>);\n\n<span class=\"hljs-comment\">\/\/ Showing a dialog box with ab empty text input.<\/span>\nprompt(<span class=\"hljs-string\">\"Enter your name, please:\"<\/span>);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_Rwgqaeb\" data-src=\"\/\/codepen.io\/anon\/embed\/Rwgqaeb?height=450&amp;theme-id=1&amp;slug-hash=Rwgqaeb&amp;default-tab=js,result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed Rwgqaeb\" title=\"CodePen Embed Rwgqaeb\" class=\"cp_embed_iframe lazyload\" style=\"width:100%;overflow:hidden\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" data-load-mode=\"1\">CodePen Embed Fallback<\/iframe><\/div>\n\n<h3 class=\"wp-block-heading\" id=\"7.-alerts-with-custom-styles\">7. Alerts with custom styles<\/h3>\n<p>In order to use your own custom alert modals we&#8217;ll have to make use of JavaScript and CSS. The easiest, fastest and probably most reliable way to do it is by using external plugins instead of doing it by yourself.<\/p>\n<p>One of the most used ones is <a href=\"https:\/\/sweetalert2.github.io\/\" target=\"_blank\" rel=\"noopener nofollow\"><code>SweetAlert2<\/code><\/a>, or even its predecesor SweetAlert.<\/p>\n<p>Here&#8217;s an example of how a confirm alert dialog looks like when using this component:<\/p>\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">var<\/span> showConfirm = <span class=\"hljs-function\">(<span class=\"hljs-params\">e<\/span>) =&gt;<\/span> {\n  e.preventDefault();\n\n  Swal.fire({\n    <span class=\"hljs-attr\">title<\/span>: <span class=\"hljs-string\">'Error!'<\/span>,\n    <span class=\"hljs-attr\">text<\/span>: <span class=\"hljs-string\">'Do you want to continue'<\/span>,\n    <span class=\"hljs-attr\">confirmButtonText<\/span>: <span class=\"hljs-string\">'Yeap!'<\/span>\n  });\n};\n\n<span class=\"hljs-built_in\">document<\/span>.querySelector(<span class=\"hljs-string\">'button'<\/span>).addEventListener(<span class=\"hljs-string\">'click'<\/span>, showConfirm);\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>As you can see there aren&#8217;t huge changes in our code and the usage is quite straight away.<\/p>\n<p>You can check more alert examples using this component on <a href=\"https:\/\/sweetalert2.github.io\/#examples\" target=\"_blank\" rel=\"noopener nofollow\">their website<\/a>.<\/p>\n<p>There are other dialog boxes plugins out there, so feel free to choose the one that fits your needs.<\/p>\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Do you know you can also create <a href=\"https:\/\/alvarotrigo.com\/blog\/css-alerts\/\">alerts with CSS<\/a>?<\/p>\n<\/blockquote>\n<h2 class=\"wp-block-heading\" id=\"related-articles\">Related articles<\/h2>\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/alvarotrigo.com\/blog\/change-css-javascript\/\">Change CSS styles with JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/alvarotrigo.com\/blog\/disable-button-jquery\/\">Disable Button with jQuery (With Examples)<\/a><\/li>\n<li><a href=\"https:\/\/alvarotrigo.com\/blog\/replace-text-with-jquery\/\">Replace Text with jQuery (With Examples)<\/a><\/li>\n<li><a href=\"https:\/\/alvarotrigo.com\/blog\/jquery-checkbox-checked\/\">Check If Checkbox Is Checked using jQuery<\/a><\/li>\n<li><a href=\"https:\/\/alvarotrigo.com\/blog\/prevent-scroll-on-scrollable-element-js\/\">Prevent Scroll On Scrollable Elements<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>The JavaScript alert() function is a function available on the global window object. It commands the browser to display a modal dialog with a message and an OK button<\/p>\n","protected":false},"author":1,"featured_media":5209,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[107],"tags":[10,18],"class_list":["post-5210","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-javascript","tag-jquery"],"acf":[],"_links":{"self":[{"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/posts\/5210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/comments?post=5210"}],"version-history":[{"count":2,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/posts\/5210\/revisions"}],"predecessor-version":[{"id":8834,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/posts\/5210\/revisions\/8834"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/media\/5209"}],"wp:attachment":[{"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/media?parent=5210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/categories?post=5210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/tags?post=5210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}