[Gambas-user] Read data from localstorage in gb.web.gui

Safiur Rahman isafiur at gmail.com
Sat Jul 23 18:24:33 CEST 2022


Hi Bruce

The WebTextBox can be filled with value you receive from javascript on
client side and then you can update on server side.

WebForm._AddJavascript("var xdata = 'abcdef'")
WebForm._AddJavascript("$_(" & JS(WebTextBox1.Name & ":entry") & ").value =
xdata")

I am using it extensively. The only problem is it cannot hold big size
string.

There should be some mechanism to communicate between javascript on client
and gambas on server.

On Sat, 23 Jul 2022, 21:51 Safiur Rahman, <isafiur at gmail.com> wrote:

> Hi
> Sorry for the Request.cookie example because cookies are sent to server
>
> On Sat, 23 Jul 2022, 21:47 Safiur Rahman, <isafiur at gmail.com> wrote:
>
>> Hi
>>
>> I think that if localstorage could be used in gambas then data on the
>> client can be uploaded to server without selecting file.
>>
>> To save data
>> WebForm._AddJavascript("var xdata = canvas.toDataURL(\"image/png\")")
>> WebForm._AddJavascript("localStorage.setItem('imagedata', xdata);")
>>
>> To upload
>> Request.Localstorage[]
>>
>> On Sat, 23 Jul 2022, 21:01 Safiur Rahman, <isafiur at gmail.com> wrote:
>>
>>> Hi Benoît
>>>
>>> I can read data from cookies using Request.Cookies[]. Unfortunately
>>> cookie can store data upto 4 KB only. Is there any gambas way to read data
>>> from localStorage (which can store data upto 5 MB)
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220723/46c0710e/attachment.htm>


More information about the User mailing list