M S*_*ach 9 html javascript jquery
这是html代码片段
<li style="opacity: 1;">
<a id="LinkDisplay" class="optionsDropDown" style="color:#FF0000;display:none" href="javascript:showThisLink('LinkId');">
</li>
Run Code Online (Sandbox Code Playgroud)
这是在加载时调用的jquery函数
$(function () {
$.ajax({
url: url,
dataType: 'json',
data: '',
type: 'POST',
success: function (data) {
alert("Test");
document.getElementById("LinkDisplay").style.diplay="block"; // line 1
// after this line execution i should see the link as i have
// changed the link display from none to block but it is still invisible
});
});
}
Run Code Online (Sandbox Code Playgroud)
第1行执行后,我不确定为什么我的链接不可见?
Nej*_*eji 18
您还没有更改代码中的显示属性
document.getElementById("LinkDisplay").style.display="block"
Run Code Online (Sandbox Code Playgroud)
在line1之后将此代码插入到您的函数中
问题在于该行中display的拼写:
document.getElementById("LinkDisplay").style.display="block";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
63821 次 |
| 最近记录: |