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.

Image not displaying in web viewer

Featured Replies

  • Newbies

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

 

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 by comment

  • Author
  • Newbies

Thanks for the help. That has sorted out the problem.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.