//start loop for each feature //how do i put these in the popup so i can access them later? var links = [{link1: 'http://...", link2: 'http://....'}] //popup content var fieldInfos= []; dojo.forEach(fieldNames, function(name){ fieldInfos.push({ fieldName: name, visible:true }); }); // alert(fieldInfos); var g = new esri.Graphic(f.geometry, sym, attrs); g.setInfoTemplate (new esri.dijit.PopupTemplate({ title: title, fieldInfos: fieldInfos })); map.graphics.add(g); features.push(g); //end loop this.popup.setFeatures(features); this.popup.select(0);
var links = feature.attributes.links; for (var key in links) { if (links.hasOwnProperty(key)) { if(links[key]){ var a = dojo.create('a',{ href: links[key],target:"_blank"}, dojo.byId('resultLinksTab')); var img = dojo.create('img',{ src:"images/"+key+".png"}, a); dojo.addClass(img,'resultLink'); } }
function hrefLinks() { //Grab all TD elements that have http:// var $tds = $('td:contains("http://")'); $.each($tds, function(i, td){ //each returns a raw element, so wrap in jQuery for convenience var $td = $(td); //save original url var url = $td.html(); //change TD's HTML $td.html('<a href="' + url + '" target="_blank">Click here</a>'); }); } function schedule_hrefLinks() { setInterval('hrefLinks();', 200); } schedule_hrefLinks();