草庐IT

defining-documents

全部标签

javascript - 添加到 ace-editor 明智的自动完成 : List user-defined functions and variables (javascript language)

我想将用户定义的函数和变量列表添加到ace编辑器的自动完成功能中。为此,我想检查用户插入到文档中的所有代码,找到定义的函数(及其参数)、定义的变量及其作用域等。主要问题这些数据是否已经在ace源代码(或语言插件)的某处计算出来,我可以通过某种方式获取它?`我想要什么例如,如果用户插入这样的代码:varvar0='abcd';functionfoo(var1,var2){varvar3='efg';}我想在自动完成框中添加名为“foo”的函数,它有两个参数——var1和var2。我还想将var0添加到变量列表中,并在用户在定义的范围内(在函数中)写入时添加var3。我已经知道的:我知道如

javascript document.write 在外部js文件中

在从事大型、高负载项目时,我遇到了已经在论坛和博客上的数十亿个主题中描述的问题,但没有任何解决方案对我的情况有帮助。这是故事。我有横幅的HTML代码,我不知道代码是什么。有时它是纯HTML,但有时它是用在里面用document.write标记包含srctodoubleclicknetwork的标签。所以我们有:script>document.write>script(doubleclick)。doubleclick网络,如您所知,也使用document.write,大多数情况下,它们会提供需要再加载一个js文件的flash横幅。所以毕竟我们有:script>document.write

javascript - 错误 : 'jQuery is not defined'

我用jQuery写了一个脚本。它适用于Firefox和GoogleChrome。只有在IE中我才返回这个错误:'jQuery'isnotdefinedjquery-ui-1.8.4.custom.min.js,Row10Character1这是我页面的头部:Contattaci-TheItalianBrand.com$(function(){$('#dialog_link,ul#iconsli').hover(function(){$(this).addClass('ui-state-hover');},function(){$(this).removeClass('ui-state-

javascript - 嵌套的 document.writes 和第三方广告在 IE 中不起作用!!!!任何安全的解决方法?

注意:我编辑了这篇文章,其中包含我从第三方获得的更多信息。简而言之,我的任务是包含一个调用我们内部广告服务器机制的JS广告标记,该机制然后重试第三方脚本,该脚本将文件写入其外部文件……它在IE中不起作用。有人向我提到嵌套的document.writes在IE中不起作用。我尝试了各种方法..appendTo/writeln/分解脚本标签/解码脚本标签等..似乎没有任何效果。由于这对我来说有些陌生,也许我忽略了显而易见的事实。这是它的样子:myhtml:document.write('\x3Cscripttype="text/javascript"src="_some_Path_to_in

javascript - Chrome 扩展中的 Require.JS : define is not defined

我正在尝试在我的chrome扩展程序中使用Requre.js。这是我的list:{"name":"myextension","version":"1.0","manifest_version":2,"permissions":["http://localhost/*"],"web_accessible_resources":["js/test.js"],"content_scripts":[{"matches":["http://localhost/*"],"js":["js/require.js","js/hd_init.js"]}]}hd_init.jsconsole.log("h

javascript - 使用 browserify,未捕获的 ReferenceError : function is not defined

我正在尝试http://browserify.org/中的示例并尝试按如下方式进行函数调用:我的html是:TestBrowserifytest我的javascript是:varunique=require('uniq');vardata=[1,2,2,3,4,5,5,5,6];console.log(unique(data));functionhello(){alert("here");}我做了browserifymain.js-obundle.js,所以我可以成功使用require。但是当我点击按钮时,出现错误:“UncaughtReferenceError:你好未定义”任何建议将

javascript - document.getElementById().getContext ('2d' ) 不是函数

这不断收到一条错误消息,说它不是一个函数,请帮忙!!varctx=document.getElementById('canvas').getContext('2d');HTML:CanvasRacecanvas{border:1pxsolidblack;background-image:url("http://www.gamefromscratch.com/image.axd?picture=road2048v2.png");background-size:200px300px;background-position-y:-81px;}Javascript:varblueCar=new

javascript - 什么是 document.getElementById?

考虑以下代码:functiontestFunc(){alert('test')}$(function(){varg=document.getElementById,w=window.testFunc;//galert(typeof(g));alert(String(g));alert(ginstanceofObject);alert(ginstanceofFunction);//walert(typeof(w));alert(String(w));alert(winstanceofObject);alert(winstanceofFunction);//runitalert(g('t'

javascript - Chrome 扩展 "$ is not defined"错误

当我处理我的chrome扩展程序时,我收到错误“$isnotdefined”。这是我的list文件:{"name":"X","description":"Snipthispage","version":"2.0","permissions":["activeTab"],"background":{"scripts":["background.js"],"persistent":false},"content_scripts":[{"matches":[""],"js":["jquery-2.0.2.js","jquery.Jcrop.js"],"css":["jquery.Jcrop.

javascript - Angular 和 jQuery ng-include with document.ready 不工作

我正在尝试使用HMTL加载一个放置在单独html中的组件。问题在于它会在浏览器加载页面后立即调用。下面是我的模态代码:组件代码在这里:termsAndConditions.html×-->Cisco'sGSAshippingPolicyThispolicyoutlinestherequirementsofshippingInternationallyincludingbutnotlimitedto:AllmembersoftheCiscoworkforceareresponsibletoadheretothispolicyASTistonotbeusedforpersona