I want to change an image when URL change the parameters.
For example:
http://localhost:8080/h5/informational.html
Don't show anything, but when URL have ?type=parameter, I want to show an image.
I have this code, but it doesn't work.
var img = new Image();
var div = document.getElementById('header');
var url = "http://172.18.43.33:58380/launcher/h5/informational/cabecera.html?type=";
var expansion = url + "expansion";
var experiencia = url + "experiencia";
if (expansion == true) {
img.onload = function() {
div.innerHTML += '<img src="' + img.src + '" />';
};
} else if (experiencia == true) {
img.onload = function() {
div.innerHTML += '<img src="' + img.src + '" />';
};
img.src = 'images/experiencia.jpg';
} else {
//Error
}