{"id":756,"date":"2022-08-30T15:06:39","date_gmt":"2022-08-30T15:06:39","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/replacing-text-in-a-child-under-parent-div-through-jquery-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:06:39","modified_gmt":"2022-08-30T15:06:39","slug":"replacing-text-in-a-child-under-parent-div-through-jquery-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/replacing-text-in-a-child-under-parent-div-through-jquery-collection-of-common-programming-errors\/","title":{"rendered":"Replacing Text in a child under parent DIV through JQuery-Collection of common programming errors"},"content":{"rendered":"<p>I want to change text of <em>(Access denied. Please Login or Register.)<\/em> to <strong><em>&#8220;You are not authorized to access&#8221;<\/em><\/strong> in the following code:-<\/p>\n<pre><code>\n<\/code><\/pre>\n<h2 class=\"element-invisible\"><code>Error message<\/code><\/h2>\n<pre>\nAccess denied. Please Login or Register.\n\n<\/pre>\n<p><code>I tried using the following code in on Ready Function, but it isn't working correctly.<\/code><\/p>\n<pre><code><code>$(\"div.messages\").text(function () {\n        console.log($(this).text());\n        return $(this).text().replace(\"Access denied. Please Login or Register.\", \"You are not authorized to access\"); \n    });\n<\/code><\/code><\/pre>\n<p>Thanks.<\/p>\n<p>Is there anyother way to do that? It gives me the error of<\/p>\n<pre><code>Uncaught TypeError: Cannot set property 'nodeValue' of undefined ... \n<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-09 22:39:09. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I want to change text of (Access denied. Please Login or Register.) to &#8220;You are not authorized to access&#8221; in the following code:- Error message Access denied. Please Login or Register. I tried using the following code in on Ready Function, but it isn&#8217;t working correctly. $(&#8220;div.messages&#8221;).text(function () { console.log($(this).text()); return $(this).text().replace(&#8220;Access denied. Please Login [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-756","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=756"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/756\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}