{"id":16651,"date":"2016-07-08T02:43:06","date_gmt":"2016-07-08T02:43:06","guid":{"rendered":"http:\/\/www.oracletutoring.ca\/blog\/?p=16651"},"modified":"2016-07-08T02:43:06","modified_gmt":"2016-07-08T02:43:06","slug":"web-design-jquery-w-regex","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/web-design-jquery-w-regex\/","title":{"rendered":"Web design:  jQuery w\/ regex"},"content":{"rendered":"<p><script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.12.4\/jquery.min.js\"><\/script><br \/>\n<script src=\"..\/jquery\/july7_2016b.js\"><\/script><\/p>\n<h1>The tutor experiments with jQuery and regex.<\/h1>\n<p>\nImagine you have a web page:  somewhere on it, you believe, is the word <strong>wine<\/strong>.  You now realize that the promoter wants <strong>wine<\/strong> to &#8220;pop&#8221;: she believes that the prospective audience will pay much more attention, if they notice it.  How will they do so, she wonders, if the word is just buried amidst other text?\n<\/p>\n<p>jQuery to the rescue:  it can find the paragraph with <strong>wine<\/strong> in it, mark up the word, and re-insert it.<\/p>\n<p>Imagine the paragraph containing <strong>wine<\/strong> runs thus:<\/p>\n<p style=\"color:black;font-family:serif;font-size:110%;\">\nThe audience will, no doubt, be enraptured by the Closet Shakespeare Players as they enact &#8220;Julius Caesar&#8221;.  Most will look forward, almost as much, to the wine afterwards.  For serious drama fans the evening is not to be missed&#8230;call &#8212; &#8212; &#8212;- to reserve or else text _______.\n<\/p>\n<p style=\"text-align:center\">\n<button id=\"july7_2016_change_wine\" style=\"color:teal;background-color:white\">Click me for change!<\/button><button id=\"july7_2016_change_back\" style=\"color:white;background-color:teal;\">Click me to reset!<\/button><\/p>\n<p>The code to achieve this effect I&#8217;ll be talking more about in future posts:)<\/p>\n<p>Source:<\/p>\n<p>Pollock, John.  <u>jQuery:  A Beginner&#8217;s Guide<\/u>.  Toronto: McGraw-Hill, 2014.<\/p>\n<p><a href=\"http:\/\/www.w3schools.com\/jquery\/sel_contains.asp\">w3schools<\/a><\/p>\n<p>Jack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The tutor experiments with jQuery and regex. Imagine you have a web page: somewhere on it, you believe, is the word wine. You now realize that the promoter wants wine to &#8220;pop&#8221;: she believes that the prospective audience will pay &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/web-design-jquery-w-regex\/\"> <span class=\"screen-reader-text\">Web design:  jQuery w\/ regex<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105,1631,1691,837],"tags":[711,1625,1700,1701],"class_list":["post-16651","post","type-post","status-publish","format-standard","hentry","category-computer-science","category-css","category-jquery","category-web-design","tag-javascript-regex","tag-jquery","tag-jquery-html-function","tag-jquery-text-function"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/16651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=16651"}],"version-history":[{"count":23,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/16651\/revisions"}],"predecessor-version":[{"id":16674,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/16651\/revisions\/16674"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=16651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=16651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=16651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}