meta-tags

How can I update meta tags in AngularJS?

廉价感情. 提交于 2019-11-26 20:20:36
I am developing an application using AngularJS. I want to update meta tags on route change. How can I update meta tags in AngularJS which can be shown in "view source" on the page? here is a HTML code - <!DOCTYPE html> <html ng-app="app"> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="fragment" content="!" /> <meta name="title" content="Test App"> <meta name="description" content="Test App"> <meta name="keywords" content="Test,App"> <link rel="stylesheet" href="css/jquery-ui-1.10.2.custom.min.css" /> <link rel="stylesheet" href="css/extra.css" />

PHP: Can CURL follow meta redirects

一个人想着一个人 提交于 2019-11-26 18:35:40
问题 CURL can follow header redirects with the use of CURLOPT_FOLLOWLOCATION but is it possible to follow meta refresh redirects? Thanks 回答1: Yes, but you'll have to do it yourself by parsing the response and looking for things that look like: <meta http-equiv="refresh" content="5;url=http://example.com/" /> Obeying <meta> refresh requests is a browser-side thing. Use DOM parsing to look for <meta> tags with the appropriate attributes in the response cURL gives you. If you can guarantee that the

iPad layout scales up when rotating from portrait to landscape

余生长醉 提交于 2019-11-26 17:55:56
问题 I have a added to the "viewport" meta tag "width=device-width,initial-scale=1.0" and on an iPad the page loads up fine in landscape mode, the it switches nicely to portrait and when I rotate it back to landscape it scales the page up and I have to pinch zoom it back to a 1 scale. I can fix this by adding the "maximum-scale=1.0, user-scalable=no" , but I was wondering if there is a way I could fix this without taking away from the user the ability to zoom in the page. If you have any

Angular2 - SEO - how to manipulate the meta description

别来无恙 提交于 2019-11-26 15:46:46
问题 Search Results in google are displayed via TitleTag and the <meta name="description"..."/> Tag. The <title> -Tag is editiable via Angular2 how to change page title in angular2 router What's left is the description. Is it possibile to write a directive in angular2, that manipulates the meta-tags in the <head> part of my page. So depending on the selected route, the meta description changes like: <meta name="description" content="**my description for this route**"/> 回答1: Since Angular4, you can

CodeIgniter: A Class/Library to help get meta tags from a web page?

馋奶兔 提交于 2019-11-26 14:42:51
问题 I am using codeigniter. I guess it doesn't matter which php framework I am using. But before I write my own class is there another that has already been written that allows a user to get the page title and meta tags (keywords, descriptions) of any sit...if they have any. Any sort of PHP class that does that would be great. Thanks all 回答1: You should have a look at this class: PHP Simple HTML DOM it works this way: include('simple_html_dom.php'); $html = file_get_html('http://www.codeigniter

Angular 4 - Update Meta tags dynamically for Facebook (Open graph)

拥有回忆 提交于 2019-11-26 13:49:59
How do we add/update meta tags dynamically so that they get picked by Facebook/Whatsapp share dialog? I upgraded my angular 2 application to angular 4 in order to use Meta service to add/update meta tags dynamically once we get the data in component from API. So far in my component, I have this.metaService.updateTag({ property: 'og:title', content: pageTitle }); this.metaService.updateTag({ property: 'og:url', 'www.domain.com/page' }); this.metaService.updateTag({ property: 'og:image', content: coverUrl, itemprop: 'image' }); this.metaService.updateTag({ property: 'og:image:url', content:

Which are the standard W3C meta tags?

与世无争的帅哥 提交于 2019-11-26 12:31:56
What are the list of standard meta tags defined in W3C other than the below given at http://www.w3.org/wiki/HTML/Elements/meta <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta name="copyright" content="© W3C" /> <meta name="author" lang="en" content="" /> <meta name="robots" content="Index,Follow" /> <meta name="description" content="The World Wide Web Consortium (W3C) is an international community where Member organizations, a full-time staff, and the public work together to develop Web standards." /> <meta

How do I get the information from a meta tag with JavaScript?

大兔子大兔子 提交于 2019-11-26 11:39:49
The information I need is in a meta tag. How can I access the "content" data of the meta tag when property="video" ? HTML: <meta property="video" content="http://video.com/video33353.mp4" /> Saket You can use this: function getMeta(metaName) { const metas = document.getElementsByTagName('meta'); for (let i = 0; i < metas.length; i++) { if (metas[i].getAttribute('name') === metaName) { return metas[i].getAttribute('content'); } } return ''; } console.log(getMeta('video')); joepio The other answers should probably do the trick, but this one is simpler and does not require jQuery: document.head

How can I update meta tags in AngularJS?

时光毁灭记忆、已成空白 提交于 2019-11-26 07:33:15
问题 I am developing an application using AngularJS. I want to update meta tags on route change. How can I update meta tags in AngularJS which can be shown in \"view source\" on the page? here is a HTML code - <!DOCTYPE html> <html ng-app=\"app\"> <head> <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"> <meta name=\"fragment\" content=\"!\" /> <meta name=\"title\" content=\"Test App\"> <meta name=\"description\" content=\"Test App\"> <meta name=\"keywords\" content=\"Test

Generating Facebook Open Graph meta tags dynamically

蹲街弑〆低调 提交于 2019-11-26 05:58:12
问题 As the title implies I\'m trying to generate Facebook Open Graph meta tags dynamically, but I can\'t get it working. Is it even possible? UPDATE: Finally I got it working with the help of @saccharine. The following code is working for me: <?php $params = array(); if(count($_GET) > 0) { $params = $_GET; } else { $params = $_POST; } // defaults if($params[\'type\'] == \"\") $params[\'type\'] = \"restaurant\"; if($params[\'locale\'] == \"\") $params[\'locale\'] = \"en_US\"; if($params[\'title\']