سؤال

I have a simple tag which has a url as its href, when I click on it, it appends the URL to the current address.

The address is www.example.com/event/

<a href="www.yahoo.com" taget="_blank">Here</a>

When I click on it, it will change to following

 www.example.com/event/www.yahoo.com
هل كانت مفيدة؟

المحلول

It is a relative URI. Add http:// to make it an absolute URI:

<a href="http://www.yahoo.com" target="_blank">Here</a>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top