Comments (2)
Hello @pehrlich2
the value of container
is just a DOM element (usually div) where you would like to inject the snippet.
If you have a HTML embed like this:
<div id="wrapper" class="nice-form" data-tf-widget="<id>" data-tf-...></div>
You can convert it to JavaScript embed like this:
<div id="wrapper" class="nice-form"></div>
<script>
const container = document.querySelector("#wrapper")
window.tf.createWidget("<id>", { container })
</script>
This should preserve all other CSS or logic you might have attached to the container.
Alternatively, if you'd like to keep using your existing embed code with data-tf-
attributes and it is the only form on your page, maybe you could try to use window.tf.reload()
(see docs) after you modify the snippet to reload your typeform with new data. Or if there is no typeform in the page, just call window.tf.load()
after you inject the snippet into your page.
from embed.
Brilliant window.tf.reload
did just what I was looking for. Thanks!
from embed.
Related Issues (20)
- test HOT 2
- second test
- test bot
- test test
- [Android Device] For Widget component, when keyboard shows up, it refreshes entire Typeform Widget HOT 5
- Text input loses focus on android devices HOT 2
- Integration with Expo and React native? HOT 3
- Enable pre-loading of a typeform HOT 4
- Ik
- Preview API for the individual response? HOT 1
- Typescript error for partial-element-with-additional-attributes.d.ts HOT 2
- Modal close button needs accessible label HOT 3
- Get answers for an embedded form without server side APIs / access tokens HOT 10
- Missing react types for 4 of the components HOT 4
- [FEATURE] A way to know if an embedded typeform is over quota and "closed" HOT 8
- NextJS Typeform Embedding HOT 3
- Embedding within a cross origin isolated document HOT 5
- HubSpot tracking option documentation missing
- Widget shows Typeform homepage when using React library HOT 1
- Typescript: type issue with components ref HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from embed.