Hello,
Is it possible to push image into client browser?
Thanks,
Semua
Printable View
Hello,
Is it possible to push image into client browser?
Thanks,
Semua
You can read this similar thread.
Semua,
As for displaying pushed images in an HTML page, you can use data URI scheme (see http://en.wikipedia.org/wiki/Data_URI_scheme).
Basically, you will push the Base64-encoded image as the value of a field of subscribed item. Your JavaScript code will change the src property if the img to inject the Base64-encoded source.
Hello,
Rather than do encode image into base64.
Can lightstreamer just push the image file name? and then in client browser, it will replace the old src value in the <img /> tag?
I see in the example folder, all of them are using div / span as a place to put the text.
Thanks
In that case, you can get the filename field values through the onItemUpdate callback;
from there, you can modify the <img> element by your code.
The StockListDemo, for instance, shows the use of fields that are not associated to cells (see "item_status")
and the dynamical modification of an image filename (though not directly from a field value, in that case).
Note that the filename field cannot be associated with a cell directly,
hence you cannot define your Table by specifying null as the schema descriptor.
If there are no fields to be associated with cells in your item containing the filename field, you can use a NonVisualTable.
There are no simple examples showing the NonVisualTable; however, using a NonVisualTable is simpler than using the other kinds of tables.
Ok, it's working now :)
Thanks,
Semua