How is DOM used in JavaScript?
DOM stands for document Object Model that is used to get, change, add or delete HTML elements.
How do you put java script into HTML?
Javascript inside html
<html>
<head>
<script type="text/javascript" language="javascript">
// Java script code here
</script>
<body>
// html code here
</body>
</html>
Via External Link:
<html>
<head>
<script type="text/javascript" language="javascript" src="location of js file">
</script>
<body>
// html code here
</body>
</html>
How can you insert javascript into an HTML document?
Here are two examples of internal and external calling of javascript
// Your javascript code ehre
Difference between alert number javascript?
alert() function display the message to the user with OK button. Pressing 'OK' button will close the pop up message box.
Example: Please enter your name.
confirm() function will display the message to user with OK and CANCEL button .Pressing OK return 'true' to js script where as pressing CANCEL button return 'false' to js script.
confirm() function is mostly used to collect the user's input also.
Example: Are you willing proceed?
Difference between vbscript and java script?
Visual Basic script and JavaScript are both programming languages. JavaScript is used primarily to create websites, and has no user interface. Visual Basic is used to create software applications, has a user interface, and is less heavy on the code than JavaScript.
Java script is best than other language?
Javascript is useful for coding dynamic webpages. It allows you to make and interpret cookies, make simple animation, make pull down menus, and more. Javascript is used to add more power to HTML, which makes it very useful for webmasters to learn.
How do you count the vowels in a string?
#include #include void main() { char string[50]; int vowel=0,consonant=0; cout<<"Enter the string"; cin.getline(string,50); for(int i=0;string[i]!='\0';i++) { switch (string[i]) { case 'a': case 'A': case 'e': case 'E': case 'i': case 'I': case 'o': case 'O': case 'u': case 'U':vowel++; continue; } if (string[i]!=' ') consonant++; } cout<<"No of vowels="<<<"\nNo of consonants="<
in 1991 games gosling was invented the java
but officially released in 1995 by sun micro systems
What is the difference between server-side and client-side image maps?
server-side and client-side. In the server-side method, when you click an image leading to multiple links, you are actually invoking a cgi-bin program. The program typically reads a separate map file that tells the program where to go, depending on what part of the image you are clicking. The program returns the destination to the web browser, which then opens the page. The imagemap is called "server-side" because the web browser must contact the remote host to find which site to contact.
Client-side imagemaps, by contrast, do not require a cgi-bin program to function. The imagemap is actually an HTML construct that can be contained on the same page as the clickable image. Rather than requiring the program on the remote host to determine what site to access, the web browser itself associates regions of the image with the appropriate sites. The browser, rather than the remote host, interprets the imagemap.
Explain briefly about Cascading Style Sheet?
}
Block 2
p {
color: #00FF00; /* Set to Green*/
}
And in the case that another Block sets the P tag to have a background color of Blue:
Block 3
p {
bacground-color: #0000FF; /* Set to Blue */
}
Then the final Cascade will result in the P tag being:
Final Cascade
p {
bacground-color: #0000FF; /* Set to Blue */
color: #00FF00; /* Set to Green*/
font-family: Arial;
}
The import statement in Java allows to refer to classes which are declared in other packages to be accessed without referring to the full package name. You do not need any import statement if you are willing to always refer to java.util.List by its full name, and so on for all other classes. But if you want to refer to it as List, you need to import it, so that the compiler knows which List you are referring to.
Classes from the java.lang package are automatically imported, so you do not need to explicitly do this, to refer to String, for example.
How do you install java script on Android phone?
JavaScript comes pre-installed with the browser that Android runs by default. It cannot be "installed" and "uninstalled" on its own.
You may be trying to install Java, the programming language and VMs.
Is C is better than JavaScript?
You can't compare them it's like apples and oranges. Javascipt is mainly geared for client-side execution in a web browser. c is an old language and is sort of the parent of all modern programming languages including javascript, but it would be used in a totally different scenario, eg. you could use it for application development on a server or desktop, rather than in an online scenario.
What is the difference between Web UI and Java?
Java Virtual Machine (JVM) is exactly as it's titled, it's just a virtual machine... while Windows is an operating system.
But since the JVM is used to run Java code, it is multi-platform.
Synchronizaion is the process by which only one Thread can access an object at a time,until and unless thread releases it's lock no other thread can acess the object. there are two forms of syncronization method and statement.
to make a method synchronized just add the keyword synchronized to the signature ie: public synchronized void increment() {
c++;
}
to create syncrhonized statements are like this:
synchronized(this) {
lastName = name;
nameCount++;
}
note: constructors can not be syncronized
How do you create slide show using javascript code?
Here is the code:
<html>
<head>
<script type="text/javascript" language="javascript">
function loadImage()
{
var image1 = new Image();
var image2 = new Image();
var image3 = new Image();
image1.src = "mypic.jpg"; // Put any image you
image2.src = "mypic2.jpg";
image3.src = "mypic3.png";
if(!document.images)
{
alert("No Images!!");
}
document.images.slide.src=eval("image"+step+".src");
if (step<3)
step++;
else
step=1;
//call function "slideit()" every 4 seconds
setTimeout("loadImage()",4000);
}
loadImage();
</script>
</head>
<body onload="loadImage()">
<img src="mypic.jpg" class="image" name="slide" />
</body>
</html>
Which HTML element do you put the JavaScript?
In order to put JavaScript in a HTML document place the code in script tags. These tags can be included in the HEAD section of the HTML document, or in the BODY.
Often, scripts are placed at the very bottom of the page to enhance search engine optimization (SEO).
window.alert("This is a sample document!")
sample text sample text
sample text sample text