{"id":84,"date":"2008-10-18T12:37:53","date_gmt":"2008-10-18T10:37:53","guid":{"rendered":"http:\/\/www.gijsk.com\/blog\/?p=84"},"modified":"2008-10-18T12:37:53","modified_gmt":"2008-10-18T10:37:53","slug":"backforward-and-js-xhr-url-manipulation","status":"publish","type":"post","link":"https:\/\/www.gijsk.com\/blog\/2008\/10\/backforward-and-js-xhr-url-manipulation\/","title":{"rendered":"Back\/Forward and JS + XHR + URL Manipulation"},"content":{"rendered":"<p>Steps to reproduce:<\/p>\n<ol>\n<li>Go to your Facebook inbox page, pick a random message, and start typing a reply<\/li>\n<li>Halfway through, realize you want to read a different message before finishing this one.<\/li>\n<li>&#8216;Accidentally&#8217; left-click instead of middle-click the link at the top for the inbox.<\/li>\n<li>Hit escape to stop the load so as to be able to still have the text you type<\/li>\n<\/ol>\n<p>Expected result:<\/p>\n<p>Stop loading the inbox page, get to keep your written stuff<\/p>\n<p>Actual result:<\/p>\n<p>This is JavaScript executing. There&#8217;s no stopping it from throwing away your text anymore by returning to the inbox &#8211; and what&#8217;s worse, the back\/forward history is so confused by what&#8217;s going on (as you hit escape) that it won&#8217;t be able to take you back to the reply page and restore your message to the textbox (as back\/forward generally does in Firefox). Congrats, you just lost N minutes worth of typing, and who knows what kind of brilliant ideas!<\/p>\n<p>Question to the Lazyweb: whose fault is this? Can it be fixed? How? (Yes, I&#8217;d prefer to just use email all the time, too, but unfortunately that&#8217;s not always an option, and I&#8217;m sure there are webmail implementations which have similar problems, especially once you turn off automatic draft saving)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Steps to reproduce: Go to your Facebook inbox page, pick a random message, and start typing a reply Halfway through, realize you want to read a different message before finishing this one. &#8216;Accidentally&#8217; left-click instead of middle-click the link at &hellip; <a href=\"https:\/\/www.gijsk.com\/blog\/2008\/10\/backforward-and-js-xhr-url-manipulation\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,5],"tags":[],"class_list":["post-84","post","type-post","status-publish","format-standard","hentry","category-mozilla","category-rants"],"_links":{"self":[{"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/posts\/84"}],"collection":[{"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/comments?post=84"}],"version-history":[{"count":1,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/posts\/84\/revisions"}],"predecessor-version":[{"id":85,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/posts\/84\/revisions\/85"}],"wp:attachment":[{"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/media?parent=84"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/categories?post=84"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/tags?post=84"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}