w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Get Meta Description from URL using jQuery or javascript
$.get is asynchronous. Both your alerts executed just after $.get call, but at this moment HTTP request can be still in progress. You need to move your alerts inside of callback function: <script type="text/javascript"> function addToInterest() { var URL = parent.window.location; var Title = parent.document.getElementsByTagName("title")[0].innerHTML; var MetaDescription = ""; var Img_Src = ""; var metaDesc = $.get('http://myURL.com', function (data) { MetaDescription = $(data).find('meta[name=description]').attr("content"); Img_Src = $(data).find('link[rel=image_src]').attr("href"); alert(MetaDescription); alert(Img_Src); }); } </script> Also note, what your code will hit

Categories : Javascript

Correctly set meta description in header.php
You can use the wp_head hook. // write this in your plugin add_action('wp_head', 'myplugin_get_meta_tags'); function myplugin_get_meta_tags() { $content = ''; $content .= '<!-- add meta tags here -->'; return $content; } I think this is slightly more elegant that doing all the logic in the header.php file. If you don't want to create a plugin for this, or it's needed for a single theme, you can add this code in the functions.php file in your theme (check the link for more info). Note The downside(s) to your solution are: If you ever need to create a new template that uses a different header, you need to copy the meta code to each new file, and when you make changes, make them in all header files The template files should have as little logic in them as possible,

Categories : PHP

Wordpress conditional meta tag description
What if you use the strip_shortcode function try this one function metadesc($pid) { $p = get_post($pid); $description = strip_tags($p->post_content); $description = str_replace (" ","",$description); $description = str_replace (" ","",$description); $description =strip_shortcodes($description ); if(empty($description )){ return please get home page content } else{ if (strlen($description) > 135) { return htmlspecialchars(substr($description,0,135) . "..."); }else{ return htmlspecialchars($description); } } } strip_shortcodes

Categories : PHP

Android:Getting meta name="description" in Webview
document.getElementsByName("title"); returns a set of elements not a single element so within a cycle you could use element.tagName to get the tag basicly document.getElementsByName("title")[0].tagName should work (or) Just use something like : var author = $('meta[name=author]').attr("content");

Categories : Android

on keyup, update meta description
you can do like example change $('.all').text($(this).val()); with $('.all').text('<meta http-equiv="content-type" content="'+$(this).val()+'">'); Updated Answer if you want to do it in your html then you can try this and check in firebug content will change of meta tag but it will reflect only on client side <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="This is the meta description of some sort" > <meta name="keywords" content="some, content, added" > <title>change meta content</title> <scr

Categories : Javascript

Replace tags with space in PHP for SEO Meta Description
You could use str_replace $showseodesc = str_replace(array('<p>', '</p>'), '', $showseodesc); $showseodec = substr($showseoproduct['text'],0, 160);

Categories : PHP

Meta description being returned in wrong language using php
The HTTP request sent by get_meta_tags does not contain the traditional Accept-Language header that normal web browsers send in order to notify the server which language might be appropriate. It seems like some sites (e.g. Twitter) will use a geographical IP lookup to determine the content language: From my local computer in Sweden Koppla direkt upp dig mot det som är viktigast för dig. Följ dina vänner, experter, favoritkändisar, och nyheter. From my VPS in London, UK Instantly connect to what's most important to you. Follow your friends, experts, favourite celebrities, and breaking news. So, it seems that if you intend to only look at English meta-data you would need to make your script act like an English localised web browser, using Accept-language and possibly other mea

Categories : PHP

dynamic link to sub page meta description
You will need php for this. Something like <?php $tags = get_meta_tags('http://www.yousite.com/'); $content = $tags['description']; echo "<a href="http://www.yousite.com/">".$content."</a>"; ?>

Categories : HTML

Meta tag is showing description on page content
try like this <meta property="og:title" content='<%=RSnoti("Titulo")%>'/> <meta property="og:image" content='http://alsite.com.br/robertoengler/<%=replace(RSnoti("foto"),"../","")%>'/> <meta property="og:description" content='<%=RSnoti("texto")%>'/>

Categories : HTML

HTML5 - meta description tag isn't working when shown in google
Just wait some hours so that Google can crawl your site again. Did you register your site to Google Webmaster Tools?

Categories : HTML

PHP function to replace a HTML tag (e.g. meta description) using preg_replace
Unless you know that the <meta> will be provided in a consistent format (which is difficult to know unless you actually have control over the HTML) you will have a very tough time constructing a working regex. Take these examples: <meta content="content" name="description"> <meta content = 'content' name = 'description' /> <meta name= 'description' content ="content"/> These are all valid, but the regex that would handle them would be very complex. Something like: @<metas+names*=s*('|")description1s+contents*('|")(.*?)2s+/?>@ ...and that doesn't even account for the attributes being in a different order. There may have been something else I didn't think of as well. On the other hand using a parser such as DOMDocument may be very expensive, especially

Categories : PHP

Getting rid of tags in the meta description of product pages in Magento?
The meta tags are rendered in the template app/design/frontend/{interface}/{theme}/template/page/html/head.phtml like this: <meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" /> <meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" /> I think you can replace htmlspecialchars with strip_tags. You will probably get a better value for these tags. What I don't understand is, how does this happen to you. The products have separated fields for entering meta description and keywords, that do not use a WYSIWYG editor. If you use some kind of automated filling of these fields from the product description maybe it would be a good idea to strip the tags before filling in the fields. [EDIT] You can

Categories : Magento

Extracting contents from specific meta tags that are not closed using BeautifulSoup
Although I'm not sure it will work for every page: from bs4 import BeautifulSoup import urllib page3 = urllib.urlopen("https://angel.co/uber").read() soup3 = BeautifulSoup(page3) desc = soup3.findAll(attrs={"name":"description"}) print desc[0]['content'].encode('utf-8') Yields: Learn about Uber's product, founders, investors and team. Everyone's Private Dri ver - Request a car from any mobile phoneΓÇötext message, iPhone and Android app s. Within minutes, a professional driver in a sleek black car will arrive curbsi de. Automatically charged to your credit card on file, tip included.

Categories : Python

Shell Script to change Jenkins build description picking bogus old description
I always see the null result for descriptions that haven't been set (in Jenkins 1.517). The difference that @DavidW sees is that null is used for unset descriptions and "" (the empty string) is used for a description that had a value that was cleared.

Categories : Bash

Mysql - store description and short_description or use SUBSTRING(description..)
No, it isn't (i.e. it isn't wasting space) in general. In all MySQL 5 versions there are: MySQL never uses indexes with functions in conditions (something like WHERE SUBSTR(X, 1, 2)=Y) You can build an index on VARCHAR column. I.e. if you will use short text - you'll be certain that you can use indexing by it and that index will be used. On TEXT column building an index is possible only with certain length. So if you have many SELECT queries - it's a good idea to have short descriptions (besides written above, TEXT fields are stored separately, so accessing them could cause the worst issue - disk operations). In this case you'll be able to create and use index with avoiding unnecessary disk reading operations.

Categories : Mysql

Wordpress query with multiple meta meta keys
You can not include if condition in array. Whatever you are trying to achieve with above code is you can achieve with this following code. $args2 = array( 'posts_per_page' => 10, 'post_type' => 'nekretnine', 'paged' => $paged, ); if ($lokacija != '') { $args2['meta_query'] = array( array ( 'key' => 'lokacija', 'value' => $lokacija.'' ), ); }

Categories : Wordpress

Finalizing a Cursor that has not been deactivated or closed or database not closed error
When you are done with the cursor, you need to call Cursor.close(). Leaving it not closed leads to memory leaks. E.g.: Cursor cursor = null; try { cursor = getContentResolver().query(myUri, MY_PROJECTION, null, null, null); if (cursor != null && cursor.moveToFirst()) { // moar code } } finally { if (cursor != null) { cursor.close(); } }

Categories : Android

Android Studio and ProGuard - can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [volley.jar:META-INF/MANIFEST.MF])
A similar problem is reported in this url. Hope it helps. BTW also make sure that you use the latest version of Android SDK.. it will create an empty proguard-project.txt for your project.

Categories : Misc

Application gets closed when terminal is closed, how to stop this?
Use nohup to prevent child processes from being killed when the terminal closes. spawn nohup /usr/bin/firefox https://www.google.com/ I assume there's more to the script, since there's no need to use Expect just to start firefox.

Categories : Python

How to draw closed spline 3D (closed curve 3d) through unordered list of points3D. How to arrange points3D?
It sounds like you're looking for the Concave Hull of the data set. Unfortunately, I don't know of any pre-canned algorithms, but the link references a paper that another developer was starting from, as well as some sample code, so maybe that'll help you in the right direction.

Categories : C#

django - request.META - when sending request, what to do so that data appears in request.META
With the exception of CONTENT_LENGTH and CONTENT_TYPE, as given above, any HTTP headers in the request are converted to META keys by converting all characters to uppercase, replacing any hyphens with underscores and adding an HTTP_ prefix to the name. So, for example, a header called X-Bender would be mapped to the META key HTTP_X_BENDER. See https://docs.djangoproject.com/en/dev/ref/request-response/ So, in your case, I think you need to simply send {"TOKEN": "abc"}.

Categories : Python

CSS precedence and !important
Unfortunately, this is ignored. Does anyone have an idea why? Without seeing the markup, it is hard to be sure, but the odds are that the class is on the table. !important applies only to the cascade, not to inheritance. The table cells also match body *, so they don't have line-height: inherit and get the value from the style sheet instead of their parent. for every element with class tableclassname and all subsidiary elements Use a descendant combinator, just like body * is using. .tableclassname, .tableclassname * {

Categories : HTML

The underlying connection was closed: The connection was closed unexpectedly wcf service
The first thing i will do is, instead of returning the full list of candidates i will return an empty list. If that works fine, then it is very clear that the size of the data is a problem. To modify the size play with your binding parameters.

Categories : Wcf

Using CSS !important in ExtJS setFieldStyle()
setFieldStyle will only set the style of input tag of the field, however the input and the field label are wrapped in another tag (usually a table) so using .getEl() will give you the outer element and you can set the style on that like this: .getEl().setStyle('background', '#000000 !important')

Categories : HTML

Loop is more important than rest?
Your Loop is happening too fast for any result to be shown. Everything is done but in about < 1ms. You could use timeouts to delay what's being shown so that you can see what's happening. Edit: here is the JsFiddle Link: http://jsfiddle.net/4Bz27/9/ var progress = document.getElementById('progress'); var restoreCursor= function () { document.body.style.cursor = 'default'; } document.getElementById('gogogo').onclick = (function(){ document.body.style.cursor = 'wait'; var ii = 0; // this is a immediately executed function //that calls itself with a small timeout (function goLoop(){ progress.textContent = ii; if(ii<30000){ ii++; setTimeout(goLoop,10); }else { restoreCursor(); } })();

Categories : Javascript

Why are control id's important to ASP.NET Web Forms?
Control id values are of critical importance for dynamically created controls and merging the ViewState data back to these dynamically created controls. This makes it appear to the user that the page just updated, when in reality the controls were rebuilt and the ViewState data was sent back to the server that had the id and value paired together and, finally, rebound to the control for display to the user. If you recreate the controls with different id values, then the ViewState will not properly bind to the controls and it will look to the user that the page "reset", because there changes were unable to be applied to the proper controls. Note: The id value is also used for statically created controls, but in the end id values are the keys for ViewState to put the correct value into the

Categories : Asp Net

Is closing the resources always important?
I guess all the resources I opened will be closed/released when the application/Virtual machine exits. What happens with a resource which was not regurarly released is out of your control. It may do no harm, or it may do some. It is also highly platform-dependent, so testing on just one won't help. why should I care about closing these resources in such small, short working application? The size of the application shouldn't matter. First, applications usually grow; second, if you don't practice doing it the right way, you won't know how to do it when it matters.

Categories : Java

Mark CSS rule as less important?
There's no way to do this since it's antithetical to CSS in the same way that !important is -- doing the opposite would be just as abusive. Your only option is to rely on selector specificity. You can write this in a way that is not as cumbersome by using a class for inputDiv instead of an ID, for example.

Categories : CSS

important tag not working for inline style in th
There is no font-color property its just color <p style="margin:2px;font-size:10px;color:#000 !important;font-style:italic;">to</p>

Categories : CSS

How to specify that app must perform important tasks in the background?
From the Apple documentation: Implementing Long-Running Background Tasks For tasks that require more execution time to implement, you must request specific permissions to run them in the background without their being suspended. In iOS, only specific app types are allowed to run in the background: Apps that play audible content to the user while in the background, such as a music player app Apps that keep users informed of their location at all times, such as a navigation app Apps that support Voice over Internet Protocol (VoIP) Newsstand apps that need to download and process new content Apps that receive regular updates from external accessories Apps that implement these services must declare the services they support and use system frameworks to implement th

Categories : Iphone

applying !important to all properties' values once
No, but there is a better way. Make the selector more specific than the selector that you want to override. You can for example specify the element name in the selector to make it more specific: div.someclass { color: #f00; background-color: #ff0; margin: 0; padding: 0; width: 100%; display: block; } Not only is it simpler, it's also possible to further override this with an even more specific selector. Adding !important only works in one level. The specificity of a selector is basically calculated by the number of identifiers, the number of class names and the number of element names that it contains, in that order. For example a selector like div.item .cost with two class names and one element name is more specific than a selector like div span.count with one class name

Categories : HTML

How can I ignore inherited styles without using "!important"?
If you only want to target the span, h2 and p within .text and not within .sub-text you should use the selector > Like this: .text > h2 { font-size: 20px; } That will target all h2 that are a direct child of .text. Also check http://www.w3schools.com/cssref/css_selectors.asp, And this demo.

Categories : HTML

why interface is important in creating RMI application?
RMI is about a client machine communicating with a server machine in such a special way that it seems from the programmer's perspective that you are invoking methods of an object which resides on the server. Clearly, there is some network communicating "magic" going on behind the scenes, and the central programming paradigm which enables this separation of the "behind the scenes" action and the perception you get by reading client code is, well, interface. From this line of reasoning you should be able to convince yourself that you not only cannot get around defining an interface, it is in fact the central concept around which everything else is built.

Categories : Java

Is it important for an app to work on both iPhone and iPad?
iPad owners can download and run ALL iPhone apps in the App Store. Your app must run correctly on an iPad in iPhone mode. You should test your app on an actual iPad device before releasing it to make sure there are no issues. In general, if your app works fine on an iPhone 3GS, you should be fine.

Categories : IOS

What are the most important metrics when monitoring openDJ?
With OpenDJ, all metrics are equally available through LDAP and JMX. SNMP only has a subset of the metrics, i.e. the ones that are defined in the standard directory MIB. When monitoring any server, I don't think a single capture of metrics is useful. What you want to compute average and running average over sample periods, define thresholds for some of the metrics and raise alert when those thresholds are met.

Categories : Misc

NSSortDescriptor with two equally important keys
It's quite interesting, but Im almost sure it is not possible to do. Just assigning shortName to the longName attribute, if there is no longName, while inserting to your db would be the best solution for me and simply sorting on longName.

Categories : IOS

Run a query so that all values in any category that contains "Important" come first
SELECT my_table.* FROM my_table JOIN ( SELECT Category, SUM(Importance='Important') number_important FROM my_table GROUP BY Category ) t USING (Category) ORDER BY t.number_important DESC, Category, Importance See it on sqlfiddle.

Categories : Mysql

Is ordering between glUniformBlockBinding and glBindBufferBase important?
glUniformBlockBinding sets state in the program (which is why you shouldn't be calling it every frame). glBindBufferRange sets state in the OpenGL context. Neither affects the other until you render, so no, it doesn't matter which. And yes, you cannot call glBindBufferRange (or Base, which is defined in terms of Range) unless you have allocated storage for the buffer object.

Categories : Opengl

How to provide !important to Color from codebehind
If you want to directly do it in style attribute, then you can use: this.GrdFormat.Rows[int.Parse(FormatFilterarr[1].ToString())].Styles.Add("background-color", "#e9e9e9 !important");

Categories : HTML

Display none ! important need to override by using jQuery
$('.actionButton.single-pet').removeClass('single-pet'); Or just: $('.actionButton.single-pet').addClass('single-pet-shown'); With CSS: .actionButton.single-pet-shown { display: block !important; }

Categories : Jquery



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.