Forum Moderators: open

Message Too Old, No Replies

why is javascript frowned upon?

         

bpresent

2:23 pm on Sep 2, 2003 (gmt 0)



Not sure if this is the correct forum for this but...

What browsers do not support javascript and why does the W3C link checker make out they are so bad (gives me mock 501s)?

Related question: does anyone know of a free link checker that handles javascript popups that have external urls in them?

DrDoc

2:51 pm on Sep 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Most normal PC browsers support JavaScript.

However...

  • JavaScript can be turned off.
  • Search engines can't follow JS links.
  • Certain "unconventional" user agents do not offer JS support.
  • Different browsers offer different levels of support for JS.
  • Most people implement JS so poorly that the page will break if/when JS is turned off
  • A lot of people implement JS so poorly that the page will break if viewed in a browser other than IE.

    ...and so on.

  • dmorison

    2:55 pm on Sep 2, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    why is javascript frowned upon?

    Because it gives a completely unknown entity unprecedented and immediate control over your environment; and in the case of client security problems the potential to covertly install malicious software!

    Well that's why I frown upon it anyway!

    I surf with Active Scripting disabled, only permitting certain sites to use JavaScript by adding them to the "Trusted Sites" zone (but only after having made the "Trusted Sites" zone have the same default security settings as the "Internet" zone).

    Having said that, I _do_ use JavaScript to enhance my sites, but it is never a requirement.

    [edited by: dmorison at 3:01 pm (utc) on Sep. 2, 2003]

    Dolemite

    2:59 pm on Sep 2, 2003 (gmt 0)

    10+ Year Member



    A lot of people implement JS so poorly that the page will break if viewed in a browser other than IE.

    I don't think you can blame that on peoples' JS code. There are rarely good, cross-browser compatible ways to do anything but the basics in JS.

    Instead, I would say most browsers' JS implementations are questionable.

    txbakers

    3:06 pm on Sep 2, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Because people are paranoid about things they don't understand, and they are tired of endless popups and redirects.

    Javascript, when used properly is a wonderful, safe tool.

    Like everything else, developers abuse it so people turn it off.

    korkus2000

    3:06 pm on Sep 2, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Here is a good discussion on Myths that have plagued the language, and helped perpetuate the dislike.

    [webmasterworld.com...]

    Like said before the number one reason to not use javascript in required functionality is SE spiders can't read it and people can turn it off.

    Here is another thread discussing the pros and cons of the language:
    [webmasterworld.com...]

    There are valid reasons for using and not using JavaScript. It should boil down to your web site's audience. Do they have it on or not.

    >>Like everything else, developers abuse it so people turn it off.

    Exactly. Flash is in the same boat.

    hartlandcat

    7:14 pm on Sep 2, 2003 (gmt 0)

    10+ Year Member



    I shouldn't worry about browsers that don't support JavaScript. Here's a rundown of the "big two" browsers support for Javascript. I believe this is vaguely right, but I cannot garuntee it's accuracy:

    Internet Explorer 1.0: No JavaScript
    Internet Explorer 1.5: No JavaScript
    Internet Explorer 2.0: No JavaScript
    Internet Explorer 3.0: JavaScript 1.1
    Internet Explorer 4.0: JavaScript 1.2
    Internet Explorer 5.0: JavaScript 1.3 (?)
    Internet Explorer 5.5: JavaScript 1.4
    Internet Explorer 6.0: JavaScript 1.4

    Netscape 1.0: No JavaScript
    Netscape 2.0: Strange built-in JavaScript
    Netscape 3.0: JavaScript 1.1
    Netscape 4.0: JavaScript 1.2
    Netscape 4.5: JavaScript 1.3
    Netscape 4.6: JavaScript 1.3
    Netscape 4.7: JavaScript 1.3
    Netscape 4.8: JavaScript 1.3
    Netscape 6.0: JavaScript 1.4
    Netscape 6.1: JavaScript 1.4
    Netscape 6.2: JavaScript 1.4
    Netscape 7.0: JavaScript 1.4
    Netscape 7.1: JavaScript 1.4

    tedster

    9:07 pm on Sep 2, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    We've got a reference thread for versions of JavaScript, jscript (IE) and EMCAscript (the standards body):

    [webmasterworld.com...]

    MonkeeSage

    9:28 pm on Sep 2, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    tedster:

    That is great! I just saved a local copy of that page for reference! WW rocks :))

    Jordan

    bpresent

    11:18 pm on Sep 2, 2003 (gmt 0)



    Understood - thanks to all.

    I, too, hate unannounced popups - I am using it... kind of like footnotes. You read through the blurb on the site and, if you want more detail on a certain topic, you click on the link which pops up the extra details in a window that has no nav buttons etc (ie. it's smaller and very content-specific). It is also re-usable once you've resized it (ie. ALL popups on the site use a window with the same name so that once you've resized it to your preference it remains that way - so long as you don't close it - I guess I could cookies to fix that one though).

    Anyway, perhaps the clincher for a change in design philosophy, is that search engines don't follow the links. Are all bots the same in this respect? (But I guess I can get around that one by having the url's all referenced in the site map)?

    Cheers, Sam.

    With respect to the thread you mentioned [webmasterworld.com...] - does this mean that so long as we adhere to ECMAScript v3 we should be okay with most Netscape and IE browsers (and maybe even the others too?)

    Netscape offered JavaScript to the ECMA for standardization in 1996. Netscape and Microsoft then both agreed to support the standards ECMA developed.

    txbakers

    12:23 am on Sep 3, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    is that search engines don't follow the links.

    If you are using javascript for informational popups, which BTW I think is a very valid use of window.open, who cares if they will be spidered or followed by the SEs?

    They are ancillary to your site, right? Why be paranoid about the SE finding every link to every page?

    MonkeeSage

    12:23 am on Sep 3, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    bpresent:

    No need for cookies if you want a static size always, just use this in the popup:

    self.resizeTo(width, height);

    Where width and height are the numeric values (in pixels) you want the window to be sized to. You could also do this from the parent window, by using something along the lines of:

    var w = window.open('blah.htm', 'popup', '');
    w.resizeTo(300, 200);

    Jordan

    bpresent

    12:57 am on Sep 3, 2003 (gmt 0)



    They are ancillary to your site, right?
    True....
    Why be paranoid about the SE finding every link to every page?
    ...They have some very wholesome chunky (subject specific / jargon) words in them that may not necessarily occur elsehwere :) The blurb is too much for css popups IMHO and I sometimes have reference document hrefs in them.

    No need for cookies if you want a static size always

    Some good tips there thanks, but I want the window to remain the size that the user previously chose as optimal. (As a user I hate having to resize the window every time I open a new one).

    Also, I've been mucking about with 60% (or whatever) of the screen width / depth / blah-de-blah but we are getting into major behavioural differences between browsers when we go there - so I have fled from that approach.

    I started looking into this at the request of a client whose market is users with limited computer (keyboard / mouse) skills. If you use target="_blank" they wind up with a million windows open and if you use target="_self" they disappear never to return (no concept of "back" button even if you put your own one on there). I've sort of adopted it elsewhere (more technical site) and perhaps it is not needed there?

    Can you name a window with target="mywindowname" and then reuse that window - I guess I should try!

    What about <LINK rel="help" href="foo.html"> to keep SEs happy?

    ggrot

    1:01 am on Sep 3, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Please, please. If you use javascript, make sure it isn't required to make use of the functionality of your site. I was doing some work with writing an automated spider for some academia research, a custom browser client. I wanted to parse some data from a site as simple as the CIA world factbook, but no can do because their country selection tool is a javascript drop-down menu. Some 3 lines of javascript and I can no longer visit their site with the spider except for the front page.

    The same is true of say 5-10% of your users who have javascript disabled. They cant navigate your site if you aren't careful.

    MonkeeSage

    1:01 am on Sep 3, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    I'm not sure about the target attribute and reuse, but I imagine so. With the window.open() method the second argument is the target and I know that if you give it a name (e.g., popup), then you do another window.open() using the same target, it will reuse the first window that opened.

    Jordan

    bpresent

    1:31 am on Sep 3, 2003 (gmt 0)



    Can you name a window with target="mywindowname" and then reuse that window - I guess I should try!

    Yes you can but it does not get focus - which means for my not-so-savvy users it is useless.
    [Of course I can give it focus with JS but the point is I'm looking at a way of doing it without JS - looks like some fancy css work is required :)]

    ..no can do because their country selection tool is a javascript drop-down menu

    Good to know - thanks.

    BjarneDM

    3:55 pm on Sep 7, 2003 (gmt 0)

    10+ Year Member



    bpresent:
    I don't think you can get around using some javascript to address all of you problems ;-)

    The problem with getting multiple popup-infomational can be addressed bu having this:
    <body onblur="window.close()">
    The problem with this is of course that the infomation about any resizing is lost when the window is closed in any way whatsoever.

    One can get around this problem by using cross-window scripting:
    <body onresize="function()">
    with function being something along the lines of:
    function() { window.opener.infoHeight = window.innerHeight; etc. }
    and using infoHeight et.al in your window.open() statements.

    If you use the same name for the window in all of your window.open() statements a previously opened window will be reused, but as you point out, it doesn't automagically get focus. The only way to address this is through javascript by having:
    window.open( URL , windowName , parameters ) ; windowName.focus() ;

    see: [webreference.com...]

    MonkeeSage

    11:43 pm on Sep 7, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    The window.open() method returns the object of the window it opens...

    var w = window.open(URL, target, parameters); w.focus();

    Jordan

    DeadAgain

    8:09 am on Sep 8, 2003 (gmt 0)

    10+ Year Member



    The way to get the content in your popups indexed is to make sure you link to a sitemap in your index.htm/default.htm's noframes section(if you are using frames) and then link to that info from the sitemap.

    I have a site with heavy frame use and navigation frames dynamically created via a CGI. I then use what I call a "frame-popper" js script that, if you load one of the pages that is inside a frameset directly(e.g. from a search engine) it auto-loads the frameset around the page. My pages get indexed just fine and when someone visits the site from a search engine the page displays as intended.

    On the sitemap I advise users to enable js on the site, and that if they don't want to get hacked or if they don't want to see popups then they shouldn't be surfing with IE in the first place. Mozilla/Netscape and Opera are far better browsers that are much, much safer to use with js enabled... and they have built-in means to stop popups. :)

    DA