Home Cooker Classes Others Rice
Classes  >  jsexecutor  >  SetSRC(string,string,string)
jsexecutor class : SetSRC(string,string,string) method

Description

It creates a script tag to current page, and sets the src attribute in order to load JavaScript code.

Syntax

jsexecutorInstance.SetSRC(string url, string id, string charSet)

Arguments

ClassNameDescription
stringurlAn url of JavaScript code to be loaded.
stringidA value of id attribute.
stringcharSetAn appropriate encoding name.

Return value

None.

Sample code

1:

jsexecutor jse = new jsexecutor();

2:

string url = "http://somewhere...";

3:

string id = "js"; // An identifier for the script tag to be created.

4:

string charSet = "utf-8";

5:

jse.SetSRC(jsCode, id, charSet);

Notes

If the id attribute do not need, specify an empty string for the second argument.

If the charset attribute do not need, specify an empty string for the third argument.

Links for reference

None.

Copyright © Rice All rights reserved.