Ich führe in einen webBrowser Control (CEFSharp) folgendes aus:
browser.ExecuteScriptAsync("document.getElementById('mainInput').value='test'");
Passiert dies dann offline, also mit dem HTMLcode der im Control aktuell im cache liegt ?
Zitat aus der Beschreibung der Methode:
Execute some Javascript code in the context of this WebBrowser. As the method name implies, the script will be executed asynchronously, and the method therefore returns before the script has actually been executed.
This simple helper extension will encapsulate params in single quotes (unless int, uint, etc)
Es wird also im aktuellen Browser Context durchgeführt - wie du sagst: "offline."
Clientseitiges Javascript wird immer lokal ausgeführt. In jedem im Browser.
document
ist das aktuelle HTML-Dokument der Seite.
Das wurde schon heruntergeladen, bevor man darauf zugreifen kann.
- performance is a feature -
Microsoft MVP - @Website - @AzureStuttgart - github.com/BenjaminAbt - Sustainable Code