Click to See Complete Forum and Search --> : Error message explanation?


cyberchimp
12-16-2002, 04:26 AM
My site has a set of thumbnails, each of which produces a small pop-up when you click on it: http://www.researchatleeds.co.uk/gallery.htm.

Everything works fine - in IE, NN and Opera - except that if I turn on the 'report javascript errors' options, I get the following error whenever I click on one of the thumbs:

Internet Explorer:
line 10, character 1
Error: 'window.scrollbars' is null or not an object

Opera:
Error:
name: TypeError
message: Value on left hand side of '.' is not convertible to Object: window.scrollbars

It seems that it may be something to do with the line of javascript which turns off scrollbars in NN6 (though I'm not sure). Is the error anything I need to worry about, and if so, how do I fix it?
Many thanks

swon
12-16-2002, 04:46 AM
Hi,

<a href="javascript:;" onClick="MM_openBrWindow('gallery/tado.htm','anger','width=578,height=285')">

try it with this one:

<a href="javascript:;" onClick="window.open('gallery/tado.htm','anger','width=578,height=285,scrollbars=no')">

then you can delete the following window settings:

<SCRIPT>
window.scrollbars.visible = false; // NN6 bug ignores styles
</SCRIPT>

is not longer needed




Swon

Charles
12-16-2002, 04:46 AM
On my browser your pop-ups don't work at all. You really ought not to make a page that relies upon JavaScript. To be honest I thought that violated the accessibility laws in the UK.

It's just a hunch, but perhaps your problem is that starting at the first character of the tenth line of a certain file you have typed windows instead of window.

cyberchimp
12-17-2002, 04:17 AM
Thanks for your replies, guys.

I've rechecked, and have 'window' through my pop-ups (they are generated using a template), rather than 'windows'. Can anyone suggest another reason for the error message? (And can anyone tell me how to turn on error messages in NN4 or NN7?)

My understanding was that the 'scrollbars=no' option was being phased out, and the style sheet 'BODY {overflow: hidden; scroll: no}' used instead. I had problems using the former (it wouldn't work on Macs, I think), hence my move to the latter (which then required the extra code to sort out NN6's bug). Does your alternative code definitely work with Macs, swon (I'm no longer able to check Macs)?

I'm not aware of any such law, Charles, though I'm concerned that my site might be inaccessible, nonetheless. Could you tell me what browser you're using? And do you know how I might achieve a similar 'pop-up' effect using just HTML? I did as much testing as I could, but hadn't realised some people might not be able to see the pop-ups at all.

Charles
12-17-2002, 04:39 AM
It is my understanding that Part III of the Disability Discrimination Act of 1995 does cover the internet. (http://elj.warwick.ac.uk/jilt/01-2/sloan.html)

I'm using Opera 6.05, but I have the JavaScript turned off. I cannot stand pop-ups and sites resizing my windows but some people find JavaScript incompatable with their disabilities. You need to make a page that works as well with as without JavaScripts. If your links looked like the following then you would find that they always worked:

<a href="http://www.w3.org/" onclick="window.open(this.href, 'child', 'height=100, width=100'); return false">W3C</a>

cyberchimp
12-18-2002, 05:04 AM
Many thanks for this link, and for the code. I've used the latter for the very last of the thumbnails currently in the Gallery Credits:
http://www.researchatleeds.co.uk/gallery.htm (http://www.researchatleeds.co.uk/gallery.htm ).
It works a treat for all browsers except NN4, which seems to ignore the stated dimensions and displays the 'pop-up' as a normal, full-sized screen instead. Do you know how to make the code compatible with NN4 as well?

vishu_gupt
12-18-2002, 05:37 AM
Hi, I read all posts. I will suggest you to use these lines for a popup without scrollbars and menu.

--------------------------------------------------------------
Use this in <HEAD></HEAD> part

<script language="javascript">
function WOpen(FILEURL)
{
window.open(FILEURL , '' ,'menubar=no,toolbar=no,location=no,resizable=no,scrollbars=no,status=no,width=450,height=200,top=18 6,left=240');
}
</script>

now USE BELOW LINE IN YOUR HYPERLINK

<a href="javascript:WOpen('FILEPATH');">[[Image url]]</a>

Hope this will solve your problem.

Charles
12-18-2002, 05:42 AM
Originally posted by vishu_gupt
Hi, I read all posts. I will suggest you to use these lines for a popup without scrollbars and menu.

--------------------------------------------------------------
Use this in <HEAD></HEAD> part

<script language="javascript">
function WOpen(FILEURL)
{
window.open(FILEURL , '' ,'menubar=no,toolbar=no,location=no,resizable=no,scrollbars=no,status=no,width=450,height=200,top=18 6,left=240');
}
</script>

now USE BELOW LINE IN YOUR HYPERLINK

<a href="javascript:WOpen('FILEPATH');">[[Image url]]</a>

Hope this will solve your problem. Having read the posts it is your ascertion that he should intentionally make a page that is unnecessarily inaccessible to 12% of users and that makes him vulnerable to legal action. I am strongly of a different opinion.

cyberchimp
12-18-2002, 05:44 AM
Thanks for this, vishu_gupt. I don't think Charles will like it though.... : )

BTW, should that be

top=186,left=240

What do these values actually do?
Thanks again

cyberchimp
12-18-2002, 05:45 AM
Told you. Any ideas on that NN4.8 issue, Charles, using the code that you suggested?

vishu_gupt
12-18-2002, 05:50 AM
Hi,
Top parameter tells the location of the popup from top of the screen and left parameter tells the position from left of the screen.

What is the NN4.8 issue.? Can you explain it clearly.

Thanks
Vishal Gupta

cyberchimp
12-18-2002, 06:21 AM
Thanks vishu_gupt. So if I leave out these values altogether, the 'pop-up' will appear at the top of the screen?

The NN4 'issue' is as follows: I've used the code that Charles provided for the very last of the thumbnails on my page: http://www.researchatleeds.co.uk/gallery.htm (its an image by Jodie Davis). It works perfectly, just like the code used for all the other thumbnails on the page (but without the Javascript), except that if you view the page using Netscape Navigator 4 (I'm using version 4.8 for test purposes) the 'pop-up' isn't 578 pixels wide and 278 pixels high, as I have specified, but appears as a full-sized window instead. Any ideas how I can make sure that the 'pop-up' is the right size in all browsers?

I'm convinced by Charles' argument against using Javascript (especially since I don't need to use it for this particular task) but ideally I'd like the page to look right for both non-Javascript users and Netscape users.

BTW, though I know we've moved away from my original post somewhat, I'd still like to know why I was getting an error message with my original code. Anyone know?

Charles
12-18-2002, 06:22 AM
Originally posted by cyberchimp
Told you. Any ideas on that NN4.8 issue, Charles, using the code that you suggested? That's a strange browser bug there. I'm still trying to track down what's going on, but in the mean time you can substitute this.href for its value. That will work.

'top' and 'left' are MSIE specific. For Netscape you have to add 'screenY' and 'screenX'.

cyberchimp
12-18-2002, 06:34 AM
Erm, sorry Charles, I'm a bit of a beginner - where do I put this.href? Could you reproduce your original code with the alteration. Many thanks.

Charles
12-18-2002, 06:42 AM
Originally posted by cyberchimp
Erm, sorry Charles, I'm a bit of a beginner - where do I put this.href? Could you reproduce your original code with the alteration. Many thanks. Using your example, change:

<a href="gallery/jd_03.htm" onclick="window.open(this.href, 'jd03', 'height=278, width=578'); return false">

to

<a href="gallery/jd_03.htm" onclick="window.open('gallery/jd_03.htm', 'jd03', 'height=278, width=578'); return false">

vishu_gupt
12-18-2002, 06:44 AM
[QUOTE]Originally posted by cyberchimp
[B]Thanks vishu_gupt. So if I leave out these values altogether, the 'pop-up' will appear at the top of the screen?

The NN4 'issue' is as follows: I've used the code that Charles provided for the very last of the thumbnails on my page: http://www.researchatleeds.co.uk/gallery.htm (its an image by Jodie Davis). It works perfectly, just like the code used for all the other thumbnails on the page (but without the Javascript), except that if you view the page using Netscape Navigator 4 (I'm using version 4.8 for test purposes) the 'pop-up' isn't 578 pixels wide and 278 pixels high, as I have specified, but appears as a full-sized window instead. Any ideas how I can make sure that the 'pop-up' is the right size in all browsers?
[QUOTE]

You can put top=0 and left=0 to get the pop on top of the screen. Have you tried the code i have posted. I think it will solve your NN4 issue.

cyberchimp
12-18-2002, 07:10 AM
I've tried this, Charles, but I'm still getting the same problem with NN4, I'm afraid.

I don't really mind where the 'pop-ups' appear - I'm happy (and feel its perhaps safer, given the huge range of screen sizes and resolutions) to use the browser defaults.

I must admit I've not yet tried your solution vishu_gupt. (My original code, which used Javascript, didn't have this NN4 problem either.) I seem to have been presented with a choice between 'pop-ups' which appear at the right size (but don't appear at all for non-Javascript users), or 'pop-ups' which are guarranteed to appear (but really mess up users of NN4).

Charles
12-18-2002, 09:39 AM
Somethig strange is going on then. The second version worked fine for me in NN 4.7 someting or other. I'm away from a Netscape enabled computer at the moment, but I'll get back to this.

If you use the <a href="javascript:... method then you will have trouble with MSIE 6, Netscape 6 and Opera 6.

cyberchimp
12-20-2002, 03:10 AM
Any joy with that NN4 bug, Charles?

Charles
12-20-2002, 12:18 PM
It's always a joy to learn new things. And today we learned that Netscape 4 really is as buggy as people say. I've tried all the possibilities; there simply is no accessible way around that bug. Mind you, it's hardly fatal error if your pop-up window is bigger than you had wished for 1% of you users. It's a choice worthy of Hobsen: on the one hand you can have it work OK for the 1% that are NN4 users and the 12% of the enlightned and JavScript free and on the other hand you can have it work exactly right for those 1% that are NN4 users but not at all for the legally protected, JavaScript free 12%.

cyberchimp
12-20-2002, 12:52 PM
Hmmm, this wasn't the result I was hoping for, I must admit. The problem is a little more serious than it sounds since, if the window is full-sized, users can see the 'Go to the Art & Design Research @ Leeds Gallery Credits' link (which is in there in case anyone arrives at a 'pop-up' from outside the site). If they click on this link, they will get trapped inside a version of the site without a browser address or tool bar.

The most recent statistics I've been able to find for browser use puts NN4 at about 2% (see http://www.thecounter.com/stats/2002/November/browser.php) - does anyone know of a better site for up-to-date browser stats?) I know this isn't a lot, but I so wanted to site to be accessible to all.

Thanks to everyone who posted in this thread. I never did find out what was wrong with my original Javascript, but, as Charles has pointed out, we all learnt something today. And now I need to make some hard decisions...