Ticker

6/recent/ticker-posts

Computer Program

 


Computer Program ?

A java script code is added on a web page then you have to create a source code of scripting there are many scripting in the market such as java script & vb script Be that as it may, despite the fact that JavaScript programs (likewise called contents) are less difficult and shorter, they share a considerable lot of similar properties of more confused projects. More or less, any PC program is a progression of steps that are finished in an assigned request. Let's assume you need to show an invite message utilizing the page guest's name: "Welcome, Bob!" There are a few things you'd have to do to achieve this undertaking:

 

 1. Ask the guest's name.

 2. Get the guest's reaction.

 3. Print (that is, show) the message on the website page.

 

While you may never need to print an invite message on a website page, this model shows the essential cycle of programming: Determine what you need to do, at that point separate that task into singular advances. Each time you need to make a JavaScript program, you should experience the way toward deciding the means expected to accomplish your objective. When you know the means, you'll make an interpretation of your thoughts into programming code—the words and characters that cause the internet browser to act how you need it to.

 

Java Script add to a Page: The aspect of the internet browser that gets HTML and CSS is known as the design or delivering motor. However, most programs likewise have something many refer to as a JavaScript translator. It acts like a switch that basically says "Hello, internet browser, here comes some JavaScript code; you don't have the foggiest idea how to manage it, so hand it off to the JavaScript mediator." When the internet browser experiences the end </script> tag, it realizes it's arrived at the finish of the JavaScript program and can return to its typical obligations. A significant part of the time, you'll include the <script> tag in the site page's <head> area, similar to this:

<html>

<head>

<tittle>My Script</tittle>

 <script type="text/javascrtpt"> </script>

 </head>

 The <script> tag attribute to indicate that what actual format and what actual type of script that you follows. In this case, type =”text/JavaScript” means the script is regular text (just like HTML) and that it's written in JavaScript. if you're using HTMLS, life is even simpler. You can skip the type attribute entirely:

<! doctype html>

 <html>

 <head>

 <meta charset=”UTF-8”.>

 <title>My Web Page</title>

<script>

 </script>

 </head>

 In fact, web browsers let you leave out the type attribute in HTML 4.01 and XHTML 1.0 files as well—the script will run the same; however, your page won't  validate correctly without the type attribute (see the box on Validating Web Pages for more on validation). This book uses HTMLS for the doctype, but the JavaScript code will be the same and work the same for HTML 4.01, and XHTML. In JavaScript the script code written in  <script> tags:

<!doctype html>

 <html>

 <head>

<meta charset="utf-8">

 <title>My Script</title>

<script>

alert('hello script!');

 </script>

 </head>

In above scripting a message print on the screen using alert and the alert method() Display alert box on the screen a given a message “hello script!”. However, it's perfectly valid to put <script> tags anywhere inside the page's HTML In fact, as you'll see later in this chapter, there's a JavaScript command that lets you write information directly into a web page.

External JavaScript: if any script under the header is not to create any problem if that script is short, but if your script under more than hundred of lines, then it can make it into your HTML code. Many other problems occur if you may run into the use of its benefits on multiple pages, then problem occur, because its function used in many other pages so, you need to update every page that uses the code. The solution is that both for( HTML & script file ). The HTML file into used external JavaScript file that are you can used in different HTML file One external script file is used into many different HTML file

<doctype html>

<html>

 <head> <meta char set=”utf-8">

<title>My Script</tittle>

 <script src="navigation.js">

</script>

 </head>

 The<img> tags, used for a src attribute in the scripting using<script> tags and also used another attribute in <img> name a href attribute.

<a href="https://www.test.com">
<img border="0" alt="Education" src="logo.gif" width="100" height="100">
</a>


For more understanding you can also read below mentioned topic from online:

how javascript is different from java


Post a Comment

0 Comments