{"id":23,"date":"2011-03-13T13:20:33","date_gmt":"2011-03-13T13:20:33","guid":{"rendered":"http:\/\/rat32.com\/rat32\/?p=23"},"modified":"2014-02-04T21:01:16","modified_gmt":"2014-02-04T21:01:16","slug":"how-to-solve-indexof-javascript-problem-in-internet-explorer","status":"publish","type":"post","link":"https:\/\/rat32.com\/rat32\/2011\/03\/13\/how-to-solve-indexof-javascript-problem-in-internet-explorer\/","title":{"rendered":"How to solve indexOf javascript problem in internet Explorer?"},"content":{"rendered":"<p>indexOf is not supported by dump web browser internet explorer.<br \/>\nTo solve this we need to add following code in our javascript file.<\/p>\n<pre class=\"lang:js decode:true \" >\r\nif (!Array.prototype.indexOf) {\r\n    Array.prototype.indexOf = function (elt \/*, from*\/) {\r\n        var len = this.length >>> 0;\r\n        var from = Number(arguments[1]) || 0;\r\n        from = (from < 0) ? Math.ceil(from) : Math.floor(from);\r\n        if (from < 0) from += len;\r\n\r\n        for (; from < len; from++) {\r\n            if (from in this &#038;&#038; this[from] === elt) return from;\r\n        }\r\n        return -1;\r\n    };\r\n}\r\n<\/pre>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>indexOf is not supported by dump web browser internet explorer. To solve this we need to add following code in our javascript file. if (!Array.prototype.indexOf) { Array.prototype.indexOf = function (elt \/*, from*\/) { var&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,45],"tags":[64,66,63,65],"class_list":["post-23","post","type-post","status-publish","format-standard","hentry","category-how-to","category-javascript","tag-indexof","tag-internet-explorer","tag-javascript-2","tag-problem"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/posts\/23"}],"collection":[{"href":"https:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":13,"href":"https:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"predecessor-version":[{"id":140,"href":"https:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/posts\/23\/revisions\/140"}],"wp:attachment":[{"href":"https:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}