Browse Source
1. Use document.getElementsByTag name to find the script's path. When used async, this fails by providing the wrong path instead of failing catastrophically. 2. Detect if the script was loaded asynchronously by attaching a load event to the body and seeing if it fires. 3. Evaluate the correct script path when it is requested. This gives the user time to manually configuring it using the Papa.SCRIPT_PATH global. If this isn't done and the script was loaded async, throw a helpful error explaining how to fix.pull/120/head
Ed Sanders
10 years ago
1 changed files with 21 additions and 7 deletions
Loading…
Reference in new issue