Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Google Suggest, advanced JS, DHTML

Reply
Thread Tools

Google Suggest, advanced JS, DHTML

 
 
awebguynow
Guest
Posts: n/a
 
      05-25-2006
It seems like I've been reading the code to Google Suggest (GS) for
about a week, and I'm going to have to wrap it up shortly.

I'm OK with many of the subjects, and I would say I have intermediate
knowledge of JS.
I've read from many sources/blogs/sites: C Justus (dissected),
alacrity, AjaxAC, etc.

After reading the code, here's a few parts, I didn't follow:
s.<div> contains Iframe, but why does s.style.left="-10000" ? does it
get moved afterwards?

setTimeout() used in multiple places, and even recalculateTimeout() //
not sure why

lots of blur() focus() processing and fireEvent() event processing

Although its brilliant, its as difficult to follow as spaghetti code,
keeping track of which variables are global, local, etc.
I understand the keystroke processing and createTextRange code.
I'm sure you have to designate priority between mouse and keystroke
selections, or else you can end up with 2 rows being highlighted, as I
saw in an ASP related example.

I'm intent on doing my own (simplified) version, but want to keep or
learn how to do, any processing that is absolutely neccessary.
Last call for code (on this topic) - I promise... Over n out

 
Reply With Quote
 
 
 
 
awebguynow
Guest
Posts: n/a
 
      05-26-2006
_completeDiv=document.createElement("DIV");
_completeDiv.id="completeDiv";
// ...
document.body.appendChild(_completeDiv);

// ...
var M=document.createElement("IFRAME");
M.completeDiv=_completeDiv; // assigning an element to new id ??
syntax ?
// element previously appendChild to body
M.name="completionFrame";
M.id="completionFrame"; // used over n over

 
Reply With Quote
 
 
 
 
awebguynow
Guest
Posts: n/a
 
      06-07-2006
Still studying this, and although I'm late to the AJAX ballgame, its a
very impressive technology, and I'm looking for more references and
articles to ready, to become proficient myself.

I'm still baffled by this statement ? "completeDiv" is it a property
? out of the blue ?
also does an element need to be appended to body, before it can be
assigned like this?
M.completeDiv=_completeDiv;

I have the same ? about "prefixStrings" It never seems to be defined
anywhere, it just appears as a property.

I don't have my notes handy, but the Google Suggest model has many
nested elements
div { iFrame { div { sub-div(line) { sub-sub-div(line-fragment) } } } }


What purpose does the iFrame (set offscreen) serve ?
Could a simplified version remove the outer two layers ?

As I design my own mini-Suggest I hope to keep it as simple as
possible.
One area of concern is the Event processing associated with keypress
keydown
Which to use ?

I have taken note of T-PE-Lahn and his _addEventListener method, from
Feb '06 post
under Keywords "elements to addEventListener, moveDeleteControls"
I want to use this xBrowser model; it seems comprehensive for
compatibility.
Is the event that should be passed Case Sensitive ?
The ex: is all lower case, yet I got an IE error when trying this for
"keydown"

I do notice Google Suggest's model uses (slightly convoluted but
efficient) structure:
a.onkeyup=new Function("return okuh(event); ");else a.onkeyup=okuh;

I don't know if Google way is best.
I have done some testing and noticed differences between IE and MOZ
Once accepts keydown events from the document.body, while the other is
more restrictive, only capturing keydown events from textbox, and other
controls, etc.

TIA for any suggestions, feedback, and good implementation ideas.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Do any DHTML books cover contemporary DHTML? Steve Javascript 1 04-09-2005 04:16 PM
Intermediate to advanced dhtml/javascript tutorials mr_burns Javascript 1 01-08-2005 07:59 PM
Advanced DHTML Dropdown List component with Autofilter feature devpoint Javascript 2 09-18-2003 09:58 AM
Advanced DHTML Dropdown List component with AutoFilter feature devpoint ASP General 0 09-08-2003 08:21 AM
Advanced DHTML Dropdown List with autofilter feature devpoint Javascript 0 09-02-2003 12:28 PM



Advertisments