javascript 相关问题

JavaScript(不要与Java混淆)是一种高级,动态,多范式,面向对象,基于原型的弱类型语言,用于客户端和服务器端脚本。它的主要用途是渲染和操作网页。使用此标记可以了解有关ECMAScript及其各种方言/实现的问题(不包括ActionScript和Google-Apps-Script)。

节点:内部/错误:496 ERRORCAPTURESTACKTRACE(ERR); ^错误[err_module_not_found]:找不到模块

节点:内部/错误:496 ERRORCAPTURESTACKTRACE(ERR); ^ 错误[err_module_not_found]:找不到模块 服务

回答 0 投票 0

如何在荷叶边放置多个.swf(字符,音频,资产...)的游戏? 我正在尝试带回2010年以来的整个网站及其与Ruffle(https://onlinewinxclub.com/centro-web/?lang = en)的闪存游戏,即使对于像我这样的人来说,谁从来没有真正w ...

),到目前为止,即使对于像我这样的人来说也很好谁从未真正与Flash合作过,我更改了有关其他5个游戏中HighScore的一些脚本,以指向我的服务器,而不是旧网站,所有游戏迄今遵循了相同的逻辑:所有文件夹中的所有文件,.xml对于语言,仅用于游戏的一种.swf ...

回答 0 投票 0

我如何摆脱小径?

let coordinates; function setup() { new Canvas(400,400); allSprites.pixelPerfect = false; background('#434275'); //reminder: add camera.x = .x; when ready for sprite world.gravity.y=9; mouseCoordinates(); let floor = new Sprite(); floor.width=800; floor.height=400; floor.y=370; floor.x=0; floor.collider='static'; floor.color='#d17921'; floor.rotation = 20; let boulder = new Sprite(); boulder.diameter= 20; boulder.bounciness= 1; boulder.mass= 9; boulder.x=0; boulder.y=100; boulder.speed=2; boulder.rotationDrag= 5; boulder.color='#e39427'; } function draw(){ coordinates.text = round(mouse.x, 1) + ', ' + round(mouse.y, 1); } function mouseCoordinates() { coordinates = new Sprite(); coordinates.color = 'white'; coordinates.width = 80; coordinates.height = 20; coordinates.x = width - coordinates.width / 2 - 5; coordinates.y = coordinates.height / 2 + 5; coordinates.collider = 'none'; }

回答 1 投票 0



如何更改日期过滤器中的日期格式?

在我的角前端,我正在使用agdatecolumnfilter进行约会过滤器。当我更改用户语言环境时,我的代码逻辑将以各自的语言环境的日期格式转换列值,但是日期格式...

回答 1 投票 0


如何在组件之间的sveltemap中保持反应性。

从“ ./component.svelte”导入组件 从“ ./store.js”导入{items} $ items.set(“ a”,{name:&... </desc> 我有三个文件:<question vote="0"> <p></p><code>App.svelte</code><p>:<pre> </pre><code>&lt;script&gt; import Component from &#34;./Component.svelte&#34; import { items } from &#34;./store.js&#34; $items.set(&#34;a&#34;, { name: &#34;John&#34;, index: &#34;a&#34; }) $items.set(&#34;b&#34;, { name: &#34;Jack&#34;, index: &#34;b&#34; }) &lt;/script&gt; &lt;h1&gt;DIV each:&lt;/h1&gt; {#if $items &amp;&amp; $items.size &gt; 0} {#each $items.values() as item} &lt;div&gt;Name: {item.name}&lt;/div&gt; {/each} {/if} &lt;h1&gt;Component each:&lt;/h1&gt; {#if $items &amp;&amp; $items.size &gt; 0} {#each $items.values() as item} &lt;div&gt;&lt;Component index={item.index} /&gt;&lt;/div&gt; {/each} {/if} </code></p> <pre></pre><code>Component.svelte</code><p>:<pre> </pre><code>&lt;script&gt; import { items } from &#34;./store.js&#34; let { index = null } = $props() let data = $state($items.get(index)) &lt;/script&gt; &lt;div&gt;&lt;input bind:value={data.name} /&gt;&lt;/div&gt; </code></p> <pre></pre><code>store.js</code><p>:<pre> </pre><code>import { writable } from &#34;svelte/store&#34;; import { SvelteMap } from &#34;svelte/reactivity&#34;; export let items = writable(new SvelteMap([])) </code></p> 我想知道如何在Sveltemap<pre><code>items</code></pre>中保持反应性。当更改输入值时,它应在Sveltemap中进行更新(如它所致)。我不知道如何使用这种反应性。 <p><pre>在这里玩耍 </pre> </p> <p>如果您在地图中的项目中,而不是完全替换它们,则项目本身必须是有状态的。 <a href="https://svelte.dev/playground/f0e961b5b8a74ff2bed93be2d7ed1ebb?version=5.20.0" rel="nofollow noreferrer">e.g.</a> </p><code>const john = $state({ name: &#34;John&#34;, index: &#34;a&#34; }); $items.set(&#34;a&#34;, john); const jack = $state({ name: &#34;Jack&#34;, index: &#34;b&#34; }); $items.set(&#34;b&#34;, jack); </code></question> <answer tick="false" vote="0">尽管如此,这将引起国家所有权警告,因为该州是在一个组件中创建的,并在另一种组成部分中修改而没有约束力。 您可以通过不使用全局状态访问项目,而是使用界限或包装所有状态创建和修改,而仅通过特定功能来揭示这一点。 <p> <em></em>

回答 0 投票 0



使用JavaScript API插入GoogleSheets单元格中 我正在尝试找出如何将用户创建的图像插入GoogleSheets单元格。我发现这个7岁的问题建议使用=图像函数。但这似乎不适合...

function save() { var dataURI = canvas.toDataURI(); dataURI=dataURI.toString(); let data = "=IMAGE(\"" + dataURI + "\")"; gapi.client.sheets.spreadsheets.values.update({ spreadsheetId: sheet, range: range, valueInputOption: "USER_ENTERED", resource: {"values":[[data]]}, }).then((response) => { window.location.href=nextPage.html; }); }

回答 1 投票 0

EXCEL脚本用于生成没有小计的枢轴表 我有一个创建一个枢轴表的脚本,但我不想显示小写,只有最终总数。 功能主(工作簿:Excelscript.workbook){ 令Sheet = Workbook.getActiveWorksheet(); //

function main(workbook: ExcelScript.Workbook) { let sheet = workbook.getActiveWorksheet(); // Downloading the active sheet // Finding the range with the data (I assume it starts with A1) let dataRange = sheet.getRange("A1").getSurroundingRegion(); // Checking that the scope is correct if (!dataRange) { console.log("No data found."); return; } // Creating a pivot table on the same sheet let pivotTable = sheet.addPivotTable("February", dataRange, sheet.getRange("H1")); let rowHierarchy = pivotTable.addRowHierarchy(pivotTable.getHierarchy("Posting date")); // Pivot table configuration pivotTable.addColumnHierarchy(pivotTable.getHierarchy("Project no.")); pivotTable.addColumnHierarchy(pivotTable.getHierarchy("Name")); pivotTable.addColumnHierarchy(pivotTable.getHierarchy("Task No.")); // Dodanie wartości (Ilość) let qtyHierarchy = pivotTable.getHierarchy("Time"); let dataField = pivotTable.addDataHierarchy(qtyHierarchy); dataField.setSummarizeBy(ExcelScript.AggregationFunction.sum); // Hiding subtotals for "Project No." and "Name" // Alternate formatting (lines) let pivotRange = pivotTable.getLayout().getRange(); let rowCount = pivotRange.getRowCount(); for (let i = 1; i < rowCount; i += 2) { // Every second line let row = pivotRange.getCell(i, 0).getEntireRow(); row.getFormat().getFill(); } console.log("The pivot table has been created."); }

回答 1 投票 0

包装应用程序组件与Context -Provider组件使网页empty

这是AppContext.jsx文件内容: 从“ react”导入{createContext}; 导出const appContext = createContext() 导出const appContextProvider =(props)=> { const va ...

回答 1 投票 0



如何从任何给定的跨度之间提取文本?

我正在尝试使用Cheerio和node.js从有趣的html中提取文本。 llet说我有以下html: <p> <span class="sectionno" id="s1">1</span> Do you see that shelf? <span class="endsection"></span> <span class="sectionno" id="s2">2</span>The shelf is hanging </p> <p>on the wall</p> <p>beside the clock.</p> <h3>Title Here</h3> <span class="endsection"></span> <p> <span class="sectionno" id="s3">3</span>The clock </p> <p>was ticking slowly</p> <p>telling time<span class="endsection"></span></p> 我希望能够提取以下数据,获得文本betew之间。 span.sectionno 我想忽略标题中的任何文本的情况。 span.endsection 由于HTML的奇怪设置,我无法成功地使用Cheerio进行此操作。任何帮助都将受到赞赏! 任何好的方法都应该分为两部分;由一个函数实现,该函数提取了两个元素节点,每个元素节点都定义了文本包含的开始点或终止点,并伴随着第二个函数,该功能提取了每个范围的文本值。 是第一个,通过通过选择器匹配两个范围标记(例如......)来利用[ { no: 1, text: "Do you see that shelf?", }, { no: 2, text: "The shelf is hanging on the wall, beside the clock.", }, { no: 3, text: "The clock was ticking slowly telling time", }, ] const $ = cheerio.load(html); const sections = []; $("span.sectionno").each((_, el) => { const sectionNo = parseInt($(el).text()); const text = $(el).nextUntil("span.endsection").addBack().text(); sections.push({ no: sectionNo, text: text.trim() }); }); console.log(sections); // [ { no: 1, text: '1' }, { no: 2, text: '2' }, { no: 3, text: '3' } ] ...已经解决了问题,但是,它不能保证(故意或意外)嵌套范围标记的故障安全。 最好通过额外的(例如基于基于的任务,在其中尝试对错误的嵌套范围标记(忽略破碎的标记)进行消毒。 LET的假设称为querySelectorAll,必须将元素节点传递给它,以将有效范围提取为一个元组。 因此,如果只有标记可以与之合作,则首先必须从中解析文件,例如... querySelectorAll('.sectionno, .endsection') 第二个功能可能称为reduce。它负责在开始和终止标记元素之间收集和返回整个文本内容。因此,后两个是该函数所期望的唯一两个参数。 通过简单的树木走动来完成文本内容,其中一个从启动标记元素开始,将要返回的文本项目对象提取的项目计数(getSectionRanges)。通过使用当前处理的节点的const docBody = new DOMParser() .parseFromString(markup, 'text/html') .body; const sectionRangeList = getSectionRanges(docBody); (文本节点或元素节点)来汇总此项目的propert-proper-allue。如果既没有下一个兄弟姐妹,也没有与终止标记元素的匹配,则必须切换到最后一个节点的父元素的下一个兄弟姐妹。多数民众赞成在成功的树走路所需的一切。 ...示例代码... extractSectionTextContent no text

回答 1 投票 0



eRror:无法在模块构建中解析图像 我有一个使用尾风V4和Laravel混合物的项目。以下是我的HTML文件:

我有一个使用尾风V4和Laravel混合物的项目。以下是我的HTML文件: <!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Skyblock Profile Viewer | Home</title> <link rel="stylesheet" href="dist/css/app.css" /> <script src="dist/js/app.js" defer></script> </head> <body> <main class="min-h-screen bg-[url(dist/assets/minecraft-background.png)] bg-cover bg-center" > <section></section> </main> </body> </html> <...

回答 0 投票 0

加载PDFJ时,我要运行JavaScript?

这不是(jQuery运行确定) $(

回答 2 投票 0

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.