HTML import relative path -


i'm writing webcomponent. therfore have index.html in import webcomponent:

<link rel="import" href="components/test.html"> 

as see have component in specific folder relative index.html. when want access ressource test.html in components folder. want like:

background-image: url("test.gif"); 

for css or:

 <img src="test.gif"> 

but doesn't work. works when change path relative of image index.html like:

<img src="components/test.gif"> 

i know can tricks document.currentscript.baseuri want write plain css , html. there easy way so?

you might want take @ how polymer guys it. code in src/standard/resolveurl.html (snapshot) , src/lib/resolve-url.html (snapshot).

it isn't pretty. alone, infer @ time of writing answer question seems "no, isn't easy , there no way without using tricks".


Comments

Popular posts from this blog

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

asp.net mvc - Cannot display error message on Editor or EditorFor -