Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript &引用;createTextRange";在Microsoft Edge(Win10 build 10162)上不受支持_Javascript_Microsoft Edge - Fatal编程技术网

Javascript &引用;createTextRange";在Microsoft Edge(Win10 build 10162)上不受支持

Javascript &引用;createTextRange";在Microsoft Edge(Win10 build 10162)上不受支持,javascript,microsoft-edge,Javascript,Microsoft Edge,我试图在页面上找到一些文本,如: 函数crossBrowserFind(){ var str=“地狱”; if(window.find){//Firefox、Google Chrome、Safari found=window.find(str); }否则{ 如果(document.body.createTextRange){//InternetExplorer,10.5版之前的Opera var textRange=document.body.createTextRange(); if(tex

我试图在页面上找到一些文本,如:

函数crossBrowserFind(){
var str=“地狱”;
if(window.find){//Firefox、Google Chrome、Safari
found=window.find(str);
}否则{
如果(document.body.createTextRange){//InternetExplorer,10.5版之前的Opera
var textRange=document.body.createTextRange();
if(textRange.findText){//Internet Explorer
found=textRange.findText(str);
如果(找到){
textRange.select();
}
}
}
}   			

}
它在win10版本中仍然不起作用。我们正在评估Windows.find在未来版本中的支持情况,但它甚至在支持Windows.find的浏览器中也不起作用。我们删除了IE特定的调用,如createTextRange,作为我们的一部分。同时,使用类似于5月份建议的方法是可行的。该代码需要偏移量,但可以修改以搜索子字符串。@CharlesMorris MSFT-MSDN文档中关于createTextRange()的内容未指明是否包含此内容。。我建议你在删除那些仍然在网络上使用的专有方法时再加上一句。@RobMaurizi谢谢你的建议!我们正在进行大规模文档清理,并期待它的发布。:)