variables should be declared in examples in the FAQ

D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
legroups.com>, Sun, 21 Jan 2007 17:37:24, Nickolay Ponomarev
Assigning to undeclared variables is considered a bad practice (I hope
I don't need to explain the reasons here). The examples in the FAQ
should declare the variables it uses:

http://www.jibbering.com/faq/#FAQ4_15


There is no need to show the declaration of variables unless the region
within which they need to be declared is shown in full.
 
N

Nickolay Ponomarev

In comp.lang.javascript message <[email protected]
legroups.com>, Sun, 21 Jan 2007 17:37:24, Nickolay Ponomarev

There is no need to show the declaration of variables unless the region
within which they need to be declared is shown in full.
It is shown in full, since you can copy paste these snippets to use in
your code (I imagine this is the reason those snippets are in the FAQ).

No need to write a several-pages-long witty response as to why they are
not in fact shown in full - I'm not going to argue anymore.

Nickolay
 
L

Lee

Nickolay Ponomarev said:
It is shown in full, since you can copy paste these snippets to use in
your code (I imagine this is the reason those snippets are in the FAQ).

No need to write a several-pages-long witty response as to why they are
not in fact shown in full - I'm not going to argue anymore.

What a jerk. "Don't bother pointing out that I'm wrong, I'm not
going to respond".

if(window.open){
wRef = window.open("http://example.com/page.html","windowName");
}

Hardly qualifies as a snippet that would be copied and pasted.


--
 
N

Nickolay Ponomarev

Nickolay Ponomarev said:

What a jerk. "Don't bother pointing out that I'm wrong, I'm not
going to respond".

if(window.open){
wRef = window.open("http://example.com/page.html","windowName");

}Hardly qualifies as a snippet that would be copied and pasted.
At least you kept it short :)

Nickolay
 
N

Nickolay Ponomarev

BTW, that snippet is rather questionable. I wonder on what browsers
that support scripting the window.open call doesn't happen.

Nickolay
 
R

Richard Cornford

Indeed the intention of the entry (and linked resources) is to
discourage the attempt to open new windows.
BTW, that snippet is rather questionable. I wonder on what browsers
that support scripting the window.open call doesn't happen.

Embedded browsers on small systems that have no "window" concept in
their UI often do not provide a window.open method. There would be
little point as they could not open new "windows" even if they wanted
to. A specific example is WebBrowser 2.0 on the Palm OS (which is a
ECMA 262, 3rd Ed. scriptable, W3C DOM (Core + HTML) Level 1 standard
browser).

Given that mobile phones are now at the point where it is becoming
difficult to get one that does not have a web browser these small-scale
and functionally restricted browsers are probably about to peek in
their relevance.

Richard.
 
N

Nickolay Ponomarev

Hardly qualifies as a snippet that would be copied and pasted.Indeed the intention of the entry (and linked resources) is to
discourage the attempt to open new windows.

Embedded browsers on small systems that have no "window" concept in
their UI often do not provide a window.open method. There would be
little point as they could not open new "windows" even if they wanted
to. A specific example is WebBrowser 2.0 on the Palm OS (which is a
ECMA 262, 3rd Ed. scriptable, W3C DOM (Core + HTML) Level 1 standard
browser).
Thanks for the information; didn't know there are embedded browsers
with DOM support, but without window.open.

By the way, I was looking at the first snippet (4.15) when I claimed it
was on the page for easy copy-paste.

Nickolay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top