Newbies BruceB Posted May 2, 2017 Newbies Posted May 2, 2017 I am trying to display an image (from disk) in a web viewer. The following is the calculation entered into the web viewer (by means of a calculation): data:text/html, <body> <p>Hello</p> <div> <img src="Maths_AS/Questions/q1.png" style="width: 700px"> </div> <p>Good-bye</p> </body> The text displays, but the img tag just produces a small box with an X. When I use the following in a simple html file and display it using a browser (Firefox, Chrome), it displays correctly. In both cases the file references are relative; both the FMP file and the html file are stored in the same directory, from where the image is referenced. <html> <head> </head> <body> <p>Hello</p> <div><img src="Maths_AS/Questions/q1.png" style="width: 700px"></div> <p>Good-bye</p> </body> </html> I am using Windows 10 Professional with FMP Advanced v.11. I would be most grateful for some help here! Thanks in advance Bruce
comment Posted May 2, 2017 Posted May 2, 2017 (edited) 7 hours ago, BruceB said: both the FMP file and the html file are stored in the same directory, from where the image is referenced. The problem here is that when you're using the data URI scheme, there is no real HTML file. There is only a virtual HTML document - which cannot be found in any directory on your hard disk. You can see this by loading the following code into your web viewer: "data:text/html, You are here: <br/> <script> document.write(window.location.href); </script>" Possible solutions: 1. Use an absolute reference to the image file; 2. Embed the image data in the HTML code. Edited May 2, 2017 by comment
Newbies BruceB Posted May 3, 2017 Author Newbies Posted May 3, 2017 Thanks for the help. That has sorted out the problem.
Recommended Posts
This topic is 3028 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 accountSign in
Already have an account? Sign in here.
Sign In Now