2013-07-29 73 views
0

我想知道我怎麼能在這方面_("status").innerHTML = '';添加圖片或GIF文件中的引號'',如果你(在實際的代碼行沒有。13)我如何設置鏈接到JavaScript圖像?下面的代碼

我會真的非常感謝你可以回答這個問題!

我實際的代碼如下: -

<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> 

回答

0

試試這個

_("status").innerHTML = "<a href='#'><img src='photos/picture.jpg' border=0/></a>"; 
0

試試這個:

_("status").innerHTML = '<img src="your image url" />'; 
0

這shold幫助你...

_("status").innerHTML = "<img src=\"img_file.gif\"/> Login unsuccessful, please try again."; 
0

很簡單,

_('status').innerHTML='<a href="#"><img src="your_image.jpg"></a>'; 
相關問題