html

Is there a Javascript template system that wraps HTML?

I wonder if there are anything like a Javascript template system that wraps HTML, so that we don't have to deal with HTML directly (yeah, i know it's a bad idea, but just out of curiosity). So instead of writing HTML: <body> <div id="title">Great work!</div> <span>My name is Peter</span> </body> We write in Json: body: [ {div:...

CSS3: Transparent Rounded Corner Problem.

Site is located here: CLICK TO VIEW THE WEBSITE Here is an image of the problem: As you can see, using CSS3 border-radius, and background: transparent I was able to make what looks like a "cutout" from the div. The problem should be obvious that the corners are transparent as well. I know I could just use an image and problem would b...

Specifying desktop text for Apple iPhone apple touch icon HTML attribute

The HTML tag : <link rel="apple-touch-icon" href="/customIcon.png"/> seems to picks up the text it will use from the first 12 characters of the HTML tag: <title>123456789012...</title> when you select the 'Add to Home' option in the Safari browser. However only the first 9 character are displayed in the iPhone's desktop. If more than...

How to keep the header static, always on top while scrolling?

How would I go about keeping my header from scrolling with the rest of the page? I thought about utilizing frame-sets and iframes, just wondering if there is a easier and more user friendly way, what would be the best-practice for doing this? ...

Is a <head> element always available in the DOM, even if absent in the HTML markup?

Every browser I've observed creates a <head> element that's accessible in the DOM even if there are no explicit <head></head> tags in the document's markup. However, Google Analytics uses the following code for dynamic script insertion: (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async...

get the text content from a contenteditable div through javascript

I want retrieve the text content from a contentEditable div through javascript. What are the options of doing this? I've tried innerHTML but it doesn't work. ...

What's stopping me from using arbitrary tags in HTML?

Even the new HTML5 tags aren't enough to describe structures without falling back to divs. What's stopping me from changing: <div class="post"> <div class="userinfo"> <span class="name">Casey</span> <img class="avatar" src="..." /> </div> <div class="body"> <p>blah blah blah</p> <p>blah blah b...

libxml2 - remove child, but not grandchildren

I'm using libxml2 to parse HTML. I want to remove certain formatting tags like <center>, while keeping their content (for example, a link). This means I'll have to remove certain child nodes from my xmlNodeSet, but keep that node's children. Right now, I got this code: xmlNodePtr parentNode = nodes->nodeTab[i]; if (parentNode != NULL...

Prevent HTML Browser from Clipping Text & Showing 1/2 a Text Line

Let's say my browser window is 105 pixels high and I show a text block where each line of text is 10 pixels high - the browser will show me 10 and 1/2 lines in the window (i.e. The bottom line will be clipped vertically). Is there some way to prevent this behavior and see only 10 lines? The reason I want to do this is that I am using a...

Websocket (javascript) vs Silverlight (ruby, python, javascript, c# etc)?

Just for clarification, is the question: websocket vs silverlight? Cause websocket is based on HTML enabling the web browser and web client to talk with each other live. Does this mean that developers cannot use Ruby/Python in client side, but only Javascript? If I use Silverlight, then it seems possibly for developers to use Ruby/Pyth...

jQuery sortable on contenteditable items

If I do "jquery sortable" on a contenteditable items, the item would never be editable. I should mention that in IE every thing works fine and i have this problem in FF 3.6.8 <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleap...

A Simple HTML Checkbox with PHP Problem.

Hi, I have a field in my update form called approve which is using the html checkbox element. now i am querying the approve value from the database which will hold the binary value (0 or 1), i want the checkbox to perofrm the following actions in condition. a) While Querying from database. 1)if the value of active is 1 then it should ...

a:active a href not working

Hi there, I'm trying to apply the css on the a href, basically i need to apply the same style as hover when the a href has been clicked to indidate the users on which page that they are on. any ideas? ...

background for checkbox at IE

Hi, I have a list of check-boxes and in IE the last one has strange color. In FF it's perfect. http://img693.imageshack.us/img693/3987/40401854.jpg <p> <span>abc:</span> <br /><br /> <label><input type="checkbox" id="a" name="a" <?php echo $a; ?> /> 1</label> <br /> <label><input type="checkbox" id="b" name="b" <?ph...

How to structure outputed data in specific table order

Hello How would you display / Echo pictures with a name underneeth in the order shown on the example below in php ? Sort of like echoing a friends list. Im looking for how to structure it with code, I guess thats the correct way to explain what I want to achieve, hope that helps. I tried echo ' <tr> <td align=\"center\"> ...

What's a reasonable amount of data to load onto a single page?

I'm working on this page for a photographer. I wrote a jQuery script that flips through the images. I was originally replacing the src attribute but found that some browsers don't update the image until the new src is fully loaded, so I ended up replacing the whole tag. However this still left the problem that images would reload if revi...

Title goes up if added more text

hi I'm wondering why it is happening here. If delete the text: "Sed ut persp iciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque." Then the title of the site will go up,please see the image here: http://www.freeuploadimages.org/images/sgazmtxj4f92ywdkqn82.jpg And here is the...

Is there a compatible way to serve videos to mobile devices?

I was wondering how to embed a video on a webpage to have it compatible with mobile devices. I am kinda new to the whole mobileweb. So I set up some testing pages and tried them out with some devices of my friends. Flash is obviously not the way to go. Embed tag neither. html5 video tag neither. I also tried to nest them for fallback com...

How do I use PHP to supply info to JavaScript?

I have a simple image-looping script that changes the src of an image. function cycleNext() { ++imgIndex; if(imgIndex>imgCount) { imgIndex = 1; } setImgSrc(imgIndex); } However, at present, I'm (shudder) manually entering imgCount in my script. The alternative is server-side, but I don't know how to fetch...

Is there a "de facto" standard link to give to users to show them how to enable JavaScript?

This is an often used HTML piece on websites. <noscript> Please enable JavaScript or use a JavaScript capable device to get the maximum benefit of this site. </noscript> I want to link it to some directions or similar to enable JavaScript. I don't want to make my own list, as it would require me to update it. I have found the Google...