Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help with jscript syntax for writing simple cookie

Posted on 2009-07-15
3
Medium Priority
?
459 Views
Last Modified: 2012-05-07
After consulting several recommended tutorials on cookies, I came up with the following line for putting the value of the variable shipWeight into a simple cookie, for debugging purposes.

document.cookie = "shipWeightCookie="+shipWeight;

Unfortunately, it "breaks" the code.  The function runs OK (although without the desired result) when this line is commented out.

Could someone tell me what is wrong with this syntax?
The examples in tutorials generally assume you want to write an explicit string value to the cookie rather than the value of a variable.
0
Comment
Question by:netsmithcentral
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 12

Author Comment

by:netsmithcentral
ID: 24865385
I suspect the problem may be

<script language="JScript" type="text/jscript" runat="server">

just above the function.

The function must run server side.  Does this preclude writing a cookie?

How else can I get variable data out of the function for debugging purposes?
I could find no information on writing session variables directly out of jscript.  Most say can't be done because it runs client side.
However, this function explicitly runs server side.
0
 
LVL 12

Accepted Solution

by:
netsmithcentral earned 0 total points
ID: 24897117
Once I determined that the function would return a number, if I replaced the designed return value with that number,
I was able to debug the jscript "runat server" script by replacing the designed Return value of the function with different variable values from within the function.

This is the kind of thing that is obvious after it is pointed out.
0
 
LVL 12

Author Comment

by:netsmithcentral
ID: 24897132
Question should have been reframed as query about debugging techniques to use with jscript runat server function.
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An overview of cyber security, cyber crime, and personal protection against hackers. Includes a brief summary of the Equifax breach and why everyone should be aware of it. Other subjects include: how cyber security has failed to advance with technol…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question