Welcome Guest Search | Active Topics | Sign In | Register

eo.webbrowser .net evalscript large scripts Options
Ioannis
Posted: Wednesday, May 18, 2016 4:07:09 PM
Rank: Newbie
Groups: Member

Joined: 5/13/2016
Posts: 5
This may not belong here but I wanted to share....

This is a much cleaner way to inject larger javascript code into the browser. It makes it easier to edit the javascript and manage the code.

Quote:

'Usage:
WebView1.EvalScript(readJSFile("jsTextFile.js"))

Private Function readJSFile(ByVal fileName As String) As String

readJSFile = Nothing

If File.Exists(My.Application.Info.DirectoryPath & "\" & fileName) Then

readJSFile = vbCrLf

For Each line As String In File.ReadLines(My.Application.Info.DirectoryPath & "\" & fileName)
readJSFile = readJSFile & line & vbCrLf
Next

End If
End Function


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.