Jump to content

Insert modified HTML code back into WebViewer, with JS and images


MyBigFM9Project
 Share

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

Recommended Posts

Hi, I have run into a standstill here where maybe someone could point me in the right direction.  This is for a large personal project that I have been working on for a few years.  I have considered all the possibilities with FM and looked at add-ons, but this is the first time I think I cannot find an answer. 

 

I have used the Webviewer just to navigate through a website to get to a certain page to scrape.  That works great.

 

In this usage, I want to do more than just scrape.  I want to load the page in FM (on the webviewer), take the "content" (client-side HTML), run it through a comparative analysis in FM, append text to it line-by-line, and then reload that back into the Webviewer. 

 

The only problem is that the reload process always causes the Webviewer to get rid of any other website files, in particular Javascript files, which this web page needs in order work correctly.

 

Right now I am working around this by using an earlier (alternate) version of my script.  I first open the web page using the web browser Opera, cut and paste the HTML from that using the Windows clipboard, dump it into a global text field in FM, run my script on that, then cut and paste that back into Opera and click Update, which replaces the HTML but leaves everything else alone. 

 

Is there any way I could use the Filemaker Webviewer (or possibly some plug-in) to do similar - only replace the HTML, but leave all the other website files (javascript) as-is??  It has to be using some sort of web viewer, as I will manually be selecting options from the updated web page and submitting to a local web server.

 

Thanks

Chris

Link to comment
Share on other sites

Well never mind, it wasn't anything to do with Filemaker.  Upon further investigation it was because HTML pages use relative paths to the files on the server, so I changed them to absolute paths.  Now when the HTML originates from Filemaker's Webviewer, it properly loads most of the files. There are still some minor issues, not related to the usage of the Webviewer, so I will go to other places to resolve those.

Link to comment
Share on other sites

Okay, just to update in case anyone is following along.  What worked out for me was to incorporate the HTML "Base" tag into the header of the HTML file which I am using Filemaker to edit.  Probably nobody else in the world is doing exactly what I did, but that made it work perfectly.  So I ended up ditching the Absolute Paths and just using HTML's Base tag to establish the correct Relative path back to the web server after the original relative path was broken (from it being loaded up and originating from FM this time) after the edits/enhancements. :)

 

I am only using FM9 ADV and 360Works Scriptmaster (free).  That all that was necessary.

Link to comment
Share on other sites

This topic is 2867 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

×
×
  • Create New...

Important Information

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