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 12 December 2002, 03:07 PM
  #1  
Markus
Scooby Regular
Thread Starter
 
Markus's Avatar
 
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes on 0 Posts
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]
Old 12 December 2002, 03:21 PM
  #2  
SJ_Skyline
Scooby Senior
 
SJ_Skyline's Avatar
 
Join Date: Apr 2002
Location: Limbo
Posts: 21,922
Likes: 0
Received 1 Like on 1 Post
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
Old 12 December 2002, 03:23 PM
  #3  
SJ_Skyline
Scooby Senior
 
SJ_Skyline's Avatar
 
Join Date: Apr 2002
Location: Limbo
Posts: 21,922
Likes: 0
Received 1 Like on 1 Post
Exclamation

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

<A HREF="#" won't be ignored
Old 12 December 2002, 03:41 PM
  #4  
AdrianFRST
Scooby Regular
 
AdrianFRST's Avatar
 
Join Date: Oct 2000
Posts: 368
Likes: 0
Received 0 Likes on 0 Posts
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.
Old 13 December 2002, 01:50 PM
  #5  
Markus
Scooby Regular
Thread Starter
 
Markus's Avatar
 
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes on 0 Posts
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!
Old 13 December 2002, 02:00 PM
  #6  
SJ_Skyline
Scooby Senior
 
SJ_Skyline's Avatar
 
Join Date: Apr 2002
Location: Limbo
Posts: 21,922
Likes: 0
Received 1 Like on 1 Post
Wink

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

Rich
Old 13 December 2002, 02:04 PM
  #7  
Markus
Scooby Regular
Thread Starter
 
Markus's Avatar
 
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes on 0 Posts
Post

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



Quick Reply: Mozilla 1.2.1 and Javascripts



All times are GMT +1. The time now is 10:32 AM.