Post by neal on Sept 25, 2014 0:53:21 GMT -5
This is something rough I just threw together (it will need changes to work with IE):
Note that the screen size is not available until you get to the second screen of the application.
Main program:
html "<script type=""text/javascript"">var x=window.innerWidth; var y=window.innerHeight; r = new XMLHttpRequest(); r.open('GET', 'https://www.mysite.com/seaside/go/runbasicpersonal?app=ajaxtest&x=' + x + '&y=' + y, false); r.send();</script>"
button #go, "Get Screen Size", [go]
wait
[go]
cls
sqliteconnect #db, "size.db"
#db execute("SELECT X,Y FROM TEMP_TABLE")
#row = #db #nextrow()
x = #row x()
y = #row y()
#db disconnect()
print "screen height = "; y
print "screen width = "; x
"ajaxtest.bas":
x = val(getUrlParam$(UrlKeys,ドル "x"))
y = val(getUrlParam$(UrlKeys,ドル "y"))
sqliteconnect #db, "size.db"
#db execute("DROP TABLE TEMP_TABLE")
#db execute("CREATE TABLE TEMP_TABLE (x, y)")
#db execute("INSERT INTO TEMP_TABLE(X,Y) VALUES ("; x; ","; y; ")")
#db disconnect()
function getUrlParam$(params,ドル key$)
' Return the value of the URL parameter key$
while 1
i = i + 1
w$ = word$(params,ドル i, "&")
if w$ = "" then exit while
k$ = word$(w,ドル 1, "=")
if upper$(key$) = upper$(k$) then
getUrlParam$ = word$(w,ドル 2, "=")
exit while
end if
next
end function