Insert variables into browser

Recommended Posts


I got a simple question about the CEF. I'm trying to insert variables into the browser but I can't get it to work.

Here's my code:

var browser ="package://test/index.html");
browser.execute(`var playerName = ${;}; document.getElementById("name").innerText = playerName;`);

After this gets executed my div only says "undefined". Any ideas why?



Stupid mistake.. I just forgot to put quotation marks around the variable like

borwser.execute(`var playerName = "${}"`);


Edited by TheDusty01

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.