Loop In EVAL In Imacros For Firefox?
Nov 30, 2011
I need to reload URL (in this case refresh same page) until I don't have word beginning with capitalized A, B or C. I can't find the way to create loop inside EVAL.
Code:
VERSION BUILD=7401110 RECORDER=FX
TAB T=1
URL GOTO=http://watchout4snakes.com/CreativityTools/RandomWord/RandomWord.aspx
[code]....
View 1 Replies
ADVERTISEMENT
Nov 30, 2011
I need to reload URL (in this case refresh same page) until I don't have word beginning with capitalized A, B or C.
I can't find the way to create loop inside EVAL.
View 5 Replies
View Related
Jul 29, 2004
I have a script that uses eval() and it works great under IE but it craps out when eval() is called in firefox. Just ignore all the commented out alerts, it is for testing purposes. Code:
View 2 Replies
View Related
Nov 4, 2009
I've following code that gets values from labels and assigns to variables. code...
it works fine in IE but not in firefox.
View 1 Replies
View Related
May 28, 2011
While doing simple interactive mathematical calculator for my son, i came across some issues. in the beginning i was working on Firefox 4.0.1 Fedora 15 didn't get any issue yet when i switched for google-chrome 11.0.696.68 the script didn't work anymore. i trimmed it down to simplest form possible and here i demonstrate:
<html>
<body>
<script type="text/javascript">
eval("x=10;y=20;document.write(x*y)");
[Code]....
View 2 Replies
View Related
Sep 22, 2009
Below is some very basic html/javascript that asks for a user to enter a number in an input text box and then a button is pressed it writes out a line that number of times. It works, but when run in firefox the pages always seems to continue to load...that is, the cursor is continuously that when a page is loading (an arrow with a little circle) and the status bar in the bottom right hand corner seems to be always be at zero. It seems to be something in the for loop as when this is take out it works. Seems to work in IE however?Is this a FireFox thing or am I not terminating the loop properly?
<html>
<head>
<script type="text/javascript" language="javascript">[code]....
View 6 Replies
View Related
Jul 23, 2005
given that I have a js file included which is written programatically and I
can't change it. I would like to know how to do the following using
something other than the deprecated eval().
whats in the js file
var numArrays=something;
var data0 = new Array();
data0.name="name";
data0.data="some data";
var data1 = new Array();
data1.name="another name";
data1.data="some more data";
etc ....
function getData(arrayName) {
for ( var i=0;i<numArrays:i++) {
var el=eval('data'+i);
if (arrayName = = el.name) doSomething(el.data);
}}
View 4 Replies
View Related
Jul 23, 2005
var fns = ['orde', 'no', 'kml', 'snf', 'td', 'ty', 'tn', ...up to 21
elms...];
var snv = new Array();
var vals = new Array();
for (i = 0; i < N; i++) {
for (j = 0; j < fns.length; j++)
vals[j] = some value;
snv[i] = new makeData(vals);
}
function makeData(vals) {
for (k = 0; k < vals.length; k++)
//the following line doesn't work
eval("this."+fns[k]+"="+vals[k]);
//neither this one
this.eval(fns[k]) = vals[k]);
}
how can i make it without writing it the long way:
this.orde = vals[0];
this.no = vals[1];
this.kml = vals[2];
and so on?
View 7 Replies
View Related
Nov 16, 2006
how comes the following doesnt work
fieldNotes2=eval("Message.notes["+id2+"]");
i believe it's because of the [] but i need to keep them!
View 9 Replies
View Related
Jan 28, 2004
I've made a funny program using eval()...it will let the person(on the page) to write javascript and have it compile(if thats the right word for it)! its quite cool, i dont know how handy it might be, but here it is none the less...
code:
<html>
<head>
<title>test</title>
<script language="JavaScript">
function submitCode(){
var the_code = window.document.form_1.textarea_1.value;
var run_the_code=eval(the_code);
}
</script>
</head>
<body>
<center>
<h1>write some code!</h1>
<form name="form_1">
<textarea name="textarea_1" rows=10 cols=40>
</textarea>
</form>
<form onSubmit="return false;">
<input type="submit" value="submit your code" onClick="submitCode();">
</form>
</center>
</body>
</html>
very simple stuff, but for those of you who are unfamilir with eval, its pretty cool, huh?
View 3 Replies
View Related
Aug 23, 2005
I'm having some weird problem with evaluating the continue statement.
Within a for loop I'm trying to evaluate a string (generated somewhere
earlier) which basically has the continue statement in it. IE6 seems to
have major problems with that as it generates an error "Can't have
'continue' outside of loop". Does anyone know why and/or have a
workaround? I haven't tried any other browser since this one is the
only one available (company policy).
I have included some code to reproduce this behaviour. The first and
second if statements of the testeval function behave as expected. The
third one however produces the mentionned error. Code:
View 6 Replies
View Related
Feb 2, 2006
I am trying to do the following but i get an error, is there no way i
can use eval to print have it assigned to a predeterminded variable.
eval (object_name + "_CalCalendar") = new CalendarPopup(object_name);
Cannot assign to function result.
View 2 Replies
View Related
Apr 17, 2006
Here is my code.
function CallDisplay()
{
nodeobj=new mynode();
x="displayId("+nodeobj+")";
eval(x);
}
function displayId(node)
{
alert(node.myid);
}
function mynode()
{
this.myid="aa";
}
In CallDisplay() I am getting the error as "Microsoft JScript
Compilation error ']' expected". Any one can suggest me how to
overcome this.
View 8 Replies
View Related
Aug 30, 2006
I'm running some javascript over a server side generated web page
and have multiple generated empty select statements, that I want to
populate when the page is loaded. As HTML doesn't do arrays each
select is individually named withe MySelecti where i is an incremental
from 1.
I know all my variables are correct (i, OptionsCount) and my arrays
of MyValues and MyDescription's exist for multiple enteries and if I
bring out an example of what I thought each line would eval too( say
document.MyForm.MySelect1.options[1]=new
Option('Value1','Description1') the line works fine, for the life of me
(i'm sure I'm missing something obvious) the eval line won't eval..
for(i = 1; i<=row; i++) {
for (j = 1; j <=OptionsCount; j++) {
eval="document.MyForm.MySelect"+i+".options["+j+"]=new
Option('"+MyValues[j]+"', '"+MyDescription[j]+"')";
eval(eval);
}
}
View 3 Replies
View Related
Nov 23, 2006
I am trying to assign an "onclick" event to a dynamically-created DOM
element (an image).
I have read countless times that "eval()" is to be avoided at all costs.
However, I cannot seem to get my new onclick to work without it.
Here's what I have so far:
myeval = 'detachFile(this);'
detachImage = getElementById('detach-jfhahhf');
detachImage.onclick = function() { eval(myeval) }
This works perfectly fine for me, but this is a web-app that will be
exposed to public users, and I obviously don't want them being able to
eval anything if i can help it.
Can that be done without the eval()?
View 6 Replies
View Related
Sep 8, 2002
i came up with the following, to help me test the syntax of functions while i'm writing them. i've only been using it for a day or two, but so far, it's been really handy.
<HTML>
<HEAD>
<TITLE>Evaluator</TITLE>
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<BODY>
<FORM>
<TABLE WIDTH="100%" HEIGHT="100%">
<TR>
<TD COLSPAN="2" HEIGHT="100%"><TEXTAREA NAME="script" STYLE="width: 100%; height: 100%"></TEXTAREA></TD>
</TR>
<TR>
<TD ALIGN="CENTER"><INPUT TYPE="BUTTON" VALUE="eval" OnClick="eval(this.form.script.value);"></TD>
<TD ALIGN="CENTER"><INPUT TYPE="RESET" VALUE="clear"></TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
View 2 Replies
View Related
Apr 12, 2006
In Visual Basic this is easy to do, but I'd like to do it in JavaScript (without writng my own).
I'd like to put a text box on a form so the user can type something like:
3+5*(sin(90))^2
and have the answer to the equation displayed.
I guess it would be possible to translate it into a javascrip command
x=Math.pow(3+5*(Math.sin(90)),2) and then execute the translated line using Eval(x);, but maybe there's an easier way. Any thoughts?
View 2 Replies
View Related
Nov 3, 2010
I have a script that will loop through all the INPUT elements of a form; if the input is a submit it will disable the submit (or enable the submit, depending upon what is passed to the function.) I hate using eval() - I avoid it whenever I can! Is there a better way to dynamically process the ".disabled = 'true'/'false';" portion?
[Code]..
View 7 Replies
View Related
Aug 29, 2009
this is the code I'm working on:
Code:
var tabs = new Control.Tabs('menu');
var pattern = 'tab=';
var nStr = location.href;
if(nStr.match(new RegExp (pattern,'gi'))){
var id = nStr.split(pattern);
[Code]...
It searches for the query string 'tabs=' and then splits the result to get the id of the tab. Then it uses this to set the active tab. If the url doesn't include the query string it set the tab to the first one.
The code works but it uses Eval to convert the id string (id[1]) to a variable and I was wondering if there was an alternative.
View 2 Replies
View Related
Jan 22, 2011
I have been looking at this code for two evenings now, and rewrote it 4 times already. It started out as jQuery code and now it's just concatenating strings together.
What I'm trying to do: Build a menu/outline using unordered lists from a multidimensional array.
What is happening: Inside the buildMenuHTML function, if I call buildMenuHTML, the for loop only happens once (i.e. only for 'i' having a value of '0'.) If I comment out the call to itself, it goes through the for loop all 3 times, but obviously the submenus are not created.
Here is the test object:
test = [
{
"name" : "Menu 1",
"url" : "menu1.html",
"submenu" : [
[Code].....
'Menu 2' and 'Menu 3' don't show up! I'm sure it's something small that I'm overlooking.
View 2 Replies
View Related
Aug 4, 2011
I'm looking to send a loop variable (i) to a function inside the loop, but I can't seem to get it to use the value I want, it keeps making it a reference of i and therefore the function is always called using the last value of i rather than the one it was set with.
So if i have 5 Tabs then Tab 1, when clicked, should call DefaultTabClick(0) and so on rather than always using 4 for any of the tabs.
View 2 Replies
View Related
Jan 14, 2006
I am try'g to send window.location.href to the server script who will
generate dynamic javascript according to the referral name comg in as
param:
<script language="javascript" src="NO JAVASCRIPT CAN BE USED HERE" />
So I am see'g If I can use eval todo something what I am doing
I have tried almost everything, following is being last one ....
View 21 Replies
View Related
Dec 26, 2006
I want to implement the template for a object output. I have two methods as follow:
View 1 Replies
View Related
Feb 19, 2007
I have this particular problem with eval() when using Microsoft
Internet Explorer, when trying to define an event handler. This is the
code:
function BigObject()
{
this.items = new Array();
this.values = new Array();
this.addItem = function( item )
{
this.items[this.items.length] = item;
}
this.makeHandlers()
{
var i, length = this.items.length;
for ( i = 0; i < length; i++ )
this.items[i].onclick = function()
{ alert( this.values[i] ); };
}}
However, this last code (makeHandlers() method) doesn't work since the
expression "this.values[i]" automatically belongs to this new
anonymous function, and therefore isn't valid (since the new anonymous
function(s) don't have the "values" attribute. So I tried the
following:
this.items[i].onclick = eval( "function() { alert( " +
this.values[i] + "); }" );
and it worked! ... in Firefox only :( Internet explorer returns
"undefined" for eval( "function() { /* whatever */ ); } " ), for the
same things Firefox perfectly understands, and if I try to make it a
handler, an exception is fired in IE. What do I do? Did I come to the
right conclusion with IE or am I making a banal mistake? Do I need to
find another way of solving this or is there a fix to this solution?
View 7 Replies
View Related
Feb 10, 2011
I have a website that allows users to enter complex mathematical formulas into a text field and evaluates them.
I am currently using eval() because it not only can handle all the standard mathematical functions, but also gives them access to the Math object. That way the users can use functions such as Math.max() and everything else.
I realize, though, that using eval is evil, I assume because a malicious user might throw in some more damaging javascript that would be run without checking it. (That's why eval is evil, right?)
Is there a way that I can allow my users to construct complex mathematical formulas and use the Math object (or an equivalent) without potentially opening my site up to harm?
View 3 Replies
View Related
Jul 6, 2011
in IE9 Browser list of country names sorting on keys. we are using Ajax javascript:
var data= remoteRequest(url);
the data like
data={" 11":"Australia"," 14":"Bermuda"," CAN":"Canada"," 12":"France"," 15":"Germany"," IND":"India"," 16":"Russia"," 13":"South Africa"," 10":"UK"," USA":"United States"}
[Code]....
how to stop the array sorting in IE9.
View 3 Replies
View Related