0

I need to add a hyperlink to a tag and the following is what I did.

<div id="dialog" style="display: none">
    The new site is started, and old site is gone
     <a href='www.google.com' id='dialog'>Google</a>
</div>

I added the code to a "Script Editor" webpart, however,i found there is an issue that the link is changed to

"https://teams.connect.te.com/sites/PCINDIRECT/SitePages/www.google.com"

"https://teams.connect.te.com/sites/PCINDIRECT/SitePages" is the folder where the page is stored. Please instruct me how to change the code, so that, the hyperlink will be "www.goolge.com" correctly?

thanks,

closed as off-topic by Mohamed El-Qassas MVP Jul 24 '17 at 7:06

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Programming questions not specific to SharePoint are off-topic here, but can be asked on Stack Overflow." – Mohamed El-Qassas MVP
If this question can be reworded to fit the rules in the help center, please edit the question.

2

Please include http:// in the href if you are pointing to some absolute URL, or use a / for relative Urls

Absolute URL Reference

<a href='http://www.google.com' id='dialog'>Google</a>

Relative URL Reference

<a href='/sites/PCINDIRECT/SitePages/something.aspx' id='dialog'>Google</a>

Not the answer you're looking for? Browse other questions tagged or ask your own question.