I need to know how I can obtain the relative path when using .src with Javascript.
In this code target.src evaluates to " which is no code for me to hardcode, because when I move it to the production server "localhost" won't work:
//Will toggle the image between collapsed and expanded
function ToggleCollExpImage( targetId ){
if (document.getElementById){
target = document.getElementById( targetId );
if (target.src == "./images/collapse-gray.GIF"){
target.src = "./images/expand-blue.GIF";
} else {
target.src = "./images/collapse-gray.GIF";
}
}
}
In this code target.src evaluates to " which is no code for me to hardcode, because when I move it to the production server "localhost" won't work:
//Will toggle the image between collapsed and expanded
function ToggleCollExpImage( targetId ){
if (document.getElementById){
target = document.getElementById( targetId );
if (target.src == "./images/collapse-gray.GIF"){
target.src = "./images/expand-blue.GIF";
} else {
target.src = "./images/collapse-gray.GIF";
}
}
}