{"id":171,"date":"2008-09-22T12:19:00","date_gmt":"2008-09-22T18:19:00","guid":{"rendered":"http:\/\/thepizzy.net\/blog\/?p=171"},"modified":"2010-10-06T10:18:50","modified_gmt":"2010-10-06T16:18:50","slug":"javascript-xhtml-ajaxagain","status":"publish","type":"post","link":"https:\/\/thepizzy.net\/blog\/2008\/09\/javascript-xhtml-ajaxagain\/","title":{"rendered":"JavaScript, XHTML, &#038; AJAX\u00e2\u20ac\u00a6again"},"content":{"rendered":"<p><a href=\"http:\/\/www.wrox.com\/WileyCDA\/WroxTitle\/productCd-0471777781.html\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"670\" data-permalink=\"https:\/\/thepizzy.net\/blog\/2008\/09\/javascript-xhtml-ajaxagain\/prosw1\/\" data-orig-file=\"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2008\/09\/prosw1.jpg?fit=400%2C508&amp;ssl=1\" data-orig-size=\"400,508\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"WROX Professional AJAX Book Information and Code Download\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2008\/09\/prosw1.jpg?fit=400%2C508&amp;ssl=1\" class=\"alignleft size-full wp-image-670\" title=\"WROX Professional AJAX Book Information and Code Download\" src=\"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2008\/09\/prosw1.jpg?resize=154%2C195\" alt=\"Cover image for product 0471777781\" width=\"154\" height=\"195\" srcset=\"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2008\/09\/prosw1.jpg?w=400&amp;ssl=1 400w, https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2008\/09\/prosw1.jpg?resize=236%2C300&amp;ssl=1 236w, https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2008\/09\/prosw1.jpg?resize=118%2C150&amp;ssl=1 118w\" sizes=\"auto, (max-width: 154px) 100vw, 154px\" \/><\/a>Well, I haven\u00e2\u20ac\u2122t done much that was technically inclined, except for some various coding forays into the world of JavaScript, and XHTML\u00e2\u20ac\u201c consequently it led me back to AJAX and XML-Http-Requests. But I didn\u00e2\u20ac\u2122t bother to post anything about that, since it was work-related, and not website-related\u00e2\u20ac\u00a6kind of.<!--more--><\/p>\n<p>Of course, with any new technology I try to build or incorporate into something bigger, I first test it on my own site, the-spot.net, and then implement it elsewhere as intended.<\/p>\n<p>Most of the work I had learned by reading \u00e2\u20ac\u0153Professional AJAX\u00e2\u20ac\u009d beforehand, and doing the XML-Http-Requests manually, and creating my own classes and such. But this time around, it was much simpler.<\/p>\n<p>We implemented the Lightbox image overlay script, and found that it made use of the <a title=\"Practical Prototype and script.aculo.us\" href=\"http:\/\/www.apress.com\/book\/view\/1590599195\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignright\" src=\"https:\/\/i0.wp.com\/prototypejs.org\/assets\/2008\/8\/11\/9781590599198.gif?resize=125%2C164\" alt=\"\" width=\"125\" height=\"164\" \/><\/a>Prototype.js framework (for handling the asynchronous JavaScript calls) and Script.aculo.us for handling the animation of the overlaid image.<\/p>\n<p>So I took it one step further, and decided to read up on the various ways to make use of these frameworks, and ended up calling all the various modules on the My Spot page of the-spot.net, it does create a problem for SEO-driven development.<\/p>\n<p>If you\u00e2\u20ac\u2122re looking for automatically updating  content on a page that doesn\u00e2\u20ac\u2122t have to change for it to happen, then you cause this code (once you include the prototype.js script in your page):<\/p>\n<p><code>new Ajax.PeriodicalUpdater(\u00e2\u20ac\u02dcproducts\u00e2\u20ac\u2122, \u00e2\u20ac\u02dc\/some_url\u00e2\u20ac\u2122,<br \/>\n{<br \/>\nmethod: \u00e2\u20ac\u02dcget\u00e2\u20ac\u2122,<br \/>\ninsertion: Insertion.Top,<br \/>\nfrequency: 1,<br \/>\ndecay: 2<br \/>\n});<\/code><\/p>\n<p>But while this code does the job to get your content updated automatically, at the given frequency in seconds (multiplied by the decay per each cycle containing unchanged content), the Google crawlers aren\u00e2\u20ac\u2122t going to find it \u00e2\u20ac\u201c because all that is on your page is this:<\/p>\n<p><code>&lt;div id=\u00e2\u20ac\u009dproducts\u00e2\u20ac\u009d&gt;&lt;\/div&gt;<\/code><\/p>\n<p>\u00e2\u20ac\u00a6and that does not have any content in it for the Google crawlers and other search engine bots to read.<\/p>\n<p>I\u00e2\u20ac\u2122m still grappling with how to get content into that box for the crawlers to read, but not my users \u00e2\u20ac\u201c and since my site is php-driven, I should be able to include the normal template includes enclosed in &lt;noscript&gt; tags:<\/p>\n<p><code>&lt;noscript&gt;<br \/>\n&lt;!-- INCLUDE \u00e2\u20ac\u0153modules\/module.html\u00e2\u20ac\u009d --&gt;<br \/>\n&lt;\/noscript&gt;<\/code><\/p>\n<p>\u00e2\u20ac\u00a6in order for my pages to show content for the crawlers, but not my visitors \u00e2\u20ac\u201c unless they have JavaScript turned off, of course. I\u00e2\u20ac\u2122ll give it a shot though, and post more information later. I have to go back and re-edit my pages and templates to make sure they are still compliant with the original template architecture.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, I haven\u00e2\u20ac\u2122t done much that was technically inclined, except for some various coding forays into the world of JavaScript, and XHTML\u00e2\u20ac\u201c consequently it led me back to AJAX and XML-Http-Requests. But I didn\u00e2\u20ac\u2122t bother to post anything about that, since it was work-related, and not website-related\u00e2\u20ac\u00a6kind of.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[25,11,3,9,347,2],"tags":[289,467,214,468,477,473,472,471,474,77,466,469,478,480,481,475,470,479,169,210,476,465],"class_list":["post-171","post","type-post","status-publish","format-standard","hentry","category-programming","category-projects","category-tech","category-the-spot-net","category-the-spot-network","category-updates","tag-ajax","tag-asynchronous-javascript","tag-code","tag-decay","tag-development","tag-div","tag-framework","tag-frameworks","tag-frequency","tag-google","tag-image-overlay","tag-insertion","tag-javascript","tag-lightbox","tag-noscript","tag-periodicalupdater","tag-prototype","tag-seo-driven","tag-technology","tag-url","tag-xhtml","tag-xml-http-requests"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":false,"jetpack_shortlink":"https:\/\/wp.me\/prOO4-2L","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/posts\/171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/comments?post=171"}],"version-history":[{"count":16,"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/posts\/171\/revisions"}],"predecessor-version":[{"id":172,"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/posts\/171\/revisions\/172"}],"wp:attachment":[{"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/media?parent=171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/categories?post=171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/tags?post=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}