innerHTML access

Hello!

I’d like to set a specific DIV on a page, and I was wondering if Wix Code has innerHTML enabled.

Here is a screenshot from the editor showing innerHTML as undefined: http://i.imgur.com/v9OcGZz.png

I checked to see if this were a jQuery issue, and the property that seems to work best for that, “html,” is also undefined: http://i.imgur.com/BF9KpQ3.png

I figure either I’ve got a bug in my code, I’m going about this the wrong way, or this is a feature that’s specifically not available. Happy to hear your thoughts on this!

And yes, I’ve got the line closed off appropriately with a closure of the string and a semicolon.

(Also, is there a way to get the editor to line wrap?)

1 Like

Hi Todd,
can you share a bit more details on what exactly you are trying to achieve through the use of innerHTML?
there might be better approaches to achieve what you’re trying to do…
thanks!

Hi Ziv,

I’m attempting to integrate a 3rd party service, “The Booking Button,” which necessitates placing a DIV with specified properties and bringing in some external JavaScript.

The instructions are decently simple from TheBookingButton’s perspective: http://i.imgur.com/KAU8s37.png

What I’m really looking for is a method to get that small amount of HTML onto the site. innerHTML is a method I’ve used with success on past projects outside of Wix, but I’m excited to see if there is a way to do this with Wix Code.

Take a look at our HTML component here .
it should point you in the right direction…
let us know how it turned out!

Sadly, iFrames aren’t working in this situation–my page needs to work on mobile phones, and I’ve had an compatibility issue with Android phones using the standard Wix iFrames (their scrolling is disabled within the larger page), not to mention standard Wix iFrames aren’t responsive as far as I can tell, leaving me with a really tiny viewport that isn’t really functional.

If you’re curious, here is the page with the Booking Button implemented: http://bit.ly/2vqtkap

I’ve tested it on Android and Chrome emulating an iPhone (impossible to scroll), as well as on an iPhone (too small but scrolling works).

I’m still hoping that there is a solution to this problem in Wix Code!

Interesting case. We’ll take a deeper look and see what we have to say…

I appreciate it greatly!

Wondering if there’s been any progress on this thread. I’ve got the same issue with a 3rd party DIV tag that needs to be embedded. The base EMBED object is really an iFrame which doesn’t work in this case. On the topic of iFrame, is there a way to prevent iFrames from opening in a new tab?