JSPÒ³ÃæÀïµÄJAVA´úÂëÊÇ:
String returnPage = null;
if (session.getAttribute( "returnPage ") != null)
{
returnPage = String.valueOf(session.getAttribute( "returnPage "));
session.removeAttribute( "returnPage ");
}
ΪʲôÕâÀïreturnPageÊÇnull
function go_back()
{
window. <%=returnTarget%> .location.href = " <%=returnPage%> ";
}
¿ÉÊÇÕâÀïÈ´Ö´ÐÐÁË
function init()
{
<% if ( returnPage != null )
{ %>
document.getElementById( 'return ').focus();
<% }%>
}
------½â¾ö·½°¸--------------------
returnPageÊÇÒ»¸ö×Ö·û´®ÁË¡£
ÓÃ.equals( "null ")À´ÅжϰÉ.
------½â¾ö·½°¸--------------------
¿ÉÊÇÕâÀïÈ´Ö´ÐÐÁË
function init()
{
<% if ( returnPage != null )
{ %>
document.getElementById( 'return ').focus();
<% }%>
}
==============================================================
ÄǾÍÖ¤Ã÷Ëû²»ÊÇnull,
»¹ÓÐÂ¥ÉϵĴó¸ç,¼´±ãÊÇ×Ö·û´®!=nullҲûʲôÎÊÌâ,û±ØÒªÕâÒ²ÓÃ.equals,ͨ³£ÓÚÅжÏÊDz»ÊÇ " "²ÅÓÃ.equals°É,ÄãÕâÑùЩ,Æñ²»³ÉÁ˵¥´¿ºÍ "null "×Ö·û´®±È½ÏÁË?