Bootstrap4
Bootstrap4

Reputation: 3841

What does '?' after href do?

What does ? after href do? Often time you will see something like this

href='?page=1'

Does anybody knows? Thanks in advance to all for the help.

Upvotes: 3

Views: 194

Answers (2)

Dijkgraaf
Dijkgraaf

Reputation: 11527

That means it is a link to the current webpage with a query-string parameter. In this case the page number. This is usually if you have a dynamic page listing contents and limiting the number per page.

Upvotes: 3

Shadow X
Shadow X

Reputation: 33

The "?" mark is very useful and important in many ways. for example, and uses to identify a particular usage for specific reasons, one of these reason is that when you have a website with three languages exists but it has the same pages. check the following links below.

http://example.com/news?language=EN

The language of example website is in English

http://example.com/news?language=RU

The language of example website is in Russian

http://example.com/news?language=DE

The language of example website is in Germany

Other reason is when you have a dynamic page that contains only one page with many contents thats stored in website's database. before it was static pages like the following links below

http://example.com/page1.html
http://example.com/page2.html
http://example.com/page3.html

As you can see we have three pages. how about that we can have many pages but in the same one page. the only thing is different is to change the parameter of the page itself.

Let's say you own an e-library. you don't waste your life creating thousands of pages working on book details, you can simply create a book page with isbn parameter as it shown below

 https://example.com/books?isbn=0132947048

It also used to track online campaigns and identify which source that users coming from...

http://example.com/?source=StackOverFlow&medium=Banner

Hope I answered your question clearly :)

Upvotes: 3

Related Questions