• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Jscript - distinguishing between IE and Webbrowser

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Jscript - distinguishing between IE and Webbrowser

    Is there any simple way for jscript to be able to distinguish if the page is running in IE or in a webbrowser in VB.? All the navigator properties are the same either way.

    Have thought of using the VB beforenavigate method to modify the URL with a marker, but are there any neater methods like a simple flag one can set?

    Ta for any ideas.

    #2
    The web browser control is IE (just the window is hosted in VB, that's the only difference).

    As far as the JavaScript is concerned, it's IE.

    Why does your JavaScript need to know?

    Comment


      #3
      Cheers dim.

      It's educational stuff where pupils can choose say from a selection of newspaper layouts in Publisher or Word.

      If they are using the VB browser I can use beforenavigate2 to open the selected documents properly (not that limited OLE thing) in Publisher or Word.

      I can't do that from jscript in IE due to the security restrictions, so would like to present alternative text and controls, even if only a message to say they need to use the browser provided.

      Comment


        #4
        Probably not much help, but can't you hard code in some kind of parameter thingy in the vb version?

        E.g. http://www.slugshavefeelings.com/ban...isusingvb=true

        Then you can decide which way to open the report based on what is passed in the Url.

        I've just noticed that this makes my quadruple Nelson post. Bugger, now I'll have to hop on one leg until I think of something else to post.

        Comment


          #5
          Re: Re: Jscript - distinguishing between IE and Webbrowser

          Think that's the beforenavigate2 intercept method I mentioned eddie, VB sticks something on end of URL, js detects it. Cheers anyhow.

          Comment


            #6
            Re: Re: Jscript - distinguishing between IE and Webbrowser

            Go to: www.quirksmode.org/js/detect.html
            That should sort you out.

            Comment


              #7
              Re: Re: Jscript - distinguishing between IE and Webbrowser

              Simply test for the existance of the document.all object.
              If it's there, then your in IE, otherwise its some other browser.

              Comment

              Working...
              X