Do we still have a 'sister site' for JS stuff?

I really want to complain about the fact that you can't do a module import from anything but a quoted string...

    Thanks for the link. "coerced from a string" is helpful. Firefox (devel browser of necessity due to certificate issues with the devel site at the moment) had docs that said "only a string was acceptable" and I was needing to alter the path based on a PHP config variable. Fortunately the relative path to DOCROOT was the same both places so that worked:

    import foobar from '/js/json/foo.js'

    I was afraid CORS would block, but it seems to be okay.

    dalecosp Firefox (devel browser of necessity due to certificate issues with the devel site at the moment)

    I prefer Firefox.

    dalecosp was needing to alter the path based on a PHP config variable.

    This is a bit confusing. Can you not just output the PHP string in your JS like so:

    import foobar from <?php echo $my_path_var; ?>;

    ?

    7 days later

    sneakyimp

    If the JS was produced by PHP, yes. But it's just plain vanilla JS. It all came out in the wash for this one at least. :-)

      Write a Reply...