Ukd4jbuysellseoc
New Member
I have been working on a project based on Google Maps API v3 for over a year now. There has been many, many changes to the information displayed in the info window. I am looking for a more efficient way to manage the html code other than a string variable. Any ideas?\[code\]var tabA = "" + '<div class="iw_field"><div class="iw_label">NAME</div>'+ '<div class="iw_data">'+c.pName+'</div></div>' + '<div class="iw_field"><div class="iw_label">CORPORATION</div>'+ '<div class="iw_data">'+c.corp+'</div></div>' + '<div class="iw_field"><div class="iw_label">INDUSTRY</div>'+ '<div class="iw_data">'+c.industry+'</div></div>'+ "<div style='text-align: center;'>"+ "<button class='btn btn-info' onclick='retriveCustomerOf(\""+c.num+"\")'>Customers</button>" + "<button class='btn btn-info' onclick=''>Prospects</button>"+ "</div>";var tabB = "" + '<div class="iw_field" style="border-bottom: 0px"><div class="iw_label">SALES VOLUME</div>'+ '<div class="iw_data">$'+dollarFormat(c.statA)+'</div></div>' + '<table style="border-top: 1px solid #aaaaaa;"><tr><td>'+ '<div class="iw_field"><div class="iw_label">GM</div><div id="" class="iw_data">$'+dollarFormat(c.statB)+'</div></div>'+ '<div class="iw_field"><div class="iw_label">OPAT</div><div id="" class="iw_data">$'+dollarFormat(c.statC)+'</div></div>'+ '<div class="iw_field"><div class="iw_label">ROI</div><div id="" class="iw_data">'+dollarFormat(c.statD)+'%</div></div>'+ '</td><td>'+ '<div class="iw_field"><div class="iw_label">GM RANK</div><div id="" class="iw_data">'+c.statE+'</div></div>'+ '<div class="iw_field"><div class="iw_label">OPAT RANK</div><div id="" class="iw_data">'+c.statF+'</div></div>'+ '<div class="iw_field"><div class="iw_label">ROI RANK</div><div id="" class="iw_data">'+c.statG+'</div></div>'+ '</td></tr></table>';var tabC = ""+ '<div class="iw_field" style="border-bottom: 0px"><div class="iw_label">SERVICE REGION</div>'+ '<div class="iw_data">'+c.area+'</div></div>' + '<table style="border-top: 1px solid #aaaaaa;"><tr><td>'+ '<div class="iw_field"><div class="iw_label">PLACE 1</div><div id="" class="iw_data">$'+dollarFormat(c.p1)+'</div></div>'+ '<div class="iw_field"><div class="iw_label">PLACE 2</div><div id="" class="iw_data">$'+dollarFormat(c.p2)+'</div></div>'+ '</td><td>'+ '<div class="iw_field"><div class="iw_label">PLACE 3</div><div id="" class="iw_data">$'+dollarFormat(c.p3)+'</div></div>'+ '<div class="iw_field"><div class="iw_label">PLACE 4</div><div id="" class="iw_data">$'+dollarFormat(c.p4)+'</div></div>'+ '</td></tr></table>';var windowContent = "<div id='infowindow' class='company'>" + "<span class='header'>"+c.cName+" (#"+c.num+")</span>" + "<div class='tabs'>" + "<ul>" + "<li><a href='http://stackoverflow.com/questions/15706563/#tab_1' onclick='selectedTab = 0'><span>A</span></a></li>" + "<li><a href='http://stackoverflow.com/questions/15706563/#tab_2' onclick='selectedTab = 1'><span>B</span></a></li>" + "<li><a href='http://stackoverflow.com/questions/15706563/#tab_3' onclick='selectedTab = 2'><span>C</span></a></li>" + "</ul>" + "<div id='tab_1'>"+tabA+"</div>" + "<div id='tab_2'>"+tabB+"</div>" + "<div id='tab_3'>"+tabC+"</div>" + "</div>" + "<div style='text-align: right;'>"+ "<button class='btn btn-primary' onclick='toggleRings(new google.maps.LatLng("+c.latitude+","+companies.longitude+"));'>Rings</button>" + "<button class='btn btn-primary' onclick='zoom("+c.latitude+", "+c.longitude+", 9)'>Zoom</button>"+ "</div></div>";\[/code\]This can't be the best practice to manage this code. Please save my sanity.