Should I include a tag?

I’ve never seen a tag formatted like that before, with an attribute called generator and the generating software as its value. Usually you’ll see it presented as name=”generator” and the generating software as its corresponding content, for example: <meta name=”generator” content=”WordPress 3.0.1″ /> <!– leave this for stats –> Previously I was unaware of any … Read more

Meta-refresh doesn’t work?

The problem is that when IE sees this: <meta http-equiv=”refresh” content=”0;http://www.example.com” /> it expects the contents attribute to contain a number. The only time IE will check for a URL is if the content attribute contains “URL=” so the redirect that is most usable in all browsers is this: <meta http-equiv=”refresh” content=”0;URL=http://www.example.com” /> The above … Read more

In , which comes first: or ?

As all of the other answers have already indicated, it usually doesn’t matter. Here’s a bit more about when it matters and why. First of all, since you asked about standards, you might like to know that the text you are quoting comes from the W3C recommendations for HTML 4: http://www.w3.org/TR/html4/charset.html#h-5.2.2 There is a similar … Read more

How to add meta tag in JavaScript

You can add it: var meta = document.createElement(‘meta’); meta.httpEquiv = “X-UA-Compatible”; meta.content = “IE=edge”; document.getElementsByTagName(‘head’)[0].appendChild(meta); …but I wouldn’t be surprised if by the time that ran, the browser had already made its decisions about how to render the page. The real answer here has to be to output the correct tag from the server in … Read more

iPad layout scales up when rotating from portrait to landscape

—— Update —— This is not an issue anymore in iOS7. And there is better fix by Scott Jehl on github scottjehl/iOS-Orientationchange-Fix that works for iOS6. —— Original answer —— Jeremy Keith (@adactio) has a good solution for this on his blog Orientation and scale Keep the Markup scalable <meta name=”viewport” content=”width=device-width, initial-scale=1″> Then disable … Read more

Getting title and meta tags from external website

This is the way it should be: function file_get_contents_curl($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $data = curl_exec($ch); curl_close($ch); return $data; } $html = file_get_contents_curl(“http://example.com/”); //parsing begins here: $doc = new DOMDocument(); @$doc->loadHTML($html); $nodes = $doc->getElementsByTagName(‘title’); //get and display what you need: $title = $nodes->item(0)->nodeValue; … Read more

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