V
V
Vladislav Sofienko2017-04-03 16:00:25
.NET
Vladislav Sofienko, 2017-04-03 16:00:25

How to get rid of page loading error in WebBrowser C#?

Created a WPF project and added a browser to the form with a link to the corresponding html file with the following content.

<!DOCTYPE html>
<html>
<head>
    <title>API карт 2ГИС</title>
    <script src="http://maps.api.2gis.ru/2.0/loader.js?pkg=full"></script>
    <script type="text/javascript">
            var map;

            DG.then(function () {
                map = DG.map('map', {
                    center: [54.98, 82.89],
                    zoom: 13
                });

                DG.marker([54.98, 82.89]).addTo(map).bindPopup('Вы кликнули по мне!');
            });
    </script>
</head>
<body>
    <div id="map" style="width:500px; height:400px"></div>
</body>
</html>

This is a 2Gis map. But it throws an error on the API link and the map itself does not continue to load after it.
9188733a35fb4d7fa377d8548637808d.JPG
When you run an html page in a regular browser, for example, IE, it loads everything fine, but through the webbrowser project it gives an error and does not want to load it.
What to do in this case?
ScriptErrorsSuppressed="True" won't work, because this property just hides the error window, but doesn't fix it )))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tom Nolane, 2017-04-03
@tomnolane

tyk - section "examples"
p.s. with IE (webbrowser uses IE as "core") - I've always had a lot of problems... on different computers (at the client) there could be different versions of IE. And something worked, something didn’t (for example, VK swears at a low version of IE). And I decided to install a "built-in" third party browser: awesomium . It has fewer problems than IE... it will work for all clients... regardless of OS (well, I mean from Win7 and above) the only thing is that it's not very convenient to use javascript through it (kind of let's say... ). And so I am very satisfied and use ONLY it ( awesomium ).
upd
js in awesomium:
tyk
tyk

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question