HTML <base> TAG and local folder path with Internet Explorer

前端 未结 9 1649
天命终不由人
天命终不由人 2020-11-28 10:55

I am trying to use < base> TAG to indicate the source folder containing the media files for my html pages located in separate folder.

I have the

9条回答
  •  一整个雨季
    2020-11-28 11:14

    
    

    Doesn't have a trailing slash, so it refers to a file called MEDIA_FOLDER and not a folder. Often you don't notice the difference because web servers will redirect an attempt to fetch folder to the proper address folder/, which will then typically return a default document (eg. folder/index.html). But for relative URL resolution it does make a difference.

    target relative to /folder is not /folder/target, it's just /target. To make it /folder/target you must let the browser know that the base URL is a folder, by adding a trailing slash:

    
    

    There is no reason for different browser behaviour here. A place you may find different browser behaviour, though, is if you've accidentally used a Windows-filesystem-style backslash \ instead of /, so do check for that.

提交回复
热议问题