SenX. Posted February 9, 2021 Share Posted February 9, 2021 Hi! l need help exporting data from 'GetElementData' using executeBrowserJavascript Here is a snippet from the code: Client: local browser = guiGetBrowser(guiCreateBrowser(0, 0, 1920, 1080, true, true, true)) addEventHandler("onClientBrowserCreated", browser, function () loadBrowserURL(source, "http://mta/account/Characters/MainMenuChar.html") showCursor(true) setDevelopmentMode(true, true) end) addEventHandler("onClientBrowserDocumentReady", browser, function () executeBrowserJavascript(source, "document.getElementById('nickname').innerHTML = '" .. getElementData(thePed,"account:charselect:name") .. "'"); end) it does not work with CEF(HTML) files, when you call 'GetElementData' using the GUI, everything works and is displayed correctly. When entering a standart varible, for example getPlayerName(localplayer) everything is also displayed in CEF and in the GUI Problems with the HTML file are excluded, except that there are no additional scripts using JavaScript (tell me, are they required?) P.S Thank you in advance for each of your answers, maybe they will help not only me, but also other newcomers in our community Link to comment
Scripting Moderators xLive Posted February 10, 2021 Scripting Moderators Share Posted February 10, 2021 (edited) Maybe getElementData returned a boolean value? see the debug if there is any error, Also are you sure from the key and thePed? because i don't see it in your code Edited February 10, 2021 by xLive Link to comment
Tekken Posted February 10, 2021 Share Posted February 10, 2021 You may add getElementData(..) or "NoName" See if maybe the element data isn’t yet set thus outputting nil 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