Foren

Generate URL from the given String

Logu R, geändert vor 8 Jahren.

Generate URL from the given String

New Member Beiträge: 10 Beitrittsdatum: 15.05.15 Neueste Beiträge
The concept is "We need to generate URL from the given String ".
For example,
1)
Here the urltext contains "www.google.com"
urlText ="www.google.com"

2)
Now i tried to append the string with "https:"
urlTemp = "<a target='_blank' href='https://"+urlText+"'>";

The issue is while executing the application it is referring to our local port.
http://localhost:9080/web/guest/www.google.com

It should be https://www.google.com
thumbnail
David H Nebinger, geändert vor 8 Jahren.

RE: Generate URL from the given String

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
There's gotta be more to it than that. If you output that <a target... /> tag as indicated, it would not be stamped with the local host prefix.