html

Faking body.scrollHeight

I have a JavaScript application that is being loaded in an iframe (via a Liferay portlet). The actual HTML is just an empty tag and the JS is loaded when the document is loaded. When Liferay loads the page in the iframe, it resizes the frame based on the body.scrollHeight property which ends up being 0 since there is no real content i...

A good HTML object model in Java ?

I'm looking for an HTML object model in Java, capable of parsing HTML (not required) and containing all HTML elements (and CSS as well) in an elegant object model. I'm looking for a pure java version of the Groovy's HTML builder. (I have no luck on google with this request.) I want to be able to perform stuff like: HTML html = new HTM...

Check the parent checkbox with jQuery

Basically I am trying to write a js func that if I check a child checkbox the parent checkbox also checks, if not already checked. I am using jquery here is my html: <ul id="ulParent" style="margin: 0; padding: 0; list-style: none;"> <li style="margin: 0 0 5px 0;"> <input type="checkbox" checked="check...

Add a Link Around an Embedded Flash File

I want to make it so that when I click anywhere on the embedded Flash element, it takes me to a destination URL. Here is my current code, which does not produce the desired effect: <div class="contentdiv" style="margin:-72px 0 10px 0px; cursor:pointer;" onclick="location.href='http://example.com/';"&gt; <object height="410" width="720...

setAttribute is not working for 'style' attribute on IE

I'm porting a piece of JS code written for Firefox into Internet Explorer. I faced a problem of changing style of an element using setAttribute method which was working on Firefox. button.setAttribute('style', 'float: right;'); I tried setting the style member of button and it didn't work either. This was the solution in case of setti...

How do I echo selected in a while loop?

Hello, I have a blogs and questions section on my site that has categories. When a user composes a question or a blog, there is a drop down menu that allows you to choose your category. When you edit either of these you have the option of changing your category via the dropdown. When you go to edit a blog,the category drop down is a stan...

How to Create Automatically Expanding Block

I need to create a one-lined 3-column layout. The left and right columns should each display one word without truncation (they should expand and contract to fit the word). The center column should display a potentially lengthy string, truncated to fit between the two columns. Here's a bit of HTML to convey the idea: <div class="cont...

Missing top and bottom border in IE7

I have a problem with border in IE7. For some reason the border shows only from the left and the right side: IE7, renders incorectly: FF, renders correctly: Using this CSS: .tags a { background:#fff; border:1px solid #D8DFEA; padding:5px; margin-left:5px; color:#3B5998; font-size:14px; } What am I doing wrong? ...

Make a div's total width the same in both Strict and Quirks mode

Consider the following <div style="width:150px;border:50px solid black">Test</div> If this is output onto a page that IE8 renders in strict mode (or if you load into Firefox etc) then the inside of the div (the white area where test is) will be 150px wide but the div in total will be 50 + 150 + 50 = 250px wide (accounting for the bord...

Can non styled HTML elements make any type of problem in document flow or any cross browser problem?

Should we write css to each element or only for those elements which want to give style? like for example <div id="first"> <span class="one"> <a href="#">content text</a> </span> </div> <div id="second"> <span class="two"> <a href="#">content text</a> </span> </div> <div id="third"> <span ...

What changed in firefox 3.6 to make <ul>'s render differently?

Edit (Solution Discovered) Thanks everyone for your help on this. The problem was an error in one of the lines of CSS that was being included (it's a large project with a huge combined CSS file so it was hard to spot). This was the problem line: background:transparent url(sf-pager.gif') repeat-x scroll bottom; Notice the missing apos...

HTML 5 SQLite: Multiple Inserts in One Transaction

Is it possible to do something like this: begin; insert into some_table (some_col, another_col) values ('a', 'b'); insert into some_table (some_col, another_col) values ('c', 'd'); ... commit; ...in HTML 5? With each transaction being async and having it's own callback, seems to me that it would be difficult to write a ro...

Best ways to reduce number of DOM elements

Everyone agrees that less DOM elements means better page performance. It means better javascript performance, especially in older browsers. But where are the best places to look to reduce DOM elements? What are the common culprits that you guys have come across that are easy fixes to get that number down? ...

how to fix html z-index problem in ie7?

hello, i have a popup that is displayed above the link when i hover over a link. there is an image just above the link so the problem is that in ie7 the popup is appearing under the image! . it works well in ie8 and firefox! the problem that i want to fix is found on this page : http://www.kandscars.com/servicecontracts.php if you hove...

How to get load finished event after appendChild(docFragment) which contains img tags with external links?

i have a frame element, whose src is a local .xhtml file, whose onload runs a script: // create some content var docFragment = content.createDocumentFragment(); if (docFragment) contentBody.appendChild(docFragment); where contentBody is a div in the frame's document. the content may contain images or such which load external links ...

Convert a table based layout to divs with Java

I've recently been charged with creating a Android & iphone app for work. That being said, I'm a css/php designer-developer with a bit of javascript in the mix. I need to write a bit of Java (not javascript) that will convert a table based layout into a div based layout so that I can then have control over positioning, padding, and what...

Dynamically create in PHP a drop-down list from a range of numbers *with increments*

I need to dynamically create in PHP a drop-down list of numerical choices like so: <select> <option value="120">120 cm</option> <option value="121">121 cm</option> <option value="122">122 cm</option> <option value="123">123 cm</option> <option value="etc... </select> I would like to only specify the starting and ending numbers. Thank...

ajax calls being called too fast.

I have a page with a link, that the user clicks to log our api out of Facebook. When you click on it, it calls a ajax function that calls a php method to delete the users keys from our database, then calls the Facebook api logout function from a JS command. This calls Facebook and ends the users session. Once logged out, it refreshes th...

in jQuery, how to remove an element that has only one whitespace?

Given the following HTML on a page: <div class='test'> <p><span id='id1' class='test1 test2 test3'>test text 1</span></p> <p><span id='id2' class='test1 test2'>test text 2</span></p> <span class='test2'> </span> <p><span id='id3' class='test1'>test text 3</span></p> <p><span id='id4' class='test1 test3 test2'>text4</span></p> </div> H...

Is there any cross-browser css-only sticky footer with W3C valid css and semantic X/HTML?

Is there any cross-browser css sticky footer with W3C valid css and semantic X/HTML? IE : 6,7,8 Firefox : All Version Safari: Windows, Mac and iPHONE Opera: Windows, Mobile and Mini Google Chrome : All Version Blackberry Browser ...