Hi Guys, Just started playing with RunBasic and HTML in general. Mainly so that I can display information contained in a small SQLite database.
First thing is, I would prefer not to keep updating the entire web page after reading data from a database. I would prefer just to update the values on screen. I suspect this is not possible without the use of some java, but I desperately want to avoid this.
Secondly, if I run an automatically refreshing page, the data returned the first run is correct. If I leave the page refreshing and change the data in the database, the data displayde never changes. The code I ran was.....
html"<meta http-equiv=""refresh"" content=""2"">" html"<META HTTP-EQUIV=""PRAGMA"" CONTENT=""NO-CACHE"">" sqliteconnect #records, "Records.db" query$ = "select amt from Payables where invoice='123'" #records execute(query$) if #records hasanswer() then print #records nextrow$(",") end if #records disconnect()
Similary, just generating a random number as follows give a unique number the irst run of the page, but the refresh results in the same data being diplayed....
html"<meta http-equiv=""refresh"" content=""10"">" html"<META HTTP-EQUIV=""PRAGMA"" CONTENT=""NO-CACHE"">" x = int(rnd(1)*10)+1 print x
I assumed this was a caching issue but I am new to all of this!
Any help/advice for a enthusiastic nebee would be welcome!!
You are right, updating just parts of the page without completely reloading is only possible by using AJAX. So, if you want to avoid this, you have to do a full page refresh. And yes, the second problem is caused by RB's internal caching. To avoid this, do not open the page by using the Sessioned url.... just do a fresh call on the project itself or insert a link into your code that makes sure it processes the required piece of code.
Post by StefanPendl on Nov 23, 2009 3:28:26 GMT -5
You can avoid refreshing the whole page, if you use the RUN command to execute a separate module. You can then use the RENDER command to display and update the separate module. This will create a separate object on your page.
[b]Stefan[/b] - [a href=http://stefanpendl.runbasichosting.com/]Homepage[/a][br][br][b]Please give credit if you use code I post, no need to ask for permission.[/b][br][br]Run BASIC 1.01, Fire-/Waterfox (IE11, Edge), Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
The Run command works very effectively. I have some jobs with as many as 20 Runned programs. Even though these are separate modules, you can control how they run between the modules. The browsers display all the data from all the Runned programs. That means using JS you can effect data or push buttons between modules..