Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Get the result after the body onload="function"

Featured Replies

The following code in a web viewer produce a response like "errno=0&desc=SMS Queued&SmsIndex=34", how to get it in to a filemaker field?

I Nead to get it without plug in, it should work also for the IOS platform.

Many thank for your help.

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
<html>
  <head>
 <script>
 function post(path, params) {
      method = 'post';
      var form = document.createElement('form');
      form.setAttribute('method', method);
      form.setAttribute('action', path);         

      for(var key in params) {
          if(params.hasOwnProperty(key)) {
              var hiddenField = document.createElement('input');
              hiddenField.setAttribute('type', 'hidden');
              hiddenField.setAttribute('name', key);
              hiddenField.setAttribute('value', params[key]);

              form.appendChild(hiddenField);
            }
      }

      document.body.appendChild(form); 
      form.submit();
}
 </script>
  </head>
  <body onload="post('http://192.168.1.99/smssend.cgi' {Pwd: '1234','Push': 0, num: '335xxxx', text:'My  sms machine Text'})">
 
  </body>
</html>

First you need to grab the content of the web viewer. Use GetLayoutObjectAttribute() for that.

You'll also want to check that the page has finished loading by ensuring the </html> tag is present.

Then you'll want to find the position of both the onload=" string the the subsequent close brackets. There are several functions that you'll probably want to use: Let(), PatternCount(), Position(), and Middle().

  • Author

i already tested GetLayoutObjectAttribute(), it give me only the html page without the result of the "<body onload=......" function.

This is the tipycal text result ".....errno=0&desc=SMS Queued&SmsIndex=34...", i need to grab this text coming out from the sms hardware machine.

 

this is what i get using GetLayoutObjectAttribute() with option "content":


 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
<html>   
<head>
 <script>  function post(path, params) {
       method = 'post';       
var form = document.createElement('form');       f
orm.setAttribute('method', method);       
form.setAttribute('action', path);                
for(var key in params) {           
if(params.hasOwnProperty(key)) {               
var hiddenField = document.createElement('input');               
hiddenField.setAttribute('type', 'hidden');               
hiddenField.setAttribute('name', key);               
hiddenField.setAttribute('value', params[key]);               f
orm.appendChild(hiddenField);             }       }       
document.body.appendChild(form);       
form.submit(); }  
</script>   
</head>   
<body onload="post('http://192.168.1.99/smssend.cgi' {Pwd: '1234','Push': 0, num: '335xxxx', text:'My  sms machine Text'})">  
 </body>
</html>

Edited by Franco Pagano

GetLayoutObjectAttribute() accesses the HTML code passed to the web-viewer, not the DOM (same as View Page Source does in a regular browser).

You might have more luck using the Insert From URL[] script step:
http://www.filemaker.com/help/14/fmp/en/html/scripts_ref1.35.50.html#1144726

Or perhaps try the fmp:// protocol to send the values back to Filemaker:
http://www.filemaker.com/help/14/fmp/en/html/sharing_data.17.6.html

Edited by comment

  • Author

i don't know how to transform the Dom text to a variable to send to filemaker using the fmp:// protocol.

about Insert From URL[] the post doesn't work with the sms machine hw, i have to use the javascript.

Thanks for your attentions

i don't know how to transform the Dom text to a variable

I believe that's a javascript question.

  • Author

some time the solution are so simple:

Select the the web viewer object

Copy the selection

paste into the destination field.

Old filemaker style.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.