Home | Add to Favorites | Ebooks Directory | News  
Javascript   Resources
Home
Javascript  Article
JavaScript Tutorial 
Java Script Example
Books
JavaScript  Download
Java script Reference
JavaScript Tutorial

Example 10

The script replaces the starting "A" alphabet in the input string with "L" The RegExp() constructor of RegExp class creates a new regular expression object.The replace() method has to be
used with the string object which has to be matched and the replace() takes the RegExp object and the replacing string as the arguments.


 

<html>
<body>
<script language="javascript">
var str="Apple";
var r1=new RegExp("A");
var str=str.replace(r1,"L");
alert(str);
</script>
</body>


 


The Plugins installed in the Web Browser can be found out as follows
Mostly browsers like Netscape navigator,FireFox  Mozilla,Opera require plugins to be installed for supporting flash, Multimedia etc,..
The details of these plugins installed (if any) like, name, filename, description , etc,... can be found using the navigator along with the plugins
object's properties.

Example 11

<html>
<body>
<script language="javascript">
var l=navigator.plugins.length;
if(l==0)
{
alert("No PLUGINS are installed in this Browser");
}
else
{
for(i=0;i<l;i++)
{
alert("Plugin Name: "+navigator.plugins[i].name+"<br>Plugins File name: "+navigator.plugins[i].file+"Plugins Description: "+navigator.plugins[i].description);
}
}
</script>
</body>
</html>

 


Example 12

The current date can be found using the date object and the toLocaleString() property with it


<html>
<body>
<script language="javascript">
var now=new Date();
alert(now.toLocaleString());
</script>
</body>
</html>

                                                            Go To Index