473,396 Members | 2,009 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,396 software developers and data experts.

javascript cycling graphic does not work on MAC IE

1. robbiehe...@gmail.com Sep 19, 1:48 pm show options

From: robbiehe...@gmail.com - Find messages by this author
Date: Mon, 19 Sep 2005 10:48:50 -0700
Local: Mon, Sep 19 2005 1:48 pm
Subject: javascript cycling graphic does not work on MAC IE
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Remove | Report Abuse

I built this page for my company's corporate website
(http://www.otpp.com/web/website.nsf/...uates&students)
The second graphic down in the content area is a cycling graphic. Upon
page reload one of 3 banner graphics randomly loads on the page.
I works on all browsers that i can get my hands on for pc and mac
except ie for mac.
Can someone help me to figure out why it doesn't work and provide a
solution for me?
Thanks
Here is the code
jsheader:
<script language="Javascript" type="text/javascript">
<!-- Hide script from old browsers
myPix = new
Array("../web/bennertestimonial/$FILE/bennertestimonial.jpg","../web/cheung*testimonial/$FILE/cheungtestimonial.jpg","../web/ttrottestimonial/$FILE/ttr*ottestimonial.jpg")

imgCt = myPix.length
function choosePic() {
if (document.images) {
randomNum = Math.floor((Math.random() * imgCt))
document.myPicture.src = myPix[randomNum]

}
}
// End hiding script from old browsers -->
</script>

body tag:
onload="choosePic()"
image tag:
<img src="../web/spacer/$FILE/spacer.gif" width="565" height="177"
alt="" border="0" name="myPicture">

Sep 20 '05 #1
3 1591
In article <11*********************@g44g2000cwa.googlegroups. com>,
ro*********@gmail.com wrote:
The second graphic down in the content area is a cycling graphic. Upon
page reload one of 3 banner graphics randomly loads on the page.
I works on all browsers that i can get my hands on for pc and mac
except ie for mac.

Is IE for Mac important to you? It's ancient, and practically no one uses it
anymore.

--
Sandman[.net]
Sep 20 '05 #2
Sandman <mr@sandman.net> wrote:
Is IE for Mac important to you? It's ancient, and practically no one uses it
anymore.


Unfortunately (for me at least), there are still people running Mac OS
9 and below using IE 5.1.7; they occasionally bring its bloated
carcass to our website, and I have to step carefully around its
innumerable stupid quirks. Whether one wishes to cater to the
wretched souls still running these browsers is a matter of personal
taste, but they do exist.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Sep 20 '05 #3
<ro*********@gmail.com> wrote in message news:11*********************@g44g2000cwa.googlegro ups.com...
I works on all browsers that i can get my hands on for pc and mac
except ie for mac.


I assume js and error reporting were enabled.

When you reference an image, it's safer to do so via document.images
but that may not be the problem.

I suggest alerting the length of the array, the value returned by
Math.random and the resolved source path:

function choosePic()
{
if (document.images)
{
randomNum = Math.floor((Math.random() * imgCt))

alert("myPix.length: "+myPix.length+'\n\nrandomNum: ' + randomNum +"\n\nsrc=" + myPix[randomNum]);

document.images['myPicture'].src = myPix[randomNum];
}
}

--
S.C.

Sep 20 '05 #4

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

Similar topics

20
by: Joe exCSSive | last post by:
Hi, folks: I'm back...and now I'm really stuck !! I have a graphic ( http://www.sundialontario.com/images/makeitatable.jpg ) that I would like to convert to CSS and I'm not sure how to do...
15
by: Michael Hill | last post by:
I have this cf script below where the javascript in it works perfectly i.e. a new window opens when I press 'click me' when I call it up using the url in the browser. But when I "POST" to it...
7
by: Privacy Advocate | last post by:
//crossposted to: comp.lang.javascript, alt.comp.lang.javascript in an effort to get factual answers from JavaScript experts// Simply put; Is it possible to obtain the real (actual) IP address of...
15
by: binnyva | last post by:
Hello Everyone, I have just compleated a JavaScript tutorial and publishing the draft(or the beta version, as I like to call it) for review. This is not open to public yet. The Tutorial is...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
4
by: Notgiven | last post by:
This works: <input type="button" value="Add to list" onClick="addOption(param1, param2);"> But this doesn't: <img src="images/add.gif" onClick="addOption(param1, param2);"> The error I get...
2
by: xander.zone.3x | last post by:
How can we download data in tables in a html page into a csv file using client side Javascript. I should click a button and a table's data should be downloaded into a csv in local drive. The os...
13
by: Prisoner at War | last post by:
I know about the * * style="cursor: pointer; cursor: hand;" * * attribute of the <imgtag, but is there a way JavaScript can "load in" one's own graphic for such events?? How? TIA!
7
by: Gregor Kofler | last post by:
Prisoner at War meinte: (a) This has nothing to do with JS. (b) This is not a fallback. You just overwrite your custom-pointer property with the standard one. In your case you will *always*...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.