Adds code to the global JavaScript object of the currently loaded page.
Typically this should be ECMA JavaScript code but if Harmony flags are enabled in OnCreate then you can also add ES6 JavaScript code to the control.
Adds code to the global JavaScript object of the currently loaded page.
Visual Basic |
---|
Public Sub AddCode( _ ByVal javascript As String _ ) |
Typically this should be ECMA JavaScript code but if Harmony flags are enabled in OnCreate then you can also add ES6 JavaScript code to the control.
You must make sure that the HTML page has loaded, parsed and rendered successfully before you call this method.
Private Sub mnuAddCode_Click() On Error Resume Next Dim s As String s = InputBox("JavaScript Code:", , "alert('test')") If s = "" Then Exit Sub WebKitX1.AddCode s End Sub
private void menuItemAddCode_Click(object sender, EventArgs e) { string input = Microsoft.VisualBasic.Interaction.InputBox("JavaScript Code", "HTML5Pad", "alert('Test')", 500, 300); if (input != "") { WebKitXCEF31.AddCode(input); } }