I am using Formsite to try to imput a form into my Wix site. iFrame Embedding works with HTML coding. Javascript is better for my purposes becuase I have multiple pages and the scrolling has issues in iFrame.
Anyone have a work around for this code that doesn’t seem to work? Javascript code is below.
I have been using the Wix Page Code on the bottom of my editor. I get multiple errors signs and after some trouble shooting I am just at a loss.
Thanks!
hey
You can’t use that kind of scripting in the code editor so I guess the best way for now is the iframe solution. What do mean by scrolling has issues in iframe? On mobile?
WixCode understands all of Javascript, except for anything that accesses the DOM.
This keeps the user from inadvertently “breaking” something. I myself tried to hack things from the code, from an iFrame, and in my dreams, but WixCode wasn’t having any of it.
Accessing document elements such as div, span, button, etc is off-limits. The way to access elements on the page is only through $w.
One small exception is the $w.HtmlComponent (which is based on an iFrame). This element was designed to contain vanilla HTML and it works just fine. You just can’t try to trick it by using parent, window, top, etc. Same goes with the Javascript evaluate() function. It is sandboxed and does not allow access to the DOM.
For your purposes, you might want to consider using the HtmlComponent . For more information, see the article Working with the HTML Component in Wix Code .
Good luck,
Yisrael