krux / postscribe

Asynchronously write javascript, even with document.write.
MIT License
986 stars 156 forks source link

Html is loaded partially #510

Open RezikoChkadua opened 3 years ago

RezikoChkadua commented 3 years ago

Hello, I'm trying to embed the script from the FromStack into the Next.js application.

The problem is that the HTML is rendered partially and some of the content is missing.

gradpawel commented 1 year ago

Hi, I have similar issue. Application is written in vuejs 2.7.

  mounted() {
    const loadingDone = () => {
      this.$emit("formstack-loading-done");
    };
    postscribe(
      "#formstack",
      `<script type="text/javascript" src="${process.env.VUE_APP_FORM_URL}"></` +
        `script>`,
      {
        done: loadingDone,
      }
    );
  }

I'm waiting untill it will be loaded then event is emitted which manipulates DOM to show form. I't never showing next button on form after entering the page. When I refresh page it will always show form correctly.

@RezikoChkadua have you fount the solution?