html

Cross browser "jump to"/"scroll" textarea

I have a textarea with many lines of input, and a JavaScript event fires that necessitates I scroll the textarea to line 345. scrollTop sort of does what I want, except as far as I can tell it's pixel level, and I want something that operates on a line level. What also complicates things is that, afaik once again, it's not possible to m...

Displaying whitespace in HTML when pulling from MySQL TEXT column

I have saved input from a textarea element to a TEXT column in MySQL. I'm using PHP to pull that data out of the database and want to display it in a p element while still showing the whitespace that the user entered (e.g. multiple spaces and newlines). I've tried a pre tag but it doesn't obey the width set in the containing div elemen...

How to start automatic download of a file in IE?

How do I initialize an automatic download of a file in IE? For example in the download page, I want the download link to appear and a message: "If you download doesn't start automatically .... etc". The download should begin shortly after the page loads. In FireFox this is easy just need to include a meta tag in the header < meta http...

What is the consensus on "Voice-family" Hacks?

I just started working for a pretty large company and my group manages all of their public facing websites. I opened the style sheet for the first time today and have seen over 20 instances of the designers using the voice-family hack to fix an IE bug. (I don't know why they allow graphic designers to write any kind of markup at all) W...

What are the potential pitfalls of using HTML Frames for templating?

We could also include IFrames as well. ...

IE7 form not prompted for remember password when submitted through javascript

I have a website where we use Javascript to submit the login form. On Firefox it prompts the user to remember their password, when they login, but on IE7 it doesn't. After doing some research it looks like the user is only prompted in IE7 when the form is submitted via a Submit control. I've created some sample html to prove this is t...

</br> not working in firefox and chrome

break line tag is not working in firefox, neither in chrome. When i see the source of my page i get: <p>Zugang zu Testaccount:</br></br>peter petrelli </br></br>sein Standardpwd.</br></br>peter.heroes.com</p> However when i do view selected source, i get: <p>Zugang zu Testaccount: peter petrelli sein Standardpwd. peter.heroes.com<...

Limiting HTML Input into Text Box

How do I limit the types of HTML that a user can input into a textbox? I'm running a small forum using some custom software that I'm beta testing, but I need to know how to limit the HTML input. Any suggestions? ...

Which Type of Input is Least Vulnerable to Attack?

Which type of input is least vulnerable to Cross-Site Scripting (XSS) and SQL Injection attacks. PHP, HTML, BBCode, etc. I need to know for a forum I'm helping a friend set up. ...

What is the best way for a website to check if a user has installed a client app?

Let's say I've got a website that works better if a client has installed and logged into a desktop application. I'd like to be able to do 2 things: Alter the website if they haven't installed the app (to make it easy for them to find a link to the installer) If they've installed the app on a couple of machines, determine which machine...

What is the best client side browser library to upload multiple files over http?

What is the best client side http library to upload multiple files? If it can handle directories that's a huge bonus. I'm looking for something that is open source or free. I'm looking for something like FTP, but that works over http, through the browser. Uploading multiple files through a normal HTML 4.x form is a bit of a hassle when i...

Find X/Y of an HTML element with Javascript

How can I find the X Y coordinates of an HTML element (DIV) from Javascript if they were not explicitly set? ...

HTML - display an image as large as possible while preserving aspect ratio

I'd like to have an HTML page which displays a single PNG or JPEG image. I want the image to take up the whole screen but when I do this: <img src="whatever.jpeg" width="100%" height="100%" /> It just stretches the image and messes up the aspect ratio. How do I solve this so the image has the correct aspect ratio while scaling to the ...

Syntax highlighting code with Javascript

What Javascript libraries can you recommend for syntax highlighting <code> blocks in HTML? (One suggestion per answer please). ...

How do I insert HTML-Formatted Strings into a Microsoft Word Document using Visual Basic while preserving formatting?

I use Visual Basic and an automation interface to retrieve strings from an external application. These strings contain simple html formatting codes (<b>, <i>, etc.). Is there any easy function in Visual Basic for Word to insert these strings into a word document and convert the html formatting codes to word formatting? ...

Word 97-2003 document to HTML conversion - programatically

I need to convert Word binary documents (version 97 up to 2003) into HTML documents programatically. I have googled for 3rd party libraries but most results are junk built on top of System.IO.Package which, ofcourse, are useless for other word documents except Word 2007 - Office Open XML. Do you know a good tool / library for .NET to pr...

Determining the height of an HTML table that is dynamically filled

Hi there, I would like to draw a diagram in HTML. The positioning structure looks like this: <div id='hostDiv'> <div id='backgroundDiv'> ... drawing the background ... </div> <div id='foregroundDiv' style='position: absolute;'> ... drawing the foreground ... </div> </div> The foreground contains a Table ...

Unequal Html textbox and dropdown width with XHTML 1.0 strict

I'm trying to have two inputs (one textbox, one drop down) to have the same width. You can set the width through css, but for some reason, the select box is always a few pixels smaller. It seems this only happens with the xhtml 1.0 strict doctype Any suggestions/ideas about the reason/work around? Having the following HTML <!DOCTYPE ht...

Are Meta Keywords Obsolete?

Creating a website for a BraodBand Company, and not too sure whether or not to go ahead and fill in the meta keywords? Are they still necessary? ...

With Rails, where should I put html snippets? I don't want partials but I want them reloaded during development.

Being lazy (and liking DRY code), I'm the kind of guy who's going to write a few little wrappers for recurring HTML markup. Those provided by Rails are good already, but sometimes I have something a little more specific that I know I'm going to repeat over and over. In some situations a partial can be the solution, but sometimes I'm jus...