JavaScript What is JavaScript? JavaScript is a language (ECMA Script) that is a standard used to enhance user interfaces for websites, browser and applications like PDF documents and widgets.
How to JavaScript? Here You will learn to install Java Script code to any website or web-page.You can add simple drop down lists to to advanced JavaScript code for forums. The only thing you really need to know is to copy the code to notepad and save it as a webpage, then upload it to your website, or just copy and paste the JavaScript and code right into your web-pages to enable JavaScript. Some of you may be using a website editor through a control panel, then all you need to do is place the code in your (Custom HTML) or (JavaScript) Button. Lets learn some simple JavaScript Code below! Setting The Home Page
Here's the easy script. Works in IE 4 and above. Won't cause errors in Netscape though. Place in the BODY... <!--[if IE]> <a HREF onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage('http://www.javascriptsandmore.com');"> Click here to make JavaScript's and More your start page!</a> <![endif]--> BLOCK ERRORS
Here's an important one to put in your pages. It will block any errors in script syntax that may be laying dormant in your pages. Just a precaution... <script language="JavaScript"> // Source: javascripsandmore.com function blockError(){return true;} window.onerror = blockError; </script> WRITING THE ACTUAL DATE
Want to get a visitor to order by a certain date or she doesn't get the bonuses? Here's the script. Place it wherever you want the display. (BODY) Order Before <SCRIPT LANGUAGE="Javascript"> <!-- // Specify names of days: var dayNames = new Array("Sunday","Monday","Tuesday", "Wednesday", "Thursday","Friday","Saturday"); // Specify names of months: var monthNames = new Array("January","February","March","April","May","June", "July", "August","September","October", "November","December"); var now = new Date(); var thisday = dayNames[now.getDay() +2]; var thismonth = monthNames[now.getMonth()]; var thisdate = now.getDate(); var thisdate=thisdate + 2; var thisyear = now.getFullYear(); document.write(thisday + ", " + thismonth + " " + thisdate + ", " + thisyear); // --> </SCRIPT> and Get 6 Bonuses FREE! And here are more formats for writing the dates display dates formats dd/mm/yy <script language="JavaScript"><!-- var date = new Date(); var d = date.getDate(); var day = (d < 10) ? '0' + d : d; var m = date.getMonth() + 1; var month = (m < 10) ? '0' + m : m; var yy = date.getYear(); var year = (yy < 1000) ? yy + 1900 : yy; document.write(day + "/" + month + "/" + year); //--></script> date month year <script language="JavaScript"><!-- function makeArray() { for (i = 0; i<makeArray.arguments.length; i++) this[i + 1] = makeArray.arguments[i]; } var months = new makeArray('January','February','March', 'April','May','June','July','August','September', 'October','November','December'); var date = new Date(); var day = date.getDate(); var month = date.getMonth() + 1; var yy = date.getYear(); var year = (yy < 1000) ? yy + 1900 : yy; document.write(day + " " + months[month] + " " + year); //--></script> |
|