Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Thursday, March 18, 2010

What is jQuery used for




jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

You may use jQuery under the terms of either the MIT License or the Gnu General Public License (GPL) Version 2.

embedding jquery-1.4.2.min.js or jquery-1.4.2.js or both of them into your code, you can manipulate or using futures of jQuery. You do not need to write a thousand line of javascript code but just include js file into your code. You can used the futures such as CSS,Effect,Ajax,manipulation, and others greatest java

How to get started?? just visit http://docs.jquery.com/Main_Page.

Click HERE to download jquery manual documentation

Friday, February 12, 2010

Islamic Calendar script - Hijrah/Masihi Calendar converter

Copy this script and paste to your code to add the Islamic Calendar converter

<HTML>
<HEAD>
<SCRIPT language=JavaScript>

function intPart(floatNum){
if (floatNum< -0.0000001){
return Math.ceil(floatNum-0.0000001)
}
return Math.floor(floatNum+0.0000001)
}
function weekDay(wdn){
if(wdn==0){
return "Monday"
}
if(wdn==1){
return "Tuesday"
}
if(wdn==2){
return "Wednesday"
}
if(wdn==3){
return "Thursday"
}
if(wdn==4){
return "Friday"
}
if(wdn==5){
return "Saturday"
}
if(wdn==6){
return "Sunday"
}
return ""

}
function chrToIsl(arg) {
d=parseInt(arg.CDay.value)
m=parseInt(arg.CMonth.value)
y=parseInt(arg.CYear.value)
if ((y>1582)||((y==1582)&&(m>10))||((y==1582)&&(m==10)&&(d>14)))
{
jd=intPart((1461*(y+4800+intPart((m-14)/12)))/4)+intPart((367*(m-2-12*(intPart((m-14)/12))))/12)-
intPart( (3* (intPart( (y+4900+ intPart( (m-14)/12) )/100) ) ) /4)+d-32075
}
else
{
jd = 367*y-intPart((7*(y+5001+intPart((m-9)/7)))/4)+intPart((275*m)/9)+d+1729777
}
arg.JD.value=jd
arg.wd.value=weekDay(jd%7)
l=jd-1948440+10632
n=intPart((l-1)/10631)
l=l-10631*n+354
j=(intPart((10985-l)/5316))*(intPart((50*l)/17719))+(intPart(l/5670))*(intPart((43*l)/15238))
l=l-(intPart((30-j)/15))*(intPart((17719*j)/50))-(intPart(j/16))*(intPart((15238*j)/43))+29
m=intPart((24*l)/709)
d=l-intPart((709*m)/24)
y=30*n+j-30

arg.HDay.value=d
arg.HMonth.value=m
arg.HYear.value=y
}
function islToChr(arg) {
d=parseInt(arg.HDay.value)
m=parseInt(arg.HMonth.value)
y=parseInt(arg.HYear.value)
jd=intPart((11*y+3)/30)+354*y+30*m-intPart((m-1)/2)+d+1948440-385
arg.JD.value=jd
arg.wd.value=weekDay(jd%7)
if (jd> 2299160 )
{
l=jd+68569
n=intPart((4*l)/146097)
l=l-intPart((146097*n+3)/4)
i=intPart((4000*(l+1))/1461001)
l=l-intPart((1461*i)/4)+31
j=intPart((80*l)/2447)
d=l-intPart((2447*j)/80)
l=intPart(j/11)
m=j+2-12*l
y=100*(n-49)+i+l
}
else
{
j=jd+1402
k=intPart((j-1)/1461)
l=j-1461*k
n=intPart((l-1)/365)-intPart(l/1461)
i=l-365*n+30
j=intPart((80*i)/2447)
d=i-intPart((2447*j)/80)
i=intPart(j/11)
m=j+2-12*i
y=4*k+n+i-4716
}

arg.CDay.value=d
arg.CMonth.value=m
arg.CYear.value=y

}
</SCRIPT>
<head>

<BODY>
<TABLE border=1>
<TBODY>
<TR>
<TH></TH>
<TH>Day</TH>
<TH>Month</TH>
<TH>Year</TH></TR>
<TR>
<TH>Masehi </TH>
<FORM name=IrgendÃ…¡ppis>
<TH><INPUT size=4 value=1 name=CDay></TH>
<TH><INPUT size=4 value=1 name=CMonth></TH>
<TH><INPUT size=4 value=1996 name=CYear></TH></TR>
<TR>
<TH>Hijrah</TH>
<TH><INPUT size=4 name=HDay></TH>
<TH><INPUT size=4 name=HMonth></TH>
<TH><INPUT size=4 name=HYear></TH></TR></TBODY></TABLE>
<P>
<INPUT onclick=chrToIsl(this.form) type=button value="Masehi to Hijrah" name=CtoH>
<INPUT onclick=islToChr(this.form) type=button value="Hijrah to Masehi" name=HtoC>
<P>Day of the week: <INPUT size=10 name=wd>
<P>Julian Day: <INPUT size=7 name=JD>
<P></FORM>
<HR>
<p><font color="#006600" size="1" face="Century Gothic">Julian dates assign a unique number to each
calendar day. The Julian day number counts the number of days since noon
on January 1, -4712 (astronomical calendar) or January 1, 4713 BC (civil
calendar). This system, widely used by astronomers, was proposed by Julius
J. Scaliger in 1583. Hours and minutes are counted as fractions of a day
since the last noon (Universal Time).</font></p>
<TABLE border=1>
<TBODY>
<TR>
<TH>1</TH>
<TH>Muharram</TH>
<TH></TH>
<TH>7</TH>
<TH>Rajab</TH></TR>
<TR>
<TH>2</TH>
<TH>Safar</TH>
<TH></TH>
<TH>8</TH>
<TH>Sha'ban</TH></TR>
<TR>
<TH>3</TH>
<TH>Rabi'ul Awal</TH>
<TH></TH>
<TH>9</TH>
<TH>Ramadhan</TH>
</TR>
<TR>
<TH>4</TH>
<TH>Rabi'ul Akhir</TH>
<TH></TH>
<TH>10</TH>
<TH>Shawwal</TH></TR>
<TR>
<TH>5</TH>
<TH>Jumadil Awal</TH>
<TH></TH>
<TH>11</TH>
<TH>Zulkaedah</TH>
</TR>
<TR>
<TH>6</TH>
<TH>Jumadil Akhir</TH>
<TH></TH>
<TH>12</TH>
<TH>Zulhijjah</TH>
</TR></TBODY></TABLE>
</BODY>
</HTML>


source: over the internet

Monday, February 8, 2010

Print only selected div content / css print selected only

If you need to print only selected content in div and not include button print, this is simple solution help you to solve it.

<html>
<head>
<style type="text/css" media="print">
@media print
{
#non-printable { display: none; }
#printable {
display: block;
width: 100%;
height: 100%;
}
}
</style>
</head>
<body>
<div id="printable" >
Your content to print
</div>
<input type="button" id="non-printable" class=normaltext onclick="JavaScript:window.print();" value="print" />
</body>
</html>


Tuesday, January 19, 2010

PHP and jquery file upload with progress bar

A very nice code to add into your application, easy to understand and simple to use.
Just configure 1 php script and 1 html script.
Provide tutorial by www.webdeveloperplus.com.

This is a screen shot of my test on it.




Visit http://demo.webdeveloperplus.com/jquery-swfupload/ to download and test it, http://webdeveloperplus.com/jquery/multiple-file-upload-with-progress-bar-using-jquery/ to heaving tutorial. http://demo.webdeveloperplus.com/jquery-swfupload/ for the demonstration

Thanks to : http://webdeveloperplus.com

Monday, September 28, 2009

Basic Javascript in web

Window popup

<head>
<script type="text/javascript">
<!--
function myPopup() {
window.open( "http://www.google.com/" )
}
//-->
</script>
</head>
<body>
<form>
<input type="button" onClick="myPopup()" value="POP!">
</form>
<p onClick="myPopup()">CLICK ME TOO!</p>
</body>


Alert box

<form>
<input type="button" onclick=
"alert('Are you like the greatest post?')"
value="Confirmation Alert">
</form>


Page redirect

<html>
<head>
<script type="text/javascript">
<!--
function delayer(){
window.location = "../javascriptredirect.php"
}
//-->
</script>
</head>
<body onLoad="setTimeout('delayer()', 5000)">
<h2>Prepare to be redirected!</h2>
<p>This page is a time delay redirect, have fun with the greatset post</p>

</body>
</html>


for more... wait for update soon..

Monday, July 27, 2009

Javascript Manual

This is java script manual that I found over the internet. I share with you and you will be able to develop your web with java script implemented. Click the icon to download. Have fun!!.



Thanks to who share this manual.
Thanks to 000webhost.com to sponsor the hosting.

Tuesday, February 10, 2009

What is AJAX (Programming)

Ajax, or AJAX techniques used to create interactive (Asynchronous JavaScript and XML), is a group of interrelated web developmentweb applications or rich Internet applications. With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. The use of Ajax has led to an increase in interactive animation on web pages. Data is retrieved using the XMLHttpRequest object or through the use of Remote Scripting in browsers that do not support it. Despite the name, the use of JavaScript and XML is not actually required, nor do the requests need to be asynchronous. The acronym AJAX has thus changed to the term Ajax, which does not represent these specific technologies.


Source : http://en.wikipedia.org

Note (site to get sourcecode):

http://www.java2s.com/
http://www.javascriptkit.com/