VS 2013:服务器标签格式不正确

时间:2017-08-04 20:08:13

标签: javascript

    function changeSystemDDLIndex() {
        // Select the Site in SitesDDL = CustomerSiteIdOfSystem
        // Save the System ID into a hidden variable
        var systemsDDL = document.getElementById('ddlSystems');
        var system = systemsDDL.options[systemsDDL.selectedIndex].value;
        var sitesDDL = document.getElementById('ddlSites');
        var hidCustomerSiteId = document.getElementById("hdnCustomerSiteId");
        var hidCustomerSystemId = document.getElementById("hdnCustomerSystemId");

        if (systemsDDL.options[systemsDDL.selectedIndex].value == '') {
            // if System = N/A, Customer_Site_Id = '' then SitesDDL.SelectedIndex = 0 (N/A)
            sitesDDL.options[0].selected = true;

            // Set new values of hidden variables
            hidCustomerSiteId.value = '';
            hidCustomerSystemId.value = '';
        }
        else {
            var isFound = false;
            var CustomerSiteIdOfSystem = systemsDDL.options[systemsDDL.selectedIndex].attributes['Customer_Site_Id'].value;

            // Find the Customer_Site_Id in SitesDDL options and set it
            var j = sitesDDL.options.length;
            var i;

            alert('i = ' + i);
            alert('j = ' + j);
            i++;
            alert('j = ' + j);
            alert('i = ' + i);
            **for (i = 1; i < j; i++) {**
                alert('dfd');
            }

        }
        return;
    }

我收到&#34;服务器标签格式不正确。&#34;错误在&#34; for(i = 1; i&lt; j; i ++){&#34;声明。如果我删除for语句,则代码可以正常工作。

我该如何纠正呢?我使用的是VS2013,.Net FW 3.5。

0 个答案:

没有答案