Discord Moderators Pirulax Posted March 8, 2018 Discord Moderators Share Posted March 8, 2018 Hello, so im here with a simple question. So we have a function called 'executeBrowserJavascript', and i have a question with using this function.So, i have scripts[js] linked to a html file, which is loaded by a browser, the question is: Can i use the functions definited inside these scripts? Ex.: --> A browser is created, and a local page is loaded in it, the index.html has the following content: <!DOCTYPE html> <html> <body> <h1 id="playername">Your name</h1> <script type="text/javascript" src="assets/js/script.js"></script> </body> </html> and the script has the following function: function setname(name){ document.getElementById("playername").innerHTML = name; } and i want to call this function from lua like this: executeBrowserJavascript(browser, "setname('"..getPlayerName(localPlayer).."')" Is it possible?If not, is there any way to do such things? Link to comment
Discord Moderators Pirulax Posted March 8, 2018 Author Discord Moderators Share Posted March 8, 2018 2 minutes ago, Jayceon said: Yes, it's possible. Yeah, a friend of mine already told me. Nice to meet ya' btw Jay.[Im hungarian, just to give you idea why i said this.] @Jayceon Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now