Skip to content

Commit 71680e1

Browse files
committed
Update readme.md
1 parent 49204ad commit 71680e1

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

readme.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ EasyQRCodeJS 是一个功能丰富的跨浏览器的纯 JavaScript QRCode 生成
2424
- [React Support](#react-support)
2525
- [Next.js Support](#nextjs-support)
2626
- [Browser Compatibility](#browser-compatibility)
27+
- [FQA](#fqa)
28+
- [Q1. Tainted canvases may not be exported.](#q1-tainted-canvases-may-not-be-exported)
2729
- [License](#license)
2830
- [EasyQRCodeJS-Premium:](#easyqrcodejs-premium)
2931
- [End](#end)
@@ -647,6 +649,35 @@ var qrcode = new QRCode(DOM_object, options_object);
647649
export default About;
648650
```
649651
652+
653+
## FQA
654+
655+
### Q1. Tainted canvases may not be exported.
656+
657+
When use canvas drawer, Canvas toDataURL function does not allow load cross domain image. there are three options to slove this problem:
658+
659+
- Option 1:
660+
661+
Configure the `crossOrigin` attribute([crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin)) for the image. Make sure that CORS is configured on the Server side.
662+
663+
```JS
664+
{
665+
...
666+
// String which specifies the CORS setting to use when retrieving the image. null means that the crossOrigin attribute is not set. 'anonymous', null.
667+
crossOrigin : 'anonymous',
668+
...
669+
}
670+
```
671+
672+
- Option 2:
673+
674+
Put your image under the same domain with your page.
675+
676+
- Option 3:
677+
678+
Use base64 image.
679+
680+
650681
651682
## Browser Compatibility
652683
IE6+, Chrome, Firefox, Safari, Opera, Mobile Safari, Android, Windows Mobile, ETC.

0 commit comments

Comments
 (0)