none
JSON errors when WebBrowser1 opens URL How can I fix it? RRS feed

  • Question

  • Can someone give me an example code on how to fix this?

    I have in my VB form:

    Public Class ChatForm   

    Private Sub

    WebBrowserChat_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowserChat.DocumentCompleted       

    WebBrowserChat.Navigate("http://#chat.php")   

    End Sub

    End Class

    I am trying to open this page in the webbrowser without any errors.

    This is the error I get when debugging and going to the chat URL.

    I have setup the same test chat script for you on one of our test servers.

    You can replicate the error here:

    http://www.#/test/chat.php


    Keith


    • Edited by Keith.Aiden Sunday, March 16, 2014 9:39 PM Removing link to site
    Wednesday, May 15, 2013 10:28 PM

All replies

  • Maybe you should bypass it using

    WebBrowser1.ScriptErrorsSuppressed = True


    You've taught me everything I know but not everything you know.

    Thursday, May 16, 2013 4:25 AM
  • Keith,

    The webbrowser is simply an reuse of the IE installed in your OS. 

    So try that and see what happens. Also look at the options you have in IE set. 


    Success
    Cor

    Thursday, May 16, 2013 7:20 AM
  • Hi, I have done both of your suggestions. And I have googled around on this one but there is very little help in relation to code examples. From what I read, JSON needs to be parsed some how, but I don't know where to start!!

    You will see if you follow the steps I did above, you'll come to the same error as me. If you don't, please provide me with the steps to move past my issue.

    Thanks


    Keith

    Thursday, May 16, 2013 7:40 AM
  • Maybe this will help but I don't think so http://msdn.microsoft.com/en-us/library/bb299886.aspx

    You've taught me everything I know but not everything you know.

    Thursday, May 16, 2013 7:49 AM
  • Not really helpful since it doesn't seem to explain how to parse the javascript in a webbrowser window.

    Keith


    Thursday, May 16, 2013 8:02 AM
  • At first glance it sounds like the webbrowser is having an issue with what is called an EndPoint relating to a web service used to pass a JSON object and if so there may not be a simple solution.

    The following is the full source of the page which has no UI elements

    <script type="text/javascript" language="javascipt"src="http://vpshosteurope.com/test/client/main.php?id=&xhash=f43f490ebf654ebce1351640145fadfd"></script>                        
    <link rel="stylesheet" href="http://vpshosteurope.com/test/client/jquery/freichat_themes/freichatcss.php" type="text/css">


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.


    Thursday, May 16, 2013 10:51 AM
    Moderator
  • I did not look closely at the script but I am not seeing any JSON. Usually a JSON object is sent upon a request (which I see none). JSON is a light weight transport for passing data across the wires, in simply form a bunch of arrays which can be parsed using native .NET classes yet I perfer JSON.NET library.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

    Thursday, May 16, 2013 10:56 AM
    Moderator
  • What Mr. MonkeyBoy provided as a link is a decent resource for understanding JSON but does not help with moving past this issue. As per my other replies I did not see anything to assist with getting to or past the JSON exeception.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

    Thursday, May 16, 2013 10:58 AM
    Moderator
  • Thanks for the replies.

    Well I am as stuck as anyone else, on this one.. Is there anything I can do?

    There must be some kind or solution...


    Keith

    Thursday, May 16, 2013 12:12 PM
  • Thanks for the replies.

    Well I am as stuck as anyone else, on this one.. Is there anything I can do?

    There must be some kind or solution...


    Keith

    Contact the ones who have created that website. The webbrowser is not meant to hack ones web pages. For not Of Line work you can add JavaScript, but then it are your own pages.


    Success
    Cor


    Thursday, May 16, 2013 1:03 PM
  • Thanks for the replies.

    Well I am as stuck as anyone else, on this one.. Is there anything I can do?

    There must be some kind or solution...


    Keith

    Contact the ones who have created that website. The webbrowser is not meant to hack ones web pages. For not Of Line work you can add JavaScript, but then it are your own pages.


    Success
    Cor


    And how are they going to help me?

    There application software works perfectly in a normal web browser.

    It doesn't work perfectly in the VB webbrowser1 window.

    So I think its fair to say, that the problem does not reside with the persons pages, but it has a lot to do with the web browser from VB.

    Wouldn't you agree? Is there anything constructive I can do to get this working?


    Keith



    Thursday, May 16, 2013 2:07 PM
  • Thanks for the replies.

    Well I am as stuck as anyone else, on this one.. Is there anything I can do?

    There must be some kind or solution...


    Keith

    Contact the ones who have created that website. The webbrowser is not meant to hack ones web pages. For not Of Line work you can add JavaScript, but then it are your own pages.


    Success
    Cor


    And how are they going to help me?

    There application software works perfectly in a normal web browser.

    It doesn't work perfectly in the VB webbrowser1 window.

    So I think its fair to say, that the problem does not reside with the persons pages, but it has a lot to do with the web browser from VB.

    Wouldn't you agree? Is there anything constructive I can do to get this working?


    Keith




    When I went to view the page nothing shows up in Microsoft IE web browser, just a blank page.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

    Thursday, May 16, 2013 3:13 PM
    Moderator
  • Thanks for pointing that out Kevin.

    That is most weird, and It wasn't doing that before. However, It works on Waterfox and Firefox perfectly. Any idea what IE setting could be blocking it? It was working on IE 64bit, and now its not. I'll message the creater of the webchat app and see if its anything to do with his code meanwhile.

    That is really strange :S

    Keith

    Thursday, May 16, 2013 3:37 PM
  • Hello,

    Beings that it is a "test" might have some baring on not working. And of course browsers like FireFox do (and I am sure you realize this) usually are better at rendering newer stuff such as CSS3 etc.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

    Thursday, May 16, 2013 3:50 PM
    Moderator
  • After playing around with this and adding additional java files, It now displays in Internet Explorer flawlessly but the chat now shows up....a bit messed up in the VB Browser. Does anyone have any clue what is going on now?

    Keith

    Friday, May 17, 2013 2:53 PM
  • Hard to say, when I view it in IE it is difficult to tell what it should look like and do.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

    Friday, May 17, 2013 3:24 PM
    Moderator
  • Hard to say, when I view it in IE it is difficult to tell what it should look like and do.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

    Below is exactly how it is meant to look. View it full size! The chat on the left is not important, but the chat on the bottom right is; and that is messes up in the VB webbrowser window. It also doesn't finish loading from "Loading online users" to displaying "online users". And the CSS is a bit messed up for some reason, but it's perfect in every other browser. Hope this helps.

    Keith

    Friday, May 17, 2013 4:10 PM
  • webbrowser1.Silent = True
    Thursday, October 20, 2016 9:45 PM