473,385 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Another JScript eval bug

According to MSDN: "new variables or types defined in the
eval statement are not visible to the enclosing program."

However, in some cases under IIS 5, this is not the case.
Try the following program:
eval("var z = 12; 5;");
Response.Write(z);

According to the documentation this should be an error;
however, it prints "12".
Jul 19 '05 #1
1 1381
Bryan Mills wrote on 31 mei 2004 in
microsoft.public.inetserver.asp.general:
However, in some cases under IIS 5, this is not the case.
Try the following program:
eval("var z = 12; 5;");
Response.Write(z);

According to the documentation this should be an error;
however, it prints "12".


eval is the root of all evil, take it away....
[IE clientside tested:]

a=eval("z = 12");
document.write(a); // 12
a=eval("var z = 12");
document.write(a); // undefined


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bryan Mills | last post by:
The eval function in JScript doesn't work according to spec. Specifically, the function C() on page 73 of the ECMA-262 spec doesn't return the function object correctly under IIS 5. Binding the...
2
by: CGuy | last post by:
Hi, I need to use the Eval function of JScript in my C# code. I was thinking that I could write this as a seperate JScript.NET file, compile it as a .NET module and then later link it with my C#...
0
by: Bassem | last post by:
Hi All, I create Jscript Dll to evaluate string expression in C# program. The Jscript code : class JScriptEval { function Evaluate(evalString : String) { return eval(evalString);
2
by: moondaddy | last post by:
I'm using vb.net and have an aspx page where I want to call a function in the code behind to do something on the backend and I want to call this function from a jscript function in the aspx page. ...
1
by: perper | last post by:
Cannot use 'jscript' because another language has been specified earlier in this page I tring to# include an JScript file into a ASp.net in order to use functions declared in ti on the server...
0
by: ttomic | last post by:
I have asp.net application written in jscript. On POST request, during Page_Load, I receive string which I evaluate using jscript eval method. String looks like: my_fun("arg") where my_fun is...
3
by: Mitch Freed | last post by:
I have been using the JScript eval() method from C# to evaluate conditional logic at run-time. I found that implementing a solution similar to the example posted at:...
2
by: namewitheldbyrequest | last post by:
I created a web service that includes the statement: using Microsoft.JScript; so I can use the eval methods. The Web Service won't build: Error 1 The type or namespace name 'JScript' does...
3
by: suganya | last post by:
Hi Some professionals already has developed the project using menu. In my company, they have given me task to clear the error in that. It is a script file named as "menubarAPI4.js" which is kept...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.