jjzjj

documentation-generation

全部标签

javascript - 在使用 window.open 打开的窗口中使用 document.write 编写的脚本元素不会在 Windows 7 的 IE8 中执行

我遇到了一个似乎只出现在Windows7上的问题。它似乎在不同版本的Windows上的IE8中运行良好。基本上,我使用window.open()创建一个新窗口,然后使用document.write()写入该新窗口的内容,其中包含脚本包含。在IE中,这些脚本未正确执行。大多数时候他们根本不执行,但偶尔会有一个执行。这仅适用于清除缓存-一旦javascript文件在缓存中,它就可以正常工作。归结测试用例:测试.html:varw=window.open();varwindowHTML="\\n\\n\\n\\n\\n\\n\\n\\n\";w.document.write(windowHT

javascript - Rails cookie 对象、Cookie HTTP header 和 document.cookie 之间的关系

当我在Javascript中访问document.cookie时,它吐出,说:'user_credentials=5beea8874f2db9feb873828'基本上,似乎是一些编码信息。很好。当我查看header时,我确实看到完全相同的字符串被设置为user_credentials,但还有另一个值被设置为_myapplication_session=BAh7CiIQX。与user_credentials不同,这个包括大写字母和F之后的字母。所以:什么是_myapplication_session?这与Rails中的session对象有关吗?为什么_myapplication_ses

javascript - 为什么 window[id] === document.getElementById( id )

这个问题在这里已经有了答案:Isthereaspecthattheidofelementsshouldbemadeglobalvariable?(5个答案)关闭8年前。我注意到在一些浏览器中,dom元素可以通过它们的id来访问,就像这样:HTMLJSalert(chocolat.id);//alerts"chocolatchocolat;//pointstothenodewindow.chocolat;//idemchocolat===document.getElementById('chocolat');//true(在这里测试:http://jsfiddle.net/GUUPT/)

javascript - 清除 jquery document.ready() 调用

如何清除设置为通过jQuerydocument.ready()调用触发的匿名函数?例如://somecodesetsadocreadycallback$(document).ready(function(){alert('ready');});//myattempttopreventthecallbackfromhappeningwindow.onload=null;$(document).unbind("ready");无论我试图规避它,警报都会发生。有什么办法吗? 最佳答案 如果您描述了您真正想要解决的问题,您可能会得到最合适的

javascript - 为什么定义了 document.all 但 typeof document.all 返回 "undefined"?

这个问题在这里已经有了答案:Whyisdocument.allfalsy?(4个答案)关闭6年前。我在研究JavaScript的typeof运算符时,偶然发现了以下怪异之处:ExceptionsAllcurrentbrowsersexposeanon-standardhostobjectdocument.allwithtypeUndefined.typeofdocument.all==='undefined';Althoughthespecificationallowscustomtypetagsfornon-standardexoticobjects,itrequiresthoset

javascript - contentEditable + selectAll : Firefox won't allow keyboard input on dynamically generated content

我在使用包含contenteditable="true"属性的动态生成元素的Firefox中遇到问题(其他浏览器似乎工作正常):如果我selectAll(动态地或使用我的鼠标),Firefox将不允许键盘输入。请看我的jsFiddleExample以供引用。这似乎只影响Firefox。$(document).ready(function(){$('.edit').live('dblclick',function(){document.execCommand('selectAll',false,null);});$('#live').append('Thiscontentisgenera

javascript - document.getSelection() 和 window.getSelection() 的区别

您能回答一下这个问题吗?howdoIgetco-ordinatesofselectedtextinanhtmlusingjavascriptdocument.getSelecttion()谢谢 最佳答案 您收到错误消息Deprecatedmethoddocument.getSelection()called。请改用window.getSelection()。”在Firefox中,这意味着document.getSelection()是一种已弃用的方法。 关于javascript-docu

javascript - 为什么 document.execCommand ("copy") 在我的 chrome 扩展程序的内容脚本中不起作用?

这个问题在这里已经有了答案:Whyisdocument.execCommand("paste")notworkinginGoogleChrome?(8个答案)关闭8年前。我想从我正在创建的chrome扩展中将一些数据写入剪贴板。在list文件中,我授予了clipboardRead和clipboardWrite权限。我使用我发现的这个函数here但它不起作用。似乎是“document.execCommand('copy');”不能工作。我在内容脚本中编写了所有这些代码。谢谢list:{"manifest_version":2,"name":"easyCopy","description"

javascript - Controller 的 ngdoc 文档

我是代码文档的新手,并尝试使用grunt-ngdocs记录我的Angular应用程序。我从以下位置克隆了一个工作示例:https://github.com/m7r/grunt-ngdocs-example给定的示例缺少文档化Controller,因此我使用以下代码添加了我自己的文档化Controller:/***@ngdoccontroller*@namerfx.controller:testCtrl*@description*Descriptionofcontroller.*/.controller('testCtrl',function(){});当我尝试通过从命令行运行grunt

javascript - 如果使用 document.write,javascript 是否同步加载?

像这样在页面加载javascript是不是一样的:像这样document.write("");我在js中有很多依赖项,想将它们配置为一个单独的数组,它们只是以如下方式捆绑在index.html中:for(iinconfig.files.javascripts){document.write("");}问题是-它是否应该按预期工作,以便在加载前一个文件之前不执行下一个文件?这是我正在做的前端中没有服务器端,它有时也可以用作小部件,但对于开发和测试,我们应该加载未合并和未压缩的文件以进行测试。谢谢! 最佳答案 回答您的问题:是的,使用d