adobe / adobe/pdf-embed-api-samples
Cannot load api via jquery getScript()
Open
- Dominant language
- JavaScript
- Stars
- 235
- Forks
- 140
- PR merge metrics
- No merged PRs in 30d
Description
### Expected Behaviour
Use jquery getScript() to load the API at run time when needed, the script is loaded and the `adobe_dc_view_sdk.ready` event is fired.
### Actual Behaviour
An unhandled javascript exception occurs: `TypeError: Cannot read properties of undefined (reading 'src') at loadSDKScript`
#### Sample Code that illustrates the problem
https://jsfiddle.net/redtopia/o3m689sg/6/ (view the console to see the exception)
The following fiddle fixes the issue by loading the script with vanilla javascript
https://jsfiddle.net/redtopia/Lyqdj2zm/6/
Contributor guide
Assessment
This issue has not been assessed yet.