{"id":659,"date":"2012-07-17T19:37:44","date_gmt":"2012-07-18T00:37:44","guid":{"rendered":"http:\/\/hoolihan.net\/blog-tim\/?p=659"},"modified":"2012-07-17T19:37:44","modified_gmt":"2012-07-18T00:37:44","slug":"simple-uri-tip-for-html","status":"publish","type":"post","link":"http:\/\/hoolihan.net\/blog-tim\/2012\/07\/17\/simple-uri-tip-for-html\/","title":{"rendered":"Simple URI Tip for HTML"},"content":{"rendered":"<p>You may already know this, in which case you ran across it randomly, or are the kind of developer that reads specs. But if you haven&#8217;t run across this, prepare for a face-palm moment wondering why you didn&#8217;t know this years ago.<\/p>\n<p>Using a uri like the following tells the browser to get the content over whatever protocol the current document was fetched from. <\/p>\n<pre>\r\n<code>&lt;script src=\"\/\/platform.twitter.com\/widgets.js\"&gt;&lt;\/script&gt;<\/code>\r\n<\/pre>\n<p>Think of all the little annoying server side script you&#8217;ve written to determine the protocol based on the request variables in order to avoid security warnings. Never again. Enjoy.<\/p>\n<p>One warning&#8230; don&#8217;t do this in <a href=\"http:\/\/phonegap.com\">phonegap<\/a>.<\/p>\n<p>More detail, and links to rfcs at <a href=\"http:\/\/stackoverflow.com\/questions\/6785442\/browser-support-for-urls-beginning-with-double-slash\">stackoverflow<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may already know this, in which case you ran across it randomly, or are the kind of developer that reads specs. But if you haven&#8217;t run across this, prepare for a face-palm moment wondering why you didn&#8217;t know this years ago. Using a uri like the following tells the browser to get the content [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,54,18,24],"tags":[238,69,272,239,237],"class_list":["post-659","post","type-post","status-publish","format-standard","hentry","category-aspnet","category-javascript","category-programming","category-web","tag-http","tag-linkedin","tag-programming","tag-uri","tag-web-2"],"_links":{"self":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts\/659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/comments?post=659"}],"version-history":[{"count":0,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts\/659\/revisions"}],"wp:attachment":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/media?parent=659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/categories?post=659"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/tags?post=659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}