new Strings()
String processing
this class is for an easier work with Strings and complexer script blocks
- Version:
- 0.0.1
- Since:
- 07.09.2017
- Source:
Classes
Methods
(static) entscripter(sStr) → {String}
Change the script tags to scri+pt
with this function we solve the problem that a script Tag in an String is interpreted as code.
When that happens, the Script breaks down and wont work.
Parameters:
Name | Type | Description |
---|---|---|
sStr |
String | String origin |
- Source:
Returns:
- Type
- String
Example
sdi = new SDI.LIBRARY.String;
strScript = sdi.entscripter(decodeURIComponent("<script>a=(a>b)?a:b;<\/script>"));
console.log(strScript);
(static) srcgetter(sStr) → {*}
Get the src as String
With this function we can get the Source String from an Iframe or an Image
Parameters:
Name | Type | Description |
---|---|---|
sStr |
String | Ursprünglicher String |
- Source:
Returns:
- Type
- *
Example
sdi = new SDI.LIBRARY.String;
strScript = sdi.srcgetter(decodeURIComponent("<script src='http://example.com'><\/script>"));
console.log(strScript);