Embed form as script
-
Hello, can you please tell me if it’s possible to embed a form in another website as a script and not as an iframe?
I want to give the visitors the option to embed a form (which has a backlink) on their website, but not as an iframe, for SEO purposes.Like this example here:
<script src="https://estate.realsoftinvest.ro/api/taxe_notariale/widget?v=1"></script>Thank you
-
Hello @victoriei101
You can implement a script to generate the iframe by coding. For example, assuming the URL to the form is: https://www.yourwebsite.com/?cff-form=1
You can implement the script similar to:
var iframe_tag = document.createElement("iframe"); iframe_tag.setAttribute("src", "https://www.yourwebsite.com/?cff-form=1"); iframe_tag.style.width = "100%"; iframe_tag.style.height = "480px"; document.body.appendChild(iframe_tag);Note my code is only an example to illustrate the process.
Best regards.
I embedded the above code and unfortunately, it doesn’t work. Thanks anyway
Hello @victoriei101
The code I sent you previously is only an example. Please, send me your definitive code.
Best regards.
The code below (simple script, no iframe), when embedded in any site, displays a calculator:
<script src="https://estate.realsoftinvest.ro/api/taxe_notariale/widget?v=1"></script>I want to have a similar script, using CFF, that can be embedded without iframe, exactly like the code example above.
Something like this:
<script src="https://www.yourwebsite.com/widget/?cff-form=1""></script>
ThanksHello @victoriei101
No, sorry, that is not possible because the URL you are referring to does not generate a javascript code block.
The alternative would be to create a JS file with a code similar to the script I sent you in a previous entry. This code would generate the iFrame tag, loading the form into it.
Best regards.
Hi, I’ve added your code
var iframe_tag = document.createElement("iframe"); iframe_tag.setAttribute("src", "https://ioio.ro/?cff-form=5"); iframe_tag.style.width = "100%"; iframe_tag.style.height = "480px"; document.body.appendChild(iframe_tag);here: https://ioio.ro/cff
and added this script <script src=”https://ioio.ro/cff”></script>
on this page https://ioio.ro/test/but the form is being displayed only at the bottom of the page, even while the script is at the top of the page, right above the headline.
Please see image:
https://ibb.co/b7f94rtHow can I display the form exactly where the script is being added?
ThanksHello @victoriei101
In the code I sent you as a reference, I used
document.body.appendChild(iframe_tag);You should replace it with the code to display the iframe tag in another place.
I’m sorry, but the support service does not cover the implementation of the users’ project. If you need me to edit your code, you can contact me through the plugin website:
https://cff.dwbooster.com/contact-us
Best regards.
The topic ‘Embed form as script’ is closed to new replies.