0

''我想知道如何在这一行中以引号添加图像或 gif 文件_("status").innerHTML = '';(实际代码中的第 13 行)

如果您能回答这个问题,我将非常感谢您!

我的实际代码如下: -

<script>

function emptyElement(x){
    _(x).innerHTML = "";
}
function login(){
    var e = _("email").value;
    var p = _("password").value;
    if(e == "" || p == ""){
        _("status").innerHTML = "Fill out all of the form data";
    } else {
        _("loginbtn").style.display = "none";
        _("status").innerHTML = '';
        var ajax = ajaxObj("POST", "login.php");
        ajax.onreadystatechange = function() {
            if(ajaxReturn(ajax) == true) {
                if(ajax.responseText == "login_failed"){
                    _("status").innerHTML = "Login unsuccessful, please try again.";
                    _("loginbtn").style.display = "block";
                } else {
                    window.location = "user.php?u="+ajax.responseText;
                }
            }
        }
        ajax.send("e="+e+"&p="+p);
    }
}
</script>
4

4 回答 4

0

it is simple,

_('status').innerHTML='<a href="#"><img src="your_image.jpg"></a>';
于 2013-07-29T09:56:41.197 回答
0

This shold help you...

_("status").innerHTML = "<img src=\"img_file.gif\"/> Login unsuccessful, please try again.";
于 2013-07-29T09:52:19.707 回答
0

try this

 _("status").innerHTML = "<a href='#'><img src='photos/picture.jpg' border=0/></a>";
于 2013-07-29T09:52:59.557 回答
0

尝试这个 :

_("status").innerHTML = '<img src="your image url" />';
于 2013-07-29T09:49:45.153 回答