Add a div to the dom?

0 favourites
  • 2 posts
From the Asset Store
Add SubRip (SRT) subtitles to your videos in Construct 3
  • Please help,

    I've been trying to dynamically create a div to add to my program. What I have doesn't work. Could someone help me figure out what I'm doing wrong in my runtime. Here is the action:

    Acts.prototype.Like_Button = function (l_verb, l_color, l_under, l_layout,l_faces,l_url,l_code)


    var div1 = document.createElement("div");"absolute";"100px"; = "10px";

    // = "white";

    div1.innerHTML = '<div class="fb-like" data-href="" data-layout="box_count" data-action="recommend" data-show-faces="true" data-share="true" data-ref="home_rec"></div>';

    document.body.appendChild (div1);


    Any help would be greatly appreciated.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • That code looks like it ought to work, but that "fb-like" inner div looks like it will do nothing by itself unless you also include the script that makes it do something. TBH this isn't much specific to Construct 2, it's just ordinary JS code, so maybe you could ask somewhere like

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)