我想在右上角显示删除按钮以显示图像?我怎么能实现这个目标?
我的HTML是这样的: -
主要形象:
<img id="' + id + '" src="../Images/DefaultPhotoMale.png" class="' + item + '" width="40" height="40" alt="image" title="' + projectTitle + '" style="cursor:pointer" />
Run Code Online (Sandbox Code Playgroud)
x按钮图像显示在上方图像的右上角
'<img id="' + item.Soid + '" src="../Images/RemoveButton.ico" style="display:none" title="Remove Specialization" />
请不要设置背景图片,我需要点击事件删除按钮,如下所示:
我使用数据值作为对象文字,而不是连接一个字符串,如本答案中所述
我的代码如下:
$.ajax({
url: "../Member/Home.aspx/SaveClient",
type: "POST",
async: false,
dataType: 'json',
contentType: 'application/json; charset=utf-8',
data: {
"projectSoid": ProjectId,
"startDate": StartDate,
"endDate": EndDate,
"clientManager": ClientManager
},
success: function(response) {
if (response.d != "") {
}
},
error: function(response) {
var r = jQuery.parseJSON(response.responseText);
alert("Message: " + r.Message);
alert("StackTrace: " + r.StackTrace);
alert("ExceptionType: " + r.ExceptionType);
}
})
Run Code Online (Sandbox Code Playgroud)
我的网络方法是这样的:
[WebMethod]
public static string SaveClient(string projectSoid, string startDate,
string endDate, string clientManager)
{
...
}
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误:
消息:无效的JSON原语:projectSoid
当字符串的名称大于一个限制时会出现三个点,这个限制是通过计算可以输入的字符数来定义的
用…
.替换最后 3 个字符。例如,假设我的名字有30
字符,但屏幕标签字段只能使用 15 个字符,而不是使用第一个12
字符并将第 13,14 和第 15 个字符替换为…
将鼠标悬停在带有...的标签上时,显示完整名称(即 30 个字符)
我怎么能在 jquery 中做到这一点?或 html
我有这样的数组
var ids = [
liRightSkills, liRightAchievements, liRightGetRatings, liRightSpecialization, liRightOrgChart, liRightMemberships
];
Run Code Online (Sandbox Code Playgroud)
如何使用jQuery读取每个元素?
我试过这个,但它没有用
jQuery.each(ids, function() {
$('#' + $(this).val()).show();
});
Run Code Online (Sandbox Code Playgroud)