DocumentComplete (Event)

From Legacy Roblox Wiki
Jump to navigationJump to search
DocumentComplete ( String URL )
Description Fired when the DHTML document finishes processing a SetBody
Member of: HtmlWindow


Example
This code would fire when the document finishes loading:
local HtmlService = game:service("HtmlService")
local htmlWindow = HtmlService:NewWindow()

htmlWindow.DocumentComplete:connect(function()
	htmlWindow:SetBody("Hello World!")
end)

htmlWindow:Show()
htmlWindow:Navigate()


Note: DocumentComplete is not required to set the contents of the window, but without it you are making a race condition for when you try to display something. I recommend debouncing an initial DocumentComplete in the case that you want to modify it's contents.