EVAL In Imacros For Firefox - Reload URL ?
Nov 30, 2011I 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.
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.
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]....
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 RelatedI've following code that gets values from labels and assigns to variables. code...
it works fine in IE but not in firefox.
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]....
I'm using window.location.reload(true) to refresh the current page. It
works fine in IE but in FF it doesn't seem to work correctly. If I
view the page source, I see that it has been updated, but the display
isn't updated. What's going on?
I have a web page, in a frame set, that has a table-menu bar in javascript.
It relies on the "movein" function attached to "onmouseover" to trigger the
chaninging of the elements background color, text color, and pointer when
the mouse moves over an element. On IE the code below works fine. In
firefox none of the movein function doesn't seem to be triggered (none of
the above effects occur) UNLESS I force a reload of the frame. Then
everyting works fine. Any ideas? Code:
To enhance user experience on my site, I've moved a few page elements (well, the ads...) to the end of the page (in a hidden div) and when the page is loaded the content of such divs are copied to their appropriate location on the page. This makes the content load much faster and thus not delay the user.So what I did works perfectly with IE/Opera but th FireFox is causes the page to try and reload, which it never succeeds to and so we're stuck with a blank page. So yes, the problem is that there are document.write calls inside those divs which contain script but I cannot change it (google ads / ebay ads)I even tried to use setTimeout() to ensure the content is loaded (and can see that it is) but still when the move is done, the page tries to reload.
HTML side:
...
<div id="xxx_slot"></div>
[code]....
when i closing popup div on firefox 3 not work well,and this my script for reload parent :
window.location.reload();
it work on firefox 4 but on firefox 3, it doesn't work well...
I want to build a form which invokes an ajax-function and therefore the page shouldn't reload.
The problem is I don't want to avoid the autocompletion of the browser. But to save the input i have to submit the form regularly, which means 'onSubmit="return false;"' doesn't work.
Is there any possibility or is this technique just impossible?
This is the current code, which works fine, but the browser doesn't save the (non-)submitted input. (The submit will be invoked by the "getSuggests()"-function.)
I wonder why firefox won't work with this script below, but it works on IE, Safari, and Chrome instead?
Code:
$(document).ready(function(){
$(window).resize(function(){
location.reload();
[Code]....
The reason to reload the page is to reload the google map when the window is being resized.
Here is the link to look at, [URL]
Is there a difference between right clicking an iframe and reloading post reponse vs. using javascript to reload the frame? So far, the javascript route hasn't worked for me. [some context] I am writing a little bookmarklet to help me with the online registrations at my school. Here is the setup.
Load up a page on the domain. Remove all body elements. Insert an iframe. Set iframe to page for class roster search. (in iframe on school search page) Select class search options, POST the form data, and view results in frame. *This works perfectly, but I need to have it refresh results every minute or so. When I use frame.contentDocument.location.reload(true); the frame loses the post data or something and the page is broken. BUT when I just right click on the frame and select "reload frame" it works perfectly. What is the difference between rightclicking the frame and refreshing it like that vs. using javascript to reload the frame?
I have a simple product display with an product image. The product image changes with ajax when i click in a dropdown menu on another color.
Now i added the (beautiful) zoom script cloud zoom. It just works fine but after i click on another color and the product image reloads the script does not work anymore. instead my <a> is just a normal <a>.
This is the part that reloads at all:
How can i reload the function when this part reloads? Or what else could i do?
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);
}}
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?
how comes the following doesnt work
fieldNotes2=eval("Message.notes["+id2+"]");
i believe it's because of the [] but i need to keep them!
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?
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:
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.
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.
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);
}
}
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()?
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>
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?
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]..
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.