为什么在IE8中不能取消选择多行选择框中的所有选项?
$("#myselect").children().removeAttr("selected");
Run Code Online (Sandbox Code Playgroud)
有解决方法吗?没有什么我能想到的(attr("选择","")等)似乎有效.
更新:这是一个更新的jsFiddle.我至少让它降级,以便在IE8中选择第一个选项.但是如果没有硬编码选择='选择' 和 IE8似乎需要的.attr调用,它在Firefox,Chrome和IE8中做了3件不同的事情!看到这个版本:,这很简单,看起来应该有效:
也许我让自己疯了,在那里我看不到有什么错误?
我正在组装一些虚拟机来测试不同的浏览器,我想知道是否有任何令人信服的理由能够在不同版本的Windows上测试相同版本的IE.(即XP和Vista上的IE8)我主要讨论测试CSS以确保它在浏览器中"看起来正确",但如果JavaScript存在重大差异,我也想知道.
在不同版本的Windows上,不同版本的IE"通常是否相同"?谢谢!
我有一些代码将用户的ID保存为cookie.它在生产中运行良好,但将代码移动到IIS7,在我的代码后面升级供应商应用程序,并将应用程序移动到IIS7中的应用程序而不是仅运行默认Web在IE中打破此cookie功能.
不幸的是,它是一个经典的ASP应用程序,所以我找不到一个发布工作版本的好方法.但这里有相关的部分.
概要:
似乎正在发生的事情(仅在IE?)是有2个cookie,取消选中该框仅触及其中一个.
这是相关的代码.希望能帮助到你 :)
在登录表单上:
var MHOLI = Get_Cookie("MHOLI");
//Check if cookie has a value
if (MHOLI != null && MHOLI != "" && MHOLI != "null") {
//Set login text
$("#Login").val(MHOLI);
//keep remember login checkbox checked
$("#RemonlineID").attr('checked', true);
$(document).ready(function() {
setTimeout(function() {
$("#Password").focus();
}, 200);
});
}
$(document).ready(function() {
//test if cookies are enabled..
Set_Cookie('test', 'testvalue', '/', '', '');
//if cookies are disabled, disable the option to remember username
if (!Get_Cookie('test')) {
$('#RemonlineID').attr("disabled", true); …Run Code Online (Sandbox Code Playgroud) 我开始使用Mono在我的Mac上开始使用ASP.NET,我想知道人们在这个设置中使用了哪些数据库.我正在寻找易于设置的东西,因为这只是为了娱乐和继续学习ASP.NET.
我有2个简单的webservice方法来查询我通过javascript查询的XML文档(存储在HTTP缓存中).GetCitiesForAffiliate()当我为aff参数传递一个完全有效的数据项时,该方法在"select new"行上抛出NullReferenceException.它适用于aff参数中的其他数据.另一种方法也可以正常工作,即使使用相同的aff参数导致另一种方法爆炸.
我刚刚验证了我要查询的XML.当我传入一个不存在的aff时,这两种方法只返回一个空的json字符串,这没关系.我应该看哪些可能是错的?
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string GetCitiesForAffiliate(string aff)
{
LocationService loc = new LocationService();
var query = (from center in loc.centersXml.Descendants("Center")
where center.Element("ServiceArea").Value.Equals(aff)
select new {
City = center.Element("City").Value
}).Distinct().OrderBy(x => x.City);
JavaScriptSerializer serializer = new JavaScriptSerializer();
string json = serializer.Serialize(query);
return json;
}
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string GetCentersForAffiliateCity(string aff, string city)
{
LocationService loc = new LocationService();
var query = (from center in loc.centersXml.Descendants("Center")
where center.Element("ServiceArea").Value.Equals(aff) && center.Element("City").Value.Equals(city)
select new {
ID …Run Code Online (Sandbox Code Playgroud) asp-classic ×2
browser ×1
cookies ×1
database ×1
javascript ×1
jquery ×1
linq ×1
macos ×1
mono ×1
monodevelop ×1
testing ×1
windows ×1