HREF=“” automatically adds to current page URL (in PHP). Can't figure it out

前端 未结 8 845
借酒劲吻你
借酒劲吻你 2020-12-01 11:48

Longtime reader of stackoverflow but first question.

I\'m working with Wordpress (specifically thesis theme) in the custom_functions.php file and am finding for some

相关标签:
8条回答
  • 2020-12-01 12:46

    if you want to redirect it to some other url lets google.com then make your like as happy to help other says rikin <a href="//google.com">happy to help other says rikin</a> this will remove self site url form the href.

    0 讨论(0)
  • 2020-12-01 12:50

    This is how a browser interprets and empty href. It assumes you want to link back to the page that you are on. This is the same as if you dont assign an action to a <form> element.

    If you add any word in the href it will append it to the current page unless you:

    • Add a slash / to the front of it telling it to append it to your base url e.g. http://www.whatever.com/something
    • add a # sign in which case it is an in-page anchor
    • or a valid URL

    EDIT: It was suggested that I add a link to help clarify the situation. I found the following site that I think does a really good job explaining the href attribute of anchor tags and how it interprets URL paths. It is not incredibly technical and very human-readable. It uses lots of examples to illustrate the differences between the path types: http://www.mediacollege.com/internet/html/hyperlinks.html

    0 讨论(0)
提交回复
热议问题