html

How to validate that a string doesn't contain HTML using C#

Does anyone have a simple, efficient way of checking that a string doesn't contain HTML? Basically, I want to check that certain fields only contain plain text. I thought about looking for the < character, but that can easily be used in plain text. Another way might be to create a new System.Xml.Linq.XElement using: XElement.Parse("<...

Does it still make sense to use HTML comments on blocks of JavaScript?

In the past people used to wrap HTML comment tags around blocks of JavaScript in order to prevent "older" browsers from displaying the script. Even Lynx is smart enough to ignore JavaScript, so why do some people keep doing this? Are there any valid reasons these days? <script type="text/JavaScript"> <!-- //some js code --> </script> ...

TinyMCE in JSP(Struts application)

Which download I need to use to use TinyMCE in JSP(Struts application) I see Main Package, Development Package and also different Compression packages.. I am trying to implement Rich text editor for a text area in our application Thanks ...

How do I automatically remove an HTML page frame?

What's the best way to remove a page frame automatically? I've used this type of code before: <script language="JavaScript"> setTimeout ("changePage()", 3000); function changePage() { if (self.parent.frames.length != 0) self.parent.location="http://www.example.com"; } </script> ...

How to print a PDF from the browser

In a Web application, is it possible to force a PDF file to be printed on the client? If the browser is configured to open the PDF inside the window, I guess that calling window.print() will work, but some browsers (like mine) are configured to open the PDF externally. ...

Inconsistent JavaScript Function Results

I have this function in my Javascript Code that updates html fields with their new values whenever it is called. The problem cannot be with the function itself because it works brilliantly in every section except for one. Here is the JS function: function updateFields() { document.getElementById('bf').innerHTML = bill.time[break...

How to create div to fill all space between header and footer div

I'm working on moving from using tables for layout purposes to using divs (yes, yes the great debate). I've got 3 divs, a header, content and footer. Thea header and footer are 50px each. How do I get the footer div to stay at the bottom of the page, and the content div to fill the space in between? I don't want to hard code the cont...

Changing the BG Color of a selected link.

I have a menu that I am using and it will change the background color when I hover using a:hover but I want to know how to change the class= line so that it sticks. So from the home if they click contacts the home pages from (a href="#" class="clr") to (a href="#") and Contacts would change from (a href="#") to (a href="#...

How can I center content between a header and footer div?

In a previous question, I learned how to keep a footer div at the bottom of the page. (see other question) Now I'm trying to vertically center content between the header and footer divs. so what I've got is: #divHeader { height: 50px; } #divContent { position:absolute; } #divFooter { height: 50px; position:absolute; ...

What's the best way to truncate a URL so that it fits within a layout

What is the best way to truncate a URL when displaying it within a web page? I don't mean a link but literally displaying the URL as a value to the user, assuming that the text might be in a container of fixed width and you don't want to wrap or run outside of the container? Is it better to truncate from the end, favouring the early pa...

firefox 3 favicons - how to make them?

i noticed that paypal displays a very different favicon, one that's not just a simple 16x16 icon and is lengthy? anyone can teach me? ...

Strip HTML from a web page and calculate word frequency?

In Groovy, how do I grab a web page and remove HTML tags, etc., leaving only the document's text? I'd like the results dumped into a collection so I can build a word frequency counter. Finally, let me mention again that I'd like to do this in Groovy. ...

Show a PDF document in a browser without the menu bar

I have a touch screen kiosk that displays a webpage and a pdf document. Can I remove the menu bar? Users must not have "save", "print" and other such features. Update random screenshot on flickr - I am refering to the print, back/forward, zoom bar that controls the PDF -- not the browser menu. Sorry for not beeing specific. ...

Minimize CSS length holding style of given HTML constant

Suppose A.css styles B.html. What tools/techniques are there to programmatically reduce the size of A.css while holding its styling effects on B.html constant? Here are some techniques I would imagine such a tool using: Remove redundancies in A.css. For example, if the same class is defined twice you can remove the second definition wi...

Non-Standard Attributes on HTML Tags. Good Thing? Bad Thing? Your Thoughts?

HTML (or maybe just XHTML?) is relatively strict when it comes to non-standard attributes on tags. If they aren't part of the spec, then your code is considered non-compliant. Non-standard attributes can be fairly useful for passing along meta-data to Javascript however. For instance, if a link is suppose to show a popup, you can set th...

How do I prevent a jQuery Selector from including nested elements?

I'm new to jQuery so hopefully there is an easy answer to this. I have html similar to: <table id="dataTable"> <tr> <!-- I want this row --> <td>...</td> <tr> <tr> <td> <table> <tr> <!-- I do not want this row --> <td>...</td> </tr> </tab...

In JavaScript is it possible to launch a file browser dialog programatically?

Instead of using the <input type="file"> tag I'd like to have a button that launches a file browser dialog. My first thought was to have a hidden file input tag and a button. I'd use the button click on the button to fire the onclick of the hidden file input, but I haven't been able to get this working properly. So the question is, is...

How do I make the footer stretch vertically?

I have a footer that is a 1 x 70px, which is set as the background and tiles horizonally. In cases when the web page does not contain a lot of content on it, it will display the footer above where the footer should be. I want it to fill in with a solid color, so if they scroll down, it won't show the footer, then the white under the foo...

How to make this site work in non-firefox browsers?

This page displays beautifully in firefox but i get all kinds of problems when testing the site in opera or internet explorer, mostly with the menu. I would like to know what techniques have caused this and how to avoid them. Thank you! Edit: Really embarrassing! I forgot to provide a link, sorry :( http://www.jkhbdesign.se/ Edit 2: He...

Why so many web pages contain such a strange code snippet in header?

I've noticed for quite a long time that strange domains such like jsev.com, cssxx.com appered in my firefox status bar from time to time, I always wonder why so many web pages contains resources from these strange domains. I googled it, but found nothing. I guess it's some kind of virus which infect the servers and insert the code. Here ...