webbrowser控件存在多个问题,但Chrome和IE11很好 [英] Multiple issues with webbrowser control but fine in chrome and IE11
问题描述
我写了一个小网页,可以在Chrome和IE11中完美运行。但是,当我用WebBrowser加载页面时,有一些我不知道如何解决的问题,Google似乎也没有任何答案;
1. user-select:none
只是不起作用,你仍然可以选择文字
2.错误信息:'无法获得属性'createelement'的未定义或空引用'
3.错误消息:'属性'$'的值为null或未定义而不是函数对象'
相关代码:
html
{
宽度:800px;
身高:500px;
font-family:'Open Sans';
字体大小:16px;
letter-spacing:-1px;
user-select:none;
font-weight:300;
}
<!DOCTYPE html>
< html lang ='en-GB'>
< head>
< link rel ='stylesheet'type ='text / css'href ='index.css'>
< script src ='jQuery-3.3.1.js'>< / script>
< script src ='index.js'>< / script>
< title>这里的标题< / title>
< meta http-equiv ='X-UA-Compatible'content ='IE = edge'/>
< / head>
< body>
< div id ='title'> Installer< / div>
< div id ='underline_holder'>
< div id ='underline'>< / div>
< / div>
< div class ='download_section'>
< div class ='download_section_title'>正在下载文件...< / div>
< div class ='progress_bar'>
< / div>
< / div>
< div class ='download_section'>
< div class ='download_section_title'>将文件写入磁盘...< / div>
< div class ='progress_bar'>
< / div>
< / div>
< / body>
< / html>
$(function()
{
$(document).ready (function()
{alert('before');
setTimeout(function()
{alert('after');
$('#title')。css ('opacity',0.8);
$('#underline_holder')。css('border-top','2px solid rgba(100,0,255,0.2)');
setTimeout(function()
{
$('#underline')。css({'opacity':1});
setTimeout(function()
{
$('#underline')。css({'top':' - 2px'});
setTimeout(function()
{
$('#underline')。css({'width':'100%'});
setTimeout(function()
{
var delay = 500;
$('。download_section')。each(function()
{
var t = $(this);
setTimeout(function( )
{
t.css({'height':'37px','padding':'16px'});
},延迟);
延迟+ = 500;
});
},500);
},800);
},300);
},500);
},1000);
});
});
除了这些问题, alert()
有效。
我尝试过:
-------------------------------------------------- ------------
'为null或undefined不是函数对象'
相关代码:
html
{
宽度:800px;
身高:500px;
font-family:'Open Sans';
字体大小:16px;
letter-spacing:-1px;
user-select:none;
font-weight:300;
}
<!DOCTYPE html>
< html lang ='en-GB'>
< head>
< link rel ='stylesheet'type ='text / css'href ='index.css'>
< script src ='jQuery-3.3.1.js'>< / script>
< script src ='index.js'>< / script>
< title>这里的标题< / title>
< meta http-equiv ='X-UA-Compatible'content ='IE = edge'/>
< / head>
< body>
< div id ='title'> Installer< / div>
< div id ='underline_holder'>
< div id ='underline'>< / div>
< / div>
< div class ='download_section'>
< div class ='download_section_title'>正在下载文件...< / div>
< div class ='progress_bar'>
< / div>
< / div>
< div class ='download_section'>
< div class ='download_section_title'>将文件写入磁盘...< / div>
< div class ='progress_bar'>
< / div>
< / div>
< / body>
< / html>
(function()
{
(document).ready(function()
{alert('before');
setTimeout(function()
{alert('after );
Hi,
I've written a small webpage which works perfectly in Chrome and IE11. However, when I load the page with a WebBrowser, there's a few problems which I don't know how to resolve and Google doesn't seem to have any answers either;
1. user-select: none
just doesn't work, you can still select text
2. Error message: 'unable to get property 'createelement' of undefined or null reference'
3. Error message: 'the value of the property '$' is null or undefined not a function object'
Relevant code:
html { width: 800px; height: 500px; font-family: 'Open Sans'; font-size: 16px; letter-spacing: -1px; user-select: none; font-weight: 300; }
<!DOCTYPE html> <html lang='en-GB'> <head> <link rel='stylesheet' type='text/css' href='index.css'> <script src='jQuery-3.3.1.js'></script> <script src='index.js'></script> <title>Title here</title> <meta http-equiv='X-UA-Compatible' content='IE=edge' /> </head> <body> <div id='title'>Installer</div> <div id='underline_holder'> <div id='underline'></div> </div> <div class='download_section'> <div class='download_section_title'>Downloading files...</div> <div class='progress_bar'> </div> </div> <div class='download_section'> <div class='download_section_title'>Writing files to disk...</div> <div class='progress_bar'> </div> </div> </body> </html>
$(function() { $(document).ready(function() {alert('before'); setTimeout(function() {alert('after'); $('#title').css('opacity', 0.8); $('#underline_holder').css('border-top', '2px solid rgba(100, 0, 255, 0.2)'); setTimeout(function() { $('#underline').css({'opacity': 1}); setTimeout(function() { $('#underline').css({'top': '-2px'}); setTimeout(function() { $('#underline').css({'width': '100%'}); setTimeout(function() { var delay = 500; $('.download_section').each(function() { var t = $(this); setTimeout(function() { t.css({'height': '37px', 'padding': '16px'}); }, delay); delay += 500; }); }, 500); }, 800); }, 300); }, 500); }, 1000); }); });
In addition to those issues, neither alert()
works either.
What I have tried:
--------------------------------------------------------------
' is null or undefined not a function object'
Relevant code:
html { width: 800px; height: 500px; font-family: 'Open Sans'; font-size: 16px; letter-spacing: -1px; user-select: none; font-weight: 300; }
<!DOCTYPE html> <html lang='en-GB'> <head> <link rel='stylesheet' type='text/css' href='index.css'> <script src='jQuery-3.3.1.js'></script> <script src='index.js'></script> <title>Title here</title> <meta http-equiv='X-UA-Compatible' content='IE=edge' /> </head> <body> <div id='title'>Installer</div> <div id='underline_holder'> <div id='underline'></div> </div> <div class='download_section'> <div class='download_section_title'>Downloading files...</div> <div class='progress_bar'> </div> </div> <div class='download_section'> <div class='download_section_title'>Writing files to disk...</div> <div class='progress_bar'> </div> </div> </body> </html>
(function() {
(document).ready(function() {alert('before'); setTimeout(function() {alert('after');
这篇关于webbrowser控件存在多个问题,但Chrome和IE11很好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!