Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7814567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:14:08+00:00 2026-06-02T05:14:08+00:00

First question so be gentle. I have been trying some projects involving the webbrowser

  • 0

First question so be gentle. I have been trying some projects involving the webbrowser component. I wanted to simply set the search string in google. I have IE9 installed on this machine. I run the below code:

 Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
    Dim dumstr As String = ""
    Dim jqCheck As Boolean = False
    Dim dum As Object
    WebBrowser1.Navigate("http://www.google.com/ncr")
    Do While WebBrowser1.IsBusy = True Or WebBrowser1.ReadyState <> WebBrowserReadyState.Complete
        Application.DoEvents()
    Loop
    dum = {"javascript:var element1 = document.createElement(""script"");element1.src = ""https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"";document.getElementsByTagName(""head"")[0].appendChild(element1);"}
    WebBrowser1.Document.InvokeScript("eval", dum)
    Do While Not jqCheck
        Application.DoEvents()
        jqCheck = WebBrowser1.Document.InvokeScript("eval", {"javascript:jqCheck=!(typeof $==='undefined');jqCheck"})
    Loop
    dumstr = WebBrowser1.Document.InvokeScript("eval", {"javascript:document.documentElement.innerHTML"})
    TextBox1.Text = dumstr
    WebBrowser1.Document.InvokeScript("eval", {"javascript:$(""#lst-ib"").attr('value','I was here')"})
    Application.DoEvents()
    dumstr = WebBrowser1.Document.Forms(0).Document.GetElementById("q").GetAttribute("value")
    System.Threading.Thread.Sleep(5000)
    WebBrowser1.Document.GetElementById("q").SetAttribute("value", "I was here first")

End Sub

The html from webbrowser is placed in the textbox.

    <meta content="IE=edge" http-equiv="X-UA-Compatible">

indicates the best available IE should be used? The webbrowser appears to be running in IE7 compatibility mode. Also GetElementById(“q”) works but from the html

   id="lst-ib" class="gsfi" title="Search" name="q". 

So I guess I have 2 questions. Why does the webbrowser appear to be running in compatibility mode and why does GetElementById seem to be working on a name.

UPDATE: I added:

dumstr = WebBrowser1.Document.InvokeScript("eval", {"javascript:navigator.appVersion"})
MsgBox(dumstr)

the output indicated ie7 was at work.

I have also added to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION the name of my .exe with a 9999 value but we are still running in ie7 mode

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:14:09+00:00Added an answer on June 2, 2026 at 5:14 am

    As a follow up: Internet Explorer allowed getElementById to reference both the name and id attribute. The relevant help description is: Returns a reference to the first object with the specified value of the ID or NAME attribute. However from ie8 onwards: Windows Internet Explorer 8 and later. In IE8 Standards mode, getElementById performs a case-sensitive match on the ID attribute only. In IE7 Standards mode and previous modes, this method performs a case-insensitive match on both the ID and NAME attributes, which might produce unexpected results. With the changes to the registry my project is not in ie7 mode anymore based on the output of navigator.appVersion and also the fact that google is giving the newer html code ( $(“#gbqfq”) instead of $(“#lst-ib”). However getElementById still appears to work on names. Strange…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

first question to StackOverflow, please be gentle. I am trying to find the equation
This is my first question her so please be gentle: I have followig animation
This is my first time asking a question, please be gentle! I have a
this is my first question, so be gentle :) I'm trying to clear the
This is my first post on StackOverflow, so please be gentle... I have some
First question on Stackoverflow (.Net 2.0): So I am trying to return an XML
This is my first post, so please be gentle. I've been playing around with
First question. Be gentle. I'm working on software that tracks technicians' time spent working
this is my first question on stack overflow, so be gentle. Let me first
first question here, be nice :P I am trying to make an infinite UIScrollView

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.