mobileFX WebKitX CEF3 ActiveX 4.x
WebKitXCEF3Lib ActiveX Control / WebKitXCEF3 Object / AddScript Method

The URL of the <SCRIPT> element.

In This Topic
    AddScript Method
    In This Topic
    Description

    Add a new <SCRIPT> element in the currently loaded page and set its URL.

    Syntax
    Visual Basic
    Public Sub AddScript( _
       ByVal url As String _
    ) 
    Parameters
    url

    The URL of the <SCRIPT> element.

    Remarks

    This method can be used to insert JavaScript in a page on demand.

    Example
    Private Sub mnuAddScript_Click()
        On Error Resume Next
        Dim s As String
        s = InputBox("Script URL:", , Replace("file:///" + App.Path + "/test.js", "\", "/"))
        If s = "" Then Exit Sub
        WebKitX1.AddScript s
    End Sub
    private void menuItemAddScript_Click(object sender, EventArgs e)
    {
        string input = Microsoft.VisualBasic.Interaction.InputBox("Script URL", "HTML5Pad", ("file:///" + Application.CommonAppDataPath + "/test.js").Replace("\\", "/"), 500, 300);
        if (input != "")
        {
            WebKitXCEF31.AddScript(input);
        }
    }
    See Also