Jump to content

Get contents of webviewer after changing DOM with Javascript?


cristoslc
 Share

This topic is 2492 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
I'm trying to use TinyMce in a webviewer in FileMaker but save the resulting HTML into a database field.
 
I am aware of the standard practice of using an fmp:// link with a script & parameter, but that won't work in Windows (the html content returned as the parameter will likely exceed the 2048 character limit).
 
I am using a javascript function to change the HTML DOM by putting the contents of the TinyMCE editor into another div on the page when the user clicks "Submit" inside the webviewer. However, when I use `GetLayoutObjectAttribute ( "webviewer" ; "Content" )` it shows the content of the unmodified (pre-javascript altered) page, not the page after javascript has modified the DOM.
 
Sample file: http://cris.lc/sxti2
 
Is this expected behavior? Am I doing something incorrectly?
Link to comment
Share on other sites

 

However, when I use `GetLayoutObjectAttribute ( "webviewer" ; "Content" )` it shows the content of the unmodified (pre-javascript altered) page, not the page after javascript has modified the DOM.

 

Did you use that function in a script or in a calculated field?

Link to comment
Share on other sites

Hi Cristo, and welcome to the Forum,

 

Sample file: http://cris.lc/sxti2

 

Please post your files here. This is a learning site, and files posted at other sites have a tendency to disappear once the OP has gotten a solution to their problem. To attach a file, just follow the steps in this Article. ATTACH FILE

Link to comment
Share on other sites

  • 1 month later...

There is a hack for getting around windows url length limit. You can find our more here http://www.seedcode.com/filemaker-webviewer-javascript-calculation-engine/ 

 

But basically you need to send the data to the clipboard with

window.clipboardData.setData( 'Text' , mydata );

and then when you call your script, paste the text into a field. 

Link to comment
Share on other sites

This topic is 2492 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Similar Content

    • By Richard Carlton
      Today we're covering the PerformScriptWithOptions JavaScript function with Calvin Mosiman. Learn about this new option for calling a FileMaker script from a web viewer! Future live streams: https://fmtraining.tv/#LIVE 
      support@rcconsulting.com
      www.fmtraining.tv
      www.fmstartingpoint.com
      www.rcconsulting.com 
    • By typewriter
      I use jQuery and the jQueryUI slider widget to display a slider in FileMaker Pro (v17-17-18-19). Works fine but I also need to have it work on FileMaker Go, so I tried my luck on jQuery Mobile 1.4.5. The slider is working nicely on FileMaker Pro, but on FmGo 17, 18 or 19 it doesn't load, keeps displaying a spinning logo. When I publish the HTML page on a website and open it in Safari Mobile it works fine. Any help appreciated! See the example file: just downlaod it and open it on FMGo. The Webviewer and the HTML are displayed side by side.
      sliderExample.fmp12
    • By 360Works
      NOW AVAILABLE:
      fmPromise Presentation and Free Download!
      Thank you for your patience with the demonstration of fmPromise, a new free tool created to improve FileMaker and JavaScript integration.

      You can now watch the video presentation by Sam Barnum immediately at the 360Works YouTube Channel. Questions can be asked in the comment section below the video, or by emailing support@360works.com
      Free download available at the fmPromise page!
      More on 360Works fmPromise:
      We are now showcasing fmPromise, a brand new free tool created to improve JavaScript and FileMaker integration! Most people are aware that JavaScript in FileMaker can provide a much better UI within apps. While FileMaker 19 improved Web Viewer usage with JavaScript, 360Works is always looking for ways to build-in improvements to the FileMaker platform.
      FileMaker 19 has added the ability to call FileMaker scripts from your JavaScript, as well as executing a JavaScript function from a FileMaker script. This allows for integration between FileMaker and JavaScript in your Web Viewer, but has some areas that fmPromise will make better.
       
      Every call from JavaScript to a FileMaker script needs a public JavaScript function to receive the script response, and it is the responsibility of the Script to call that function. All data coming back from FileMaker is a string Debugging JavaScript errors is very difficult without browser-based dev tools The window.FileMaker object is not available right when the page loads, so you need a window.setTimeout() to wait for it to become available if you want to populate your web viewer using a script call.  
      fmPromise is designed to address these shortcomings, and help you utilize Web Viewers in your solution with the minimum amount of fuss.
      Tune In Remotely:
      Click here to watch the video presentation anytime!

      Click here to visit the fmPromise page and get your free download.
       
        Stay updated with 360Works
         
    • By ggt667
      I can ping my PDF document server from Terminal, I can connect to the PDF document server from all browsers apart from Safari, my default web browser is FireFox, I also tried to change to Chromium and Opera as the default web browser. WebViewer has the same symptoms as Safari, server not found.
      $ ping -nc 1 document PING document (10.0.0.7): 56 data bytes 64 bytes from 10.0.0.7: icmp_seq=0 ttl=64 time=0.002 ms --- document ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.002/0.002/0.002/0.000 ms FileMaker says ’Couldnot connect to the server.’
       
      The issues is easily solved by creating a new MacOS X user, and log in to that user, however I would rather like to fix the current user not having to migrate all other application settings. Is there some dns cache specific to Web Viewer and Safari?
    • By St3v1e
      Hi,
      As a complete novice to FMP, I'm attempting my very first database. We rely on storing our contracts on Google & Dropbox. I've been trying to either embed the pdf's into a "tab", or (my preferred option) to have an "Add URL" button to link to the online pdf.
      I tried adding a field and copying and pasting the URL, but it's not clickable, and I'd need to add another field for each pdf/contract.
      Is there a better more efficient way to do this?
      Thanks
      Steve
  • Who Viewed the Topic

    1 member has viewed this topic:
    Lee Smith 
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.