html

Adding an onclick event to a table row

Hey! I'm trying to add an onclick event to a table row through Javascript. function addRowHandlers() { var table = document.getElementById("tableId"); var rows = table.getElementsByTagName("tr"); for (i = 1; i < rows.length; i++) { row = table.rows[i]; row.onclick = function(){ var c...

Are these DIVs really necessary?

Hey there I sometimes find myself creating a div which serves no other purpose than to hold another element. For example when creating a menu, I would create a div and assign it a background colour, position etc. Then within it I would create an unordered list. I could surely assign all the properties I assigned to the DIV to the UL ...

PHP/HTML/CSS: IE acting weird when using require_once()

Now this is the most weird problem I've ever had in PHP. All pages looks normal except one; when I first saw the problem I thought it was one of these common problems with IE and stylesheets (I've got a specific CSS-file on this page). I tried to exclude the CSS-file just to ensure that the problem really was in this file, but it wasn't...

How can I make these elements line up correctly using CSS?

Here is how my menu looks right now: Here is how I want it to look: Right now I have the following css: #menu { position:relative; width: 940px; height:90px; } #menuItem { position: absolute; bottom: 0px; padding-left: 50px; float: left; width: 600px; } .titleText { float: right; color...

IE not loading the whole page HTML source code

My blog loads normally on Google Chrome and FireFox, but not on IE, when viewing the source code I figured out that it stops reading html at a certain amount. at the end of the source code I find this </script> <div class='clear'></div> <span class='widget-item-control'> <span class I agree it's a big webpage (the last line is 1338) ...

How can I force the browser to redraw while my script is doing some heavy processing?

I am using the innerHTML property to modify a DIV dynamically, to report on a process that takes a few seconds to finish. The problem is that on Firefox the page is not actually re-rendered to reflect that change until after the script has finished. This makes the app feel sluggish. Is there a way to make sure that changes to the HTML sh...

Does everything inside a <ul> have to be wrapped in an <li>?

Hello, I need some guidance about nested lists in HTML. I have a layout that I would like to be built like below. Is it a terrible thing to nest an element not wrapped by an <li>? I'm fairly sure that it is against standards, but don't know what ill effect it has. <ul> <li> <h1>header 1</h1> <li> <ul> <li>nes...

DOCTYPE's role in general XML

I know the purpose of DOCTYPE (and what each url/identifier on the line is) as far as web standards and page validation goes, but I am unsure about what it actually "is" in the context of an XML document. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dt...

HTML Purifier - what to purify?

I am using HTML Purifier to protect my application from XSS attacks. Currently I am purifying content from WYSIWYG editors because that is the only place where users are allowed to use XHTML markup. My question is, should I use HTML Purifier also on username and password in a login authentication system (or on input fields of sign up pa...

How to disable default scroll bar for textareas in IE8?

I am going through some of my older sites where I have a contact form and in IE8 there always is a vertical scroll bar displayed for my textareas, even when there is no content. In Firefox, it doesn't seem to make the vertical scroll bar exist until the content in the textarea reaches a height that deems them necessary. I have styled m...

Live HTML & PHP editor/IDE for PC?

Are there any IDEs on PC which will allow you to view your changes live as you are typing? / Can any IDEs you know of be set up to do that? For both HTML and PHP ideally? ...

Setting focus using left and right arrows (HTML + JS)

Is there any to make the left arrow behave like the tab button (set focus to the next focusable item) and the right arrow behave like a shift+tab (set focus to the previous focusable item)? I've gotten this far: $().keypress(function(e) { if (e.keyCode == 37) { alert('I want to do a shift-tab'); } else if (e.keyCode...

substituting valign through CSS

Hi Guys, I have been trying to position content within a table row. The row in question in turn contains 2 other tables and 1 small thumbnail image (each within a table cell of course). The row was positioned using valign="top" till now. This worked well getting contents of all the three columns to the top. However, I wanted to positio...

GET variables not passed when mixed in with URL

Why is it that when I pass parameters through encoded URL and GET method in HTML form, the URL encoded parameters are dropped? e.g. Setup: <form action="process.php?hello=world" method="GET"> <input type="text" name="foo" value="bar"> <input type="submit"> </form> Result: the variable hello will not be recognized in process.php. Is ...

How do I improve this Menu code

I am using a function to spit out my main and sub menu's for me. Basically I feed it a page ID and it gives me the menu with the menu item properly highlighted through CSS. What I'm asking is: How do I improve this code (and others like it that I have laying around)? Lowering the amount of lines of code and decreasing repetition of cod...

What is the replacement for a blinking text in a web page?

Hi, I have heard that using blinking text in a page to get user's attention is not a good practice. What is the alternative for that? ...

Vertically aligning the text cursor (caret?) in an input box with jQuery, Javascript or CSS.

Hey all, I'm messing with the CSS on an input box in CSS, to make the text bigger, adding a border, changing color, etc. I've aligned the bigger text to fit nicely (vertically-aligned) within my input box using padding, but the little blinking text cursor is terribly aligned (hugs the bottom). I'm wondering if there is a way to adjust...

In a URL Should spaces be encoded using %20 or +?

In a URL that used to request an image on a page (in this case a tracking image) should I encode the spaces using %20 or +. i.e. www.mydomain.com?type=xbox%20360 or www.mydomain.com?type=xbox+360 Our tracking company is expecting the top version, but the Java method URLEncoder.encode("xbox 360","UTF-8") gives the bottom version. Wh...

overflow="scroll" in <td>

Why does the css property overflow="scroll" not work in <td>, while overflow="hidden" works well? <table border="1" style="table-layout:fixed; width:100px"> <tr> <td style="overflow:scroll; width:50px;">10000000000000000000000000000000000</td> <td>200</td> <td>300</td> </tr> </table> From the css specs1,2, I can't see ...

How can I convert this table based layout to CSS?

I have a table based layout which is 100% height/width with no scrollbars. The header (red) automatically expands to fit the content and I don't know how many pixels it will be. The fluid table below gives exactly what I what. <html> <body height=100%> <table height=100% width=100% padding=0> <tr height=1><td colspan=2 bgcolor=red>Fit...