Forum Moderators: open

Message Too Old, No Replies

JavaScript on Macintosh issue

Problem in IE and Safari

         

surfgatinho

4:04 pm on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi
Trying to populate a drop down menu with dates. Works fine in Windows but not on Macs. Code is:

<script>document.write(week1.getDate() + " " + monthname[week1.getMonth()] + " " + week1.getYear());</script>

Placed between option tags in select object.

Any ideas
Thanks in advance
Chris

BlobFisk

4:15 pm on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try:

<script type="text/javascript">

The Mac probably wants to know exactly what scripting language is being used.

surfgatinho

12:11 pm on Sep 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



BlobFisk, thought you might have been on to something there, those attributes should be in there anyway really.
Unfortunately it didn't solve the problem. I checked it in Safari and IE on a Mac and slightly different output but both didn't parse the script properly and IE just spat out the raw code.

Any ideas?

BlobFisk

10:58 am on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried put the script call in another part of your page to see if it works? It may be that it is between <option> tags....

I wonder if it could be something to do with your main script. Have you made sure that your variables (eg week1) are global, rather than local, variables?

What sort of error are you seeing?

mikejson

2:43 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



You could make your script print the option tags... instead of putting the option tags around the script. That would eliminate that as being the problem.

I would try your script printing and check your source code. Is it truly printing what you want it to print?

I think you may have a syntax error. Just check it out closely

BlobFisk

4:39 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




monthname[week1.getMonth()]

What is this doing?

surfgatinho

7:30 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There's an array of English monthnames and this references the relevant one.
I'll try writing the entire select box in JavaScript and see what happens.
Unfortunately I only get to try this on a Mac every other day!

BlobFisk

10:09 am on Sep 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What error are you getting?

amznVibe

10:36 am on Sep 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Fire up Mozilla on the Mac, it has a very nice javascript console and debugger.

There are versions for os 8.6, 9 and X