1

本当の人は、建物に入る人の数を数えるAXIカメラを数えます。ライブビューとカウントイン\アウトをウェブページで見ることができます。カウント結果をアニメーションなしで画面に表示したい。vb.netのwebbrowserコントロールを使用して、ライブビューのWebページをロードし、webbrowserにjavascriptを挿入して、テキストボックスにカウントを表示することを考えました。これが私のコードですが、JavaScriptテキストでエラーメッセージが表示され続けます。

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Me.WebBrowser3.Navigate( "http://10.xx.xxx.xx/people-counter/liveview.html"

Private Sub WebBrowser3_DocumentCompleted(ByVal sender As System.Object、ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)Handles WebBrowser3.DocumentCompleted

    Dim mScript As HtmlElement
    Dim mHead As HtmlElement
    Dim element As mshtml.HTMLScriptElement


    With WebBrowser3
        mHead = WebBrowser3.Document.GetElementsByTagName("head")(0)
        mScript = .Document.CreateElement("script")
        mScript.SetAttribute("type", "text/javascript")
        element = mScript.DomElement
        element.text = "$(function showcount(){$("#video").countingArea($.extend({},cntarea,{displayWidth:320,displayHeight:240,mjpgUrl:"/axis-cgi/mjpg/video.cgi?resolution=320x240",jpegUrl:"/local/people-counter/.api?image.jpg",fps:12}));$.liveviewWithTable({countsTableElement:$("#counts"),countTableElement:$("#count"),directionIn:$.getParam("Counter.DirectionIn"),liveSumUrl:"/local/people-counter/.api?live-sum.json",loadingAnimationUrl:"/people-counter/images/ajax-loader.gif",dataTypes:["in","out"],strings:{"x second ago":"%d second ago","x seconds ago":"%d seconds ago","x minute ago":"%d minute ago","x minutes ago":"%d minutes ago","x hour ago":"%d hour ago","x hours ago":"%d hours ago","x day ago":"%d day ago","x days ago":"%d days ago","x week ago":"%d week ago","x weeks ago":"%d weeks ago","x month ago":"%d month ago","x months ago":"%d months ago","x year ago":"%d year ago","x years ago":"%d years ago"}})});"

        mHead.AppendChild(mScript)
        .Document.InvokeScript("showcount")
    End With
End Sub
4

0 に答える 0