Skip to main content

Javascript vs CGI

Differences

CGI and Javascript are both functional with both Netscape and Internet Explorer browsers. But there is an essential difference between the two. Javascript functions as a code executed and downloaded in the clients’ side while CGI operates with the server. Before probing deeper into the difference of the two, let us first try to understand these two often-used scripts. Javascript requires no special plug-ins, and it works transparently within an HTML page. It animates web page graphics, allows users to change page elements (background color, display preferences), and allows site navigation. Usually, javascript is made up of two parts: the javascript functions (the instructions for what the javascript does on the page) and elements that cause the javascript functions to execute. These two go in different ways. The javascript functions are placed between special javascript tags within the head tags in the HTML source. Javascript follows specific punctuation conventions. Usually, javascript functions are the last element within the head tag. The elements that cause the javascript to execute are placed within the body tags of the HTML source, depending on where the web page designer wants the javascript to run.
Because javascript is included in the other HTML tags in the page source, a web page with javascript elements will be saved in exactly the same format as a web page: the file type should be an ASCII text, and the file name should have the suffix .html appended to the end of it. The script’s difference from CGI will not be clear unless we discuss both CGI and javascript.

Similarities

CGI is the short version of Common Gateway Interface. It is commonly used in web pages because it allows interactivity by letting the web server respond to user input through a web page with CGI elements. A common example of CGI function is a web guest book. A web designer usually includes a web guest book in the web page so users and visitors can put in their suggestions. These suggestions are collected by the CGI and e-mailed to the designer. CGI and javascript also have similarities. Like in a javascript, files used in CGI must be ASCII text with the suffix .html appended to the end of it. However, if a CGI script will be stored in the CGI bin, it is most likely that the file must be saved as a Perl document. Unlike javascript, where the functions must reside within the head tags, form elements can be placed wherever the web page designer wants to put them. The only consideration is that to call the CGI script, HTML tags should come before the form elements of the page.

Conclusion

Though both scripts have different functions, both CGI and javascripts have undoubtedly improve the way the internet works. They have also infiltrated the world of movies and televisions with digital films and fantastic characters. Who knows, maybe more uses of both scripts will be identified in the future.

Comments

Popular posts from this blog

How to Create Chat Bubbles in CSS

At first, you need to write the appropriate HTML markup. Refer to the examples below: INPUT HTML <div class="talk-bubble"> <div class="talktext"> <p>CSS Talk Bubble configured by classes. Defaults to square shape, no triangle. Height is auto-adjusting to the height of the text.</p> </div> </div> <div class="talk-bubble tri-right left-top"> <div class="talktext"> <p>This one adds a right triangle on the left, flush at the top by using .tri-right and .left-top to specify the location.</p> </div> </div> <div class="talk-bubble tri-right left-in"> <div class="talktext"> <p>This talk-bubble uses .left-in class to show a triangle on the left slightly indented. Still a blocky square.</p> </div> </div> <div class="talk-bubble tri-right round btm-left"> <div class="talktext"> <p>And now...

What You Need to Know About CSS !

Style sheet is a progressive breakthrough for the advancement of web. Today, more and more browsers are implementing style sheets, opening authors’ eyes to unique features that allow influence over presentation while preserving platform independence. The advantages of style sheets have become apparent — and the disadvantage of continually creating more HTML tags — galore — for presentation effects with the gradual development of CSS. Let’s understand CSS in the right perspective. Style sheets in retrospect As the HTML language grew, however, it came to encompass a wider variety of stylistic capabilities to meet the demands of web developers. Style sheets have been around in one form or another since the beginnings of HTML in the early 1990s . As the HTML language grew, however, it came to encompass a wider variety of stylistic capabilities to meet the demands of web developers. With such capabilities, style sheets became less important, and an external language for the purposes of ...

How to Create a Circle in CSS

At first, you need to write the appropriate HTML markup. Refer to the examples below: INPUT HTML <div id="content"> <h1>CSS circles using border radius</h1> <div class="circle blue">Blue</div> <div class="circle green">Green</div> <div class="circle red">Red</div> <p class="feedback">Feedback welcome<a href="#">@htmlwhiz</a></p> </div> Now, you need to write the CSS script to assign properties. Refer to the examples below: CSS body { font-family: "open sans", sans-serif; background: #f1f1f1; } #content { margin: 40px auto; text-align: center; width: 600px; } #content h1 { text-transform: uppercase; font-weight: 700; margin: 0 0 40px 0; font-size: 25px; line-height: 30px; } .circle { width: 200px; height: 200px; line-height: 200px; border-radius: 50%; -moz-border-radius: 50%; -webkit-border-radius: 50%; text-align: center; ...