 |
| Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

April 26th, 2004, 04:59 AM
|
|
Authorized User
|
|
Join Date: Nov 2003
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
asp/javascript
Hi
This program works fine, but I keep getting the yellow triangle error on the bottom of my page. I have the following javascript code, which basically shows or hides menu items dependent on whether it is intranet,extranet or internet.
function initNiveau1Expandible(paVersion)
{
hideshow('Niveau1ChildProduct')
hideshow('Niveau1ChildApplication')
if (paVersion == "intranet") {
hideshow('Niveau1ChildNonIngredient')
}
if (paVersion != "internet") {
hideshow('Niveau1ChildOverview')
}
if (paVersion != "internet") {
hideshow('Niveau1ChildFormulation')
}
}
This is called in the following code, this code relates to the last if statement above.
<% if Application("Version") <> "internet" then %>
<% if strRegion = "Automotive" then %>
<div id="Niveau1ParentFormulation" onClick="javascript:hideshow('Niveau1ChildFormulat ion')" class="exheading"><img src="images/bt_Formulation.gif" width="154" height="27"></div>
<div id="Niveau1ChildFormulation" style="cursor:auto" class="exindent">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="Formulations.asp?Viewtable=Yes&Region=<%=str Region%>" target="main" onFocus="if(this.blur)this.blur()">Overview</a></td>
</tr>
<tr>
<td><a href="FormulationSearch/searchcontent.asp?Region=<%=strRegion%>" target="main" onFocus="if(this.blur)this.blur()">Search</a></td>
</tr>
</table>
</div>
<%end if%>
<%end if%>
The above bit of code is to call the javascript function if the version is extranet and intranet and if the region is automotive.
As I said the code works fine, but I want to remove the error message. Any idea's
Thanks in advance for any help given
K
|
|

April 26th, 2004, 05:06 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
What error do you get? To see the error message, double-click the yellow triangle.....
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

April 26th, 2004, 05:14 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
If you double click the Yellow triangle, it would give you details about the error.
OR
If your browser is Netscape, then once you browse your page that has errors, then type javascript: in the ADDRESS bar, that would tell you which line and what error it is.
May be you can post that error here, if you are unable to figure it out.
Hope that helps.
-Vijay G
|
|

April 26th, 2004, 06:03 AM
|
|
Authorized User
|
|
Join Date: Nov 2003
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi
Error message
object required
Line 41
However I know that the code here is fine as all the other hide/shows work.
The line causing the problem is <% if strRegion = "Automotive" then %>
If I take this out codes fine no error but then I have the formulation menu in all regions.
This piece of code makes the menu appear for automotive but not in other regions.
I don't get an error message on the automotive page but do on the other regions.
Here is the bit of code above what I have already give you this is from the start so you will be able to see where line 41 sits
Thanks
K
<%
strRegion=Request.QueryString("Region")
%>
<html>
<head>
<title>Contents</title>
<link rel="stylesheet" href="ProductCatalogue.css" type="text/css">
<style type="text/css">
body{ background-image: url(images/filler2.gif);
background-repeat: no-repeat;
background-attachment: fixed;
background-position: left top;
}
a:link { color: indigo; text-decoration: none}
a:visited { color: indigo; text-decoration: none}
a:hover { color: white; text-decoration: none; background-color: #B0203E}
.exheading {font-weight: bold; cursor: pointer; cursor: hand}
.exindent {padding-left: 40px}
.exindent2 {padding-left: 20px}
</style>
<script language="JavaScript">
//begin IE 4+ And NS6 dHTML Outlines
function hideshow(which)
{
if (!document.getElementById|document.all)
{
return
}
else
{
if (document.getElementById)
{
oWhich = eval ("document.getElementById('" + which + "')")
}
else
{
oWhich = eval ("document.all." + which)
}
}
window.focus()
if (oWhich.style.display=="none")
{
oWhich.style.display=""
}
else
{
oWhich.style.display="none"
}
}
//end IE 4+ And NS6 dHTML Outlines
function initNiveau1Expandible(paVersion)
{
hideshow('Niveau1ChildProduct')
hideshow('Niveau1ChildApplication')
if (paVersion == "intranet") {
hideshow('Niveau1ChildNonIngredient')
}
if (paVersion != "internet") {
hideshow('Niveau1ChildOverview')
}
if (paVersion != "internet") {
hideshow('Niveau1ChildFormulation')
}
}
|
|

April 26th, 2004, 06:13 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I am not sure, if this causes the error. but I suspect this line.
if (!document.getElementById|document.all)
Can you check at your end?
-Vijay G
|
|
 |