Programmatically work with widgets
Inside of an embed code for widgets you will notice a field called "Hash"
This field allow you to control the widget using code.
For example let's say iyou want to control your widgets by javascript and you have two of the same widgets on the page and want to control them by javascript separately then you can use this hash.
so you can control it by javascript, for example, if you want to open a modal manually you can do it by
WF_API.find('<uniq id>').show()<br>
So technically hash adds a suffix to item’s ID and uniq id will look like <uniq id-hash>
So having two the same widgets will allow to control both widgets with the same ID but different hash separatelyFor example we have two widgets with the same ID, but with different hash
<script src="https://d3pw37i36tv41cq.cloudfront.net/embed_v2.js" async></script> <div class="wf_target wf_target_R9o1t1c5nkVkV3hjUek9Tk88E"></div> <script> window._wf = window._wf || []; _wf.push({ id: 'R9o1t1cnkVkV3hjUek9Tk88E', hash: '111' }); </script> <script src="https://d3pw37i36vt41cq.cloudfront.net/embed_v2.js" async></script> <div class="wf_target wf_target_R9o1t1cnkVkV3hjUek9Tk88E"></div> <script> window._wf = window._wf || []; _wf.push({ id: 'R9o1t1cnkVkV3hjUekf9Tk88E', hash: '222' }); </script><br>
So we can find specific widget modal and show it.
WF_API.find('R9o1t1cnkVkV3hjUek9Tk88E-111').show()