• Home
  • Trace mobile number (From India)
  • Entertainment
  • SiteMap
  • Home
  • ASP.NET
  • C#
  • BLOGGING
  • SQL SERVER
  • FACEBOOK
  • Entertainment
Showing posts with label JavaScript Scripting. Show all posts
This below JavaScript code will enable you to place a button on your website that, when clicked on, will make your web site your visitors home page.


<INPUT TYPE="button" VALUE="Make This page Your Home Page" onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage('http:// www.usetricks.com');">
Display:

There are three location where JavaScript can be placed for use in a webpage.

  1.     within the head tag
  2.     Within the body tag
  3.     In an external file

If you want to have a script run if some event occure,like when a user clicks a button, then you will place that script within the head tag. If you want the script to run when the page loads, then you will have to place the script within the body tag.We use External JavaScript files if we want seprate or hide  javascript function  from html webpage .

An Example Placing  Script within head Tag

<html>
<head>
<script type="text/JavaScript">
<!--
function popup() {
alert("Hello I am within Head")
}
//-->
</script>
</head>
<body>
<input type="button" onclick="popup()" value="popup">
</body>
</html>

An Example Placing  Script within <body> Tag

<html>
<head>
</head>
<body>
<script type="text/JavaScript">
<!--
alert("Hello I am within Head")
//-->
</script>
</body>
</html>

An Example Placing  Script within External JavaScript files


<html>
<head>
<script type="text/JavaScript" src=”script.js”>
</script>
</head>
<body>
<input type="button" onclick="popup()" value="popup">
</body>
</html>

Place the following code in script.js file .


function popup()
 {
alert("Hello I am within External file");
 }


This javascript code will display the current time from the client’s computer. This will display the format you might see on a typical digital clock -- HH:MM AM/PM (H = Hour, M = Minute).

<h4>The Current Time Is 
<script type="text/javascript">
<!--
var dateobj = new Date()
var hrs = dateobj.getHours()
var min = dateobj.getMinutes()
if (min < 10){
min = "0" + min
}
document.write(hrs + ":" + min + " ")
if(hrs > 11){
document.write("PM")
} else {
document.write("AM")
}
//-->
</script>
</h4>

Display:

The Current Time Is

The getDate() method will returns the day of the month (from 1 to 31) for the specified date, according to local system time.It is always use with the Javascript Date object.

Sysntax is
Date.getDate();

This method is supported by all main browser.

Example:
Return the day of the month:

    <script type="text/javascript">
    var MyDate=new Date();
    document.write(MyDate.getDate());
 </script>
<!--Output will be Date of your local system-->

Return the day of the month from a specific date:

    <script type="text/javascript">
    var MyDate=new Date("May 25, 2012 02:25:00");
    document.write(MyDate.getDate());
 </script>
 <!--Output will be 25-->

To view webpages which uses JavaScript, you need to ensure that your browser has JavaScript enabled. if JavaScript is disable, you can still view the webpage without JavaScript, but you will not be able to take advantage of the JavaScript functionality.

How do you check if your browser has JavaScript enabled?

This will depend on the browser you're using. Steps for some of the more common browsers are below:

Internet Explorer (6.0):

  1.     Go to Tools from the top menu
  2.     Select Internet Options
  3.     Click on the Security tab
  4.     Click Custom Level
  5.     Scroll down until you see the Scripting section
  6.     Ensure that the Active Scripting option is set at Enabled
  7.     Click OK


Netscape Navigator (4.8):
  •     Go to Edit from the top menu
  •     Select Preferences
  •     Select Advanced
  •     Select Scripts & Plugins
  •     Check the Enable JavaScript checkbox
  •     Click OK


Mozilla Firefox (1.0):

  •     Go to Tools from the top menu
  •     Select Options
  •     Select Web Features from the left menu
  •     Ensure the Enable JavaScript option is checked
  •     Click OK


Mozilla Firefox (1.5):

  •     Go to Tools from the top menu
  •     Select Options
  •     Click on the Content button
  •     Ensure that the Enable JavaScript option is checked
  •     Click OK


Apple Safari (1.0):

  •     Go to Safari from the top menu
  •     Select Preferences
  •     Select Security
  •     Ensure that the Enable JavaScript option is checked
  •     Click OK


If you are a  developer and you had develope web pages with JavaScript, then it is  good practice to view your website with JavaScript disabled. This will show you what your website will look like to users who choose to disable JavaScript.

 Video tutorial about enabling JavaScript in one of the most commonly used web browsers: Google Chrome

 

 How To Turn Javascript On/Off IE

 

Video tutorial about enabling JavaScript in one of the most commonly used web browsers: Safari.

 

 How to enable JavaScript in Mozilla Firefox

 

 HTML, JavaScript Scripting, ,Scripts, Java, WebBrowser, browser
Older Posts Home

Most Read

  • How to Capitalize the First Letter of All Words in a string in C# ?
  • keyboard shortcuts For Windows
  • List Of Best Free WordPress Plugins : 2012
  • Read Write XML Data-Read Write XML File Using C#, VB.NET In Asp.Net
  • How to Shake Internet Explorer - Javascript Code
  • How to Choose a Nice Topic for your Blog .
  • Free Search Engine Submission List ,search engine optimization
  • Number validation in Textbox of ASP.NET Using Regular Expression validator
  • Javascript:Percentage Gain Javascript Calculator
  • .Net Interview Questions and Answers on OOPS | OOPS Frequently Asked Questions
Google
Custom Search Bloggers - Meet Millions of Bloggers

Join Us On FaceBook

  • Recent Posts
  • Comments

All Topics

  • ▼  2014 (10)
    • ▼  January (10)
      • ASP.NET Interview Question : difference between ge...
      • Dot Net Framework:What is the .NET Framework?
      • Dot NET Framework - .NET Framework Interview Quest...
      • What is the differences between MVC2,MVC3 and MVC4...
      • Is try catch is using a good coding (exception han...
      • What is the use of Just - In - Time (JIT)?
      • What is GUID , why we use it?,how to create a GUID
      • How to Rename database table column in sqlserver
      • How to Rename Database in sqlserver
      • Asp.net Example Calendar Control
  • ►  2013 (14)
    • ►  October (1)
    • ►  April (2)
    • ►  March (11)
  • ►  2012 (142)
    • ►  December (25)
    • ►  October (1)
    • ►  September (9)
    • ►  August (2)
    • ►  July (7)
    • ►  June (2)
    • ►  April (5)
    • ►  March (27)
    • ►  February (27)
    • ►  January (37)
  • ►  2011 (23)
    • ►  December (3)
    • ►  November (6)
    • ►  October (12)
    • ►  September (2)
  • ►  2009 (1)
    • ►  June (1)

Tips & Tricks

  • What is good One Blog and Many Categories, or Many Blogs with One Categories?
  • Adding Twitter tweet button to each Blogger posts.
  • How to Choose a Nice Topic for your Blog .
  • Embedding YouTube Videos ,movie in your blog
  • Facebook iFrame Apps – Getting Rid of Scrollbars
  • Facebook Analytics:How to Set Up Your Website or Blog with Facebook Insights for Domains
  • How To Add Perfect Share Box to Blogger
  • Blogger Free Images Hosting Tip,Free unlimited bandwidth image hosting for Blogger blogs
  • Add “Link to this post” codes below Each blogger posts
  • Free Search Engine Submission List ,search engine optimization
  • Adsense Tips for Maximum CTR
  • List Of Best Free WordPress Plugins : 2012
2012 tectopix. All rights reserved.
Designed by tectopix