Web design: jQuery w/ regex
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 “pop”: 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?
jQuery to the rescue: it can find the paragraph with wine in it, mark up the word, and re-insert it.
Imagine the paragraph containing wine runs thus:
The audience will, no doubt, be enraptured by the Closet Shakespeare Players as they enact “Julius Caesar”. Most will look forward, almost as much, to the wine afterwards. For serious drama fans the evening is not to be missed…call — — —- to reserve or else text _______.
The code to achieve this effect I’ll be talking more about in future posts:)
Source:
Pollock, John. jQuery: A Beginner’s Guide. Toronto: McGraw-Hill, 2014.
Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.
Leave a Reply
You must be logged in to post a comment.