Kamala Harris - Wordpress Themes - Manga - Online Advertising - Debt Consolidation

PDA

View Full Version : Need yours help about javaScript in ASP (1)


john_vn
Oct 27th 2005, 7:57 pm
This code cannot run
CODE JavaScript:

var cookieKey = null;
var cookieItem = null;
for (cookieKey in Request.Cookies)
{
if (Request.Cookies(cookieKey).HasKeys)
for (cookieItem in Request.Cookies(cookieKey))
Response.Write(Request.Cookies(cookieKey)(cookieItem));
else
Response.Write(Request.Cookies(cookieKey));
}

while this code runned :
Code VBScript:
Dim cookieKey;
Dim cookieItem;
for each (cookieKey) in Request.Cookies
if (Request.Cookies(cookieKey).HasKeys then
for each cookieItemin Request.Cookies(cookieKey)
Response.Write(Request.Cookies(cookieKey)(cookieItem))
next
else
Response.Write(Request.Cookies(cookieKey))
end if
next

How can i repair this code in JavaScript to run as same as VBScript????
Thanks
John

factorysealed
Oct 27th 2005, 8:18 pm
Try this:

<%
Dim cookieKey
Dim cookieItem
for each cookieKey in Request.Cookies
if Request.Cookies(cookieKey).HasKeys then
for each cookieItemin in Request.Cookies(cookieKey)
Response.Write(Request.Cookies(cookieKey)(cookieItem))
next
else
Response.Write(Request.Cookies(cookieKey))
end if
next
%>

john_vn
Oct 27th 2005, 8:36 pm
Oh, Sorry i type wrong.
My VBscript is correct and run well.
But my JavaScript code has a problem, i cannot run it.
I dont know what error it has.???
Please help me to debug my JavaScript code.

factorysealed
Oct 27th 2005, 8:45 pm
hmm... i'm not to good with Javascript...

There is a typo in your code though:
You have:
" for (cookieKey in Resquest.Cookies) "

It should be:
" for (cookieKey in Request.Cookies) "

You've got an extra "s" in "Request"

Hope that works out for you.

john_vn
Oct 27th 2005, 8:47 pm
Oh,it just another my type wrong there.
So,i change it.
And anybody can help me?

omgitapro
Oct 27th 2005, 10:06 pm
did it work for <%
Dim cookieKey
Dim cookieItem
for each cookieKey in Request.Cookies
if Request.Cookies(cookieKey).HasKeys then
for each cookieItemin in Request.Cookies(cookieKey)
Response.Write(Request.Cookies(cookieKey)(cookieItem))
next
else
Response.Write(Request.Cookies(cookieKey))
end if
next
%>
?? if not try google it for the problem