Home News DOC Class DL Others Rice
Class  >  jsexecutor  >  SetSRC(string,string,string)
jsexecutor class : SetSRC(string,string,string) method

Description

Creates a script tag and sets the src attribute.

Syntax

instance.SetSRC(string url, string id, string charset)

Arguments

ClassNameDescription
stringurlUrl to JavaScript code.
stringidid attribute.
stringcharSetEncoding name.

Return value

None.

Sample code

1:

window w;

2:

jsexecutor jse = w.CurrentJSExecutor;

3:

string url = "https://code.jquery.com/jquery-3.5.1.min.js";

4:

string id = "sample";

5:

string charset = "utf-8";

6:

jse.SetSRC(url, id, charset);

The following script tag is added to the body tag.

1:

<script src="https://code.jquery.com/jquery-3.5.1.min.js" id="sample" charset="utf-8">

2:

</script>

Notes

None.

Links for reference

None.

Copyright © Rice All rights reserved.