Relative URL to a different port number in a hyperlink?

前端 未结 11 1876
心在旅途
心在旅途 2020-11-27 15:13

Is there a way without Javascript / server-side scripting to link to a different port number on the same box, if I don\'t know the hostname?

e.g.:

&l         


        
11条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 15:55

    You can do it easily using document.write and the URL will display correctly when you hover over it. You also do not need a unique ID using this method and it works with Chrome, FireFox and IE. Since we are only referencing variables and not loading any external scripts, using document.write here will not impact the page load performance.

    
    

提交回复
热议问题