2016-04-02 19 views
0

Burada benim kodum, açılır menü listesinden bir değer seçtiğimde yereldirChanged olayı tetiklenir, ancak bu kodu sunucu seçimine eklediğimdeChanged olayı tetiklenmiyor. Beni orada Bunun için herhangi bir alternatiftir yardım lütfen, ben this URLselectionChanged event knockout'ta çalışmıyor js

**HTML Code** 

    <select data-bind="options: choices, value: selectedChoice"></select>  
    <select data-bind="event: { change: selectionChanged }"> 
     <option>A</option> 
     <option>B</option> 
     <option>C</option> 
    </select> 

**JS Code:** 

    var viewModel = { 
     choices: ["one", "two", "three"], 
     selectedChoice: ko.observable("two") , 
     selectionChanged: function(event) { 
      alert("the other selection changed"); 
     } 
    }; 

    viewModel.selectedChoice.subscribe(function(newValue) { 
     alert("the new value is " + newValue); 
    }); 


    ko.applyBindings(viewModel); 

cevap

0

bu SOUTION bulundu Sorun jsfiddle url sabitlendiği; ve kullanılan komut nereye değil. Eğer giderseniz

: yerine https ait http o

Mixed Content: The page at 'https://fiddle.jshell.net/rniemeyer/LBz6d/show/' was loaded over HTTPS, but requested an insecure script 'http://knockoutjs.com/downloads/knockout-2.2.1.debug.js'. This request has been blocked; the content must be served over HTTPS. 
+0

çalışması gerekir ama benim sunucuda http://dev-sc8.corsair.com/en-us/memoryfinder Bu kodu o olduğunu çalıştırıyorum benim sunucuda çalışmıyor –

+0

Verilen kod çalışması gerekir, bu yüzden sorun başka bir yerde yatıyor. Tam js ve html dosyalarınızı gösterebilir misiniz – Timvr01

+0

Burada dosyalarım https://onedrive.live.com/redir?resid=143242B617BA6BE2!8464&authkey=!ALfhswMBsY8wTR8&ithint=folder%2caspx –