Draw on Canvas in generated HTML doesn't work


#1

Hello!

I have a problem with the generated HTML files. I’ve got a OnPageLoad event which contains drawing some lines on an Canvas. This works properly in the preview, but not in the generated HTML.

Here is my prototype:
example.rp (128.6 KB)

And here the steps to explain an reproduce the problem:

  1. Click on “Draw”-button
  2. Draw five points by clicking on iframe area (5th point has an arrow at his end)
  3. Click on “Draw”-button

In preview:
4. the same arrow (with thinner line) is shown
5. click on iframe-area
6. set number to “3” and choose “Auto” in droplist and click “Speichern”-button
7. the same arrow is shown, but with a three-line-stroke and is colored red

In generated HTML:
4. the arrow disappears but a click on the iframe area shows menu as it does in preview

I tried to fix it by loading a page that just loads the page I really want to load, but that didn’t work.

That means that a part of the javascript is executed (or works) and another part, that one that draws the arrow, doesn’t.
I’m very confused by this. Are the global variables I use to draw the arrow not working in the generated HTML? Or is there another mistake?

I would be so so thankful if anybody could help me!

Thanks!


#2

Tried recreating your issue but no matter what I did the behavior was exactly the same in preview and the generated HTML.

Also, in case you care, your prototype is entirely broken in Firefox. In your Open Link actions with JS you need to include throw new Error() at the end each time or it won’t work in Firefox.


#3

Thanks for your reply!
Maybe I have the wrong settings for generating the HTML? Is it possible that you tell me yours?

And thanks for the info about Firefox! :slight_smile:


#4

Default settings, I changed nothing. In both preview and generated, after step 6 I saw the three line stroke colored red. Both looked the same.


#5

Then I don’t get it. I’m not able to make it work… I really don’t know why there is a different behaviour on my pc.

But thanks alot for your help! Now I know, that’s it is not an axure error…


#6

Are there any errors in the browser console in the instances where it doesn’t work? What browser did you try? I used Safari.


#7

This works the same in Preview as in local HTML for me as well. On Win10 with Chrome or Edge browser it works. With Firefox or MSIE it fails with a “function(e) dump” --but always same behavior in Preview as with generated HTML.

Are you using the default HTML generator? It appears you are, as that is what is in your .rp file.
Are you using the same browser for Preview as for your local HTML?
Have you closed and reopened your browser? Rebooted computer?

If still having an issue, you should email your .rp file to support@axure.com


#8

I use Chrome for preview and generated HTML. My whole prototype is designed to (only) work in Chrome…
The browser console says nothing but “loadTime: 0.003”.


#9

Thanks for your reply!
I’m using the default HTML generator. And I’m using the same browser for Preview an local HTML (Chrome). I reopened the browser and I rebooted my computer…
I think I should try what you said and mail my .rp to axure.


unlisted #10