Sunday, 27 October 2013

Include Javascript File in Html

Ways of Embedding and Integrating JavaScript in the HTML Pages


(js tag, javascript embed tag, embed javascript into html, include javascript file in html, javascript within html, include javascript file, include js file in html, add js file to html)
As you know, there are two places you can put your JavaScripts in an HTML page: in either the head or body section. In addition, I have told you that you can either embed JavaScript directly into the HTML page or reference it in as an external .js file. One more way you can integrate JavaScript into an HTML page is as a component in an HTML tag.
As we already told you that we can put our JavaScript code in anywhere in <head> or in <body> tags. We told you that you can embed your code directly or in your code or by saving it in another file and then referring the web page to get data from that external file. Here we are going to define how to use both ways of embedding code in an HTML page.

Using or Embedding JavaScript Code in the Body Section of an HTML page

JavaScripts embedded with the <SCRIPT> and </SCRIPT> tags can be placed anywhere in the body section of an HTML page. Scripts embedded in the body section are executed as part of the HTML document when the page loads. This enables the script to begin executing automatically as the page loads. For example, the statements shown below demonstrate how to embed a JavaScript within the body section of an HTML page.
<BODY>
  <SCRIPT TYPE="Text/JavaScript" LANGUAGE="JavaScript" >
    document.write("Code embedded in the body of an HTML page.");
  </SCRIPT>
</BODY>

JavaScript can be used or embedded more than once in the HTML pages.

<BODY>
  <SCRIPT TYPE="Text/JavaScript" LANGUAGE="JavaScript" >
    document.write("First embedded code in the body section.");
  </SCRIPT>
  <BR>
  <SCRIPT LANGUAGE="JavaScript" TYPE="Text/JavaScript">
    document.write("Second embedded code in the body section.");
  </SCRIPT>
</BODY>

Embedding the JavaScript in <Head> and </Head> tags in HTML pages

JavaScripts can also be placed anywhere within the head section of your HTML pages. Unlike scripts embedded within the body section of HTML pages, scripts embedded in the head section are not necessarily automatically executed when the page loads. In some cases, they are executed only when called for execution by other statements within the HTML page. Most JavaScript programmers move all functions and most variables to the head section because this ensures that they will be defined before being referenced by scripts located in the body section of the page.

NOTE

Variables are containers for storing information in computer memory. Functions are groups of JavaScript statements that you can call to perform a specific task. We'll talk more about the benefits of using functions and variables in upcoming posts.
The following statements show an HTML page with a JavaScript embedded in the head section. This script will automatically execute when the HTML page is loaded.
<HTML>
  <HEAD>
    <TITLE>Programming Dost Home Page</TITLE>
    <SCRIPT TYPE="Text/JavaScript" LANGUAGE="JavaScript">
      window.alert("JavaScript is executing from the Head section");
    </SCRIPT>
  </HEAD>
  <BODY>
  </BODY>
<HTML>

Using JavaScript with an External file in HTML pages

To store your JavaScripts in external files, you need to save them as plain text files with a .js file extension. You then need to add the SCR attribute to the opening <SCRIPT> tag in your HTML page as stated here.
<SCRIPT SRC="myExternalFile.js" TYPE="Text/JavaScript" LANGUAGE="JavaScript" > </SCRIPT>

In this example, an external JavaScript named myExternalFile.js has been used. This external JavaScript can contain any number of JavaScript statements or code. However, it cannot have any HTML whatsoever. Otherwise you'll end up with an error. For instance, the contents of the myExternalFile.js script  might be very simple as follows:
document.write("External JavaScript for the friends(dost) of Programming Dost.");

There are many advantages to putting JavaScripts in externally referenced files. For beginners, by getting JavaScripts out of your HTML pages you make your HTML pages smaller and easier to work with. In addition, you can reuse the JavaScripts stored as external files over and over again by referencing them from any number of HTML pages. This way if you create a script that you want to reference from several HTML pages, you can do so without having to insert the same script in all HTML pages over and over again. As a plus, should you ever want to alter the functionality of an externally stored script, you can do it by changing the code in the external file and all is done for you.

NOTE

There is no limit of the external file which can be called in an HTML page. And there is not limit of code use in the external file.

Use of JavaScript in the HTML tags in Web Pages

JavaScript can also be placed within HTML tags, as shown in the following example.
<BODY onLoad=document.write("Hello World! From Programming Dost")> </BODY>

In this example, the JavaScript onLoad=document.write("Hello World! From Programming Dost ") statement has been added to the HTML <BODY> tag. This particular JavaScript statement tells the browser to write the enclosed text when the browser first loads the HTML page.



JavaScript and Case Sensitivity | JavaScript Case Sensitivity

JavaScript and Case Sensitivity

It should be kept in mind the JavaScript is a case sensitive programming language (Not like the HTML). So you should be extremely careful about the code you embed while using JavaScript. Case sensitivity means that you must type JavaScript elements exactly as they appear in this book in order for them to work. For example, as far as JavaScript is concerned, the words “variable” and “Variable” refer to two different things, so pay special attention when typing your scripts. As for example in our program instead of using document.write() we mistaken and used Document.write() so our program ended with an error. So be very careful with JavaScript’s case sensitivity.

Insert JavascriptInto Html

Integrating JavaScript with HTML

(insert javascript into html, javascript insert html after element, embed jquery in html, embed javascript in php, javascript innerhtml, jquery insert html)

JavaScript is a collection of some or many programming statements that a programmer embeds in an HTML document. These statements will work or affect the HTML when they are placed in the <script> and </script> tags. Placement of these tags is up to the developer that where he or she wants to put them in the head section or in the body section.
Previously the Language was used to specify the type of the <script> tag. For example:
<script LANGUAGE="JavaScript1.5" > </script>
According to the HTML 4.0 specification, the TYPE attribute is now the proper way to go. However, you can continue to use both attributes if you want, in order to ensure that older browsers don't get confused. When working with JavaScripts, the TYPE attribute will always be Text/JavaScript.
Another way to work with JavaScripts is to store them in external files that have a .js file extension and then to reference those files from within your HTML pages. To accomplish this, you use the SRC attribute to specify the location of an external JavaScript file.  This is use full as it makes difficult for the user to view the JavaScript code.  It also makes it possible to share the same JavaScripts among multiple HTML pages. Once you have defined the opening and closing tags, you can begin placing JavaScript statements between them.
Before writing your first program in JavaScript you should know a little about the structure of the HTML page. If you are not so familiar with these tags and structure please do check the Programming Dost’s Learning HTML section.

<HTML>
  <HEAD>
    <TITLE>The Title of the Page goes here</TITLE>
  </HEAD>
  <BODY>
  </BODY>
</HTML>
This HTML page structure contains the <HEAD> </HEAD>, <TITLE> </TITLE>, and <BODY> </BODY> tag sets all wrapped inside the starting and ending <HTML> </HTML> tag set. If you want to do so, create your own template now. When you are done, add the following lines inside the body section:
<SCRIPT TYPE="Text/JavaScript" LANGUAGE="JavaScript" >
  document.write("Hello World From Programming Dost");
</SCRIPT>
After you put the code in the head or body tags the code will look like:
<HTML>
  <HEAD>
    <TITLE> The Title of the Page goes here</TITLE>
  </HEAD>
  <BODY>
    <SCRIPT TYPE="Text/JavaScript" LANGUAGE="JavaScript" >
      document.write("Hello World From Programming Dost");
   </SCRIPT>
  </BODY>
</HTML>

How to test your JavaScript Code?

Now that you have typed in your first script, you need to save it. We called this script as javaScriptTutorial_1.html. The HTML extension identifies the page as an HTML page. Your computer uses the information in the file's extension to associate the file with a particular application. An .html extension tells the operating system to open its default browser and pass the HTML file to it. Alternatively, you can use the .htm extension, which is also recognized as an extension for HTML pages.
If you are using a full-featured HTML editor, the editor may enable you to test your script with the click of a button like Dreamweaver or Visual Studio etc. Because Notepad has no such automatic HTML testing feature, we simply started up a browser and used it to open the javaScriptTutorial_1.html file. The browser opened our page and ran the script.




Thursday, 17 October 2013

Header Files in C and C++

Header files


You have already been using a header file from day-zero. You know that we used towrite at the top before the start of the main() function <iostream.h>, with ‘.h’ as an extension, you might have got the idea that it is a header file.
Now we will see why a Header file is used. In the previous lecture, we discussed a little bit about Function Prototypes. One thing is Declaration and other is Definition. Declaration can also be called as ‘Prototype’. Normally, if we have lot of functions and want to use them in some other function or program, then we are left with only one way i.e. to list the prototypes of all of them before the body of the function or program and they use them inside the function or program. But for frequent functions inside a program, this technique increases the complexity (of a program). This problem can be overcome by putting all these function prototypes in one file and writing a simple line of code for including the file in the program. This code line will indicate that this is the file, suppose 'area.h' containing all the prototypes of the used functions and see the prototypes from that file. This is the basic concept of a header file.

So what we can do is: Make our own header file which is usually a simple text file with '.h' extension ('.h' extension is not mandatory but it is but it is a rule of good programming practice).
Write function prototypes inside that file. (Recall that prototype is just a simple line of code containing return value, function name and an argument list of data types with semi-colon at the end.)
That file can be included in your won program by using the ‘#inclue’ directive and that would be similar to explicitly writing that list of function prototypes.

Function prototypes are not the only thing that can be put into a header file. If we use the standard  variables like ‘pi’ which is equal to 3.1415926 in a file and then include the file as a header file we will be able to use the variable ‘pi’ in any file which includes the containing file, without specifying every time the value of ‘pi’. It would be nice, if we can assign meaningful names to them. There are two benefits of doing this. See, we could have declared a variable of type double inside the program and given a name like ‘pi’:
double pi = 3.1415926;
Then everywhere in the subsequent calculations we can use 'pi'. But it is better to pre-define the value of the constant in a header file (one set for all) and simply including that header file, the constant ‘pi’, is defined. Now, this meaningful name ‘pi’ cab be used in all calculations instead of writing the horrendous number 3.1415926 again and again.
There are some preprocessor directives which we are going to cover later. Moment, we will discuss about ‘#define’ only. We define the constants using this preprocessor directive as:

#define pi 3.1415926

The above line des a funny thing as it is not creating a variable. Rather it associates a name with a value which can be used inside the program exactly like a variable. (Why it is not a variable?, because you can’t use it on the left hand side of any assignment.). Basically, it is a short hand, what actually happens. You defined the value of the ‘pi’ with ‘#difine’ directive and then started using ‘pi’ symbol in your program. Now we will see what a compiler does when it is handed over the program after the writing process. Wherever it finds the symbol ‘pi’, replaces the symbol with the value 3.1415926 and finally compiles the program. Thus, in compilation process the symbols or constants are replaced with actual values of them. But for us as human beings, it is quite readable to see the symbol ‘pi’. Additionally, if we use meaningful names for variables and see a line ‘2 * pi * radius’, it becomes obvious that circumference of a circle is being calculated. Note that in the above statement, ‘2 * pi * radius’; 2 is used as a number as we did not define any constant for it. We have defined ‘pi’ and ‘radius’ but defining 2 would be over killing.




Useful Things for Functions in Programming

Return-value_type:


Function may or may not return a value. If a function returns a value, that must be of a valid data type. This can only be one data type that means if a function returns an int data type than it can only return int and not char or float. Return type may be int, float, char or any other valid data type. How can we return some value from a function? The keyword is return which is used to return some value from the function. It does two things, returns some value to the calling program and also exits from the function. It does two things, returns some value to the calling program and also exits from the function. We can only return a value (a variable or an expression which evaluates to some value) from a function. The data type of the returning variable should match return_value_type data type.
There may be some functions which do not return any value. For such functions, the return_value_type is void. ‘void’ is a keyword of ‘C’ language. The default return_value_type is of data type i.e. if we do not mention any return_value_type with a function; it will return an int value.

Function-name:

The same rules of variable naming conventions are applied to functions name. Function name should be self-explanatory like square, squareRoot, circleArea etc.

Argument-list:

 Argument list contains the information which we pass to the function. Some function does not need any information to perform the task. In this case, the argument list for such functions will be empty. Arguments to a function are of valid data type like int number, double radius etc.

Declarations and Statements:

This is the body of the function. It consists of declarations and statements. The task of the function is performed in the body of the function.
//The function multiplies an integers to itself and returns the result
Int multiply(int my_number)
{
            Int my_result = 0;
            my_result = my_number * my_number;
            return result;
}

Calling Mechanism:

How a program can use a function? It is very simple. The calling program just needs to write the function name and provide its arguments (without data types). It is important to note that while calling a function, we don’t write the return value data type or the data types of arguments.


Scope of Identifiers in a Function

Scope of Identifiers


An 'Identifier' means any name that the user creates in his/her program. These names can be of variables, functions and labels. Here the scope of an identifier means its visibility. We will focus Scope of Variables in our discussion.
Suppose we write the function:
void func1() {
int i;
……..      //Some other lines of code
int j = i+2;    //Perfectly alright
. . .
}
Now this variable ‘i’ can be used in any statement inside the function func1(). But consider this variable being used in a different function like:
void func2() {
int k = i + 4; //Compilation error
. . .
}
The variable ‘i’ belongs to func1() and is not visible outside that. In other words, ‘i’ is local to func1().To understand the concept of scope further, we have to see what are Code Blocks? A code block begins with ‘{‘ and ends with ‘}’.Therefore, the body of a function is essentially a code block. Nonetheless, inside a function there can be another block of code like 'for loop' and 'while loop' can have their own blocks of code respectively. Therefore, there can be a hierarchy of code blocks.
A variable declared inside a code block becomes the local variable for that for that block. It is not visible outside that block. See the code below:
void func() {
            int outer; //Function level scope
            . . .
            {
                        Int inner;         //Code block level scope
                        inner = outer; //No problem
                        . . .
            }
inner ++;          //Compilation error
}
Please note that variable ‘outer’ is declared at function level scope and variable ‘inner’ is declared at block level scope.
The ‘inner’ variable declared inside the inner code block is not visible outside it. In other words, it is at inner code block scope level. If we want to access that variable outside its code block, a compilation error may occur.


            

Declaration and Definition of a Function

Declaration and Definition of a Function


Declaration and definition are two different things. Declaration is the prototype of the function, that includes the return type, name and argument list to the function and definition is the actual function code. Declaration of a function is also known as signature of a function. As we declare a variable like int x; before using it in our program, similarly we need to declare function before using it. Declaration and definition of a function can be combined together if we write the complete function before the calling function. Then we don’t need to declare it explicitly. If we have written all of our functions in a different file and we call these functions from mani() which is written in a defferent file. In this case, the main( ) will not be compiled unless it knows about the functions declaration. There we write the declaration of functions before the main() function. Function declaration is a one line statement in which we write the return type, name of the function and the data type of arguments. Name of the arguments is not necessary. The definition of the function contains the complete code of the function. It starts with the declaration statement with the addition that in definition, we do write the names of the arguments. After this, we write an opening brace and then all the statements, followed by a closing brace.

If the function square is defined in a separate file or after the calling function, then we need to declare it:

Delaration:

Double square (double);


Definition:
Double square (double number)
{
            return (my_num * my_num);
}

Here is the complete code to elaborate the topic more:

#include <iostream.h>

//Here we are declaring the function.
double square(double);

main(){
            double num, result;
            result = 0;
            num = 0;
            cout<<”Please Enter a Number to calculate the square of.”;
            cin>>num;
            //now we are going to call the function
            result = square (num);
            cout <<”The square of ”<<num<<”is”<<result;
            // function to calculate the square of a number
            double square ( double num)
{
                        return (num * num ) ;
}

}

A function in a calling program can take place as a stand-alone statement, on hand side of a statement. This can be a part of an assignment expression.




Functions in C and C++ Programming

Functions in Programming 

The functions are like subtasks. They receive some information, do some procedure and provide a result. Functions are invoked through a calling program. Calling program does not require to know what the function is doing and how it is performing its task. There is a specific function-calling methodology. The calling program calls a function by giving it some information and receives the result.
We have a main () in every C program. ‘main()’ is also a function. When we write a function, it must start with a name, parentheses, and surrounding braces just like with main(). Functions are very important in code reusing.
There are two categories of functions:
a)      Functions that return a value
b)      Functions that do not return a value
Suppose, we have a function that calculates the square of an integer such that function will return the square of the integer. Similarly we may have a function which displays some information on the screen so this function is not supposed to return any value to the calling program.
A Function Structure
The declaration syntax of a function is as follows:
Return-value-type function-name (argument-list)
{
            Declarations and statements
}

The first line is the function header and the declaration and statement part is the body of the function.

Goto Statement in Programming

“goto” Statement

Up to now we have covered the basic programming constructs. These include sequences, decisions and repetition structures (i.e. loops). In sequences, we use the simple statements in a sequence i.e. one after the other. In decisions construct we use the if statement, if/else statement, the multi way decision construct (i.e. the switch statement). And in repetition structures, we use the while, do-while and for loops.
Sometime ago, two computer scientists Gome and Jacopi proved that any program can be written with the help of these three constructs (i.e. sequences, decisions and loops).

There is a statement in the computer languages COBOL, FORTRAN and C. This statement is goto statement is used to jump the control anywhere (back and forth) in a program. In legacy programming, the programs written in COBOL and FORTRAN languages have many unconditional branches of execution. To understand and decode such programs that contain unconditional branches is almost impossible. In such programs, it is very difficult, for a programmer, to keep the track of execution as the control jumps from one place to the other and from there to anywhere else. We call this kind of traditional code as spagatti code. It is very difficult to trace out the way of execution and figure out what the program is doing. And debugging and modifying such programs is very difficult. When structured programming was started, it was urged not to use the goto statement. Though goto is there in C language but we will not use it in our programs. We will adopt the structured approach. All of our programs will consist of sequences, decisions and loops.

Continue Statement in C Programming

Continue Statement

(continue statement in c, continue statement in java, continue statement python, continue statement php, continue statement in c programming)


There is another statement relating to loops. This is the continue statement. Sometimes we have a lot of code in the body of a loop. The early part of this code is common that is to be executed every time (i.e. in every iteration of loop) and the remaining portion is to be executed in certain cases and may not be executed in other cases. But the loop should be continuous. For this purpose, we use the continue statement. Like the break statement, the continue statement is written in a single line. We write it as
                        Continue;
 The continue forces the immediate next iteration of the loop. So the statements of the loop body after continue are not executed. The loop starts from the next iteration when a continue statement is encountered in the body of a loop. One can witness very subtle things while using continue.
Consider the while loop. In while loop, we change the value of the variable of while condition so that it could make the condition false to exit the loop. Otherwise, the loop will become an infinite one. We should be very careful about the logic of the program while using continue in a loop. Before the continue in a loop. Before the continue statement, it is necessary to change (increment/decrement) the value of the variable on which the while condition depends. Similarly it is same with the do-while loop. Be careful to increment or decrement the conditional variable before the continue statement.
In for loop, there is a difference. In a while loop when continue is encountered, the control goes to the while statement and the condition is checked. If condition is true the loop is executed again else the loop exits. In a for loop, the three things i.e. initialization, condition and increment/decrement are enclosed together as we write
for (counter_variable = 0;  counter_variable <=5; counter_variable++).

In the for loop when a continue is encountered, the counter_variable (i.e. loop variable) is incremented at first before the execution of the loop condition. Thus, in for loop the increment to the loop variable is built in and after continue the next iteration of the loop is executed by incrementing the loop variable. The condition is checked with the incremented value of the loop variable. In while and do-while loop, it is our responsibility to increment the value of the loop variable to test the condition. In a for loop, the continue automatically forces this increment of value before going to check the condition. 

For What Purpose JavaSript and Jscript are Used | What Kinds of Things Can JavaScript and Jscript Do

For What Purpose JavaSript and Jscript are Used | What Kinds of Things Can JavaScript and Jscript Do

In mid 1990s the HTML or Hypertexttransfer protocol made people to use internet and create Web Pages to display some static contents. But over the years, HTML has lost much of its gleam. Markup languages are great for formatting the display of text, but they lack the capability to interact with visitors. People surfing the Internet have come to expect and demand more than a static presentation of data from Web sites. If you want people to visit your Web site, to enjoy themselves, and to return again, then you have to find ways to make it more interesting. One of the best ways to do this is with JavaScript. The use of JavaScript will make it more attractive for the user.
JavaScript provides your Web pages with the ability to do a lot of exciting things. The following list provides a preview of what you will learn how to do with JavaScript here in Programming Dost.
Ø  Show pop-ups  that display and gathers information from visitors
Ø  Make rotating banners
Ø  Open new windows
Ø  Redirect people using older browsers to non-JavaScript HTML pages
Ø  Identify the browsers and plug-ins being used by people visiting your Web site
Ø  Validate forms and package their contents in an e-mail message
Ø  Do simple animations such as rollovers
Ø  Use greater control over HTML frames and forms
Ø  Take control of the status bar and create scrolling messages
JavaScript can do a lot of different and exciting things. However, there is one thing that it cannot do. JavaScripts cannot run outside of the browser. This "limitation" helps make JavaScript more secure because users do not have to worry about somebody writing a JavaScript that might erase their hard drive or read their address book and extract private information.

NOTE
This JavaScript tutorial focuses on client-side scripting. By client-side scripting I means scripts that execute within the browsers of people that visit your Web pages. A server-side version of JavaScript also exists.This version of JavaScript is designed to run on Web servers and is used by professional Web site developers to create scripts that provide dynamic content based on information received from visitors, as well as from information stored in a server-side database

Like JavaScript, JScript is limited by the constraints of its implementation environment. When run by the WSH, JScripts don't have access to Web content. They don't work with HTML frames or forms. Instead, the WSH opens up a whole new execution environment that provides JScripts with the capability to access both local and network computer resources. In this context, JScript's primary reason for existing is to facilitate the development of scripts that automate tasks.
JScript provides an especially powerful tool for developing scripts that can automate repetitive and mundane tasks or tasks that are complicated and prone to error when performed manually. The following list provides a preview of what you will learn how to do with JScript in this book.
v  Make and configure desktop shortcuts
v  Produce text reports and log files
v  Manage the Windows file system by copying, moving, and deleting files and folders
v  Manage operating system resources such as Windows services, the registry, and event logs
v  Create and administer user accounts
v  Manage local and network resources such as network printers and disk drives
v  Work together with and control other applications


Introduction to JavaScript and Introduction to Jscript

Introduction to JavaScript and Introduction to Jscript

JavaScript in a programming language and it is specifically made for the web browsers to use. It is used in HTML to create interactivity between the web pages. There is a very similar language called Jscrpit which is made by Microsoft. Microsoft has provided a version of Jscript for the desk top users it means for the local use in a machine and it can be used with the help of Windows Script Host (WSH).
The Windows Script Host (WSH) is an optional scripting environment that supplies Windows operating systems with the capability to run scripts directly on the Windows desktop. Both languages support the same collection of programming statements.
JavaScript and JScript are interpreted languages. This means that scripts written in these languages are not compiled before they are executed (as is typical of most programming languages such asC++). Every script statement must first be converted into binary code (a computer language made up of 0s and 1s that the computer can understand) in order to execute. Unlike complied programs, which are converted to binary code in advance, JavaScript and JScript statements are processed at execution time. This means that they run a little slower than compiled programs. The upside is that this makes writing and testing JavaScripts and JScripts very intuitive and easy. You simply write a few lines of code, save your script, and test it without having to stop and compile it into executable code.
Both JavaScript and Jscript are object-based scripting languages not truly object oriented languages. They have almost everything as object. Everything in JavaScript is an object, for JavaScript a browser, a window, a button etc are objects. JScript has access to a different set of objects. For example, JScript has the capability to access objects such as files, drives, and printers.
Every object has properties, and you can use JavaScript and JScript to manipulate these properties. For example, with JavaScript you can change the background color of a browser window or the size of a graphic image. In addition to properties, objects have methods. Methods are the actions that objects can perform. For example, JavaScript can be used to open and close browser windows. By manipulating their properties and executing methods, you can control objects and make things happen.
JavaScripts support event-driven programming. An event is an action that occurs when the user does something such as click on a button or moves the pointer over a graphic image. JavaScript enables you to write scripts that are triggered by events. Did you ever wonder how buttons dynamically change colors on some Web sites when you move the mouse over them? It's simply a JavaScript technique known as a rollover. The event is the mouse moving over the button (object). This triggers the execution of an event handler, which is a collection of JavaScript statements that replaces the button with another one that uses a different color.

JavaScripts and JScripts that run inside Web browsers have access to objects placed on Web pages. On the other hand, JScripts that run within the WSH have access to desktop resources such as toolbars, files, printers, and the Windows registry.

What is JavaScript | JavaScript Programming Language | JavaScript History

JavaScript History

JavaScript is a powerful scripting dialect that, when blended with HTML, permits you to create stimulating and mighty world wide web pages. You can use these world wide web sheets to run a small enterprise or to share data with family and friends over the Internet. JScript is a Microsoft implementation of JavaScript that can be utilized as a scripting language for automating repetitive or convoluted desktop and system jobs.
What you are likely asking yourself is, "Can I actually discover to program utilizing JavaScript and JScript in a single weekend?" The response is "Yes!" I am not promising that you will become a programming guru in just a couple of days, but if you will dedicate a full weekend to this book and pursue along with its demonstrations, you will be adept to write your own JavaScripts and JScripts. In no time you will be adept to make dramatic improvements to your world wide web sheets as well as evolve scripts that automate any number of Windows desktop tasks.
Syntactically, JavaScript and JScript are virtually equal. So by learning how to compose JavaScripts, you are furthermore learning how to work with JScript as well. Where the two languages disagree is in the environments in which they execute. JavaScripts are embedded interior HTML sheets and run by world wide web browsers. JScripts, on the other hand, are written as simple text files that are performed exactly from the Windows desktop by the Windows Script owner or WSH.
JavaScript is a versatile language. It can be utilized to create meal lists, validate forms, supply interactive calendars, mail the current day's headlines, produce background consequences on a world wide web page, track a visitor's annals on your site, and play games, amidst numerous other things. That's likely why it's one of the most popular dialects on the World broad world wide web.
Netscape conceived JavaScript in 1995. initially called "LiveScript," it was conceived to make Web pages more interactive. In the beginning the language was inundated with security problems which, for the most part, have been overcome.

Browser Compatibility with JavaScript

JavaScript and Browser Compatibility

(browsers that support javascript, browser compatibility code in javascript, javascript innerhtml browser compatibility, javascript events browser compatibility)

Browser compatibility has always been a major topic for JavaScript programmers. The two most popular Internet browsers since the mid-1990s have been Microsoft's Internet Explorer and Netscape's Communicator. Microsoft and Netscape conventionally have had distinct attitudes as to how browsers should work. As a outcome, Netscape Communicator versions 2, 3, and 4 presented differently in many positions than Internet Explorer versions 3, 4, and 5. HTML sheets and JavaScript’s often behaved distinctly when inquired to do the same thing on either browser.

Now a days there are many world wide web browsers available. And nearly all of them support JavaScript. But the user can disable or enable JavaScript for their convenience.

The foremost difference was in the earlier versions of the Netscape and Internet Explorer, their object forms. The browsers accumulate their functionalities and contents in the pattern of things. JavaScript interacts with browsers by interacting with these things. This difficulty was in these two browsers because they both had distinct object model, so as a outcome some things were found in Netscape and not in Internet Explorer and vice versa. However, with the arrival of the ECMA Script measures, things have become a alallotmentment more reliable in newest years. With the newest versions of both browsers, small dissimilarities in implementation still exist. The good practice to use JavaScript is to use distinct browsers to check the compatibility of the browser.

Another browser issue that JavaScript programmers still have to be worried with is what type of JavaScript the diverse browsers support. JavaScript support started with the Netscape 2 browser, but that browser supports only the primary version of JavaScript. Microsoft began to provide JavaScript support only in Internet Explorer 3. The difficulty is that there are still a lot of people out there running older versions of both browsers, and endeavoring to accommodate them all is very tough.
Not all browsers are conceived equal. In detail, things are made more tough because Microsoft and Netscape are not the only businesses that make browsers. Other browsers supply varying degrees of JavaScript support.


It is not any large-scale topic now a days because the browsers are made very effective and supportive to JavaScript.