javascript document.getElementsByClassName compatibility with IE

It’s not a method of document: function getElementsByClassName(node, classname) { var a = []; var re = new RegExp(‘(^| )’+classname+'( |$)’); var els = node.getElementsByTagName(“*”); for(var i=0,j=els.length; i<j; i++) if(re.test(els[i].className))a.push(els[i]); return a; } tabs = getElementsByClassName(document.body,’tab’); // no document

Cannot properly set the Accept HTTP header with jQuery

I also had trouble with this, not just in IE but also in Chrome and Safari using jQuery 1.6.2. This solution appears to work as intended in all browsers I’ve tried (Chrome, Safari, IE, Firefox). $.ajax({ headers: { Accept : “text/plain; charset=utf-8”, “Content-Type”: “text/plain; charset=utf-8” }, data: “data”, success : function(response) { … } }) … Read more

Inline block doesn’t work in internet explorer 7, 6

In IE6/IE7, display: inline-block only works on elements that are naturally inline (such as spans). To make it work on other elements such as divs, you need this: #yourElement { display: inline-block; *display: inline; zoom: 1; } *display: inline uses a “safe” CSS hack to apply to only IE7 and lower. For IE6/7, zoom: 1 … Read more

Best way to check for IE less than 9 in JavaScript without library

Javascript var ie = (function(){ var undef, v = 3, div = document.createElement(‘div’), all = div.getElementsByTagName(‘i’); while ( div.innerHTML = ‘<!–[if gt IE ‘ + (++v) + ‘]><i></i><![endif]–>’, all[0] ); return v > 4 ? v : undef; }()); You can then do: ie < 9 By James Panolsey from here: http://james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments

“Access is denied” JavaScript error when trying to access the document object of a programmatically-created (IE-only)

if the document.domain property is set in the parent page, Internet Explorer gives me an “Access is denied” Sigh. Yeah, it’s an IE issue (bug? difficult to say as there is no documented standard for this kind of unpleasantness). When you create a srcless iframe it receives a document.domain from the parent document’s location.host instead … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)