w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Mouseovers in NSCollectionView+NSScrollView
A different approach... an NSView inherits from NSResponder class. NSResponder has methods "mouseEntered:" and "mouseExited:". My suggestion is to use those in your NSView subclass if possible and skip the tracking areas.

Categories : Objective C

how to randomly insert html inside of html string without causing invalid html
You'd need to incorporate some kind of state machine in your generator. You can think of something like this: Step1: Choose which element to render: a textnode, a paragraph, a list node. When you pick a textnode you randomly generate some text and return to Step 1. When you pick a paragraph you emit <p> and generate some text, emit </p> and return to Step 1. In the case of a list node you can only make list elements <li>, so pick a random number of elements and fill them with same rules from Step 1. -- You can also allow nesting. In <li> you can add <strong> and <em>, similar for <p>. You can make it as crazy as you want I guess :) Tweak a bit with the coefficients to get good results. Try to make a generator that produces random, but pred

Categories : PHP

Getting links from an HTML table using HTML::TableExtract and HTML::Extor in Perl
You don't describe what the problem is...what exactly doesn't work? What does $row->[0] contain? But part of the problem might be that TableExtract returns just the 'visible' text, not the raw html, by default. You probably want to use the keep_html option in HTML::TableExtract.

Categories : HTML

How to make an html id defined in an html accessable in another html file
Normally you can't. But you could create an iframe from your html page and load the file that you want to access. either make the iframe hidden or of no size. Here is a post that mentions how to do access id's like that: Access child iFrame DOM from parent page

Categories : HTML

jQuery .html() Outputs html code as text not html
Use $('.tooltip' + $rowid + '').append($dbData); instead of $('.tooltip' + $rowid + '').html(). or $('.tooltop' + $rowid + '').html(function(index, yourOldHtml) { return $dbData; } if $dbData is your <table><tr><th>Cause</th><th>Delay</th></tr></table> string. Fiddle here update as @roasted pointed out, the append() way isn't the exact same behaviour as html() as it empties the element first. use .empty().append($dbData). Thanks roasted!

Categories : Jquery

How to load html contents from stream and then how to create style sheet to display the html file in preview pane (like HTML preview handler)
You mean you want to make HTML Browser inside a window? please take a look at this link. http://www.codeproject.com/Articles/3365/Embed-an-HTML-control-in-your-own-window-using-pla if this isnt what you want, please explain what you mean by "preview handler for HTML"

Categories : C++

Difference between and
<html:html> uses the struts-html tag library, where <html></html> is just plain old html. You can read all about the struts-html taglib here.

Categories : Java

how to convert string containing HTML element into HTML DOM elements form in Django Python
you need to set the autoescape to off {% autoescape off %}{{ str }}{% endautoescape %}

Categories : Jquery

mvc3 @Html.EditorFor and @Html.CheckBoxFor fields do not bind to new sorted values
This may be an instance where you can't rely on Html.CheckBoxFor<T>() but instead should use Html.CheckBox() to manually bind the Ids and values you're looking for. It's not the nicest, but it's seemed to work for me before. Here's a psuedo-code example of the View as I'm thinking about it in my head: @for (var i = 0; i < Model.ProductItems.Count; i++) { <tr> <td> @Html.HiddenFor(m => m.ProductItems[i].ProductID) @Html.ActionLink(Model.ProductItems[i].ProductID.ToString(), "ProductEdit", new { id = Model.ProductItems[i].ProductID }) </td> <td> @Html.HiddenFor(m => m.ProductItems[i].Code) @Html.DisplayFor(m => m.ProductItems[i].Code) </

Categories : Asp Net Mvc

Django/Python - how to crawl html and change text and send as html email
Well, your template should have Dear {{name}} as part of it and when you render instead of using html_content = render_to_string('the_template.html', {'varname':'value'}) use html_content = render_to_string('the_template.html', {'name':<whatever name you want>}) if you're referring to it from the request object, you can use Dear {{request.user.first_name}} {{request.user.last_name}} instead.

Categories : Python

Using Grunt, is there a way to reuse html snippets and have Intellij IDEA still recognize the snippet as html?
please can you clarify what your code looks like? Is it javascript with some HTML snippets? Smth like: livereloadUtils.getSnippet = function() { snippet += '<p>my html code here</p>'; ... WebStorm normally recognizes such snippets as HTML, and syntax highlighting/completion is available. You don't need to do anything special to enable it

Categories : Javascript

HTML Agility Pack - Issue selecting an HTML select tag with the option tags within
You need to set the ElementsFlag field for the option tag to make it work HtmlNode.ElementsFlags["option"] = HtmlElementFlag.Closed; HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(html); which should return your original HTML code. I believe the reason that HtmlAgilityPack behaves this way is because the <option>-tag is ironically an optional tag in HTML that doesn't require a closing tag. Taken from the documentation of the HtmlNode class and it's field ElementsFlags: Gets a collection of flags that define specific behaviors for specific element nodes. The table contains a DictionaryEntry list with the lowercase tag name as the Key, and a combination of HtmlElementFlags as the Value. Further look into the HtmlElementFlag enums reveal this: Empty - The node

Categories : C#

How can I package html data (html text, images, etc) in PHP so a client can access it (iOS, Android)
You could try the data URI scheme. It allows you to encode an image file directly into your HTML code. <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" /> That example is taken from this Wikipedia article, which also provides a PHP example. It's very easy to do. The caveat to this is browser support but it sounds like most modern browsers, including mobile, should support it. Give it a go and see, should take no time to implement and you'll know right away if it's the right solution.

Categories : PHP

Convert html encoded string back into html elements jQuery/JavaScript
Here's a quick example. You just pass it into the other jQuery object's html function. JSFiddle HTML: <div id="someInfo">Hello, this is a simple example.<p>Boom, a paragraph.</p></div> <div id="storeHereLater"></div> CSS: $(function(){ var someInfoHTML = $('#someInfo').html(); $('#storeHereLater').html(someInfoHTML); });

Categories : Javascript

The difference between "IE9 debug tools" HTML output and webpage source HTML that I got via C#
You can get the original source (the one sent by the server) in "Script" tab (this works both on my IE8 and my IE10). If you do not use AJAX, I think you can right-click on the page and choose Display Souce option too.

Categories : C#

Loading HTML using JQuery's getScript multiple times after the HTML is removed over and over
From http://api.jquery.com/remove/ Similar to .empty(), the .remove() method takes elements out of the DOM. Use .remove() when you want to remove the element itself, as well as everything inside it. In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed. To remove the elements without removing data and events, use .detach() instead. So all events bound on the div and its descendants will be removed and can be safely rebound. However if the JavaScript you are injecting binds events to things outside the div like the document, window, body etc.. multiple events will be bound which will likely cause problems if unintended. As of jQuery 1.4, the same event handler can be bound to an element multiple times. This is especially

Categories : Javascript

How can I send a mail from unix mutt client with both html and body in html?
I suspect you'll have to craft the body yourself. Note that the content_type of a mixed body is multipart/alternative I found this question interesting. Here's my take on it: #!/bin/sh # using mutt, send a mixed multipart text and html message: usage() { echo "error: $1" echo "usage: $(basename $0) -t textfile -h htmlfile -s subject -r recipient" exit 1 } textfile="" htmlfile="" subject="" recipient="" while getopts "t:h:s:r:" opt; do case $opt in t) textfile="$OPTARG" ;; h) htmlfile="$OPTARG" ;; s) subject="$OPTARG" ;; r) recipient="$OPTARG" ;; ?) usage "invalid option: -$OPTARG" ;; esac done shift $((OPTIND-1)) [ -z "$textfile" ] && usage "no textfile specified" [ -z "$htmlfile" ] && usage "no htmlfile spec

Categories : Shell

Parse content inside all HTML elements with class .mod in HTML document with PHP
You could use xpath $path = new DOMXPath($this->document); $nodes = $path->query("//*[contains(concat(' ', normalize-space(@class), ' '), ' mod ')]");

Categories : PHP

HTML link HTML code inside (for toolbar across multiple pages)
You can try to type out your navigation bar / header in a html page, save it has header.php and then in all of your other pages (for example index page), type in <?php get_header(); ?> at the beginning to grab the header. Make sure the header.php is in the same folder as your other files (for example index.php).. Let me know if it does or doesn't work.

Categories : HTML

Parsing html in win8 store app using linq and Html Agility Pack
HtmlAgilityPack.HtmlDocument doc= new HtmlAgilityPack.HtmlDocument(); htmlDoc.LoadHtml(stringWithHtml); var names = doc.DocumentNode.Descendants().Where(n => n.Name == "td").Where(x => x.Attributes["class"] != null && x.Attributes["class"].Value == "sivo"); var links = doc.DocumentNode.Descendants().Where(n => n.Name == "td").Where(x => x.Attributes["class"] != null && x.Attributes["class"].Value == "sivo").Select(x => x.Descendants().Where(s => s.Name == "a")); foreach (var item in names) { var blabla = item.InnerText; } foreach (var item in links) { var lnks = item.Select(x => x.Attributes["href"].Value);//links var times = item.Select(x => x.InnerText); //times }

Categories : C#

creating dynamic HTML. Automatically write HTML to a web page when an action is done
You shouldn't try to append a content to the HTML file. What will you do when your user removes the MP3 ? Remove the HTML content ? Heavy process ^^ Where you basically use your HTML file, use a PHP script which reads entries from your database. Something like... $db = new PDO(/* database settings */); $query = $db->query("SELECT * FROM musics"); while($result = $query->fetch(PDO::FETCH_OBJ)) { echo $result->song_name . " by " . $result->artist; } This will list your songs and give that kind of output : My Little Song by Soroush Shamsfard. My Favourite Song by Soroush Shamsfard. Some information about reading data from a database : http://www.electrictoolbox.com/php-pdo-bound-placeholders/

Categories : PHP

Html.Raw(HttpUtility.HtmlDecode(item.Content)) displays html tags
I would look at your data. I ran into something similar and found that my data was saving with ascii tags in it. the editor was translating those ascii tags and showing html tags instead of rendering. I created two simple methods to convert public string Decode(string value) { return (value) .Replace("&quot;", """) .Replace("&lt;", "<") .Replace("&gt;", ">"); } public string Encode(string value) { return (value) .Replace(""", "&quot;") .Replace("'", "''") .Replace("<", "&lt;") .Replace(">", "&gt;"); } and ran my string through that going to the database and back and it fixed the problem for me.

Categories : HTML

HTML source field is also changing html code into escaped characters
Not sure I totally understand what you're saying, but try this to use the htmlEncode function as defined like this: function htmlEncode(value){ //create a in-memory div, set it's inner text(which jQuery automatically encodes) //then grab the encoded contents back out. The div never exists on the page. return $('<div/>').text(value).html(); } From HTML-encoding in JavaScript/jQuery

Categories : Javascript

How to Convert the converted HTML tags back to the actual HTML Content
You have to use the same function, but this time with additional parameter 1. SELECT DBMS_XMLGEN.CONVERT ( '<p style=&quot;margin-bottom: 0pt;&quot;&gt;&lt;FONT color=#000080 size=2&gt;&lt;FONT color=#000080 size=2>;', 1) FROM DUAL

Categories : SQL

Trying to use HTML::TableExtract in Perl to extract table from HTML file, but failing
This seems to work with the URL you provided: use 5.014; use strict; use warnings; use open qw(:std :utf8); use HTML::TableExtract; my $te = HTML::TableExtract->new( headers => [qw(Ligand Sp. Action Affinity Units Reference)], ); $te->parse_file('sample.html'); my @tables = $te->tables; for my $t (@tables) { my @rows = $t->rows; for my $r (@rows) { for my $c (@$r) { $c =~ s/As+//; $c =~ s/s+z//; } say "@$r"; } }

Categories : Perl

jQuery - how to append values into html elements without getting them parsed as html tags
You can use html() to set the element markup, then find() the container you want to insert text into and invoke text() on it. In your case, something like: $("#htmltest").html("<ul><li></li></ul>").find("li").text(testvar);

Categories : Javascript

Insert html tag to a Database as a String and retrieve it back and show the html
Let's suppose that you have a view model and in the Text property you have retrieved the HTML value from the database: public class MyViewModel { public string Text { get; set; } } Now in your view you could use the @Html.Raw helper to avoid the output to be automatically HTML encoded: @model MyViewModel @Html.Raw(Model.Text) Needless to say that by doing this you are opening your site to XSS attacks if you do not sanitize the user input before outputing it. For example you could use the AntiXSS library.

Categories : C#

Parsing RSS in a Ruby on Rails project shows the html as inline html
The way you're processing and displaying the RSS in a view isn't the way I'd do it, but the quick answer is that you need to call html_safe for any HTML strings you build in this way. This may be unsafe, as the incoming RSS data may have code in it that causes cross site security issues. You can handle that by using the sanitize helper. I think the sanitize helper automatically calls html_safe for you. So, at the end of your blog_feed method, replace the html return value with: sanitize html Check out the documentation for sanitize here: http://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize

Categories : Ruby On Rails

HTML Parsing and removing anchor tags while preserving inner html using Jsoup
How about extracting the inner HTML first, adding it to the DOM and then removing your tags? This code is untested, but should do the trick: Edit: I updated the code to use replaceWith(), making the code more intuitive and probably more efficient; thanks to A.J.'s hint in the comments. Document doc = Jsoup.parse(inputHtml); Elements links = doc.select("a"); String baseUri = links.get(0).baseUri(); for(Element link : links) { Node linkText = new TextNode(link.html(), baseUri); // optionally wrap it in a tag instead: // Element linkText = doc.createElement("span"); // linkText.html(link.html()); link.replaceWith(linkText); } Instead of using a text node, you can wrap the inner html in anything you want; you might even have to, if there's not just text inside your li

Categories : Java

Save the client HTML content back to the Server as a HTML file
Even though I have no idea why you want to save the whole html code because I'm sure there will be parts that are the same for every user and you will be wasting memory, but ok. So there are two ways to do this: 1. is javascript as you said 2. would be to put all the generated html code into a hidden form input (already on server side) the first one seems more comprehensive and this is what I would do but the second one would also work for users with js disabled.

Categories : Javascript

how to append html in jQuery Form Plugin without rewriting previous html
You can use hidden proxy container which will receave html from plugin. Bind custom event on this container an fire event in success() method. In event handler you can append html from both containers. html: <div id="hidden"></div> <div id="htmlExampleTarget">Init html</div> js $(document).ready(function() { // bind form using ajaxForm $('#htmlForm').ajaxForm({ // target identifies the element(s) to update with the server response target: '#hidden', // success identifies the function to invoke when the server response // has been received; here we apply a fade-in effect to the new content success: function() { $('#hidden').trigger('changed'); } }); $('#hidden').on('changed'

Categories : Jquery

return to index.html from images.html by using phone back button in phonegap android
Try putting $.mobile.phonegapNavigationEnabled = true in your mobileinit handler per http://jquerymobile.com/demos/1.2.0/docs/pages/phonegap.html instructions.

Categories : Javascript

Adding Javascript/HTML Form functionality to an 'html item' in COGNOS Report Studio v10
In COGNOS Report Studio I was able to drag in a single 'html item' onto my report and put the following code in it; <script> function openWindow() { windowObject = window.open('http://www.google.com/','_blank','width=400,height=700,status=yes,resizable=yes,scrollbars=yes'); windowObject.focus();//gives focus to window } </script> <input type="button" value="Info" onclick="openWindow();" /> Now there is a button in the upper right of my chart that once clicked opens a separate window (with a set size) to additional information pertaining to the chart.

Categories : Javascript

Html.ActionLink(linkText, actionname, actioncontroller, routevalues, htmlAttributes) renders wrong HTML
@Html.ActionLink(linkText: "dothis", actionName: "Index", controllerName: "SelectActioncontroller", routeValues: new { actionController = "dothisController", actionName = "dothis", actionText = "dothis" }, htmlAttributes: null) You are using "Index" action in your link, check the second parameter. Since it's the default value for an action in the default route, it isn't added to the URL.

Categories : HTML

I want to convert this html code using html helper into cakephp But it shows unexpected Behaviour in my layout. How can i fix it?
try this code snippet <?php echo $this->Html->link('Company' . $this->Html->tag('b', '', array('class' => 'caret')), '#', array('class' => 'dropdown-toggle', 'data-toggle' => 'dropdown','escape' => false)); ?>

Categories : Cakephp

MVC Html ActionLink with Twitter Bootstrap doesn't work with html attributes for javascript integration
Try to use initializer syntax to pass HTML Attributes as Dictionary @Html.ActionLink("Delete", "Delete", routevalues, new Dictionary<string, object>{ { "id", "mylink" } } ) As per LinkExtensions.ActionLink there is no overload for ActionLink(HtmlHelper, String, String, RouteValueDictionary, Object) Thus you have to use oveload ActionLink(HtmlHelper, String, String, RouteValueDictionary, IDictionary<String, Object>)

Categories : Javascript

How can I use these Node modules to accept HTML through a file or URL and then output JSON as validation of existing HTML elements?
Depending on the arguments call either one of checkHtmlFile() or checkUrl() Something like: if (program.url) checkUrl(program.url, program.checks); else checkHtmlFile(program.file, program.checks); Read this for more references: commander.js option parsing Also, checkJson2 is undefined as checkUrl() isn't returning anything.

Categories : Javascript

Export charts to html - missing images when open html in application. How to set absolute path to image
You don't want the image to be an absolute path, otherwise when you send it via email it won't show on the client machine unless the image is in the exact location (which it won't be). You need to make sure that when you send the html file the image is also sent and in the correct format. See the post below for more details on this: embedding image in html email I don't think iReport will be able to help you with this so you may have to modify the contents of the HTML file before attaching it to the email.

Categories : Java

BeautifulSoup not extracting all html (automatically deleting much of a page's html)
It's working fine for me, but I get error when I say soup.prettify().encode('utf-8') >>> from BeautifulSoup import BeautifulSoup as bs >>> >>> import urllib >>> url = 'http://brooklynexposed.com/events/' >>> html = urllib.urlopen(url).read() >>> >>> >>> soup = bs(html) >>> soup.prettify().encode('utf-8') Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 8788: ordinal not in range(128) >>> >>> soup.prettify() '<!doctype html> <!--[if lt IE 7 ]&gt; &lt;html class="no-js ie6" lang="en"&gt; &lt;![endif]--> <!--[if IE 7 ]&gt; ... ... ... ... </body>

Categories : Python

Python: Convert quote in HTML content not HTML tags
Use a HTML parser instead, then simply replace the quotes with .replace('"', '&quot;'). BeautifulSoup makes this task easy: from bs4 import BeautifulSoup soup = BeautifulSoup(htmlsource) for string in soup.strings: string.replace_with(string.replace('"', '&quot;')) htmlsource = str(soup)

Categories : Python



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