在这段代码中:http://jsfiddle.net/PDwBF/1/
链接到谷歌不起作用。如何修复它?
<ul data-bind="foreach: Items">
<li data-bind="click: $root.SetCurrent">
<p data-bind="text: id"></p>
<div>
<a href="http://google.com" target="_blank">Go to google</a>
</div>
</li>
</ul>
function ViewModel()
{
var self = this;
self.SelectedItem = ko.observable();
self.Items = ko.observableArray([]);
self.SetCurrent = function(item)
{
self.SelectedItem(item);
};
};
var vm = new ViewModel();
ko.applyBindings(vm);
vm.Items.push({id: 55});
vm.Items.push({id: 66});
vm.Items.push({id: 77});