hagrawal7777
hagrawal7777

Reputation: 14668

Query string of the URL getting removed in mobile for HTML's <a> tag

This is very strange issue - I have a very simple HTML anchor tag as below (ofcourse this not all the code, there is much more). It works great for laptop browsers but in Samsung note browser when I click this (exact URL is not for Google's but my application's URL) then query string part automatically gets removed/truncated and I am only left with URL without query string opened in a new window.

<a id="gog" href="http://localhost/WebContent/index.jsp?abc=ABC" target="_blank" rel="noreferrer">Google</a>

Originally, the href value I was building dynamically in the href attribute itself, I though mobile doesn't allow that so I computed the full URL separately and then used that variable in href but it didn't help.

Then I thought may be rel="noreferrer" is causing issue but to no avail.

This happens only in mobile device - Samsung and Chrome browser, laptop Chrome is fine.

Anybody has ever faced this issue or any idea on how to resolve.

Upvotes: 0

Views: 1152

Answers (1)

SLaks
SLaks

Reputation: 887797

Your URL is malformed; you need a / between the host portion and the path / querystring.

Also, to make the URL actually work, you should change that to /search

Upvotes: 1

Related Questions