Hi,
I'd like to replace the relative URLs in the following code to absolute:
... <script language="JavaScript" type="text/javascript" src="foo.js"></script> <link href="bar.css" rel="stylesheet" type="text/css" /> ...
I've tried LinkTag, ScriptTag and StyleTag without success.
What is the best way to go about doing this?
Cheers.
Like this, modify the attribute of 'src'. --------------- String src = scriptTag.getAttribute("src"); if(src!=null){ scriptTag.setAttribute("src", modifyUrl(src) ); } ---------------
Log in to post a comment.
Hi,
I'd like to replace the relative URLs in the following code to absolute:
...
<script language="JavaScript" type="text/javascript" src="foo.js"></script>
<link href="bar.css" rel="stylesheet" type="text/css" />
...
I've tried LinkTag, ScriptTag and StyleTag without success.
What is the best way to go about doing this?
Cheers.
Like this, modify the attribute of 'src'.
---------------
String src = scriptTag.getAttribute("src");
if(src!=null){
scriptTag.setAttribute("src",
modifyUrl(src)
);
}
---------------