JavaScript Placement
JavaScript and Cascading Style Sheets are two similar when they are added to a Website. Although, javascript is a light scripting language and CSS is a styling script, both can be added at the header section of the HTML file that you are working. Javascript codes can be added in an HTML document in four ways. First, javascript can be added in the head section using the script tag. Second, scripts can also be added inside the body section using the same script tags, or they can be placed in both head or body tags where the one placed in the body tag are prioritized. The last option is to have your JavaScript as an external file to be called at the header. For CSS on the other hand, there are three ways to apply CSS styling.
These are through inline styling, internal styling or external styling. External styling and internal styling are applied through the header section. One can use all of the CSS styling methods because they will all cascade into one.
JavaScripts and Cascading Style Sheets can be both used in the website. However, if the two are used to define the behavior of a specific object, the CSS takes precedence over the JavaScript. It is also advised that as much as possible, styling should be done with CSS and if some logic is needed then that’s the only time JavaScript will be used.
Sometimes even if one doesn’t find any error on the script, it still doesn’t work the way it should when tested in a website. There are a number of possible reasons why this happens. First, is that the active scripting may be turned off for that browser mostly for security purposes. This is because client-side scripts are downloaded onto the client’s browser and executed there. Sometimes, the scripts require the utilization of pop-ups that may be a turn-off. Other possible reasons are conflicts with the CSS codes or incompatibility with the browser being used.
Javascript Considerations
Web designers must always take CSS as the first choice when designing websites. Only when specific design mechanisms required by the website are not within the capacity of CSS should it explore or consider the use of JavaScript. It should be kept in mind that CSS is for the look and feel of a website while JavaScript is focused on the provision of interaction, but some of its features overlapped. However, experienced web designers have noted that although there are number of options that can be implemented in javascript in terms of animations compared to CSS the trade-off comes on its performance especially the speed.
If a travel agency wants to automated its operations and do it online, I would possibly bend on using server-side scripting for the application like PhP because of the requirement for a back-end database since the application concerns with content management and customer relation management. Server-side scripting will be best since this can provide an additional way of interaction with the clients while being able to record the interactions that happened. Client-side scripting on the other hand, can be used in validation of forms to be able to filter information or to ensure that correct formats are entered before passing then to the server.
References:
Web Standards (2013). Retrieved from http://ut-ite.wikispaces.com/file/view/Opera+Web+Standards+Curriculum.pdf