html

<iframe src="reallylongpage.html#bottom" /> doesn't work

I have the following embedded iframe <iframe width="100%" height="400" src="reallylongpage.html" /> reallylongpage.html has 2 anchors #top and #bottom I want my iframe to load reallylongpage.html at the bottom of the page so I did <iframe width="100%" height="400" src="reallylongpage.html#bottom" /> But this has the undesirable ef...

How to use preg in php to add html properties

I'm looking to write a script in php that scans an html document and adds new markup to a element based on what it finds. More specifically, I was it to scan the document and for every element it searches for the CSS markup "float: right/left" and if it locates it, it adds align="right/left" (based on what it finds). Example: <img alt...

Javascript Clock output text style

I have a clock on my website written in javascript which I got from the internet and modified it slightly to fit my needs better and it looks great on firefox using a mac, but when I use it in other browsers on a PC or Mac it looks terrible and I have no idea how to change it, I'm fairly new to javascript. The code i'm using is below: ...

Javascript::How to identify what the character (or string) was inserted on a editable div?

I want to know how to identify what the character inserted on a div editable... I want to see if the user type a single or double quotation mark, and give a specific class to this quote to the text after the quote... I think that is a onkey property or return... i don't know... Anyone has a tip ? ...

Handling image-heavy web pages

I have a list of TV shows which is about 200 shows long. Each of these shows has a little image, 40x60 pixels and 3 kB, and they are all listed on the same page at the same time. Now I'm starting to think that maybe it's not such a great idea to have about 200 requests to the server each time the page is being viewed. What is the best ...

Prevent or clear HTML/CSS tags.

I'm developing a website using PHP, MySQL and HTML. In the database, one of the fields is a text that may contain HTML tags such as <b> or <i>, for example. My problem is that in a specific part of the website (a search section), I wanna display only a 'summary'/substring of this field. The problem is: when I get a part of this field t...

Best Way to determine MimeType from a String?

I have a crawler that downloads pages and tries to parse the HTML. One of the issues I've been facing is how to properly determine what mimetype an HTML file is. Right now I'm using is = new ByteArrayInputStream( htmlResult.getBytes( "UTF-8" ) ); mimeType = URLConnection.guessContentTypeFromStream(is); but it misses sites like this:...

change color on hover

Hi! I have buttons and they change colors when they are hovered. But I am trying to make a button remain with a changed color after being hovered until another button is hovered. I read a post and it said to use a:focus but this is an implementation that works only when clicking a button, not with mouseover thing. Any help appreciated....

swf file not looping

Hello. I'm working with a swf file (a simple flash movie) and I am trying to get it to loop. I've tried setting loop="true" in the embed tag, and for the object. Does this mean that the problem is in the swf file itself? ...

Validate selected form data on link click

I have a form that is broken into several screens. Although it is a single form, because of its size I am using jQuery to visually break it into several smaller sections. There is a simple link to navigate to the "next section" which triggers a div show/hide. I would like to validate each section as the user proceeds, rather than on su...

Is there any "code corrector" for Vim which highlights HTML, PHP, CSS mistakes??

Sometimes when I make coding mistakes I spend a lot of time finding the error. Is there a plugin which makes Vim underline or highlight PHP, HTML or CSS mistakes? For instance: <?php foreach ($row as $r) { <echo '<h1>' . $r->title . '</h1>'; } ?> The '<' before echo will be highlighted in red. Vim has HTML correction but I n...

JS Replace Text

I have a drop down menu that looks like this: It works fine, but I need to replace the text "Choose an Action" with whatever link the user selects from the box. What is the best way to handle this? Here is the code for the drop down: $("#dd_open a").click(function(event) { event.preventDefault(); $("#dd_open a").removeClass('selecte...

center loading overlay div

I have the following structure, the #tabs div is a static positioned div. I would like to show the loading inner div during an ajax request and have it centered on the #tabs div (which is actually a jquery tab). But it's not getting centered with the css I have at the moment. <div class="span-18 last" id="top_tab_container"> <div id=...

Applying classes to a parent element with JS

I need to apply a class to the <li> tag that encloses an anchor tag when a user clicks on the link. Like this: <ul> <li><a href="#">Just an Example</a></li> </ul> So when the user clicks on <a href="#">Just an Example</a>, I need to apply a class to the <li> enclosing it. How would I target this? I am using jquery. ...

Can this jQuery validation be refactored?

Hi Guys, I'm doing some simple client side validation with jQuery. var passedValidation = new Boolean(true); // Required Field Validators. if ($('#fbsignup input.firstName').val().trim() == '') { $('#fbsignup tr.firstName em').show(); passedValidation = false; } if ($('#fbsignup input.lastName').val().trim() == '') { $('#f...

How do the the "Pros" design and code web sites?

How do most modern "pro" web designers go about starting/designing/coding a site? I realize that techniques will range and differ drastically, I'm just looking for some solid, relied-on tactics or approaches. For example, "I know most draw out a rough design with the client, then go into photoshop and create it, then slice it up, then ...

how to play mp3 files in an image button in html page

how to play mp3 files in an image button in html page ...

Checkbox checklist attribute

I could not understand what this javascript line does. chkBox.setAttribute("CheckList", range); What is the "CheckList" attribute is used for? ...

Do CSS files get sent to browser?

Do CSS files get sent to brower for the browser to render the page, or are CSS files processed server side, with only the HTML page being sent to browser? ...

Escaping quotations for jQuery XML request

Simple question really, I am relatively new to both jQuery and XML. I just want to pull an email address into a link, but unsure how I am escaping the quotations. <a href="mailto:'+email+'">Email me</a> The +email+ is being taken from an XML file with code like this: <email>[email protected]</email> so I want the HTML to look like: <a...