To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.admin.generalOpen lugnet.admin.general in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Administrative / General / 5356
5355  |  5357
Subject: 
Re: quickset
Newsgroups: 
lugnet.admin.general
Date: 
Sun, 19 Mar 2000 02:41:06 GMT
Viewed: 
307 times
  
In lugnet.admin.general, Dan Boger writes:
Hey Todd?  Love the quickset things... but found two problems (?) with it:

1.  when multiple sets come up (type 560), it doesn't say which is -1 -2...
:)

It does if you have the Location bar enabled...or if you do a "view image"...


2.  Is it possible to make it work like the previous version of quickset
(qs.js)?  where if you type multiple numbers, it'll show them all?

Now *that* is wicked bizarre!  Not only is the escape() function broken in
NN 4.6 & 4.7 under Linux (and maybe others) but even the workaround to convert
+ to %2B and space to + by hand fails to run correctly when the JS code is
activated via this "javascript:" directive.

I'm stumped on that one...not a big fan of client-side scripting languages
because so many things (like this!) can go wrong with the slightest dumb
little browser bug.  :-(

Any thoughts on how to coax NN into not decoding the + back to space and the
%2B back to + during the location.href=u statement?

Say, here's an idea!  (This is *totally* an evil kludge, but it might work...)
Try double-encoding the characters that need encoding.  Change this:

   c=q.charAt(i);u+=(c=="+")?"%2B":(c==" ")?"+":escape(c)

to this:

   c=q.charAt(i);u+=(c=="+")?escape("%2B"):(c==" ")?"%2B":escape(escape(c))

Does that make it work on your browser?


TWO THINGS TO NOTE!

1.  The second version (the replacement text) MIGHT work, but it *SHOULDN'T*
    work.  The code is WRONG, but since the browser is also wrong, two wrongs
    make a right in this case.  If it replacement code works, then the browser
    has a bug.

2.  This business with manually checking each character for "+" and " " isn't
    even supposed to be necessary in the first place, BUT the built-in escape()
    function in Netscape Navigator for Linux (and possibly other platforms)
    is BROKEN because it doesn't properly encode " " to "+" and "+" to "%2B"
    even though it properly escapes other stuff for URLs.  The RIGHT code (if
    there was no browser bug in the first case, much less the second case),
    should simply be this:

       u+=escape(q)

    with no for() loop.  If your browser's escape() function encodes " " and
    "+" the canonical way, the loop isn't necessary.

3.  The escape() function does at least encode " " to "%20" under NN/Linux.
    But close only counts in horseshoes and hand grenades.  :)

--Todd



Message is in Reply To:
  quickset
 
Hey Todd? Love the quickset things... but found two problems (?) with it: 1. when multiple sets come up (type 560), it doesn't say which is -1 -2... :) 2. Is it possible to make it work like the previous version of quickset (qs.js)? where if you (...) (24 years ago, 19-Mar-00, to lugnet.admin.general)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR