groupie wrote:
This code is in <head>.
Actually, it is not. It is between <headand </head*server-side*. It
may be within <headand </headclient-side, too.
If I write this:
<script language="JavaScript" type="text/javascript">
Remove the deprecated `language' attribute, `type' suffices.
<%
if (oRs.BOF && oRs.EOF )
%>
alert("hello");
</script>
...then the BOF/EOF methods are valid but the IF statement is not.
<% ... %indicates ActiveServer Pages. The default programming language
in ASP is VBScript which syntax naturally differs from JScript (another
programming language that ASP supports).
Either
<%
If oRs.BOF And oRs.EOF
%>
window.alert("hello");
<%
End If
%>
or
<%@ LANGUAGE = "JScript" %>
<%
if (oRs.BOF && oRs.EOF)
{
%>
window.alert("hello");
<%
}
%>
should work (I recommend the latter, even if it means a rewrite). It would
generate
<script type="text/javascript">
window.alert("hello");
</script>
if the condition was met.
If I write this instead:
<script language="JavaScript" type="text/javascript">
if (oRs.BOF && oRs.EOF )
alert("hello");
</script>
...then the IF statement is valid but the BOF/EOF methods are not.
http://www.jibbering.com/faq/faq_not...ml#ps1DontWork http://jibbering.com/faq/#FAQ4_43
`oRs' would be a reference to an object that exists server-side only.
I didn't know what <% %actually meant...thanks! I could also use
runat = 'server' ?
You could get a minimum clue before you start messing around with
(server-side) programming. There are plenty (online) resources out there,
including several about ASP, with the MSDN Library being not the least one.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann