473,594 Members | 2,757 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"for loop" works in FF but not in IE

In this for loop, IE skips over the animation function until the end of the
loop and only aninmates the last phrase. Firefox does it right. Loop is
right below, entire script is below that. This script uses the Yahoo GUI
library (beta) for animation.

for (var c=0; c < index; c++) {
document.getEle mentById("sampl e").innerTex t = myArray[c];
var myanim = new YAHOO.util.Anim ('sample', {
fontSize: {from: 0, to: 50},
opacity: {from: 0.5, to: 1}
}, 2);
myanim.animate( );

if (c >= myArray.length)
c=0;
};
};
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>test10 </title>
<script language="JavaS cript" type="text/javascript"
src="yui/build/yahoo/yahoo.js"></script>
<script language="JavaS cript" type="text/javascript"
src="yui/build/dom/dom.js"></script>
<script language="JavaS cript" type="text/javascript"
src="yui/build/animation/animation.js"></script>
<script language="JavaS cript" type="text/javascript"
src="yui/build/event/event.js"></script>

<script type="text/javascript">
var myArray = new Array("note 1","note 2","note 3","note 4","note 5");

var index = myArray.length;
var animtest = {};
animtest.init = function() {
for (var c=0; c < index; c++) {
document.getEle mentById("sampl e").innerTex t = myArray[c];
var myanim = new YAHOO.util.Anim ('sample', {
fontSize: {from: 0, to: 50},
opacity: {from: 0.5, to: 1}
}, 2);
myanim.animate( );

if (c >= myArray.length)
c=0;
};
};

YAHOO.util.Even t.addListener(w indow, 'load', animtest.init);
</script>
</head>
<body>
<div id="sample"><sp an id="sampletext " style="font-family:Arial, Helvetica,
sans-serif">SOMETEXT </span></div>
</body>
</html>
--

Patrick Sullivan, AA-BA, BA-IT

Jun 9 '06 #1
3 2241
Patrick Sullivan said the following on 6/9/2006 8:55 AM:
In this for loop, IE skips over the animation function until the end of the
loop and only aninmates the last phrase. Firefox does it right. Loop is
right below, entire script is below that. This script uses the Yahoo GUI
library (beta) for animation.

for (var c=0; c < index; c++) {
document.getEle mentById("sampl e").innerTex t = myArray[c];


Firefox executes that statement without a syntax error? I ask because FF
doesn't support innerText in any form unless you create it yourself.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 9 '06 #2
Randy Webb wrote:
Patrick Sullivan said the following on 6/9/2006 8:55 AM:
In this for loop, IE skips over the animation function until the end
of the
loop and only aninmates the last phrase. Firefox does it right. Loop is
right below, entire script is below that. This script uses the Yahoo GUI
library (beta) for animation.

for (var c=0; c < index; c++) {
document.getEle mentById("sampl e").innerTex t = myArray[c];


Firefox executes that statement without a syntax error? I ask because FF
doesn't support innerText in any form unless you create it yourself.


Sounds like he's not using the javascript console
--
"The most convoluted explanation that fits all the available and made-up
facts is the most likely to be believed by conspiracy theorists"
Jun 9 '06 #3
heheh, firefox did much better than IE. innerText has been incorporated into
several browsers besides IE. I know it's not standards compliant. I am doing
it entirely different now, using innerhtml. Also not standards compliant.
thanks guys.

--

Patrick Sullivan, AA-BA, BA-IT

"Randy Webb" <Hi************ @aol.com> wrote in message
news:Iv******** *************** *******@comcast .com...
Patrick Sullivan said the following on 6/9/2006 8:55 AM:
In this for loop, IE skips over the animation function until the end of the loop and only aninmates the last phrase. Firefox does it right. Loop is
right below, entire script is below that. This script uses the Yahoo GUI
library (beta) for animation.

for (var c=0; c < index; c++) {
document.getEle mentById("sampl e").innerTex t = myArray[c];


Firefox executes that statement without a syntax error? I ask because FF
doesn't support innerText in any form unless you create it yourself.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -

http://www.JavascriptToolbox.com/bestpractices/

Jun 9 '06 #4

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

Similar topics

23
3555
by: Invalid User | last post by:
While trying to print a none empty list, I accidentaly put an "else" statement with a "for" instead of "if". Here is what I had: if ( len(mylist)> 0) : for x,y in mylist: print x,y else: print "Empty list" which was supposed to be:
11
2253
by: Wayne Folta | last post by:
Two observations about PEP-315: 1. It's clever, addresses a definite "wart", and is syntactically similar to try/except. But it's syntax seems like an acquired taste to me. 2. It is a very general construct, which might be what is called for. But I wonder if most of the time it would be used to accomplish something like:
15
2521
by: Robin Eidissen | last post by:
What I try to do is to iterate over two variables using template metaprogramming. I've specialized it such that when it reaches the end of a row ot starts on the next and when it reaches the last row it stops.. At least that's what I thought I did, but VC71 says "warning C4717: 'LOOP<0,1>::DO' : recursive on all control paths, function will cause runtime stack overflow". What's wrong? Here's the code: template<int M, int N>
32
4616
by: Toby Newman | last post by:
At the page: http://www.strath.ac.uk/IT/Docs/Ccourse/subsection3_8_3.html#SECTION0008300000000000000 or http://tinyurl.com/4ptzs the author warns: "The for loop is frequently used, usually where the loop will be traversed a fixed number of times. It is very flexible, and novice programmers should take care not to abuse the power it offers."
6
71958
by: John Pass | last post by:
What is the difference between a While and Do While/Loop repetition structure. If they is no difference (as it seems) why do both exist?
3
1812
by: Dale | last post by:
Access 2000 I am trying to check the form to be sure that required fields are entered. For each required field (Control) I have set the tag property to "1". I am trying to loop through all controls with a tag property of "1", If they are null, I want to stop the loop and setfocus on the control. The below code works Except it will not stop looping when a control is null. It will display the msgBox and then continue to the next...
9
3491
by: haijin.biz | last post by:
why the following program using "char" gives me an infinite loop? If I change char to int, it works fine. #include <iostream> using namespace std; int main(int argc, char** argv) { for(char i=64; i<128; i++ ) cout<<i<<endl;
15
2350
by: Steve | last post by:
I am having problems getting values out of an array. The array is set as a global array and values are pushed into it as they are read from a JSON file using a "for loop". When the "for loop" is finished I want to convert the array into a string which can be used by another function. My attempt to do this is not working. The script looks like this: heights=; function getElevationInter(latv,lngv) { var script =...
8
1707
by: Ratko | last post by:
Say you have something like this: for item in myList: del item Would this actually delete the item from the list or just decrement the reference counter because the item in myList is not associated with name "item" anymore (but still is with myList)? In other words, is "item" a temporary reference to myList or is it actually that reference that myList has stored?
0
8255
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8242
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6665
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3868
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.