我有这个Javascript代码,我从其他开发人员继承。我对JavaScript很陌生。使功能在HTTP和HTTPS中工作
我遇到的问题是,当用户处于HTTPS中时,它不起作用。有没有解决这个问题的方法?
var tier1CategoryLink = "http://" + window.location.hostname + "/categories/";
$("#as_Placeholder").load(tier1CategoryLink + " .SubCategoryList > ul", function(){
$('#tier1').find('option').remove().end().append('<option>Make</option>');
$("#as_Placeholder ul li").each(function(){
var thisText = $(this).children("a").text();
if ((thisText != "All Products") && (thisText != "Best Selllers") && (thisText != "Chromoly Flywheel Combo Sale") && (thisText != "New Arrivals") && (thisText != "On Sale") && (thisText != "Needs Categories")) {
$("#tier1").append("<option value='" + $(this).children("a").attr("href") + "'>" + thisText + "</option>");
}
});
});
定义:“will not work” – saluce
好吧,如果'“http://”'改为'“https://”',它会“工作”吗? (解决问题的第一步是了解问题。) – 2012-06-15 17:00:22
定义“用户处于HTTPS” –