p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

proasp_codeclinic thread: How do I call a cookie and a piece of JAVAScript???

Message #1 by jprentice@e... on Fri, 18 May 2001 16:03:46
Hey everyone,

I have a piece of code within an html table that calls a cookie and some 

At the top of the page is the Javascipt:


<script language="JavaScript" src="dhtmllib.js"></script>
<script language="JavaScript" src="navbar.js"></script>
<script language="JavaScript">

var myNavBar = new NavBar(966);
var tempMenu;
("#000000", "#ffffff", "#000000", "#ffff66", "#A80339", "#ffffff", "#A80339
", "#ffff66", "#000080");

tempMenu = new NavBarMenu(110, 110);
tempMenu.addItem(new NavBarMenuItem("Home", "welcome.asp"));
tempMenu.addItem(new NavBarMenuItem("ESI International", "http://www.esi-


function init() {
  var img;
  // Find the position of the embedded image and move bar accordingly, note
  // that we have to adjust for the table's cell padding.
  img = getImage("placeholder");
  myNavBar.moveTo(getImagePageLeft(img) - 2, getImagePageTop(img) - 2);

.//and then I create a similar piece of code but name it differently in 
the function, as follows://.

var myNavBar2 = new NavBar(966);
var temp2Menu;


function init() {
  var img;
  img = getImage("placeholder2");
  myNavBar2.moveTo(getImagePageLeft(img) - 2, getImagePageTop(img) - 2);

...then later in the html code I call the cookie and incorporate the 

  <%if Request.Cookies("Cookie") = "1" then%>
    <td><img name="placeholder2" align="center" border=0 
src="dscript42/transparent.gif" width=1 height=22></td>
    <td><img name="placeholder" align="center" border=0 
src="dscript42/transparent.gif" width=1 height=22></td>
 <%end if%>

the cookie isn't taking.  the first option (b/w the if and else statments) 
always appears.  Does anyone have any idea how to do this?


  Return to Index