{"id":4696,"date":"2014-04-17T23:26:38","date_gmt":"2014-04-18T06:26:38","guid":{"rendered":"http:\/\/g-liu.com\/blog\/?page_id=4696"},"modified":"2014-04-17T23:26:38","modified_gmt":"2014-04-18T06:26:38","slug":"stackoverflow","status":"publish","type":"page","link":"https:\/\/g-liu.com\/blog\/links\/stackoverflow\/","title":{"rendered":"StackOverflow"},"content":{"rendered":"<p>Just a collection of interesting questions\u00a0on <a href=\"http:\/\/stackoverflow.com\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">StackOverflow<\/a>, the programmer&#8217;s greatest online Q&amp;A source.<\/p>\n<h1>JavaScript<\/h1>\n<ul>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/348792\/how-do-you-tell-if-caps-lock-is-on-using-javascript\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to detect caps lock?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/18082\/validate-decimal-numbers-in-javascript-isnumeric\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to validate numbers?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/400212\/how-to-copy-to-the-clipboard-in-javascript\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to copy to the clipboard?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/46155\/validate-email-address-in-javascript\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to validate emails?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/352098\/how-can-i-pretty-print-json\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to pretty-print JSON?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/826782\/css-rule-to-disable-text-selection-highlighting\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to check if a checkbox is checked?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/244777\/can-i-comment-a-json-file\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">You cannot comment JSON files<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/359494\/does-it-matter-which-equals-operator-vs-i-use-in-javascript-comparisons\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">The difference between <code>==<\/code> and <code>===<\/code><\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1789945\/how-can-i-check-if-one-string-contains-another-substring-in-javascript\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to check if one string contains another string?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/31044\/is-there-an-exists-function-for-jquery\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to check if a DOM element exists?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/178325\/testing-if-something-is-hidden-using-jquery\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to test if a DOM element is visible?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1206203\/how-to-distinguish-between-left-and-right-mouse-click-with-jquery\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to tell apart left\/right click?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1403615\/use-jquery-to-hide-a-div-when-the-user-clicks-outside-of-it\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to hide a <code>div<\/code> when you click outside of it?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/111102\/how-do-javascript-closures-work\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">A practical explanation of JavaScript closures<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1034621\/get-current-url-with-javascript\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to get the current URL of the page<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/268490\/jquery-document-createelement-equivalent\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\"><code>document.createElement<\/code> &#8230; in jQuery<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1232040\/how-to-empty-an-array-in-javascript\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to empty an array<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/784929\/what-is-the-not-not-operator-in-javascript\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">What does <code>!!<\/code> mean?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/121203\/how-to-detect-if-javascript-is-disabled\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to detect if JavaScript is disabled<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/251420\/invoking-javascript-code-in-an-iframe-from-the-parent-page\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Calling JavaScript code in an <code>iframe<\/code><\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/3437786\/how-to-get-web-page-size-browser-window-size-screen-size-in-a-cross-browser-wa\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to get dimensions of web page, screen, and browser?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1933969\/sound-effects-in-javascript-html5\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Playing sound in JavaScript<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1060008\/is-there-a-way-to-detect-if-a-browser-window-is-not-currently-active\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to test whether the browser window is currently visible?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1197928\/how-to-add-30-minutes-to-a-javascript-date-object\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to add minutes to time?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1050720\/adding-hours-to-javascript-date-object\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to add hours to time?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1125482\/how-to-impose-maxlength-on-textarea-in-html-using-javascript\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Textarea <code>maxlength<\/code> attribute emulation<\/a><\/li>\n<\/ul>\n<h1>HTML\/CSS<\/h1>\n<ul>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/218760\/how-do-you-keep-parents-of-floated-elements-from-collapsing\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Keep parents of floating elements from collapsing<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/114543\/how-to-center-a-div-in-a-div-horizontally\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Center a div in a div<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/271743\/whats-the-difference-between-b-and-strong-i-and-em\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\"><code>&lt;b&gt;<\/code> vs. <code>&lt;strong&gt;<\/code>, <code>&lt;i&gt;<\/code> vs. <code>&lt;em&gt;<\/code><\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/2610497\/change-an-inputs-html5-placeholder-color-with-css\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Changing input placeholder text color with CSS<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/940451\/using-relative-url-in-css-file-what-location-is-it-relative-to\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Clarifying relative URLs in CSS<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/90178\/make-a-div-fill-the-height-of-the-remaining-screen-space\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Fill the remaining page height with a <code>div<\/code><\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1895476\/how-to-style-a-select-dropdown-with-css-only-without-javascript\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Style a dropdown with just CSS<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/469059\/button-vs-input-type-button-which-to-use\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Should I use <code>button<\/code> or <code>input type=\"button\"<\/code>?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/826782\/css-rule-to-disable-text-selection-highlighting\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Disable text selection highlighting<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/339923\/how-to-set-cellpadding-and-cellspacing-in-css\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to set cellpadding and cellspacing?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/211383\/which-method-of-clearfix-is-best\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">What clearfix should I use?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/217776\/how-to-apply-css-to-iframe\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Applying CSS to an <code>iframe<\/code><\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/585945\/how-to-align-content-of-a-div-to-the-bottom-with-css\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Align content to bottom of a <code>div<\/code><\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/526035\/html-css-positioning-float-bottom\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Simulating <code>float: bottom<\/code><\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1033156\/how-to-write-ahover-in-inline-css\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">You cannot write <code>:hover<\/code> inline<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/260857\/changing-website-favicon-dynamically\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Dynamically changing website favicon<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/7560813\/why-are-dashes-preferred-for-css-selectors-html-attributes\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Style: why do we use dashes for ids and classes?<\/a><\/li>\n<\/ul>\n<h1>PHP<\/h1>\n<ul>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/3737139\/reference-what-does-this-symbol-mean-in-php\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">What does ___ mean in PHP?<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/60174\/how-can-i-prevent-sql-injection-in-php\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">How to prevent SQL injection<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1921421\/get-the-first-element-of-an-array\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Get the first element of an array<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/2418473\/when-should-i-use-require-once-vs-include\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\"><code>require_once<\/code> vs. <code>include<\/code><\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/2401478\/why-is-faster-than-in-php\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Performance of <code>===<\/code> vs. <code>==<\/code><\/a><\/li>\n<\/ul>\n<h1>Java<\/h1>\n<ul>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1154008\/any-way-to-declare-an-array-in-line\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Declaring an inline array<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/197986\/what-causes-javac-to-issue-the-uses-unchecked-or-unsafe-operations-warning\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">What is &#8220;uses unckeched or unsafe&#8221;?<\/a><\/li>\n<\/ul>\n<h1>Misc.<\/h1>\n<ul>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1197928\/how-to-add-30-minutes-to-a-javascript-date-object\" target=\"_blank\" class=\"broken_link\" rel=\"nofollow\">Commenting in Markdown<\/a><\/li>\n<\/ul>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content --><!-- AddThis Related Posts generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Just a collection of interesting questions\u00a0on StackOverflow, the programmer&#8217;s greatest online Q&amp;A source. JavaScript How to detect caps lock? How to validate numbers? How to copy to the clipboard? How to validate emails? How to pretty-print JSON? How to check if a checkbox is checked? You cannot comment JSON files The difference between == and === How to check if &#8230;<!-- AddThis Advanced Settings generic via filter on wp_trim_excerpt --><!-- AddThis Share Buttons generic via filter on wp_trim_excerpt --><!-- AddThis Related Posts generic via filter on wp_trim_excerpt --><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":83,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"aioseo_notices":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P2Zt3y-1dK","_links":{"self":[{"href":"https:\/\/g-liu.com\/blog\/wp-json\/wp\/v2\/pages\/4696"}],"collection":[{"href":"https:\/\/g-liu.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/g-liu.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/g-liu.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/g-liu.com\/blog\/wp-json\/wp\/v2\/comments?post=4696"}],"version-history":[{"count":1,"href":"https:\/\/g-liu.com\/blog\/wp-json\/wp\/v2\/pages\/4696\/revisions"}],"predecessor-version":[{"id":4697,"href":"https:\/\/g-liu.com\/blog\/wp-json\/wp\/v2\/pages\/4696\/revisions\/4697"}],"up":[{"embeddable":true,"href":"https:\/\/g-liu.com\/blog\/wp-json\/wp\/v2\/pages\/83"}],"wp:attachment":[{"href":"https:\/\/g-liu.com\/blog\/wp-json\/wp\/v2\/media?parent=4696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}