Greetings

There are problems when working with WebBrowser, when executing JS it gives an error, but there are no errors when opening it in Google Chrome.

HTML code:

<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script> <script src="circle.js" type="text/javascript"></script> </head> <body> <div id="map" style="width:300px; height:300px"></div> </body> </html> 

JS Code:

 ymaps.ready(init); function init() { var myMap = new ymaps.Map("map", { center: [60.000000, 30.000000], zoom: 10 }); var myCircle = new ymaps.Circle([ [60.000000, 30.000000], 01000 ], { balloonContent: "Радиус круга - 10 м", }, { draggable: false, fillColor: "#DB709350", strokeColor: "#990066", strokeOpacity: 0.7, strokeWidth: 2 }); myMap.geoObjects.add(myCircle); } 

Both codes are taken from the sandbox of Yandex , are fully working. Help make WebBrowser work as it should. Show me the true path.

Ps: I put Awesomium in my project, it does not give out errors, but it does not display anything, but I think this is due to incorrect settings, I use it for the first time.

News by mistake:

1 In order to avoid errors in JS execution, it is necessary to add code to the content in the html file, since the content is Default - ie6. Code to add:

 <meta http-equiv="x-ua-compatible" content="ie=edge"> 

However, this did not solve all the problems, now WebBrowser behaves like Awesomiun, everything works, it does not give errors, but the map does not display for some reason.

2 Finally, the map is displayed but the elements do not work (buttons to zoom out and so on), and also the map is not dragged by pressing the LMC, it can only be scaled with a wheel.

  • And WebBrowser shows what error? What does say Details - Alexey Shimansky
  • Error 1: local js file, source above. "On this page, a script error occurred." It is assumed that there is an identifier, string or number, and indicates if you look at the code in question for this place "], {". Do you want to continue running the script? yes / no Error 2: api-maps.yandex.ru/2.1/?lang=en_RU "A script error has occurred on this page" Script error. Do you want to continue running the script? yes / no I apologize for the poor formatting of the text, the inter does not work in the comments? It seems everything is normal in the editor, but if you save the horror .. - Vladimir Alexandrov
  • An error occurred on this page. The script is solved by setting the property WebBrowser1.Silent = true. By blocking the alert asked a question ru.stackoverflow.com/questions/513062/… - NMD
  • I need to eliminate errors, not blocking windows with errors ... Blocking errors does not lead to solving the problem .. All errors with scripts and display are resolved, it remains only to understand why dragging the map does not work in webBrowser, but it works in webControl. - Vladimir Alexandrov
  • aah, that's it)) still, as an option to force webbrowser to use the latest version of IE PC, this may help you solve the remaining problem. try stackoverflow.com/questions/17922308/… - NMD

1 answer 1

The problem with displaying content in webBrowser was solved by this code.

 <meta http-equiv="x-ua-compatible" content="ie=edge"> 

The remaining problems were solved by switching to Awesomium.