Antonio Linares wrote:Please try this from the inspector console:
typeof document.getElementById('dosya_listesi_result' )
or
console.log( typeof document.getElementById( 'dosya_listesi_result' ) )
aaa := 'document.getElementById("yargiTuru").stringify()'
oWebView:Eval( "SendToFWH( " + aaa + " )" )
Antonio Linares wrote:Dear Hakan,
ok, then please try this:
- Code: Select all Expand view
aaa := 'document.getElementById("yargiTuru").stringify()'
oWebView:Eval( "SendToFWH( " + aaa + " )" )
Uncaught TypeError: document.getElementById(...).stringify is not a function
at <anonymous>:1:38
JSON.stringify(document.getElementById("yargiTuru"))
'{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{},"jQuery1112018490637981077995":112,"readOnly":false}'
JSON.stringify(document.getElementById("dosya_listesi_result"))
'{}'
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function Main()
local oWebView := TWebView():New()
oWebView:bOnBind = { | cJson, nCalls | MsgInfo( cJson, nCalls ) }
oWebView:Bind( "SendToFWH" )
oWebView:Navigate( "https://datatables.net/examples/data_sources/js_array" )
// Sleep( 400 )
sysWait(6)
aaa := "document.getElementById('example' )"
oWebView:Eval( 'SendToFWH( First : '+aaa+ ' )' )
oWebView:Eval('console.log( '+aaa+' )')
aaa := 'JSON.stringify(document.getElementById("example"))'
oWebView:Eval( 'SendToFWH( Second : '+aaa+ ' )' )
oWebView:Eval('console.log( '+aaa+' )')
oWebView:Run()
oWebView:Destroy()
return nil
Antonio Linares wrote:Solved
oWebView:Eval( 'window.onload = function () { SendToFWH( document.getElementById("example").innerHTML ) }' )
aaa := "document.getElementById('dosya_listesi_result' ).innerHTML"
oWebView:Eval( 'SendToFWH( '+aaa+ ' )' )
oWebView:Eval( 'window.onload = function () { SendToFWH( document.getElementById("dosya_listesi_result").innerHTML ) }' )
await ExecuteScriptAsync("document.getElementById('DropDownList').selectedIndex");
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function Main()
local oWebView := TWebView():New(), aaa
oWebView:bOnBind = { | cJson, nCalls | MsgInfo( cJson, nCalls ) }
oWebView:Bind( "SendToFWH" )
oWebView:Navigate( "https://datatables.net/examples/data_sources/js_array" )
Sleep( 200 )
oWebView:Eval( 'window.onload = function () { SendToFWH( document.getElementById("example").innerHTML ) }' )
oWebView:Run()
oWebView:Destroy()
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 94 guests