मुझे निम्न टाइपस्क्रिप्ट कोड के साथ एक त्रुटि मिल रही है:
///<reference path='../../../Shared/typescript/jquery.d.ts' />
///<reference path='../../../Shared/typescript/jqueryStatic.d.ts' />
function accessControls(action: Action) {
$('#logoutLink')
.click(function () {
var $link = $(this);
window.location = $link.attr('data-href');
});
}
मुझे निम्न के लिए एक रेखांकित लाल त्रुटि मिल रही है:
$link.attr('data-href');
संदेश कहता है:
Cannot convert 'string' to 'Location': Type 'String' is missing property 'reload' from type 'Location'
क्या किसी को पता है कि इसका क्या मतलब है?
window.location = "some string"का विशेष व्यवहार है, यहां देखें: stackoverflow.com/questions/2383401/… - समान-साइट, समान-मूल और XHR व्यवहार के बारे में टिप्पणियां देखें।