{"id":1660,"date":"2009-07-22T23:07:42","date_gmt":"2009-07-23T06:07:42","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=1660"},"modified":"2009-07-30T12:26:16","modified_gmt":"2009-07-30T19:26:16","slug":"ramping-up-on-javascript","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/","title":{"rendered":"Ramping Up On JavaScript"},"content":{"rendered":"<p>I didn&#8217;t think I would ever have sufficient motivation to learn JavaScript, but here I am. I worked a little more on that <a href=\"http:\/\/fate.multimedia.cx\/index-v3.php\">new FATE index page<\/a> based on <a href=\"http:\/\/code.google.com\/apis\/visualization\/\">Google&#8217;s Visualization API<\/a>. To that end, I constructed the following plan:<\/p>\n<p><strong>Part 1: Create A JSON Data Source<\/strong><br \/>\nCreate a JSON data source, now that I figured out how to do that correctly. JSON data really is just a JavaScript data structure. It can be <a href=\"http:\/\/code.google.com\/intl\/de-DE\/apis\/visualization\/documentation\/dev\/implementing_data_source.html#examples\">crazy to look at<\/a> since it necessitates packing dictionaries inside of arrays inside of dictionaries inside of arrays. (Check the examples&#8211; observe that the data structure ends with &#8220;}]}]}});&#8221;.) But in the end, the Google visualization knows what to do with it.<\/p>\n<p><em>Done.<\/em><\/p>\n<p><strong>Part 2: Connect the JSON Data Source<\/strong><br \/>\nHook the JSON data source up to the newest revision of the FATE front page, <a href=\"http:\/\/multimedia.cx\/eggs\/google-visualizing-fate\/\">rolled out a little while ago<\/a>.<\/p>\n<p><em>Done.<\/em><\/p>\n<p><strong>Part 3: Save The User&#8217;s Most Recent Sort Criteria<\/strong><br \/>\nThe problem is that the page resets the sort criteria on a refresh. There needs to be a way to refresh the page while maintaining that criteria. This leads me to think that I should have some &#8220;refresh&#8221; button embedded in the page which asks the server for updated data using a facility I have heard of named <a href=\"http:\/\/en.wikipedia.org\/wiki\/XMLHttpRequest\">XMLHttpRequest<\/a>. I found <a href=\"http:\/\/www.webpasties.com\/xmlHttpRequest\/xmlHttpRequest_tutorial_1.html\">a simple tutorial on the matter<\/a> but was put off by the passage &#8220;Because of variations among the Web browsers, creating this object is more complicated than it need be.&#8221;<\/p>\n<p>Backup idea: Cookies. <a href=\"http:\/\/www.quirksmode.org\/js\/cookies.html\">Using this tutorial as a guide<\/a>, set a cookie whenever the user changes either the sort column or the sort order.<\/p>\n<p><em>Done,<\/em> though I may want to revisit the XHR idea one day.<\/p>\n<p><strong>Part 4: Make It Look Good<\/strong><br \/>\nFinally, figure out how the div tag works to make the layout a little cleaner. <\/p>\n<p><em>Done.<\/em> Sort of. There are 2 div tags on the page now, one for the header and one for the table. I suppose I will soon have to learn CSS to really drag this page out of 1997.<\/p>\n<p><strong>Bonus: Caching the JSON Data<\/strong><br \/>\nIdeally, the web browser makes the JSON data request using the If-Modified-Since HTTP header. Use a sniffer to verify this. If this is true, add a table to the FATE MySQL table which contains a single column specifying the timestamp when the web config cache table was last updated. If this time is earlier than the time in the request header, respond with a 304 (not modified) HTTP code.<\/p>\n<p><em>Not done.<\/em> It seems that these requests don&#8217;t set the appropriate HTTP header, at least not in Firefox.<\/p>\n<p>I hope to put this page into service soon, just as soon as I can dump the rest of the existing index.php script into this new one. As usual, not elegant, but it works.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The new FATE index page prototype works even better now<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[182],"class_list":["post-1660","post","type-post","status-publish","format-standard","hentry","category-fate-server","tag-javascript"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"The new FATE index page prototype works even better now\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Multimedia Mike\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Breaking Eggs And Making Omelettes | Topics On Multimedia Technology and Reverse Engineering\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Ramping Up On JavaScript | Breaking Eggs And Making Omelettes\" \/>\n\t\t<meta property=\"og:description\" content=\"The new FATE index page prototype works even better now\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2009-07-23T06:07:42+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2009-07-30T19:26:16+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Ramping Up On JavaScript | Breaking Eggs And Making Omelettes\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The new FATE index page prototype works even better now\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/ramping-up-on-javascript\\\/#article\",\"name\":\"Ramping Up On JavaScript | Breaking Eggs And Making Omelettes\",\"headline\":\"Ramping Up On JavaScript\",\"author\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#organization\"},\"datePublished\":\"2009-07-22T23:07:42-07:00\",\"dateModified\":\"2009-07-30T12:26:16-07:00\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/ramping-up-on-javascript\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/ramping-up-on-javascript\\\/#webpage\"},\"articleSection\":\"FATE Server, javascript\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/ramping-up-on-javascript\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/multimedia.cx\\\/eggs\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/fate-server\\\/#listItem\",\"name\":\"FATE Server\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/fate-server\\\/#listItem\",\"position\":2,\"name\":\"FATE Server\",\"item\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/fate-server\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/ramping-up-on-javascript\\\/#listItem\",\"name\":\"Ramping Up On JavaScript\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/ramping-up-on-javascript\\\/#listItem\",\"position\":3,\"name\":\"Ramping Up On JavaScript\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/fate-server\\\/#listItem\",\"name\":\"FATE Server\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#organization\",\"name\":\"Breaking Eggs And Making Omelettes\",\"description\":\"Topics On Multimedia Technology and Reverse Engineering\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/\",\"name\":\"Multimedia Mike\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/ramping-up-on-javascript\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2eb93f7cada658f7986b5092062849fa255779eada3342c8f6b9a40764b95fdd?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"Multimedia Mike\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/ramping-up-on-javascript\\\/#webpage\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/ramping-up-on-javascript\\\/\",\"name\":\"Ramping Up On JavaScript | Breaking Eggs And Making Omelettes\",\"description\":\"The new FATE index page prototype works even better now\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/ramping-up-on-javascript\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\"},\"datePublished\":\"2009-07-22T23:07:42-07:00\",\"dateModified\":\"2009-07-30T12:26:16-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#website\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/\",\"name\":\"Breaking Eggs And Making Omelettes\",\"description\":\"Topics On Multimedia Technology and Reverse Engineering\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Ramping Up On JavaScript | Breaking Eggs And Making Omelettes","description":"The new FATE index page prototype works even better now","canonical_url":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/#article","name":"Ramping Up On JavaScript | Breaking Eggs And Making Omelettes","headline":"Ramping Up On JavaScript","author":{"@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author"},"publisher":{"@id":"https:\/\/multimedia.cx\/eggs\/#organization"},"datePublished":"2009-07-22T23:07:42-07:00","dateModified":"2009-07-30T12:26:16-07:00","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/#webpage"},"isPartOf":{"@id":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/#webpage"},"articleSection":"FATE Server, javascript"},{"@type":"BreadcrumbList","@id":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs#listItem","position":1,"name":"Home","item":"https:\/\/multimedia.cx\/eggs","nextItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/category\/fate-server\/#listItem","name":"FATE Server"}},{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/category\/fate-server\/#listItem","position":2,"name":"FATE Server","item":"https:\/\/multimedia.cx\/eggs\/category\/fate-server\/","nextItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/#listItem","name":"Ramping Up On JavaScript"},"previousItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/#listItem","position":3,"name":"Ramping Up On JavaScript","previousItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/category\/fate-server\/#listItem","name":"FATE Server"}}]},{"@type":"Organization","@id":"https:\/\/multimedia.cx\/eggs\/#organization","name":"Breaking Eggs And Making Omelettes","description":"Topics On Multimedia Technology and Reverse Engineering","url":"https:\/\/multimedia.cx\/eggs\/"},{"@type":"Person","@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author","url":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/","name":"Multimedia Mike","image":{"@type":"ImageObject","@id":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/2eb93f7cada658f7986b5092062849fa255779eada3342c8f6b9a40764b95fdd?s=96&d=identicon&r=g","width":96,"height":96,"caption":"Multimedia Mike"}},{"@type":"WebPage","@id":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/#webpage","url":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/","name":"Ramping Up On JavaScript | Breaking Eggs And Making Omelettes","description":"The new FATE index page prototype works even better now","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/multimedia.cx\/eggs\/#website"},"breadcrumb":{"@id":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/#breadcrumblist"},"author":{"@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author"},"creator":{"@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author"},"datePublished":"2009-07-22T23:07:42-07:00","dateModified":"2009-07-30T12:26:16-07:00"},{"@type":"WebSite","@id":"https:\/\/multimedia.cx\/eggs\/#website","url":"https:\/\/multimedia.cx\/eggs\/","name":"Breaking Eggs And Making Omelettes","description":"Topics On Multimedia Technology and Reverse Engineering","inLanguage":"en-US","publisher":{"@id":"https:\/\/multimedia.cx\/eggs\/#organization"}}]},"og:locale":"en_US","og:site_name":"Breaking Eggs And Making Omelettes | Topics On Multimedia Technology and Reverse Engineering","og:type":"article","og:title":"Ramping Up On JavaScript | Breaking Eggs And Making Omelettes","og:description":"The new FATE index page prototype works even better now","og:url":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/","article:published_time":"2009-07-23T06:07:42+00:00","article:modified_time":"2009-07-30T19:26:16+00:00","twitter:card":"summary","twitter:title":"Ramping Up On JavaScript | Breaking Eggs And Making Omelettes","twitter:description":"The new FATE index page prototype works even better now"},"aioseo_meta_data":{"post_id":"1660","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-31 22:01:17","updated":"2025-12-31 19:11:50","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/multimedia.cx\/eggs\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/multimedia.cx\/eggs\/category\/fate-server\/\" title=\"FATE Server\">FATE Server<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRamping Up On JavaScript\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/multimedia.cx\/eggs"},{"label":"FATE Server","link":"https:\/\/multimedia.cx\/eggs\/category\/fate-server\/"},{"label":"Ramping Up On JavaScript","link":"https:\/\/multimedia.cx\/eggs\/ramping-up-on-javascript\/"}],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/1660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=1660"}],"version-history":[{"count":9,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/1660\/revisions"}],"predecessor-version":[{"id":1679,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/1660\/revisions\/1679"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=1660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=1660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=1660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}