Insert iframe and js code

  • Unknown's avatar

    Hi, I’m trying to insert this code widget :

    var myEventMethod = window.addEventListener ? ‘addEventListener’ : ‘attachEvent’; var myEventListener = window[myEventMethod]; var myEventMessage = myEventMethod == ‘attachEvent’ ? ‘onmessage’ : ‘message’; function onEventClick(eventId, occId) { } myEventListener(myEventMessage, function(e) { switch (e.data.action) { case ‘setHeight’: { document.getElementById(‘form-iframe’).height = (e.data.height) + ‘px’; break; } case ‘eventClick’: { var eventId = e.data.params.eventId; var reservationId = e.data.params.reservtionId; onEventClick(eventId, reservationId); break; } } }, false);

    I’ve tried using the shortcode feature and also editing my page with the code editor. No luck. If I include just up until the JS code, I can see the calendar on the page, but not when I hit preview. Please advise.

  • Hi there,

    You will not be able to use this code on a free WordPress.com site, as we allow neither JavaScript nor iframe code to be used on WordPress.com:

    Add Code to Your Site

    Using custom code like that on a WordPress.com site is only possible on our Business or eCommerce plan.

  • The topic ‘Insert iframe and js code’ is closed to new replies.