#native_company# #native_desc#
#native_cta#

Remote Scripting with Javascript, IFrames and PHP Page 8

By David Vance
on May 10, 2004

The function takes the string created and passed by searchServer.php,
decodes it, tests it for validity, and transforms it to an array
using this Javascript:

<?php

function arrayFromStringsdelim )

{

    var 
= (delim == null) ? '|' delim;

    return 
s.split(d);

}

?>



Back to handleResponse(), the array of names is next transformed
into Option tags, inserted into a Select List, and the list placed
in the HTML document using innerHTML. (The getOBJ() function
merely uses getElementById() to fetch the specified element.)
And that is it. The user now has a dynamic drop down list
wherein they can find and select the appropriate value for
futher processing. Amazingly, even though it is done on every
keystroke (after 2), it is surprisingly fast. Also,
with 60,000+ records, even a subset of records can be quite
large, but I’ve run into no problems with the string being
too large to pass through Javascript.

1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9