Tag Archives: html

HTMLUnit doesn't wait for Javascript

Questions: I have a GWT based page that I would like to create an HTML snapshot for it using HtmlUnit. The page loads using Ajax/JavaScript information on a product, so for about 1 second there is a Loading… message and then the content appears. The problem is that HtmlUnit doesn’t seem to capture the information… Read More »

Android HTML.fromHTML() with images?

Questions: My Android application receives HTML content with images in it. Is it possible to make fromHTML() function to display the images in the HTML String it receives? If not, how can I retrieve the images in the HTML string and convert them to TextView images? Thanks Answers: URLDrawable.java public class URLDrawable extends BitmapDrawable {… Read More »

HTML/XML Parser for Java [closed]

Questions: What HTML parsers have the following features: Fast Thread-safe Reliable and bug-free Parses HTML and XML Handles erroneous HTML Has a DOM implementation Supports HTML4, JavaScript, and CSS tags Relatively simple, object-oriented API What parser you think is better? Thank you. Answers: Check out Web Harvest. It’s both a library you can use and… Read More »

Loading images from jars for Swing HTML

Questions: While this answer works to load images from Jar files for ImageIcons, I cannot seem to get the right path for images referenced in Swing HTML. This displays an image in the Swing HTML when the resources are not bundled into a jar: new JLabel(“<html><table cellpadding=0><tr><td><img src=’file:icons/folder_link.png’></td></tr><tr><td>100</td></tr></table></html>”) ); Inside of the jar, the image… Read More »

Embedding Java Applet into .html file

Questions: I am having trouble embedding my applet into a webpage. I don’t think I’m doing it correctly. * I have my html file in the same directory as my .class files My main method is in CardApp class This is my html code <html> <head> <meta content=”text/html; charset=ISO-8859-1″ http-equiv=”content-type”> <title>TestJCardBet.html</title> </head> <body> <applet codebase=””… Read More »

HTML5 File Upload to Java Servlet

Questions: My question kind of says it all. I am currently using Uploadify (Flash + Ajax) to the Servlet (Commons Upload w/ OWASP ESAPI overlay) with success, but I was wondering how I would go about building in HTML5 support, or rather HTML5 with flash support. I know how to get the HTML5 DnD working,… Read More »

HTML filter that is HTML5 compliant

Questions: Is there a simple approach to add a HTML5 ruleset for HTMLPurifier? HP can be configured to recognize new tags with: // setup configurable HP instance $config = HTMLPurifier_Config::createDefault(); $config->set(‘HTML.DefinitionID’, ‘html5 draft’); $config->set(‘HTML.DefinitionRev’, 1); $config->set(‘Cache.DefinitionImpl’, null); // no caching $def = $config->getHTMLDefinition(true); // add a new tag $form = $def->addElement( ‘article’, // name ‘Block’,… Read More »

Strip out HTML and Special Characters

Questions: I’d like to use any php function or whatever so that i can remove any HTML code and special characters and gives me only alpha-numeric output $des = “Hello world)<b> (*&^%$#@! it’s me: and; love you.<p>”; I want the output become Hello world it s me and love you (just Aa-Zz-0-9-WhiteSpace) I’ve tried strip_tags… Read More »