2 Replies Latest reply on May 17, 2013 1:24 PM by receng

    Webviewer - grabbing data from a dynamically generated javascript / PHP table

    receng

      Hi all,

      I am trying to use a webviewer on filemaker so people can login on their timesheet and input their hours on a website. I need to grab those project numbers and hours once they are done.

      The problem is that the table is generated dynamically. The GetLayoutObjectAttribute( "webviewer", content) only grabs the static source document and the data is not there.

       

      I can find the data on the Safari web inspector and I actually tested injecting javascript code on the address bar that gets me the results I want.

      Here is a sample that throws an alert on Safari containing the table I want:

       

      "javascript:var myIframe=document.getElementById('unitFrame'); var a=myIframe.contentWindow.document.body.innerHTML; alert(a);"

       

      I tried doing this on filemaker url to change the webviewer content with no luck: (this works on Safari too):

       

      "javascript:var myIframe=document.getElementById('unitFrame'); var a=myIframe.contentWindow.document.body.innerHTML; document.body.innerHTML=a;" (I tried document.content=a too)

       

      I even tried to change the URL using this:

       

      "javascript:var myIframe=document.getElementById('unitFrame'); var a=myIframe.contentWindow.document.body.innerHTML; document.body.innerHTML=a; window.location.href = a";

       

      This worked on Safari too, and it tried to reload the page with this huge URL - no luck on the Filemaker webviewer though.

       

       

      Please help. I would appreciate suggestions on how to get this data .

       

      Thanks!