html

Adding text to a table data cell with jQuery

Why this code: row.append($("<td></td>").text("someText")); ...isn't working, and how can I fix it? Thanks. ...

Manipulating a <div>'s position through JavaScript

How do I set the top, left, width and height of a <div>? I already made sure it floats by inserting the following CSS code: div.grid_tooltip { position: absolute; left: 0px; top: 0px; } ...

regex to match p tags and add br's inside of them

Well the question title explains the question :D but here is an example none the less asdf asdf <p>asdf asdf asdf</p> how to i get it to regex the inside of the p tags and apply nl2br to it so the output would be: asdf asdf <p>asdf<br /> asdf<br /> asdf</p> Edit: In PHP ...

Why is Google Chrome not converting tags/entities?

I keep running into this problem recurring, where Chrome refuses to parse tags/entities on text which is handed to it by JavaScript. I first noticed it with entities like &quot;. It will display &quot; as opposed to " Now I am also running into the problem with <strong> and <em>. It displays <strong>Text</strong> as opposed to bolding ...

Why doesn't Internet Explorer render this page smoothly?

Have a look at this page in IE 8: http://labs.pieterdedecker.be/hetoog/layout.htm It looks okay at first, but try hovering over an item and then taking your mouse off the item grid again. Before After Notice how there's a black border on the right of the yellow item. Also, the font looks different. How can I fix this? ...

Regexp that matches all the text content of a HTML input

I have articles on my website which I would like to get corrected and translated automatically. But I need to get the content, without having the HTML tags around. The idea is to have a regex that could retrieve all the content between the tags (and, if possible, also the content found in tags fields like <img alt='Little house'>). The ...

Find href attribute values that do not contain “javascript:”

I have a RegEx which nicely finds the href's in a URL: <[aA][^>]*? href=[\"'](?<url>[^\"]+?)[\"'][^>]*?> However, I want it to NOT find any href that contains the text, 'javascript:' in it. The reason is that I sometimes need to mod the href and sometimes don't. When there is a 'javascript:' text in the href I want it not to be found...

How to find/replace text in html while preserving html tags/structure

I use regexps to transform text as I want, but I want to preserve the HTML tags. e.g. if I want to replace "stack overflow" with "stack underflow", this should work as expected: if the input is stack <sometag>overflow</sometag>, I must obtain stack <sometag>underflow</sometag> (i.e. the string substitution is done, but the tags are sti...

Django not rendering CSS correctly

I have a site that I'm creating, part in static HTML, the other part is served via Django. Since I want the look and feel to remain the same (who doesn't?) I have used CSS for the static site. That same CSS I have included (almost successfully) in the dynamic site. When I create a form, I can get a very nice two column listing on the ...

Stick ID to the HTML element (using js) instead of id-attribute?

Hello! First post on stackoverflow. Hope everything is right! I'm thinking of attaching an ID value to the HTML element itself via JavaScript, instead of using the HTML id attribute. For instance, say that JavaScript variable htmlElement is a div. So htmlElement.cssName would tell us its CSS class. Now, how about doing htmlElement.id...

Problem with character encoding of '

Why does this page http://reboltutorial.com/cgi-bin/designpatterns-quiz.cgi shows a ? in the sentence (at least on my firefox) Separates an object’s abstraction from its implementation whereas I am using utf-8 ? ...

Divs Shift When Content Gets Too Large

I'm experiencing some strange behavior with a project i'm working on: http://daft.net76.net/yah/ When you click the rules link the entire layout shifts to the left by a pixel or three. I've attributed this to the amount of content in that div, because when you click the 'Scores' link, which has a smaller content height. The lower div ...

jQuery syntax question (getting the ID of a link)

I have a series of links, each with their own id: <li><a id="about" href="#">About</a></li> <li><a id="call-us" href="#">Contact us</a></li> <li><a id="home" href="#">Head on home</a></li> Instead of writing a series of statements like this: $(document).ready(function(){ $("a.about").click(function(event){ $("#content").l...

Why isn't this callback resolving properly in jQuery?

I have this code: $(document).ready(function(){ $(".links a").click(function(e){ var toLoad = "products.html #" + this.id; $('#block').fadeTo('fast',0,loadContent); function loadContent() { $('#block').load(toLoad,'',showNewContent()) } function showNewContent() { ...

How to prevent newline/line break within a <form></form>?

This is my code. <form name="publish"> <?php include 'location.selector.html'; ?> <input type="submit" value="submit"/> </form> When displayed, there is a newline preceding the submit button, how to eliminate this newline/line break? The HTML content of location.selector.html is <table><tr><td>都道府県を選択してください</td> <td>市区町村を選択して...

Problem in php upload script?

function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } define ("MAX_SIZE","2000"); if( isset($_FILES['file_upload'])) { $errors=0; $image=$_FILES['file_upload']['name']; if ($image) { $filename = stripslashes($_FILES['file_u...

IFrame with wrong URL - parent page displayes error in IE - how to solve?

I have the following html in a page: <div> <iframe src="http://google.co.in" style="width:200px;height:200px"> </iframe> <iframe src="http://" style="width:200px;height:200px"> </iframe> </div> This page displays correctly in Firefox: But in IE (7 & 8), the whole page gets replace...

Using background-repeat and background-position together.

Hey all, I'm trying to implement a faux column layout on a website. Briefly, it involves tiling a background image on the div that holds both the vertical columns to make it look like both columns extend all the way to the bottom. My columns look like this: XXXX MMMM XXXX MMMM XXXX XXXX YYYY XXXX YYYY XXXX YYYY XXXX YYYY X...

How do I show a loading image before actual body load?

I want to hide the body of my web page. Once the all content of the body tag of the web page are ready to display I want to show it body, but until that time I want to show some loading image. If for some reason the content of the body does not load properly I want to show an error message. What is the best way of doing this in javasc...

trying to change width on click

Concerrning this, I wanted to get the same effect, then I thought I'll just change width of my div on click. I have a left sidebardiv and contentdiv on the right, and I have an image with onclick trigger, which hides the left sidebardiv and sets the right contentdiv width to 100 %. It does hide the left sidebardiv but it doesn't expand...