Html+javascript Interview Questions And Answers
Question: 1. What Is Javascript?
Answer:
JavaScript is a preferred-purpose programming language designed to allow programmers of all skill ranges manipulate the behavior of software program gadgets. The language is used most extensively these days in Web browsers whose software items generally tend to symbolize a spread of HTML elements in a record and the record itself. But the language may be–and is–used with different styles of gadgets in different environments. For example, Adobe Acrobat Forms makes use of JavaScript as its underlying scripting language to connect together items which are specific to the forms generated by way of Adobe Acrobat. Therefore, it’s miles vital to differentiate JavaScript, the language, from the objects it may communicate with in any unique surroundings. When used for Web documents, the scripts cross at once inside the HTML files and are downloaded to the browser with the rest of the HTML tags and content.
JavaScript is a platform-unbiased,event-driven, interpreted purchaser-side scripting and programming language developed with the aid of Netscape Communications Corp. And Sun Microsystems.
Question: 2. How Is Javascript Different From Java?
Answer:
JavaScript changed into advanced through Brendan Eich of Netscape; Java changed into evolved at Sun Microsystems. While the 2 languages proportion a few common syntax, they had been advanced independently of every other and for distinct audiences. Java is a complete-fledged programming language tailored for network computing; it includes hundreds of its own gadgets, along with objects for developing consumer interfaces that seem in Java applets (in Web browsers) or standalone Java applications. In assessment, JavaScript is predicated on some thing environment it is working in for the consumer interface, consisting of a Web file’s shape factors.
JavaScript changed into initially known as LiveScript at Netscape at the same time as it become underneath improvement. A licensing deal among Netscape and Sun on the remaining minute permit Netscape plug the “Java” call into the name of its scripting language. Programmers use entirely distinctive tools for Java and JavaScript. It is likewise no longer uncommon for a programmer of one language to be unaware of the opposite. The two languages do not rely on every different and are meant for exclusive purposes. In a few methods, the “Java” name on JavaScript has pressured the world’s knowledge of the differences between the two. On the alternative hand, JavaScript is a whole lot easier to examine than Java and may offer a mild creation for learners who want to graduate to Java and the varieties of packages you can develop with it.
XML Interview Questions
Question: three. What’s Relationship Between Javascript And Ecmascript?
Answer:
ECMAScript is yet some other name for JavaScript (different names consist of LiveScript). The modern-day JavaScript that you see supported in browsers is ECMAScript revision 3.
Question: 4. How Do You Submit A Form Using Javascript?
Answer:
Use report.Forms[0].Post();
(0 refers to the index of the shape – if you have multiple shape in a page, then the primary one has the index 0, 2nd has index 1 and so on).
XML Tutorial
Question: 5. Is There A Site That Shows Which Tags Work On Which Browsers?
Answer:
There had been numerous attempts to do that, but I’m not aware about any virtually correct source of comparisons among the browsers. The trouble is that there are numerous specific versions of every browser, and many extraordinary tags. All modern browsers have to guide the tags in the reliable HTML three.2 specification, but the main ones also assist nonstandard tags and sometimes have slightly one-of-a-kind implementations. One vicinity that has pretty precise compatibility info is Browsercaps.
HTML four Interview Questions
Question: 6. Why Does The Browser Show My Plain Html Source?
Answer:
If Microsoft Internet Explorer displays your report normally, but different browsers show your simple HTML supply, then most probably your net server is sending the record with the MIME type “text/plain”. Your web server needs to be configured to send that filename with the MIME type “textual content/html”. Often, using the filename extension “.Html” or “.Htm” is all this is important. If you’re seeing this conduct even as viewing your HTML documents on your neighborhood Windows filesystem, then your textual content editor might also have added a “.Txt” filename extension robotically. You have to rename filename.Html.Txt to filename.Html so that Windows will deal with the file as an HTML record.
Question: 7. How Can I Display An Image On My Page?
Answer:
Use an IMG detail. The SRC attribute specifies the region of the image. The ALT attribute presents trade text for those no longer loading images. For instance:
HTML 4 Tutorial HTML Interview Questions
Question: eight. Why Do My Links Open New Windows Rather Than Update An Existing Frame?
Answer:
If there is no existing frame with the name you used for the TARGET attribute, then a brand new browser window may be opened, and this window could be assigned the call you used. Furthermore, TARGET=”_blank” will open a brand new, unnamed browser window.
In HTML four, the TARGET characteristic fee is case-insensitive, so that abc and ABC each talk over with the same frame/window, and _top and _TOP each have the identical meaning. However, most browsers deal with the TARGET characteristic price as case-sensitive and do not recognize ABC as being the same as abc, or _TOP as having the special which means of _top.
Also, some browsers consist of a protection feature that forestalls files from being hijacked by way of third-birthday celebration framesets. In these browsers, if a report’s link goals a frame described with the aid of a frameset record that is located on a special server than the record itself, then the link opens in a new window as a substitute.
Question: nine. How Do I Get Out Of A Frameset?
Answer:
If you’re the writer, this is easy. You only should upload the TARGET attribute to the link that takes readers to the intended ‘out of doors’ record. Give it the fee of _top.
In many present day browsers, it isn’t feasible to show a body in the complete browser window, at least not very without difficulty. The reader would want to copy the URL of the desired body after which request that URL manually.
I could advise that authors who need to provide readers this selection upload a link to the report itself in the record, with the TARGET characteristic set to _top so the record displays within the full window if the link is accompanied.
HTML 5 Interview Questions
Question: 10. When I Try To Upload My Site, All My Images Are X’s. How Do I Get Them To Load Correctly?
Answer:
They are some motives that this could show up. The maximum not unusual are:
You’re trying to use a .Bmp or .Tif or different non-supported file format. You can simplest use .Gif and .Jpg at the net. You have to convert files that aren’t .Gif or .Jpg right into a .Gif or .Jpg together with your photograph/photographs program.
You’ve forgotten to upload the picture documents. Double-Check.
You’ve incorrectly related to the pics. When you’re beginning out, try just using the document name within the tag. If you’ve got cat.Jpg, use
img src=”cat.Jpg”>.
Image report names are case-sensitive. If your report is called CaT.JpG, you can’t kind cat.Jpg, you must kind CaT.JpG exactly in the src.
If all the above fail, re-upload the image in BINARY mode. You may have accidentally uploaded the photo in ASCII mode.
HTML Tutorial
Question: 11. How Do I Make A Frame With A Vertical Scrollbar But Without A Horizontal Scrollbar?
Answer:
The simplest way to have a body with a vertical scrollbar but without a horizontal scrollbar is to define the frame with SCROLLING=”car” (the default), and to have content that doesn’t require horizontal scrolling. There is no manner to specify that a frame ought to have one scrollbar however not the other. Using SCROLLING=”yes” will pressure scrollbars in each guidelines (even when they aren’t wanted), and the use of SCROLLING=”no” will inhibit all scrollbars (even when scrolling is vital to get admission to the body’s content). There are no other values for the SCROLLING attribute.
HTML+XHTML Interview Questions
Question: 12. Are There Any Problems With Using Frames?
Answer:
The essential problem with the design of frames is that framesets create states inside the browser that aren’t addressable. Once any of the frames within a frameset changes from its default content material, there is now not a manner to address the contemporary country of the frameset. It is difficult to bookmark – and impossible to link or index – this type of frameset state. It is not possible to reference such a frameset state in other media. When the sub-files of any such frameset country are accessed directly, they seem without the context of the encircling frameset. Basic browser features (e.G., printing, transferring forwards/backwards inside the browser’s history) behave otherwise with framesets. Also, browsers cannot identify which frame need to have focus, which impacts scrolling, looking, and the use of keyboard shortcuts in wellknown.
Furthermore, frames focus on layout instead of on facts structure, and lots of authors of framed web sites neglect to provide beneficial opportunity content material inside the NOFRAMES element. Both of these factors cause accessibility troubles for browsers that fluctuate appreciably from the author’s expectations and for search engines.
XML Interview Questions
Question: thirteen. How Do I Keep People From Stealing My Source Code And/or Images?
Answer:
Because copies of your HTML files and pictures are saved in cache, it is impossible to save you someone from being able to save them onto their tough pressure. If you are involved approximately your pix, you may wish to embed a watermark with your statistics into the image. Consult your photo modifying software’s assist document for greater details.
The colorations on my web page appearance one of a kind while viewed on a Mac and a PC. The Mac and the PC use slightly specific colour palettes. There is a 216 “browser safe” shade palette that both structures guide; the Microsoft colour picker page has a few excellent facts and links to different sources about this. In addition, the 2 platforms use exclusive gamma (brightness) values, so a photo that appears best on the Mac may additionally appearance too dark at the PC. The only way to cope with this problem is to tweak the brightness of your image in order that it looks perfect on each structures.
HTML five Tutorial
Question: 14. How Do You Create Tabs Or Indents In Web Pages?
Answer:
There changed into a tag proposed for HTML three.Zero, but it turned into in no way followed with the aid of any primary browser and the draft specification has now expired. You can simulate a tab or indent in diverse approaches, which includes the usage of a obvious GIF, however none are pretty as satisfactory or broadly supported as an official tag might be.
My web page appears excellent on one browser, however now not on any other. There are slight differences among browsers, which include Netscape Navigator and Microsoft Internet Explorer, in regions along with page margins. The only real solution is to apply preferred HTML tags every time feasible, and consider your pages in multiple browsers to see how they look.
Question: 15. How Do I Make Sure My Framed Documents Are Displayed Inside Their Frame Set?
Answer:
When the sub-files of a frameset state are accessed directly, they seem with out the context of the surrounding frameset.
If the reader’s browser has JavaScript support enabled, the subsequent script will repair the frameset:
A greater standard method is a “restore frames” link:
Restore Frames
Note that in either case, you should have a separate frameset record for every content file. If you link to the default frameset document, then your reader gets the default content material report, instead of the content material file he/she changed into looking to access. These frameset files must be generated automatically, to keep away from the tedium and inaccuracy of creating them by means of hand.
Note that you can work across the trouble with bookmarking frameset states by using linking to these separate frameset files using TARGET=”_top”, in preference to linking to the man or woman content material files.
HTML DOM Interview Questions
Question: 16. How Do I Update Two Frames At Once?
Answer:
There are two primary strategies for updating more than one frames with a unmarried link: The HTML-based technique hyperlinks to a new frameset file that specifies the brand new aggregate of frames. The JavaScript-based totally answer uses the onClick characteristic of the link to replace the additional frame (or frames).
The HTML-based technique can hyperlink to a new frameset report with the TARGET=”_top” characteristic (replacing the whole frameset). However, there is an alternative if the frames to be up to date are part of a nested frameset. In the preliminary frameset file, use a secondary frameset file to outline the nested frameset. For example:
