Ads by Lake Quincy Media
| Next Tip?
Home » Archive

Articles in the Javascript Category

Javascript »

[17 Jun 2009 | No Comment | 220 views]

This piece of code demonstrate that when we take mouse on a particular image the place holder for the image displays the corresponding image… here goes the code
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” >
<head>
<title>Meetu Choudhary</title>
Script for head section
&lt;script language=”javascript” type=”text/javascript”&gt;
function showimage(imagename)
{
targetimage.src=”images/” + imagename;
}
&lt;/script&gt;
&lt;/head&gt;
Body will have these contents..
<body>
&lt;table width=”694″ height=”525″ border=”0″&gt;
&lt;tr&gt;
&lt;td width=”141″ height=”95″ valign=”top”&gt;
&lt;img src=”images/image1.jpg” onmouseover=”showimage(‘image1.jpg’)” width=”141″ height=”93″&gt;
&lt;/td&gt;
&lt;td width=”141″&gt;
&lt;img src=”images/image2.jpg” width=”141″ height=”93″ onmouseover=”showimage(‘image2.jpg’)”&gt;
&lt;/td&gt;
&lt;td width=”141″&gt;
&lt;img src=”images/image3.jpg” width=”141″ height=”93″ onmouseover=”showimage(‘image3.jpg’)”&gt;
&lt;/td&gt;
&lt;td width=”139″&gt;
&lt;img src=”images/image4.jpg” width=”141″ height=”93″ onmouseover=”showimage(‘image4.jpg’)”&gt;
&lt;/td&gt;
&lt;td width=”98″&gt;
&lt;img src=”images/image5.jpg” width=”141″ height=”93″ onmouseover=”showimage(‘image5.jpg’)”&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height=”424″&gt;&amp;nbsp;&lt;/td&gt;
&lt;td colspan=”3″ valign=”top”&gt;
&lt;img id=”targetimage” src=”images/image1.jpg” width=”420″ height=”252″/&gt;
&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;

To …

Javascript »

[14 Mar 2009 | One Comment | 619 views]

Show or Hide combobox at Runtime using JavaScript
Many a times in the programming world we feel the need to hide or show the drop1down lists or combo boxes of the particular page or a div or anyother control so here is a small snippet
The Following is the JavaScript function to achieve the above you can embede it in any external JavaScript file or write as an inline script or include in the head section…
function showOrHideAlldrop1Downs(newState)
{
var elements = document.documentElement.getElementsByTagName(’select’);

Javascript »

[14 Mar 2009 | No Comment | 619 views]

JavaScript String Replace All
Today When I was working I came across the need to replace all the “’” marks with null or with nothing like “” as the “’” mark produces an error while handling with database I have the StringBuldier Class and could replace all at once but to use that it will be a server side code that means irrespective of anything on textchanged event the page should be postback so I decided to use the JavaScript function replace ()
Now the problem with this JavaScript String Replace …

Get Adobe Flash playerPlugin by wpburn.com wordpress themes