1 of 1 people found this helpful
1. Copy/paste the code that your webviewer uses and evaluate it in the data viewer.
2. Copy the result.
3. Past result in new text file, save as "zxzx.html" (or similar) and save on the desktop
4. Open new window/tab in your browser and use the debugging features there to look for errors.
Thanks Mike I do have advanced so I will give this a try.
Strangely enough - when I do that it works perfectly fine. It just wont load in my webviewer for some reason. Hmmmm.
Are there any documents that discuss best practises for using a webviewer with your own HTML? Things that you shouldnt put in there because the webviewer doesnt like them, etc?
If it helps, I believe it is related to my background picture. I am trying to put a background picture on a canvas. I have tried it a few ways, using Base64 and putting the data right into the calculation field. I have tried putting the base64 string into a text field in filemaker and referencing that, I have even tried putting the picture in a container field and then using Base64Decode function in my text string field to have filemaker get the string. I am fairly confident this is what is causing it to fail.
+1 to Mike Duncan's response for being the best first step towards troubleshooting.
A few things that I would do:
1) See if you can get a simplified version of your code running in both the browser and webviewer. In this case, perhaps that would mean removing all other code but the canvas with the background image. I'll bet you've probably already done this, but if not, this sort of isolation helps you to hone in more closely on what part of the code is breaking. With this process, be sure to continue to use Mike's methodology to compare what works in the browser versus what works in the WebViewer.
2) If you are on Windows:
Note that the browser functionality available in your webviewer is not necessarily on par with the functionality available in your web browser. My understanding is that, unless you have specially tweaked your machine, the webviewer is going to offer you the functionality available in IE8. Chances are, you are using a more modern browser than IE8, and therefore your browser may support features that the webviewer does not. Sometimes the desired feature will still exist in IE8, but the API is slightly different, and you may need to adapt your code.
Focusing on this aspect of troubleshooting could mean:
- Using Mike D's approach with the additional caveat of finding and using a version of an IE8 browser to test your code.
- Running your FM code on OSX, and seeing if the webviewer runs your code properly, or if it also breaks. If it does not break in OSX, this suggests that there may be a compatibility issue with IE8.
3) Simulate having a console to log to by using alert() statements:
At the point when things break, you'll stop seeing your alert messages. Strategically modifying where you place these alerts can allow you to discover the exact line(s) of code where things are breaking.
HTH & Good luck!
Thats a great write up on troubleshooting your webviewer code, I will definitely save it.
I was able to refactor a bit and got it working. I am not exactly sure what was causing the issue, but its working now! Thanks for all the replies.
I'm glad to hear that you got it working. Thanks for the update.