';
}
document.getElementById('devContainer').innerHTML = html;
var anchors = document.getElementsByClassName('availableAnchor');
@@ -67,7 +67,7 @@ function show(deviceArray){
var part2 = "');"
for (var i = 0; i < deviceArray.length; i++)
{
- html += '
';
+ }
+
+ if(html.localeCompare("")==0)
+ html += "
There are no devices with the search criteria: " + this.textContent + "
";
+
+ document.getElementById('devContainer').innerHTML = html;
+
+ var requestbuttons = document.getElementsByClassName('requestbutton');
+ for(var i = 0; i < requestbuttons.length; i++) {
+ requestbuttons[i].addEventListener('click',addToCart);
+ }
+}
//when an option is selected, show a new list of devices based on what the user asked for
function show(deviceArray){
// var type = this.getAttribute('data-type');
@@ -44,7 +64,7 @@ function show(deviceArray){
var part1 = "nhpup.popup('";
var part2 = "');"
for (var i = 0; i < deviceArray.length; i++) {
- html += '