html

Adding a custom method to the document object is 'undefined' in IE8

For some reason the following code does not work as expected when in IE 8, as noted in the comment. I'm trying to add a "writeSpecial" method to the document object, and this works fine the first time that the method is called, but whenever this is called a subsequent time, it becomes undefined. However, this only happens in IE when I ...

Set Div Width to Background Image Width Css?

Is there a pure css way of setting your div width to the width of the background image you are using for that div? for instance right now I'm doing this... #homeNav{ background-image:url(../images/navPieces/home.jpg); width:165px; text-align:right; } #aboutNav{ background-image:url(../images/navPieces/about.jpg); ...

Child div behind parent div, how to fix link?

I'm trying to put a child <div> (with a link in it) behind its parent <div>, but the links doesn't work. I am using z-index: -1, so maybe the link is being drawn "behind" the <body>. Is there a way to achive this without breaking the link? Thanks The CSS .front { width: 200px; height: 200px; background...

Centering a table vertically preferably CSS

I am looking without much luck how to center an element (a table) vertically. I tried CSS vertical-align: middle; which did not work I also tried margin-top: auto; margin-bottom: auto; which also did not work. I also used the table attribute valign as "middle" which still did not work. I am using Chrome but have tested all these stra...

dynamic html watcher

Hi I want to create a program that can read an url and when some conditions are met, it will do something for me, sort of like a bot. How do I read the html of a webpage and how can I tell it to do something for me. Are there some programs out there? ...

delay the loading of 3rd party javascript

Is there ANY method to delay the loading of 3rd party JavaScript files until the rest of the page has finished loading? ...

Best way to create a menu in an ASP.NET website

I have to create a simple, one-level menu in an ASP.NET website clicking on whose items would result in displaying an apt .ascx file on the remaining screen area. I would like to know which is the most suitable method to achieve this: ASP.NET Menu control HTML ul tag HTML table with hyper-links within the cells Any other way (which I w...

HELP....How to delete extra DIV element from HTML Document ?

I am developing a News application and for this i am using a web product for fetching News Headline. When I call a NewsHeadline, product sends a Html Code including News Headline. <div class="mydiv"> <script type="text/javascript"> document.write('&lt;div style="display: none"&gt;'); </script><div style="display: none;"> <div>< a h...

how to hide text in an html textbox

i am having a simple html text box what i want just as the user type something in it the text should be invisible but the text should be there <html> <head> <title>My Page</title> <script type="text/javascript"> function hide() { document.forms["text"].style.visibility = 'hidden'; } </script> </head> <body> <form name="myform"> <div al...

CSS: background-image not aligned anymore if I change zoom

Hi, If I change the zoom in my browser, the background image (the logo of my website) is positioned differently with respect to the other elements of the website. I'm using: background-image:url('tbs-logo.png'); background-repeat:no-repeat; background-position: 92% 22%; I was wondering if I can keep it aligned with the other element...

douplacate drop down menu onchange

I use drop down menu - that contain all tags- for select tags for a topic. so, I need after users select a first tag, new drop down menu appere , and so on. ...

how to use accesskey in html

i want a feature then when user fill username and goes for fill the password then if he click ENTER then form is automatically submit how i can do this in html ...

How to let a .myhtml file has colors as a html file in vim?

I have a html file, it has good colors in vim. But I want to define some custom file types, they have html content, but with different suffix names. e.g. index.html -> index.myhtml But when I open "index.myhtml", it has no colors, only black and white. How to let the vim treat the ".myhtml" as ".html"? Thanks in advance! ...

IDE with HTML closing tag highlighting similar to closing brace

Is there an IDE that highlights each HTML closing tag (as you highlight over the opening tag, for example), similar to how many IDE's highlight where the opening/closing braces are for functions and such? ...

Trying to use regex matches between words using PHP

Hello, I am trying to match HTML tags that might occur between words on a web page, using regex's. For example, if the sentence that I want to match is "This is a word", I need to develop a pattern that will match something like "This is a <b>word</b>". I've tried using the code below to prepare the regex pattern: $pattern = "/".str_...

How do I make an HTML button’s onclick event trigger one of two different functions at random?

How do I make an HTML button’s onclick event trigger one of two different functions at random? I’m using PHP on the server, and jQuery on the client. Using this code when i click the button image nothing happens... function a(){ alert('A got called!'); } function b(){ alert('B got called!'); } $('#button').bind('click...

calling an ajax function via html

i have an ajax function(with arguments) and i want to call it via html the calling now is: <a href='javascript:;' class='vote_down' id='$wordNum'></a> and the ajax function starts with: $("a.vote_down").click(function(args){ how do i add the arguments to the html code ...

Serving JSON and HTML securely to JavaScript

Hi, I am thinking of secure ways to serve HTML and JSON to JavaScript. Currently I am just outputting the JSON like: ajax.php?type=article&id=15 { "name": "something", "content": "some content" } but I do realize this is a security risk -- because the articles are created by users. So, someone could insert script tags (just ...

How to set date field in HTML form and how can i retrieve the date in servlets?

Hi, I need to set a date field in my html form. After submitting the form the request goes to the servlet and tha data will be stored in database. In servlets how can i retrieve the date field? Please help me. -renu ...

Hiding and showing parts of an html with PHP?

The example I have in HTML: <div id="red-nav-warp"> <ul id="red-nav-logo"> <li><img class="sponsors" id="sponsorone" src="media/img/logosmall.png" /></li> </ul> <ul class="clearfix" id="red-nav-list-member" > <li><?php $themeSys->Href('logout',$langSys->get('LOGOUT')); ?></li> <li><?php $themeSys->Href('settings',$lang...