473,796 Members | 2,483 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript cycling graphic does not work on MAC IE

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

From: robbiehe...@gma il.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="Javas cript" type="text/javascript">
<!-- Hide script from old browsers
myPix = new
Array("../web/bennertestimoni al/$FILE/bennertestimoni al.jpg","../web/cheung*testimon ial/$FILE/cheungtestimoni al.jpg","../web/ttrottestimonia l/$FILE/ttr*ottestimoni al.jpg")

imgCt = myPix.length
function choosePic() {
if (document.image s) {
randomNum = Math.floor((Mat h.random() * imgCt))
document.myPict ure.src = myPix[randomNum]

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

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

Sep 20 '05 #1
3 1612
In article <11************ *********@g44g2 000cwa.googlegr oups.com>,
ro*********@gma il.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)cybers pace.org | don't, I need to know. Flames welcome.
Sep 20 '05 #3
<ro*********@gm ail.com> wrote in message news:11******** *************@g 44g2000cwa.goog legroups.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.image s)
{
randomNum = Math.floor((Mat h.random() * imgCt))

alert("myPix.le ngth: "+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
2700
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 this.
15
1853
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 from another script the javascript window does not open when I click "click me". Is cf writing something kludgy to the browser when I post to it causing the javascript not to execute??
7
21318
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 someone (client) that visits a web site through an anonymous proxy if this person ONLY has JavaScript enabled in their browser? This is NOT a question about PHP, perl, VBScript, Java(.class), or ActiveX. Let us _only_ deal with JavaScript for...
15
4233
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 avaliable at... http://www.geocities.com/binnyva/code/javascript/advanced_tutorial/ If any of you could spare the time, please have a look at my tutorial
136
9460
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 code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to use. The above URL is version 1.0 (draft) that resulted. IMO, it is not a replacement for the FAQ,...
4
1912
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 using the img tag is, "this.form has no properties". Yet it is right beside the input tag that does work with the same OnClick= params
2
15728
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 used is m$ windows..
13
2219
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
2706
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* get a cursor: pointer. Small wonder...
0
9680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
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...
1
10173
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9052
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...
0
5441
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...
1
4116
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
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
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.