.

Monday, April 1, 2019

Scripting Types and Uses

Scripting Types and UsesA different type of hired handing and their expenditures areMaintaining cookies Website uses cookies to let the drug user to use the website easily for cause cookies entrust give your preference when visit that website and gives you recommendations when buying things for exemplar when buying things from the net profit it give give you preferences to allow shopping much easier.Checking and validating input. The use of checking and validating input is when for ensample for searches or to check a certain box has been filed in right on with the right information.Browser detention Browser detection is when a user types a website in the search bar and it shows recommendation of what you might be searching and it will show different types of searches to save you clipping and effort. well-nigh old browser does not brave JavaScript and washstand cause problems when inserting enrol as the browser will not recognise and understand JavaScript. And it w ill just show a bunch of mandate into the webpage when loading it.To distract this note playscript allows hyper textual matter mark-up language to ignore the gloss that the user has inputted so that it will not show on the web page.JavaScript is an target area oriented and event driven.Nature of languages Procedural- line by line and it bring through breeding and the computer just have to read it. government issue driven Event driven is when a button is be kill by clicking that button. For exampleObject oriented language mean that the commandments are broken downheartedcast into objects or pieces and apiece objects has its own properties. Inserting scriptYou outhouse add script element to any hypertext mark-up language document by adding extra enter into the page. You goat add the JavaScript on the head section, body section as long as you have an opening script and a stop script or else it would not work when opening it in a web browser as it would just show you bunch of codes. And in like manner you would need to have a script type to be to assure the web page that it is a script.Object -Most things in JavaScript is an object e.g Boolean, numbers. An object is a type of data which has its properties own and knows how to trigger it orders.Examplevar person = firstNameJohn, lastNameDoe, age50, eyeColorblueExample from http//www.w3schools.com/js/js_object_definition.aspMethod A method is a collection of statement that are grouped, methods are actions that can be performed on objects. The document write path is to output a core on the screen and it could be value or text.Write() This will write something directly into a html page e.g. Click() this can be a radio button that user can select and click, e.g. Male or female.open() this is to open up new browsers or a new tab. This can be used if the user will need to have to go on a external website e.g. windows.open(www.google.co.uk)Properties properties are building block of objects. in that location are many types of properties in JavaScript. Here is an example of a position using JavaScript.Example from surf attitude website.Handling eventsEvents are things that happen to a HTML element. JavaScript can react to many events. Events are things that can happen in a browser. If an event is detected, then multiple thigs can happen in the browser e.g. a function might be triggered e.g. pressing a button. These are some of the main eventOnclick this will activate when a HTML element has been click by a user.On fawnover this is triggered when the user hovers their mouse on a HTML element.Onload this is triggered when the page has finished loading.Onkeydown this is triggered when the user presses the down arrow on the keyboard.A function is a piece of script that be called when the script is run.For exampleA function in JavaScript us defined with a function keyword, with a name, and parentheses (). Functions names can maintain letters, numbers, and different ty pes of symbols. The code can be executed if the code is within a curly bracket .function name(parameter1, parameter2, parameter3) code to be executedExample is taken from http//www.w3schools.com/js/js_functions.aspWe use functions because we can reuse the code (define the code once and use it again as many generation as the user wants).You can use the aforementioned(prenominal) code many times with a different argument.Hiding scripts Scripting language are not support in older browsers or updated browsers. Updated and newer browsers will know whats deviation in between the script, while older browser will not know. You can also comment to hide the script.Note scriptHTML CSS /* comment */JavaScript //You can also disable the script in the browsers settings.What we mean or so the interaction and the use of thickening side scripting for web pages is that the client side uses a browser to connect to a static web pages that uses HTML and CSS that allows them to interact to the w ebsite. And that scripting allows the website to have interactivity to a user and make it dynamic. For example, when a client requested information from the website e.g. looking for a holiday.Variable is a container that holds a value or it can be a whole text and data. It can be change anytimevar namefield=detailsform.fullname.valuevaluevariableevent.returnValue-falsethis means that the event which is submitted cannot be executed if box or container has no value. trade protection issues One of the most common security problems of JavaScript is Cross-Site Scripting also known as XSS. Cross-Site Scripting enables the attackers to change the website to return a malicious script to user going on that website. As JavaScript is an object oriented scripting language, hackers can use irradiations such as XSS to write their code and harm the users machine and their information stored in the machine. The difficult thing about JavaScript malicious code is that it is hard to detect security breaches that are happening because its usually happening inside the website or inside the users machine without any warnings.https//www.veracode.com/security/javascript-securityThe HTML element rag we use to implement script is with an opening script and a oddment script .If the user wants to run the same script in a different html page, then it should be best to put the JavaScript in one folder so that the user doesnt have to rewrite in all over again. You have to save the script file with a.js lengthiness and you have to refer to it using the src attribute in the script tag.For exampleLoopsExample of loops example taken from Moodle.Loops is beneficial when you want to run the same code over and over again with different values.The For loop is the tool when you want to create a loopfor (statement 1 statement 2 statement 3)code block to be executedStatement 1 this is executed before loop even start (code block)Statement 2 defines the conditions for running the roomStatement 3 is executed each time the loop has been executed.http//www.w3schools.com/js/js_loop_for.aspA IF statement is a control statement that will allow the JavaScript to make decisionsFor exampleWe use the if conditions if the specified condition is true.We use the else conditions if the same specified condition is false.The dot operator is used to as a separation technique which separate the objects from their methods and properties.Functions are pieces of code that can be written separately or within the tags and can be called or executed whenever programed to. Functions are never executed unless they are called. downstairs is an example of a function existence declared within the tags and being called.Script 1Internet adventurerClicking the part on internet explorer will enlarge the consider.Google ChromeIn google chrome, if you click the substitution class the image will download to your computer.Mozilla FirefoxIn Mozilla Firefox, if you click the image the image will download to your computer.OperaIn opera , if you click the image the image will download to your computer.Script 2Internet Explorer__________________________________________________________________________________Google Chrome__________________________________________________________________________________Mozilla Firefox_________________________________________________________________________________OperaThe browsers are output are different to each other because each of the way each browser renders web content. The code also runs differently depending on the browser you are using, this is because the string that it is being returned will vary between browsers.

No comments:

Post a Comment