Please try this from the inspector console:
typeof document.getElementById('dosya_listesi_result' )
or
console.log( typeof document.getElementById( 'dosya_listesi_result' ) )
Please try this from the inspector console:
typeof document.getElementById('dosya_listesi_result' )
or
console.log( typeof document.getElementById( 'dosya_listesi_result' ) )
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:
aaa := 'document.getElementById("yargiTuru").stringify()' oWebView:Eval( "SendToFWH( " + aaa + " )" )
Uncaught TypeError: document.getElementById(...).stringify is not a function
at <anonymous>:1:38JSON.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 nilPlease try this:
document.getElementById('dosya_listesi_result' ).constructor.name
Lets know what class of object it is
We need to find the way to return an object
Tomorrow we will keep trying it
I am trying using document.getElementById("example").innerHTML and it works from the console, but fails from Bind...
The strange thing is that this code:
oWebView:Eval('SendToFWH( document.getElementById("example") )' )
returns "null"
why ? ![]()
Solved ![]()
oWebView:Eval( 'window.onload = function () { SendToFWH( document.getElementById("example").innerHTML ) }' )
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");Hakan,
can't you use a timer and check document.readyState first?
Best regards,
Otto
#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