html

How to version files in the <HEAD> section?

I have seen on various websites how developers version their css/javascripts files by specifying querystrings similar to: <head> <link rel="stylesheet" href="css/style.css?v=1"> <script src="js/helper.js?v=1"> </head> How is that done? Is it a good practice? I've been searching around but apparently, I'm not looking for the ri...

Converting a Java object to a Javascript object using velocity

Hi, If a have a Java object (lets say a User object), and I use velocity to template the page so I can access a field in the user object like ${user.id}, is there an easy way to convert this into a javascript object (so I can access the fields of the User object)? I can assign a value to javascript variable like var id = "${user.id}...

Dojo fileuploader without AJAX

I want to use Dojo to be able to style the upload input, since the browser will not allow CSS to style it. Currently I can only get the FileUploader to work as AJAX, and this is not desired because it needs to be passed with other form data. Is it possible to do this with Dojo? Or should I just write my own transparent file input and s...

jQuery - Disable HTML Page until .load calls is done.

What is the easiest way to disable an entire HTML page until an initial .load call is complete? What I mean by disable is the user can not interact with it in any way. It is ok for them to navigate away. I am using jQuery 1.2.6. Is it to set the call to be sync instead of async? how do you set options for this on the .load function? U...

inline list size issue

I am using an inline-block list as a horizontal navigation bar with drop down menus. But I can't seem to get it to fill up the entire width of the screen. To make it more frustraiting, when I change the zoom level of the browser screen, the list resizes at a different rate from everything else. Thus, on some zooms it is too long and wrap...

[PHP] - How to plan a "secure" HTML FORM

I use $_POST to read data sent through HTML forms to the server, narrowing down attacks exposure. How can I strengthen security, using some kind of tokens in the form? The tokens could be readable however with a sniffer..... EDIT * I agree the message above is generic...I'll try to give more details! Ok, a PHP/Server generates emails...

How could I apply the class or the style to some HTML element in IE?

I'm doing an application that has to parse elements in an XML tree to HTML and in all the browsers it goes well but IE doesn't want to apply the styles to the elements. How could I fix this? function add2Doc(elmnt, domDoc, newEl) { /* * This function transform an * element to into the an acceptable * part of another ...

What are good techniques for creating simple, zero-css-zero-html-knowledge admin theming for websites?

I would like to allow administrative users to simply theme their own website (a re-deployable charity website built in php in the back end). I certainly don't know what the ideal approach would be, but my naive concept of how to do it is like this: Create a theme.css file that is dynamically generated, and overloads the colors and bac...

Javascript: Update label content while typing inside of a parent input with Jquery

How to update with jquery the label of preview div when im typing inside of the parent input of edit div? Thank you. <html> <body> <div id="preview"> <label id="companyName" class="workExperience"> This is my company </label> ...

Add a sequence of numbers to divs

I have a list of 8 divs and need to add a sequence of class numbers to them using Jquery to style them individually. Need to add them to the 'content-block' div see example below. The desired effect will be something like this: <div class="wrapper"> <div id="content-block" *class="post1"*> </div></div> <div class="wrapper"> <div id="c...

showing contents of textarea as I type

I am going to make a textarea box for input a text and save it and show it in another part... like comment, ... but when i put the text in another area it is plain text....no paragraph no space ... nothing... as it shows here in below as a preview ,.....what i should do? ...

Disable one Selection Box based on a Selection in another

I have two selection boxes in the same form. I would like to have one disabled based on some of the options that can be selected in the other selection box. I'm looking for a solution in JavaScript if possible. ...

CSS Table Layout

I have an HTML table with 3 columns and amount of text in each column is variable. I would like to set some rules on the layout of the table but Im not sure how to do that in CSS. Title | Author | Publisher The default ratio is 50%, 25%, 25% for each column. The goal is to keep everything on a single line if possible. The author and...

jqGrid columns do not expand to setGridWidth after 1 column hidden in IE8 only

I've a jqGrid v3.7.2, after hiding a column using .jqGrid('hideCol', infoName); and setting the grid width using .setGridWidth(setWidth, true) The columns do not expand to fill the table width in IE8 only. The table width is correct. The tbody/col widths comes short. Any way to solve this problem via CSS? Or is there another meho...

How can I get the NEW value of an HTML text input during a keypress event via jQuery?

I can only retrieve the value without the newly pressed key. Using the keyup event isn't an option, because it does not fire if the user doesn't release the key. This is important because I want to act upon every single keypress. Combining the old value with the keyCode that is reachable from the event's arguments isn't acceptable eithe...

When you touch an HTML element in Safari on the iPad, it turns gray. What is the logic to decide which element among nested elements is shown in gray?

When you touch an element, such as an edit box, in a web page on the iPad, it turns gray while you are touching it. I have a table wrapped by a floating div. Instead of an individual data element or row going gray, the whole table (or its wrapping div) goes gray when a data element is touched. (The function of this table is an autocompl...

Make an image width 100% of parent div, but not bigger than its own width.

Hi. I’m trying to get an image (dynamically placed, with no restrictions on dimensions) to be as wide as its parent div, but only as long as that width isn’t wider than its own width at 100%. I’ve tried this, to no avail: img { width: 100%; height: auto; max-width: 100%; } Many of these images are way wider than their pare...

How to get the height of hidden content in a div setup with overflow:hidden?

I want to make a div that expands to reveal its content when clicked. What I did to date is: Created a div, set to overflow:hidden Created a JS function that toggles the height of the div between "minimized" and "maximized" (20px height and XYZpx height). So far everything works, except I don't know how to get the height of the conte...

How can i change the size of a HTML canvas

how can i change the size of an html canvas through a function? i tried Width=123;" and canvas.style.Width=123 canvas.width=123 neither of them worked heres the HTML code for the canvas <CANVAS id="canvas" width="460px" height="800px"></CANVAS> and in the css canvasarea { width: 460px; height: 800px; ...

Cocoa WebView, WebKit - Prevent I-Beam cursor from showing over text?

Hi all, Cocoa app, SnowLeopard I have a WebView in to which I'm loading HTML (essentially for application UI purposes). In the html, I've added: <body onselectstart="return false" ondragstart="return false"> This prevents text from being selected, which is what I want for this job. However, whenever the cursor is moved over any te...