Jump to content

Search the Community

Showing results for tags 'executebrowserjavascript'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Member Title





Found 2 results

  1. 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
  2. Hello I have an issue when I trigger an event that call a function using onClientBrowserDocumentReady, i don't know what is the issue... This is my code: The issue is... onClientBrowserDocumentReady doesn't found the browser and it can't in into the event. the executeBrowserJavascript doesn't work event = {add = addEventHandler, load = addEvent, execute = triggerServerEvent} local WINDOW_WIDTH, WINDOW_HEIGHT = guiGetScreenSize() local CEF = nil local browser = nil function deleteWebPage() if isElement(CEF) then destroyElement(CEF) showCursor(false) end end function createWebPage() page = "http://mta/player/html/login.html" CEF = guiCreateBrowser(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, true, false, false) browser = guiGetBrowser(CEF) addEventHandler("onClientBrowserCreated", browser, function() loadBrowserURL(source, page) showCursor(true) end) end function sendErrorLabel(error) addEventHandler("onClientBrowserDocumentReady", browser, function() executeBrowserJavascript(browser, "document.querySelector('.error:nth-child(5)').innerHTML = '" .. error .. "'"); executeBrowserJavascript(browser, "document.querySelector('.error:nth-child(5)').style = 'display: initial; top: 90%; left:40.5%'"); end) end event.load('login-data:send', true) event.add('login-data:send', root, function(user, password) event.execute('login-menu:execute', resourceRoot, user, password) end, true) event.load("onClientPlayerLogout", true) event.add("onClientPlayerLogout", root, function() createWebPage() end) event.load("show-label:error", true) event.add("show-label:error", root, function(error) sendErrorLabel(error) end) event.load('login-menu:remove', true) event.add('login-menu:remove', root, function() deleteWebPage() end) event.add("onClientResourceStart", resourceRoot, function() createWebPage() end)
  • Create New...