| Availability: |
| |||
| JavaScript syntax: | N | myBlob = blob() | ||
| N | myBlob = myCursor.colName.blobImage(...) | |||
| Object methods: | <methodname>blobImage()</methodname>, <methodname>blobLink()</methodname> | |||
A blob object is so called because it encapsulates a Binary Large OBject or BLOB. This is a block of data, often quite large, that is stored in a binary form and which is likely to contain many non-printable characters and probably some nulls as well.
You cannot instantiate a blob object directly in JavaScript but you can obtain one by fetching the data from a database as shown in the example code.
<SERVER>
// Example derived from Wrox Professional JavaScript
// This opens a database, selects some records
// Traverses the collection that was selected
// and for each one, outputs an image tag.
database.connect("ODBC", "TargetDB", "", "", "");
myCursor = database.cursor("SELECT * FROM TARGET_TABLE");
while(myCursor.next())
{
myBlob = myCursor.blobData;
write(myBlob.blobImage("bmp"));
}
myCursor.close();
</SERVER>| See also: | Netscape Enterprise Server, unwatch(), watch() |
| Method | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| blobImage() | 1.1 ![]() | ![]() | ![]() | ![]() | ![]() | 2.0 ![]() | ![]() | ![]() | ![]() | ![]() | - |
| blobLink() | 1.1 ![]() | ![]() | ![]() | ![]() | ![]() | 2.0 ![]() | ![]() | ![]() | ![]() | ![]() | - |
| Prev | Home | Next |
| Blinds() | Up | blob.blobImage() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. | ||