html

jQuery / Javascript - Multiple RegEx Validation

How would you go about validating 2 different regular expressions in jQuery or JS? My JS Code: function validate(){ var MyField = document.getElementById('MyField'); if (MyField.value == null || !MyField.value.toString().match(/^(\d{3})-?\d{2}-?\d{4}$/) || !MyField.value.toString().match(/^(\d{2})-?\d{7}$/)); alert('Ivalid ...

how to have fixed with list or anchor element in html?

I have website with list and anchor links. I want to have the anchor length is fixed so that it will not come to next line. When I move the mouse over,the remaining text should be displayed and when the over leave out of the link, it should be again set back to normal one line. I want the one like the green color. ...

The white-space property between blocks

Is the CSS 'white-space' propert supposed to be able to affect the whitespace between block elements? For example, in the document used as an example in "Whitespace in the DOM" as follows, there is whitespace between the </h1> and the <p>: <!-- My document --> <html> <head> <title>My Document</title> </head> <body> <h1>Header</h1> ...

Preloading wav/mp3 files in jQuery

I have this code (found from another StackOverflow question: $(document).ready(function() { $.ajax({ url: "soundfile.mp3", success: function() { $("#play_button").show(); } }); }); This code works fine, but how can I amend it to handle multiple sound files? ...

Text in front of variables inside a foreach loop

I have set up a small script to handle a page where I have three checkboxes. The HTML for the checkboxes looks like this: <input type="checkbox" value="Ex1" name="Check[]" />Ex1 <input type="checkbox" value="Ex2" name="Check[]" />Ex2 <input type="checkbox" value="Ex3" name="Check[]" />Ex3 And the PHP script for these: if($_POST['Che...

how to set image width and height 100% from css?

my code- background:url(images/menu_edu.jpg) no-repeat; but but only half of image is getting displayed. ...

Passing a string through a URL via JavaScript.

Hello, I am trying to interact with Twitter via JavaScript. I want to pass a pre-set message to a user's Twitter status page when they click a link. In an attempt to do this, I have a link defined as follows: <a href="#" onclick="updateTwitterStatus();">Update Status</a> <script type="text/javascript"> function updateTwitterStatus()...

Can't replace a div inside of an iframe from its parent

I've got an iframe that I filled like this: var usableUrl = unescape(url); var iframe = $("<iframe id='pageContentDownloader' name='pageContentDownloader' style='display:block'></iframe>"); $("body").append(iframe); iframe.load(usableUrl, null, ondocloaded); iframe.css({ "width": $(window).width(), "height": $(window).height(), "border"...

`color: transparent` is not working in IE

color: transparent is working in mozilla, but it's not working in IE. what else I can use? I want to sent font color to transparent. ...

Double mysql_real_escape_string insert of new line characters. How to get new line breaks back?

Hi, I have a textarea field that's inserted into a mysql database which may contain line breaks. The textarea data has accidentally gone through two lots of mysql_real_escape_string functions. Therefore the line-break bit of the field data is now stored as "\r\n" instead of an actual new line, as it's been double escaped? Now when writ...

Is it possible to create a CSS-only accordion?

I'm thinking about using an accordion in a "please enable Javascript" page, but I don't know if it's possible with CSS only. I'm almost sure it is for most browsers, but I'm also fearing I'll face some limitation of IE and I'd like to know if any of you tried this already (or not) and could tell me if it's either possible or impossible...

What's the easiest way to show a tooltip on my web pages?

I'd like to modify some parts of my website to show popups when a user clicks on some <td> elements. I'd like to keep the modification very simple, which is why I considered using a JavaScript framework. It does not really matter which, but I'd like to be able to include html in the tooltip's text. What's the easiest way to achieve this?...

HTML Drag And Drop On Mobile Devices

When you add drag and drop to a web page using JavaScript, such as jQuery UI draggable and droppable, how do you get this to work when viewed via a browser on a mobile device - where the touch-screen actions for dragging are intercepted by the phone for scrolling around the page etc? All solutions welcome... my initial thoughts are: H...

problem in reading txt file in php

hey guys im looking for a way to read a file into an array and get what i want . this is the code i used to read a file into an array $Path = 'dewp/pix/info.txt'; $productsArray = file($dirPath, FILE_IGNORE_NEW_LINES); foreach ($productsArray as $key => &$product) { $arr = explode("\t", $product); $product =array('album=' => ...

Extracting readable text from HTML using Python?

I know about utils like html2text, BeautifulSoup etc. but the issue is that they also extract javascript and add it to the text making it tough to separate them. htmlDom = BeautifulSoup(webPage) htmlDom.findAll(text=True) Alternately, from stripogram import html2text extract = html2text(webPage) Both of these extract all the java...

centering a div between one that's floated right and one that's floated left

I have a page in which a header consists of three divs - one that's floated to the left, one that's floated to the right, and one that's in between them. I'd like for that central div to be centered, yet sadly float: center doesn't exist and I can't just float it to the left and add padding as it'd have to change depending on the window ...

How does a YouTube movie downloader work? - YouTube

Hi folks, I'm wordering how apps such as Video DownloadHelper work. Any ideas? ...

Why does youtube etc use <object> and not <iframe>?

Why does youtube etc use <object> and not <iframe>? What are the advantages of object over iframe for this case? ...

how to find URL of the page where the Flash file is embedded

Hello people, I am writing a Flash app in Flex Builder 3. I have a problem. I need the URL of the place where the Flash app has been embedded. mx.core.Application.application.url This gives me the address of the original swf file, but I actually need the URL of the HTML file where this SWF has been embedded. is there a way ??? th...

Why does this site completely break in IE 8 but work perfectly in Firefox 3.6.2?

Maybe HTML/CSS gurus can explain? I find it somewhat ironic given the focus of the site. http://www.vowsjs.org ...