html

PHP - prevent form from being submitted twice

Hi I have a simple php form, like this: <?php if(isset($_POST['myform'])) // email... else // display form the problem is that if I refresh the page after I submit the form, it gets submitted twice... How can I prevent this from happening? ...

Automatically resizing the top frame?

Suppose I have two frames. I want to set the size of the top frame so it shows all the necessary content, but no more. For example, could I put an "hr" tag or a wide image transparent image at the bottom of the top frame and have the top frame resize automatically based on the location of this element so that this element marks the ver...

jQuery, get html of a whole element

Simple question, I wish to get the entire html of a selected element not just it's contents. .html() uses javascripts innerHTML() method according to the documentation. HTML: <div id="divs"> <div id="div1"> <p>Some Content</p> </div> <div id="div2"> <p>Some Content</p> </div> </div> Using $('#divs:first').html(); will...

Why is it so hard to print a web page properly?

I printed a page from a bank web site. Aside from the page with my data, I got five other pages with just a logo, just a header, just a footer, etc. It's sort of a joke in my household that you can't print a web page without getting a useless wasted page too. So, why is it so hard? Are we blaming the web page designers, the browsers, or...

why using htmlspecialchars() when you have htmlentities()?

i know exactly the difference between the two functions. what i want to know is what would be the possible reasons to use htmlspecialchars() when you have a more complete option, that is htmlentities(). thank you (: ...

My <input type="image"> is not working like a <button type="submit">...

I used to have a submit button like this: <button type="submit">Submit</button> I've now replaced the text with a swanky image that fits the look and feel of my site, but strangely, this isn't working: <input type="image" src="myimage.gif" alt="Submit" /> In particular, the form "submits", but the other form input values aren't sub...

Hyperlink to play youtube video...

Is it possible to create a hyperlink on your web page that can play an embedded youtube video on the same page.? ...

How do you attach a click event to a jquery object created programmatically?

I'm writing some jquery to programmatically build a list of links and I'd like to attach a click() event to each link. I'm having trouble getting the click function to fire. Can anyone point me in the right direction on how to do this? This is what I have so far: <!doctype html> <html> <head> <title></title> <script type="text/javascr...

ie7 problem: multiple floating divs with percentage widths equaling 100% inside container div

This seems to works in ie8, Chrome, and Firefox. Everything should be on the same line, but in ie7 the last div for some reason doesn't seem to "fit" and gets dropped down to the next line. Is there a simple way to get this to work with ie7? <div style="width: 95%"> <div style="width: 25%; background-color: blue; float: left;">test...

Calling a function in parent file from child frame?

I have a function that resizes the col width ratio of my frameset in "frame.html": <frameset id="set" cols="*,*" FRAMESPACING=0 BORDER=3 BORDERCOLOR=#eeeeee> <frame src="index.html"> <frame src="index2.html"> <noframes></noframes> </frameset> The function works fine when called from "frame.html", However i want to call ...

Java - How do I modify a hyperlink attribute from an HTML document loaded into jEditorPane?

I am creating a start page for my application and it use jEditorPane to load an HTML document. I have it detecting hyperlink "ENTER" "EXIT" and "ACTIVATED". I know how to get an attribute of the link but how do I change an attribute. I would like to impliment a rollover effect so when ENTER is fired off it changes the links style to have...

HTML table with contentEditable - Could we merge cells?

When you make a table editable, you get special handles to manipulate it. I know how to delete and add rows and columns. Is there a special key+handle combination of sorts to merge two cells? If so, is it the same across browsers? ...

Styling highlighted text in incremental search JS

Hello, First StackOverflow question - woo! Quick question about styling this piece of Javascript: //Search $('#search').keydown(function(e) { setTimeout(function() { if ($('#search').val() == '') { $('#history h4').show(); $('#history li li').show(); return; } $('#hi...

HTML Layout debugging

I previously asked what tools there were for understanding HTML layout. I would like to be able to see lower level information than these tools make available. For example, I would like to be able to find out why an element was placed on a new line. If there aren't tools for doing this, then I was thinking that debugging information from...

How to Prevent My CSS From Clashing With Facebook's CSS?

Hi Guys, I have the following HTML on my page: <div id="mypanel"> <span>SomeText</span> <span>SomeText2</span> <span>SomeText3</span> <span>SomeText4</span> <fb:login-button ..snip.. /> </div> You can see there i have some Facebook Markup Language (FBML) for the Login button. Which get's rendered as: <span id="RES_ID...

How do I trigger ESC button to clear text entered in text box?

<input type="text" id="search" size="25" autocomplete="off"/> I know it is something with onkeydown="if (event.keyCode == 27) ...

Detect if a web request is the result of an <img src=""> tag

If you have <img src=""> on your page, the image load will result in another web request to the page that was originally loaded. Is there a way (in ASP.NET) to detect that the web request was the result of being loaded for an <img> tag like this? The only difference I can find is the HTTP_ACCEPT value of */* for <IMG> requests, vs. a l...

Alternative Representation of a Website Drop-Down Navigation

I'm being brought in to re-design a website that currently has five or six hover-drop-down-style-list-menus. They are displayed similar to the expanding menu on the left hand side of http://www.amazon.co.uk/ except the menu runs horizontally. I hate these kind of drop-down menu lists and I was wondering if any of you could help me figur...

Grab largest image on site given the URL

Given a URL how do I pull the largest image (in terms of image-dimensions) on the site? I am using it to act as the best possible representation of a sites thumbnail. Similar to first thumbnail image when sharing a url on Facebook: http://www.facebook.com/share.php?u=my_website_url The image thumbnail on Facebook in the div: <div cla...

iframe and image popup position

I have nested a very long joomla page into a simple HTML page, using iframe When an image popup, they now comes up in the center of the long page instead, since it is a long page, the popup is not viewable without scrolling up or down. are there any way around this? Regards ...