Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Mozilla 1.2.1 and Javascripts

Thread Tools
 
Search this Thread
 
Old Dec 12, 2002 | 03:07 PM
  #1  
Markus's Avatar
Markus
Thread Starter
Scooby Regular
25 Year Member
 
Joined: Mar 1999
Posts: 25,080
Likes: 0
From: The Great White North
Question

Hi,
Just downloaded Mozilla 1.2.1 (for Mac OS X). Looks nice, and renders damn quick.

One problem though, and it could be just because I'm on a macintosh, however, I'll ask here in case it's not just Mac.

Ok the problem is with Javascript.

Sooooo, if anyone is using Mozilla (mac, PC, *nix, or anything!) then can you do me a flavor?

Fire up mozzy and pop over here

right, can you click on each of the pictures and see what happens.

What *should* happen, and does in IE, is it calls a js which opens a bigger image in a new window.

Now this is just not working for me in Mozzy, and I don't know why.

I think it could be the way I'm calling the JS code, hence the two pics, as they have different ways of calling my js function (oh and both DO work in IE)

To make things easier, the code is:

for the top picture
<A HREF="" onClick="openPictureInWindow('../../artwork/cars/exhaust/exhaust.05.06.2002.1.JPG','4040',624,464,' ');"&gt ;<IMG SRC="../../artwork/cars/exhaust/thumbnails/exhaust.05.06.2002.1t.JPG" BORDER=1></A>

for the bottom picture
<A HREF="javascriptpenPictureInWindow('../../artwork/cars/exhaust/exhaust.05.06.2002.1.JPG','4040',624,464,' ') "><IMG SRC="../../artwork/cars/exhaust/thumbnails/exhaust.05.06.2002.1t.JPG" BORDER=1></A>


so, why it no work? am I being really silly here?

Any help appreciated.

[Edited by Markus - 12/12/2002 3:08:29 PM]
Reply
Old Dec 12, 2002 | 03:21 PM
  #2  
SJ_Skyline's Avatar
SJ_Skyline
Scooby Senior
 
Joined: Apr 2002
Posts: 21,922
Likes: 2
From: Limbo
Post

Try removing "function openPictureInWindow" from your included .js file and sticking it local to the page in the header.

dunno if it will work though

Rich
Reply
Old Dec 12, 2002 | 03:23 PM
  #3  
SJ_Skyline's Avatar
SJ_Skyline
Scooby Senior
 
Joined: Apr 2002
Posts: 21,922
Likes: 2
From: Limbo
Exclamation

<A HREF="" - is possibly being ignored - I know that forms with no action are!

<A HREF="#" won't be ignored
Reply
Old Dec 12, 2002 | 03:41 PM
  #4  
AdrianFRST's Avatar
AdrianFRST
Scooby Regular
 
Joined: Oct 2000
Posts: 368
Likes: 0
Post

<a href="#"> will cause it to jump to the top of the page.

<a href="javascript:void(0);"> will generate a link that does nothing.
Reply
Old Dec 13, 2002 | 01:50 PM
  #5  
Markus's Avatar
Markus
Thread Starter
Scooby Regular
25 Year Member
 
Joined: Mar 1999
Posts: 25,080
Likes: 0
From: The Great White North
Post

Right.
Thanks to all helping out on this. Esp Rich who gave me some ASP stuff, which means I can do what I originally wanted to do with my site.

I've also found out what the problem was.

There was a bug in my .js code. Basically it went like this:

var refExpressionObj = /[^./]/;

now, this is what Mozilla did not like. Why? well, it was basically saying to look for a newline char and remove it. When what i wanted to do was to remove any '../' type stuff from a url passed to the fucntion.

However IE seems to have an ickle bug, in that it did NOT look on the '.' for a new line, hence the reason it all worked in IE

I've now changed the code to:

var refExpressionObj = /\w/;

Which basically strips off anything that's not a number or letter. This works in both IE and Mozzy.

Thanks to Jim for his help with this bit!

Phew! now all I have to do is reinstate my old menu system, tinker with the ASP stuff, upload it all, and sit back, and chillll!
Reply
Old Dec 13, 2002 | 02:00 PM
  #6  
SJ_Skyline's Avatar
SJ_Skyline
Scooby Senior
 
Joined: Apr 2002
Posts: 21,922
Likes: 2
From: Limbo
Wink

Told you that you needed to sort out your regular expressions!

Rich
Reply
Old Dec 13, 2002 | 02:04 PM
  #7  
Markus's Avatar
Markus
Thread Starter
Scooby Regular
25 Year Member
 
Joined: Mar 1999
Posts: 25,080
Likes: 0
From: The Great White North
Post

yup! you did! bloomin JS! Maybe when I get round to a bit of C++ coding I'll learn! lol
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
CodeKey@Lisan
Computer & Technology Related
11
Feb 20, 2004 05:23 PM
RichB
Computer & Technology Related
2
Nov 5, 2003 02:27 PM
Iain Young
Computer & Technology Related
11
Sep 15, 2003 02:30 PM




All times are GMT +1. The time now is 08:48 AM.