|
(no subject) [message #682321 is a reply to message #682268] |
Fri, 10 June 2011 20:32 |
|
Mike,
I added an image to a text element like:
<div id="testimg">
<img id="myimg"
src=<VALUE-OF>reportContext.getHttpServletRequest().getContextPath()
+"/webcontent/birt/images/Go.gif"</VALUE-OF> alt="Angry face" />
</div>
I then added a script to another text element that changed the image like:
<script>
var img = document.getElementById("myimg");
var cur = img.src;
var newsrc = cur.replace("Go.gif", "Up.gif");
img.src = newsrc;
</script>
And this worked
Jason
On 6/10/2011 2:18 PM, Mike Wulkan wrote:
> I have the following code in a Text control:
>
> <div id="twisty_01" style="cursor:pointer"
> onclick='if (document.getElementById("content_01").style.display ==
> "none") {
> document.getElementById("twisty_01").innerHTML = "<img
> src=\"WebContent/report/images/CollapseInfoIcon.gif\" alt=\"Angry face\"
> />";
> document.getElementById("content_01").style.display = "block";
> } else {
> document.getElementById("twisty_01").innerHTML = "<img
> src=\"WebContent/report/images/ExpandInfoIcon.gif\" alt=\"Angry face\" />";
> document.getElementById("content_01").style.display = "none";
> }' > <img src="WebContent/report/images/ExpandInfoIcon.gif" alt="Angry
> face" /> </div>
> <div id="content_01" style="display:none;" >
> Stuff goes here...
> </div>
>
> The issue is that the two image references in red (inside the onclick
> script) do not find the image at the relative path. To make these work I
> must put in the fully qualified path which is not desirable for obvious
> reasons!
> The exact same relative path works fine in the last image specification
> (in blue).
>
> Sorry if this is just an HTML question rather than a BIRT question but
> it is hard to tell how this is all being parsed and resolved under all
> these layers ;)
>
> So how the heck can I find the images for the tags in red without
> specifying the fully qualified path?
>
> Thanks,
> Mike
|
|
|
Powered by
FUDForum. Page generated in 0.03197 seconds