【问题标题】:How do I detect if jQuery is in a document navigated to in the WinForm WebBrowser control?如何检测 jQuery 是否在 WinForm WebBrowser 控件中导航到的文档中?
【发布时间】:2010-10-01 05:35:15
【问题描述】:

我在 C#/Visual Studio 2008 中有一个带有 IE WebBrowser 控件的 Windows 窗体应用程序。在 DocumentCompleted 事件中,我想搜索 WebBrowser.Document 或 WebBrowser.DomDocument 以查看页面中是否已经存在 jQuery。

有什么好方法可以做到这一点?

谢谢!

【问题讨论】:

    标签: c# jquery winforms dom webbrowser-control


    【解决方案1】:

    你试过了吗:

    bool hasjQuery = webBrowser1.Document.InvokeScript("jQuery") != null;
    

    【讨论】:

    • 谢谢!在​​少数情况下,我会尽快将您标记为答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-23
    • 2011-07-26
    • 2010-11-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多