JavaScript
Posted on July 3, 2008. Filed under: JavaScript |
<script language=javascript>
function SetSetectedVelue()
{
var id=’<%=Request.QueryString["cityid"] %>’;
if(id.length==0)
id=1;
var city=document.getElementById(’<%=ddlcity.ClientID%>’);
for(var i=0;i<city.length;i++)
{
if(city.options[i].value==id)
city.selectedIndex=i;
}
}
</script>
<body onload=”SetSetectedVelue()”>
<form id=”form1″ runat=”server”>
<div>
<asp:DropDownList id=”ddlcity” runat=server >
<asp:ListItem value=”1″ >delhi</asp:ListItem>
<asp:ListItem value=”2″>mumbai</asp:ListItem>
<asp:ListItem value=”3″>channai</asp:ListItem>
<asp:ListItem value=”4″>kolkota</asp:ListItem>
</asp:DropDownList>
</div>
</form>
</body>
Read Full Post |
Make a Comment ( None so far )
Posted on July 1, 2008. Filed under: JavaScript |
function GetXmlHttpObject()
{
/*extern ActiveXObject, XMLHttpRequest */
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject(”Msxml2.XMLHTTP”);
}
catch (e)
{
xmlHttp=new ActiveXObject(”Microsoft.XMLHTTP”);
}
}
return xmlHttp;
}
function displayRSS(url)
{var xmlhttp=GetXmlHttpObject();
if(xmlHttp==null)
{return;}
xmlHttp.open(“GET”,url,true);
xmlHttp.onreadystatechange=getRssFormat;
xmlHttp.send(null);
}
function getRssFormat()
{if(xmlHttp.readyState==4)
{if(xmlHttp.status != 200)
{
document.getElementById(“rss”).innerHTML= “<br><br><br>Sorry….<br><br><br><br>The Server did not return any results (Result code: 200)<br><br><br><br>Please try again<br><br>Sorry for the Inconvenience”;
}
else{
var items_count=3;
link=new Array(), title=new Array(), pubDate=new Array()
for(var i=0; i<items_count; i++) {
if(items.getElementsByTagName(‘item’)[i].getElementsByTagName(‘link’).length==1)
link[i]=items.getElementsByTagName(‘item’)[i].getElementsByTagName(‘link’)[0];
if(items.getElementsByTagName(‘item’)[i].getElementsByTagName(‘title’).length==1)
title[i]=items.getElementsByTagName(‘item’)[i].getElementsByTagName(‘title’)[0];
if(items.getElementsByTagName(‘item’)[i].getElementsByTagName(‘pubDate’).length==1)
pubDate[i]=getDateFormat(items.getElementsByTagName(‘item’)[i].getElementsByTagName(‘pubDate’
[0].firstChild.nodeValue);
}
if(title.length==0)
return false;
var ws=/\S/;
ul = document.createElement(“ul”);
var mydiv = document.getElementById(“rss”);
mydiv.appendChild(ul);
for(var [...]
Read Full Post |
Make a Comment ( None so far )
Posted on June 28, 2008. Filed under: JavaScript |
<asp:TextBox id=”txtname” runat=server ></asp:TextBox>
<script>
function getvalue()
{
var val=document.getElementById(’<%=txtname.ClientID%>’).value;
alert(val);
}
Read Full Post |
Make a Comment ( None so far )
Posted on June 24, 2008. Filed under: JavaScript |
var urlAddress =window.location.href;
var pageName = document.title;
function addToFavorites()
{
if (window.external)
{
window.external.AddFavorite(urlAddress,pageName)
}
else
{
alert(”Sorry! Your browser doesn’t support this function.”);
}
}
Read Full Post |
Make a Comment ( None so far )
Posted on June 24, 2008. Filed under: JavaScript |
function showDiv(dvnm)
{
document.getElementById(dvnm).style.display = ‘block’;
document.getElementById(dvnm).style.visibility = ‘visible’;
}
function hideDiv(dvnm)
{
document.getElementById(dvnm).style.display = ‘none’;
document.getElementById(dvnm).style.visibility = ‘hidden’;
}
function showlayer(n)
{
for(i=1;i<=2;i++)//number of layer u want to show
{
if(i==n)
{
showDiv(’div’+ i);//dynamically call div id
document.getElementById(’tab’+i).style.backgroundColor=”#666666″;//dynamically show contant id
}
else
{
hideDiv(’div’+ i);
document.getElementById(’tab’+i).style.backgroundColor=”gray”;
}
}
}
Read Full Post |
Make a Comment ( None so far )
Posted on June 24, 2008. Filed under: JavaScript |
<table width=”99%” cellpadding=”3″ cellspacing=”1″ bgcolor=”#000000″>
<tr>
<td height=”20″ class=”photonamewhite”><div style=”float: right; width: 100px; position: relative; height: 25px;” class=smallphotoname align=”right”><a href=”#” class=”curhand” title=”Previous” onclick=”moveRight(’div_hall’,90)”>«prev</a> <a href=”#” title=”next” onclick=”moveLeft(’div_hall’,90)”>next»</a></div></td>
</tr>
<tr>
<td bgcolor=”#999999″ >
<DIV style=”MARGIN-LEFT: 5px; OVERFLOW: hidden; background-color:#666666; WIDTH: 276px; POSITION: relative; HEIGHT: 184px”>
<DIV id=”div_hall” style=”LEFT: 0px; WIDTH:<%=(photo.Items.Count%6)==0?(photo.Items.Count/6)*270:((photo.Items.Count/6)+1)*270%>px; POSITION: absolute; TOP: 0px”>
<asp:DataList ID=photo runat [...]
Read Full Post |
Make a Comment ( None so far )
Posted on May 23, 2008. Filed under: JavaScript |
head>
<title>Untitled Page</title>
<script language=javascript>
function submitvalue()
{
var red=document.getElementById(‘rd’);
var val=“PH”;
if(rd[0].checked==true)
{val=“KH”;
}
window.location.href=“keywordsearch.aspx?kq=”+document.getElementById(‘txtsearch’).value+“&stype=”+val;
}
</script>
</head>
<body>
<input type=text name=”txtsearch” runat=server />
<input type=radio name=”rd” value=”KH” runat=server checked=checked/>
<input type=”radio” name=”rd” value=”PH” runat=server/>
<input type=”button” name=”btnsearch” value=”search” onclick=”submitvalue();”/>
</body>
Read Full Post |
Make a Comment ( None so far )
Posted on May 16, 2008. Filed under: JavaScript |
<a href=”javascript:return false;” onclick=”javascript:window.open(’sendquery.aspx?rg=” + sd.REGID + “&comp=” + sd.COMPANYNAME + “&city=” + sd.CITYNAME + “‘,’smallwindowsms’,’toolbars=0,crollbars=0,width=600,
height=500,menubar=0,resizable=0′);return false;”>send query</a>
Read Full Post |
Make a Comment ( None so far )
Posted on May 15, 2008. Filed under: JavaScript |
<
SCRIPT language=javascript type=text/javascript>
function disableCtrlKeyCombination(e)
{//list all CTRL + key combinations you want to disable
var forbiddenKeys = new Array(‘a’, ‘n’, ‘c’, ‘x’, ‘v’, ‘j’);
var key;var isCtrl;
if(window.event)
{key = window.event.keyCode; //IE
if(window.event.ctrlKey)
isCtrl = true;
else
isCtrl = false;
}
else
{key = e.which; //firefox
if(e.ctrlKey)
isCtrl = true;
else
isCtrl = false;
}
//if ctrl is pressed check if other key is in forbidenKeys array
if(isCtrl)
{for(i=0; i<forbiddenKeys.length; i++)
{// alert(forbiddenKeys[i]);
//case-insensitive comparation
if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
{// [...]
Read Full Post |
Make a Comment ( None so far )
Posted on April 9, 2008. Filed under: JavaScript |
<!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>Untitled Page</title>
<style type=”text/css”>
.chatclk{cursor:pointer;cursor:hand;}
.f10 {FONT-FAMILY: arial; FONT-SIZE: 10px;}
.f11 {FONT-FAMILY: arial; FONT-SIZE: 11px;}
.f12 {FONT-FAMILY: arial; FONT-SIZE: 12px;}
.f12r {FONT-FAMILY: arial; FONT-SIZE: 12px; line-height:13px}
.f12n {FONT-FAMILY: arial; FONT-SIZE: 12px; line-height: 1.3em}
.ft11a{font-family:Tahoma;font-size:11px;line-height: 13px}
.fv9 {FONT-FAMILY: verdana; FONT-SIZE: 9px;}
.fv8 {FONT-FAMILY: verdana; FONT-SIZE: 8px;}
.fv10 {FONT-FAMILY: verdana; FONT-SIZE: 10px;}
.ft11{font-family:Tahoma;font-size:11px;line-height:14px;}
.fmicro9 {FONT-FAMILY: Microsoft Sans Serif; FONT-SIZE: 9px;}
a.srchlink:link [...]
Read Full Post |
Make a Comment ( None so far )