Giter Club home page Giter Club logo

Comments (5)

theprojectsomething avatar theprojectsomething commented on August 24, 2024

Hey @joemasilotti thanks for the kind words and posting issue #1! And a legit issue, no less.

If I copy-paste the <script> tag mentioned in the README I get the following error in the console. I'm running Safari v15.2.

This is a mistake in the readme unfortunately! Try importing the core script instead, which works without modules / workers:
<script src="//cdn.jsdelivr.net/npm/[email protected]/src/re.places.core.js"></script>

If I try to use the dynamic import I get the following error in both Safari and Chrome.

And another problem with the readme! I neglected to mention that this line must be used in a module, e.g:

<script type="module">
import replaces from 'https://cdn.jsdelivr.net/npm/[email protected]/re.places.js'
// ... search logic goes here
</script>

I've put together some minimal working examples for both the standard script and the module import, both tested and working in chrome, safari and firefox.

Thanks for bringing these up, I'll push the changes up into the readme as soon as i get a chance. I'll need to include a small fix for the standard script tag usage as well, so you're not stuck with the worker-less core version. Will aim to have a fix up for tomorrow AEST.

And if you do get things up and running, any feedback would be most appreciated.

from re.places.

joemasilotti avatar joemasilotti commented on August 24, 2024

I'm not sure how to set up the module type script, so I can't comment on that.

But for the CDN, if I use your new import script I get the following errors:

[Error] Load cannot follow more than 20 redirections
[Error] Cross-origin script load denied by Cross-Origin Resource Sharing policy.
[Error] Failed to load resource: Load cannot follow more than 20 redirections (re.places.core.js, line 0)

from re.places.

theprojectsomething avatar theprojectsomething commented on August 24, 2024

from re.places.

theprojectsomething avatar theprojectsomething commented on August 24, 2024

Hi @joemasilotti I've just pushed an update that should (hopefully!) resolve your issue, can you try importing the latest version of the library using the following tag:

<script type="module" async src="https://cdn.jsdelivr.net/npm/[email protected]/re.places.js?global"></script>

You should then be able to use replaces in a standard script tag, no module wizardry required.

If you'd prefer to name the global variable something other than replaces (for semantics, beauty, whatever), you can specify it as a search parameter of the script src, e.g. global=groovynewname

I've updated the minimal example I put together for you to show this working: https://codepen.io/theprojectsomething/pen/eYeeNmE?editors=1010

from re.places.

joemasilotti avatar joemasilotti commented on August 24, 2024

Got it, thanks for the help!

from re.places.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.