Topic: a couple of ?'s (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=9603" title="Pages that link to Topic: a couple of ?&amp;#039;s (Page 1 of 1)" rel="nofollow" >Topic: a couple of ?&#039;s <span class="small">(Page 1 of 1)</span>\

 
coregraphics
Nervous Wreck (II) Inmate

From: Kansas, USA
Insane since: Jan 2003

posted posted 02-20-2003 21:49

I am needing some help on a couple of questions.
-What is the best way to designate font sizes so that they will appear kind of universal over different browsers and resoulutions. Is it using points, pixels, or values like, large, small, xx-small?

I also have a window.open script on one of my pages but with different browsers it looks odd. Like in one the image fits perfectly but in another browser it may be off 10 pixels on the right. Also in a chimera browser it opens the new window but the window behind it goes to another page that says: [object window]. Any suggestions as to why it is doing this? The open.window code I am using is:

<a href="javascript:window.open('sterling575.html','sterling575','titlebar=yes,status=yes,scrollbars=no,width=585,height=345')">

What am i doing wrong?



[This message has been edited by coregraphics (edited 02-20-2003).]

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 02-20-2003 22:17

Question 1: http://www.alistapart.com/stories/sizematters/

Question 2: Dunno, might be a CSS problem?

Question 3: Please see http://www.ozoneasylum.com/Forum2/HTML/001964.html for a discussion of the "void" operator.

coregraphics
Nervous Wreck (II) Inmate

From: Kansas, USA
Insane since: Jan 2003

posted posted 02-20-2003 22:35

Thanks for the link about the font size (cute title). It seems getting this font thing squared away is going to take quite a bit of thinking on my part.

As far as the void thing, well I kind of understand. It happens in opera too btw. Anyway so do I rewrite it like this:

<a href="javascript:void:window.open('sterling575.html','sterling575','titlebar=yes,status=yes,scrollbars=no,width=585,height=345')">


To be honest I am learning the code aspect of web design. I am a designer with a tad bit over just basic knowledge of coding. I want to learn and understand I just need it explained to me a little more. Could you elaborate?

[This message has been edited by coregraphics (edited 02-20-2003).]

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 02-21-2003 00:30

The best way to open a new window, actually, is not to use the javascript: protocall. It's best to use the href attribute normally, and add an onclick attribute to handle the window opening. That way, users without javascript enabled will still be able to reach the page linked to. So I would suggest this code:

<a href="'sterling575.html" onclick="window.open(this.href,'sterling575','titlebar=yes,status=yes,scrollbars=no,width=585,height=345'); return false;">

the "return false;" in the onclick event prevents the href from being followed.

Now, if for some reason you *had* to use the javascript: protocall, you would do it as follows:

<a href="javascript:window.open(...);void(0);">

coregraphics
Nervous Wreck (II) Inmate

From: Kansas, USA
Insane since: Jan 2003

posted posted 02-21-2003 01:31

It works, thanks slime. Okay there is one part of the code I do not understand.

Why do you have to have this and what does it do:
this.href,'sterling575'

I understand everything else and you're right, this is a much better way to do it. Thanks for the help!! Where do you learn this stuff? What do you study?

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 02-21-2003 01:46

I merely took the first argument to window.open, which was 'sterling575.html', and replaced it with this.href. The keyword "this" refers to the object that the onclick event is inside - the <a> tag. the .href part gets the "href" property of that object, which happens to be what's inside the href="...". This makes it so that you can change the href property of the <a> tag, and the window.open will still work correctly with the changed href.

My programming experience came first from C++, which I hardly understood, followed by Visual Basic, which I understood a little better, then JavaScript, which was the first language I *really* understood, thanks to O'Reilly's "JavaScript: The Definitive Guide," which I still occasionally use as a reference. The general syntax of the language is second nature to me now, after... what is it... 6 years of programming, I think. The specifics (like, "what function do I use to open a new window") I still have to look up from time to time (although you start to memorize it before long).

I've been working with JavaScript for slightly over 3 years now.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu