| | |
hide link if variable is empty
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2004
Posts: 1
Reputation:
Solved Threads: 0
Hi,
Can anybody tell me why in the following peace of code the link does
not get hidden when "locationid" is empty? thanks, torsten
<%if IsNull(cursor("locationid")) = false then %><A
href="javascript:MM_openBrWindow('http://www.mapminder.co.uk/getmap/default.asp?page=viewlocation&locationid=<%
=cursor("locationid")
%>&source=82YWNH0INZZDY-zIkhkce2L£wY!Pbgx6&zoom=<%
=cursor("mapbytezoom")
%>','','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width=585,height=585,screenX=0,screenY=0,top=0,left=0');"
onMouseOver="window.status = 'Link To Location Map'; return true;"
onMouseOut="window.status = ''; return true;"><IMG
SRC="../images/pubs/gpg_getmap_button.gif" WIDTH=58 HEIGHT=38 HSPACE=0
VSPACE=0 BORDER=0 ALT="Get Map"></A><% end if%>
Can anybody tell me why in the following peace of code the link does
not get hidden when "locationid" is empty? thanks, torsten
<%if IsNull(cursor("locationid")) = false then %><A
href="javascript:MM_openBrWindow('http://www.mapminder.co.uk/getmap/default.asp?page=viewlocation&locationid=<%
=cursor("locationid")
%>&source=82YWNH0INZZDY-zIkhkce2L£wY!Pbgx6&zoom=<%
=cursor("mapbytezoom")
%>','','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width=585,height=585,screenX=0,screenY=0,top=0,left=0');"
onMouseOver="window.status = 'Link To Location Map'; return true;"
onMouseOut="window.status = ''; return true;"><IMG
SRC="../images/pubs/gpg_getmap_button.gif" WIDTH=58 HEIGHT=38 HSPACE=0
VSPACE=0 BORDER=0 ALT="Get Map"></A><% end if%>
JSP Syntax (Toggle Plain Text)
<c:if test="${not empty urldata}"><a href="<c:out value='${urldata}'/>"><c:out value="${urldescription}"/></a></c:if>
Now isn't that a simple and clean bit of code?
Learn to use JSTL and ditch those scriptlets. They're 7 year old technology and no longer recommend.
In fact on any new project I ban the use of scriptlets, dictate JSTL is used exclusively.
Any JSP containing scriptlets gets thrown back to the programmer for rework.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Similar Threads
- make a link from an array variable (PHP)
- Css javascript question (JavaScript / DHTML / AJAX)
- How do I pass a link (webpage) through url? (PHP)
- Code to control display of time-sensitive link? (JavaScript / DHTML / AJAX)
- Hide Button when DataView is empty (ASP.NET)
- hide link music vbulletin !! (Existing Scripts)
Other Threads in the JSP Forum
- Previous Thread: How to Display Seconds in a JSP file
- Next Thread: dateadd function
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web






