dojo.create("a", { href: "foo.html", title: "Goto FOO!", innerHTML: "link" }, dojo.body());
dojo.create("img", {"class":"", "src": "images/test.jpg"}, 'legendPanel',"last");
Solved! Go to Solution.
This is the full code:var legendDijit = new esri.dijit.Legend({ map: map, layerInfos: layerInfo }, dojo.create('div')); dojo.create("img", {"class":"", "src": "foo.jpg"}, 'legendPanel',"last"); dojo.create("img", {"class":"", "src": "foo1.jpg"}, 'legendPanel',"last"); dojo.create("img", {"class":"", "src": "foo2.jpg"}, 'legendPanel',"last"); dojo.byId('legendPanel').appendChild(legendDijit.domNode); navigateStack('legendPanel'); if (dojo.isIE === 8) { setTimeout(function () { legendDijit.startup(); }, 100); } else { legendDijit.startup(); }
Is there an easier way to incorporate the "a href" code into the dojo.create("img") or somewhere after that references each image?
var img = document.createElement("img"); img.src = "images/test.jpg"; var a = document.createElement("a"); a.href = "foo.html"; a.appendChild(img); document.getElementById("legendPanel").appendChild(a);
var a = domConstruct.create('a', {href: links[key], target: "_blank"}, dom.byId('resultLinksTab')); var img = domConstruct.create('img', {src: "images/" + key + ".png"}, a); domClass.add(img, 'resultLink');
var legendDijit = new esri.dijit.Legend({ map: map, layerInfos: layerInfo }, dojo.create('div')); dojo.create("img", {"class":"", "src": "foo.jpg"}, 'legendPanel',"last"); dojo.create("img", {"class":"", "src": "foo1.jpg"}, 'legendPanel',"last"); dojo.create("img", {"class":"", "src": "foo2.jpg"}, 'legendPanel',"last"); dojo.byId('legendPanel').appendChild(legendDijit.domNode); navigateStack('legendPanel'); if (dojo.isIE === 8) { setTimeout(function () { legendDijit.startup(); }, 100); } else { legendDijit.startup(); }
This is the full code:var legendDijit = new esri.dijit.Legend({ map: map, layerInfos: layerInfo }, dojo.create('div')); dojo.create("img", {"class":"", "src": "foo.jpg"}, 'legendPanel',"last"); dojo.create("img", {"class":"", "src": "foo1.jpg"}, 'legendPanel',"last"); dojo.create("img", {"class":"", "src": "foo2.jpg"}, 'legendPanel',"last"); dojo.byId('legendPanel').appendChild(legendDijit.domNode); navigateStack('legendPanel'); if (dojo.isIE === 8) { setTimeout(function () { legendDijit.startup(); }, 100); } else { legendDijit.startup(); }
Is there an easier way to incorporate the "a href" code into the dojo.create("img") or somewhere after that references each image?