Anda di halaman 1dari 5

JavaScript Difference FAQs-1 1.Difference between PHP and JavaScript S.

No 1 PHP JavaScript

PHP runs on server and the JavaScript can handle only local major functionality of PHP is to tasks that are specific. produce the HTML code which will be read by browser. In PHP, code will be available In JavaScript the code can be only after the server interprets viewed even after the output is it. interpreted. PHP is embedded only with JavaScript can be combined with HTML and PHP cannot be HTML, XML and AJAX. combined with XML. PHP is used to produce web pages on the go, read and deploy databases, import the files available on the server, and gain files of data from further domains. JavaScript can import files of information available by mentioning the URL of the file in the address bar of the browser.

5 6

PHP does not execute within a JavaScript executes browsers window. browsers window.

within

PHP commonly uses MYSQL MYSQL is not commonly used by as a database. JavaScript.

2.Difference between JScript and JavaScript S.No 1 JScript JScript is Microsoft. released JavaScript by JavaScript is released by Netscape in partnership with Sun Microsystems is a newly formed

JScript is reverse engineered JavaScript from Javascript by Microsoft in language. order to have its own ECMAScript language.

Microsofts JScript is a JavaScript is a language language openly implemented independent of the Java language on the lines of Netscapes of Sun Microsystems. JavaScript. JScript is used for creating JavaScript is used for developing active and also online content client applications and server for WWW. applications.

All versions of JScript have Very few versions of JavaScript access to ActiveX objects. have access to ActiveX objects.

3.Difference between Java and JavaScript S.No 1 Java JavaScript

Java is termed as an Object JavaScript is a Scripting Language. Oriented Programming language. Java was originally created by Netscape,Inc. has developed the James Gosling belonging to JavaScript programming language. Sun Microsystems. Standalone applications and Standalone applications or applets applets are created by Java are not created by JavaScript. programming language. Java is known for the creation JavaScript code always needs a of applications that can run on browser for its execution. a browser but it does not always require a browser for program execution. Java code can survive on its JavaScript should be placed own as a stand alone Java through a HTML document for its Program. functioning. Java code should always be JavaScript code is always in text compiled. and it does not need compilation process.

Reference: http://onlydifferencefaqs.blogspot.in/2012/08/javascript-difference-faqs-1.html Difference between == and === in JavaScript Difference between == and === in JavaScript S.No 1 2 3 == == denotes equal to 0= =false // true === === denotes exactly equal including both value and type to

0= = =false // false, because they are of a different type

1= ="1" // true, auto type 1= = ="1" // false, because they are coercion of a different type

Summary:

JavaScript has both strict and type-converting equality comparison. For strict equality the objects being compared must have the same type and also the below characteristics: Two strings are strictly equal when they have the same sequence of characters, same length, and same characters in corresponding positions. Two numbers are strictly equal when they are numerically equal (have the same number value). NaN is not equal to anything, including NaN. Positive and negative zeros are equal to one another. Two Boolean operands are strictly equal if both are true or both are false. Two objects are strictly equal if they refer to the same Object. Null and Undefined types are == (but not ===). Reference: http://onlydifferencefaqs.blogspot.in/2012/08/difference-between-and-injavascript.html Difference between "setTimeout" function and setInterval functions in Javascript Difference between "setTimeout" function and setInterval functions in Javascript S.No 1 SetTimeout function setTimeout is only execute the function after the defined time in milleseconds, its execute only one time. SetInterval function setInterval, will call the function in each time interval.

Reference: http://onlydifferencefaqs.blogspot.in/2012/08/difference-between-settimeoutfunction.html Difference between undefined value and null value Difference between undefined value and null value S.No 1 undefined value Undefined value cannot be explicitly stated i.e., there is no keyword called undefined Typeof undefined variable or property returns undefined null value null value has keyword called null.

Type of null value returns object.

Reference: http://onlydifferencefaqs.blogspot.in/2012/08/difference-between-undefinedvalue-and.html

Difference between onSubmit and onClick events in JavaScript Difference between onSubmit and onClick events in JavaScript S.No 1 2 onSubmit() Event Category: onSubmit() is a form event. When it occurs: This event occurs when we try to submit a form. When to use: We can put our form validation against this event type. onClick() Event Category: onClick() is a mouse event. When it occurs: This event occurs when a user clicks mouse left button. When to use: We can put our validation, warning etc against this event type.

Reference: http://onlydifferencefaqs.blogspot.in/2012/08/difference-between-onsubmitand-onclick.html VBScript vs JavaScript Difference between VBScript and JavaScript S.No 1 VBScript Definition: VBScript is an Active Scripting language,which uses the Component Object Model to access elements of the environment within which it is running. Who developed ? VBScript is developed Microsoft. JavaScript Definition: JavaScript is an object-oriented scripting language used to enable programmatic access to objects within both the client application and other applications.

Who developed ? by JavaScript is developed Netscape.

by

Client-side / Server-side Client-side / Server-side scripting language: scripting language: It is both Client and server side It is client side scripting language. scripting language. Case sensitive or not: It is not case sensitive. Runs on which browser ? VBScript runs only on IE Case sensitive or not: It is case sensitive. Runs on which browser ? Javascript runs on any browser

4 5 6

Default scripting language or Default scripting language or

not: not: It is the not the deault scripting It is the default scripting language language.It must be specified for most web browsers. as the scripting language. 7 How to denote functions in VBScript ? It uses Function and End Function to denote functions. Same / Different Character used for different actions: It uses different characters for different actions.example: & for concatenation and + for addition. How to denote functions in JavaScript ? It uses curly braces to denote functions. Same / Different Character used for different actions: It uses the same character (+) for both addition and concatenation.

File Extension: File Extension: File extension for VBScript is File extension for JavaScript is .js. .vbs or .vba.

Reference: http://onlydifferencefaqs.blogspot.in/2012/09/difference-between-vbscriptand.html

Anda mungkin juga menyukai