What is the difference between JavaScript and Jscript?
Jscript supports more rich set of functionality/commands than the java script, through which ActiveX and local computer can be accessed. These commands are used in an intranet where the connecting computer’s configuration is known and they are all being accessed using Internet Explorer. While java script targets unknown machine configuration and Jscript cannot for which java script are suitable for internet which Jscripts are not.
What is java script and what are their functionalities?
JavaScript is a client side scripting language that is mainly used to perform client side processing to prevent server round trips and to make the user response time faster. It is widely used for validation purpose such as confirm password validation and etc. It is generally embedded within the HTML which on client side is interpreted by the browser and the scripts are copy able.
What is the main difference between Client side JavaScript and Server side Java Script? How actually they run on both side?
To state the main difference, JavaScript at the client side does not require a web server to make it run instead it uses the client’s processor for this purpose. This eradicates the portability issue. But in server side JavaScript deployment, portability, configuration are major and vast issues and requires a web server to run the script within a page before rendering its output as a response html page.
What are the methods of validating whether the form is secure?
Security of a form can be ensured by several ways some of them are:-
1.Action Attribute of the form- The form action attribute must start with https:// for ensuring the secure site.
2.Checking the Java Routine- In the Java routine the formname.action=”specified URL” which should also begin with https:// for ensuring the secure site.
3.Checking the URL of the form itself whether it begins with https://
Any one of the condition should be obeyed by the web form else the form is not secured.
How can JavaScript make a Web site easier to use?
Javascripts run on the client side which saves the server roundtrip time for small processing. It means that it makes web pages more interactive as everything is not required to be submitted at the server. Let’s consider a small clock if controlled by the server then the transmission time will make the clock faulty in this case javascript is used.
What does sticky session mean in a web-farm scenario?
Sticky session is a characteristic which provides load balancing solution for web farms for re-routing the request of the session to the machine which first answered the request for that session. This ensures the session persistency in case when the session is routed to other servers. Sticky session causes uneven load distribution across servers.
How do we get JavaScript onto a web page?
The script element can directly be added inside the body of the page. It should start with the tag tag. The script can also be added to the head tag of the web page. Similarly the other way is by placing the script in a separate file which gets downloaded on the client’s machine when the page is requested.
How to change style on an element?
Cascaded Style Sheet CSS and java script has an uncanny relationship. On top of DOM CSS style rules are listed. Properties of the CSS say like font-weight are translated as myElement.style.fontWeight. The elements belonging to their class can be swapped out. For example:-
document.getElementById("Text").style.color = "red";
document.getElementById("Text").style.fontSize = "15";
Discuss how can we access Elements using java script?
Each elements of JavaScript can be accessed by their names. To access the page, document element is used and to access the browser the window element is used in the script. This element’s values are required for several computing reason say validation check. For example:
var myID = windows.document.formLogin.userID.value;
What is the difference between undefined value and null value?
Undefined value having no keyword and not defined is known as undefined value. While declaring a variable it does not contain any value hence it is called as undefined value. Null value has to be specifically declared as null indicating that the variable doesn’t point at any particular location in memory. For example String str = null; declares variable str which references null.
What is decodeURI(), encodeURI() in JavaScript?
In order to transform the URL into its hexadecimal equivalent the encodeURI() and decodeURI() are used. This is done to send the characters that by default cannot be specified in a URL.
For example, the following code snippet performs the encoding of URL:
var uri = http://agnlosticajams.weber.com; // original URI
var encodeuri=encodeURI(uri);
document.write("necodeuri”);
var decodeuri = decodeURI(ncodeuri);
document.write(“/>decodeuri”);
What are windows object and navigator object in JavaScript?
The top level object in java script is the windows object. It further has several other objects such as document, location, history, menu bar, name, etc. contained within itself. The global object on which client side java scripts are written is the windows object. Information regarding the client system is returned by the Navigator browser of the script. For all users Navigator browsers are the base object.
How to read and write a file using java script?
This can be done in two ways which are discussed below,
1.Using an ActiveX objects (Internet Explorer only)
Using ActiveX objects, following should be included in the code to read a file
var fso = new ActiveXObject(“Scripting.FileSystemObject”);
var s = fso.OpenTextFile(“C:\\example.txt”, 1, true);
2. By the use of JavaScript extensions which runs from the Java Script editor.
In JavaScript Extensions,
fh = fopen(getScriptPath(), 0); to open a file
Discuss the relationship between JavaScript and ECMAScript?
Javascript is a scripting language that has been widely accepted for client side web development. However it originated from ECMA standards. ECMA and livescripts are just other names of java script.
Read More
Recent Comments