Computer Science, asked by prakhargupta3301, 1 year ago

When do we use '#' inside the tag? I tried using it but it didn't created any difference in the output file. The link in was same even after '_blank' attribute. Please help.

Answers

Answered by Inna
1
A hash sign (#) in a URL is referred to as a fragment. Historically, URL fragments have been used to automatically set the browser’s scroll position to a predefined location in the web page. In that sense, if a URL refers to a document, then the fragment refers to a specific subsection of that document.

Any information that appears after the first hash symbol in a URL is referred to as the fragment identifier – sometimes also called an anchor tag. By default, the fragment identifier is interpreted only by the local web browser and is typically not passed to the remote web server. For example, the following two links would both be considered requests for the same document by the web server:

www.example.com/fruits.html#apple
www.example.com/fruits.html#orange

Since the fragment identifiers in the example URLs above signify two different locations in the same page, search engines like Google will consider them both to refer to a single search result: www.company.com/fruits.html

For this reason, it’s important not to use fragments as a way to represent what should instead be different pages. In short, if you want Google to crawl two different pages and index them separately, you’re better off simply using two distinct URLs without fragments.

However, in modern implementations, fragments are often used in a different way – to add dynamic functionality to websites and web applications. In this approach, a series of related requests are all processed by the same URL. So, in order to return different variations of the content, parameters are passed via URL fragments. Javascript is then used to interpret the fragment and update only portions of the page that need to change, without the need for a full page refresh. This is typical of AJAX-style applications.

prakhargupta3301: well I encountered it in this way:
prakhargupta3301: <#_blank><a href="xyz location>
prakhargupta3301: what does this mean?
Inna: plzz mark brainliest
prakhargupta3301: will you clear my doubt please?
Similar questions