meta-query 相关问题


Django 中的 Meta 到底是什么?

我想简单地知道Django中的Meta类是什么以及它们的作用。 从 django.db 导入模型 类作者(models.Model): first_name=models.CharField(max_length=20) 姓氏=models.CharF...


多个机器人元标签

我最近继承了一个代码库并发现了这个宝石: {% if PAGE_EXTRAS.hide_from_sitemap %} 我最近继承了一个代码库并发现了这个宝石: {% if PAGE_EXTRAS.hide_from_sitemap %} <META NAME="ROBOTS" CONTENT="NOINDEX, FOLLOW"> <META NAME="ROBOTS" CONTENT="INDEX, NOFOLLOW"> <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> {% endif %} 我不知道它想做什么。您是否有理由在这样的网站中放置多个明显冲突的机器人标签?或者它真的像我无知的眼睛看起来那么疯狂吗? 这对我来说似乎是一个错误。我能找到的唯一信息是在 Google 的机器人元标记规范: 如果我们的爬虫遇到竞争指令,我们将使用我们找到的最严格的指令。 所以(至少对于谷歌来说)代码: <meta name="robots" content="noindex, follow"> <meta name="robots" content="index, nofollow"> <meta name="robots" content="noindex, nofollow"> 的作用与: 完全相同 <meta name="robots" content="noindex, nofollow"> 可以想象,这段代码可能是某种偷偷摸摸的黑客行为,旨在通过利用不同的爬虫解决冲突的方式的差异,将不同的规则应用于不同的爬虫。如果是这样,恕我直言,这是一个糟糕的主意。当已经有合法的机制可以做同样的事情时,就不需要进行混乱而脆弱的黑客攻击: <meta name="googlebot" content="noindex, follow"> <meta name="bingbot" content="index, nofollow"> 根据这篇文章,最严格的将获胜: https://developers.google.com/search/blog/2007/03/using-robots-meta-tag


发送 csv 时“(400) 输入错误。某些域无效”

H。我需要通过ajax发送csv文件。我写了这段代码 $('#send-csv').click(function(){ var CSRF_TOKEN = document.querySelector('meta[name="csrf-token"]').getAttribute("c...


Tanstack React Query 中更新数据的问题

我正在用 React 构建一个在线商店,并决定在该项目中使用 React Query。任务是在缓存中显示和存储产品。从这些产品中,我需要获取所需的一个...


参数类型 {query: () => "products"} 不可分配给参数类型

我有此错误,并且仅在 WebStorm 中出现。在VS代码中就可以了。 我需要更改一些配置还是我在某个地方犯了错误? 参数类型 {query: () => "products"} 不是


在 Power query 中重新排列表格

我在 Power Query 中有一个表,我正在尝试重新排列。原始表如下所示: 我想重新排列它看起来像: 我将不胜感激任何帮助解决这个问题的帮助。谢谢...


有没有办法动态改变react-query查询?

我有一个带有react-query的next.js项目。基本上我需要做的是在主页上显示 API 中的所有国家/地区,但还有一个按名称搜索的输入,以及一个选择搜索...


如何正确使用 Function.InvokeAfter 来延迟 Excel 中整个查询的 Power Query 处理

我试图将 Excel 中的 Power Query 运行延迟大约 25 秒(我们称之为查询 2)。这是为了允许另一个查询(查询 1)首先从外部源提取数据。查询 2 o...


Excel Power Query 将列格式更改为自定义数字格式

我在 Power Query 编辑器中有一个包含多个应用步骤的查询。我有一列文本,我需要将其更改为以下格式的数字:000.000 我可以在 Excel 中手动执行此操作,但


JIRA jql 查询 - * 意味着什么?

JQL 中没有正则表达式: https://answers.atlassian.com/questions/138055/how-can-i-use-regex-in-a-jql-query-i-cannot-match-strings-that-have-a-specific-ending- in-jql-ex-ing-should-match-running-jo...


Flutter:版本解决pubget失败

注意:meta 通过 flutter SDK 中的integration_test 固定到版本 1.10.0。 有关详细信息,请参阅 https://dart.dev/go/sdk-version-pinning。 因为 sdk 中的每个版本的integration_test都依赖于...


数组文字缺少一行或多行的值

=SORT(UNIQUE({QUERY(LAMBDA(z,filter(z,index(z,,12))=max(index(z,,12))))(IMPORTRANGE("1madkVso_zaoU9MH2gvtVlTaT2iJ9nMcCxS8ux0Vpz14", "概述!A2 :Z")),"选择 Col1,Col2,Col3,...


在React语义ui列表元素中显示奇怪的字符而不是项目符号点

我正在使用react语义ui列表项目符号,但部署后项目符号点显示像奇怪的字符。我已经在 index.html 文件中包含以下代码 我正在使用 React 语义 ui 列表项目符号,但部署后项目符号点显示像奇怪的字符。我已经在index.html文件中包含了以下代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <meta name="theme-color" content="#000000" /> 我也有这个问题,为什么它们只是偶尔出现,并且不可选,也不属于html?


react中firestore onSnapshot的返回值

我在函数中有一个 onSnapshot 查询: //firebaseutil.js 导出异步函数 getShorts(uid) { const q = query(collection(db, 'shorted'), where('owner', '==', uid)); 常量取消订阅 = onSnapsh...


在 SQL Server 中获取最大递归 100 错误

我的此查询在不到 100 个日期内正常运行。 声明@startDate DATETIME 声明 @endDate DATETIME 将 @cols 声明为 NVARCHAR(max) 将 @query 声明为 NVARCHAR(max) 声明@startDa...


apache beam 和 Big Query TableSchema 中的序列化问题

并感谢您的支持。 我目前正在尝试使用 Apache Beam,以尽可能多地了解它的工作原理。我面临 com.google.api.serv 序列化的问题...


如何在 Google Sheets 中使用 SQL 进行表查找

这是我的数据(批号和日期的组合始终是唯一的): 所需结果: 我用过这个: =QUERY(Production!A:G, "SELECT A,B, C, D, G WHERE A is NOT NULL label C 'NEW LOT NO.',...


如何使用 Bootstrap 5 将嵌入水平居中

我正在尝试使用上面的图像进行集中输入。我按照位置文档进行操作,但不知何故图像没有水平集中: 代码: 我正在尝试使用上面的图像进行集中输入。我按照位置文档进行操作,但不知何故图像没有水平集中: 代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Title --> <title>Title</title> <!-- Css --> <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> </head> <body> <div class="container position-absolute top-50 start-50 translate-middle"> <embed class="logo" src="https://www.google.com.br/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" alt="Logo"> <form action="/streams" method="POST"> <div class="input-group"> <input class="form-control border-danger border-5" type="text" aria-describedby="start-button"> <button class="btn btn-danger" type="submit" id="start-button">Click</button> </div> </form> </div> </body> </html> 我尝试手动执行此操作并使用 display flex,但没有成功。 使用text-center链接 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Title --> <title>Title</title> <!-- Css --> <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> </head> <body> <div class="container text-center"> <embed class="logo " src="https://www.google.com.br/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" alt="Logo"> <form action="/streams" method="POST"> <div class="input-group"> <input class="form-control border-danger border-5" type="text" aria-describedby="start-button"> <button class="btn btn-danger" type="submit" id="start-button">Click</button> </div> </form> </div> </body> </html>


xquery 输出为降价表

我知道如何以 HTML 格式输出 x-query 结果,请参阅例如XQuery 到 HTML 表:生成列 但我在互联网上找不到在降价表中输出的单个示例。 (Xquery 版本...


如何将数据从 Google Big Query 导出到 PostgreSQL

我有一个表存储在 BigQuery 中,我想在 PostgreSQL 数据库中创建该表+数据的副本。这个 PostgreSQL 位于 Google Cloud SQL 中。 此导出每天都会发生,即


创建不带实体表类的@Query select

从数据库返回 Json 而不使用 @Table(tableName) @Entity 等的代码应该是什么样的? 例如,该 CustomResponse 未映射到数据库表,但通过该选择我想要 得到


qmake 和 QT_INSTALL_PREFIX。如何为 Qt 库选择新位置?

我是 qmake 的新手,我正在尝试构建一个现有的应用程序。 Qt 最初安装在 /usr/local/lib/Qt-4.3.5 中,“qmake -query QT_INSTALL_PREFIX”返回该路径。 我已经移动了 Qt


如何在 Google Big Query 中循环执行异常处理?

我试图通过使用 EXPORT DATA OPTIONS 命令将数据导出到 GCS 来对各种数据集中存在的多个表进行每月备份。这些表名称存在于


Power Query 中 Mysql 的查询折叠

我的数据位于 mysql 中,我想在我的 power bi 报告中使用增量刷新。但我需要可折叠查询才能使用此增量刷新功能。 我遇到过这个函数 - Value。


由于已婚和婚前姓名而导致 QUERY 命令出现问题

我正在尝试创建一个选项卡,根据另一个选项卡显示拖欠成员。 我的示例数据位于此处:https://docs.google.com/spreadsheets/d/1hyBfQBYF1TNmVgXammI5vADWFCD2d1eA/edit?usp=sha...


如何在 Big Query 中使用下一个非空 LEAD 值?

我想选择下一个非空引导场景_时间戳。我尝试了以下方法,但收到“从 BOOL 到 TIMESTAMP 的转换无效”错误。 格式时间戳( '%Y-%m-%d %H:%M...


作为 Props 传递时输入 React 无限查询数据

我正在使用 React Query 无限查询来加载带有“下一个”按钮触发器的条目列表(这是文档中的缩写代码,但它是相同的想法): 导入 { useInfiniteQuery } ...


iPhone 移动视图上的 ReactJS 状态栏为黑色

我查找了解决方案,大多数都是关于 PWA 的,但这是一个静态网页。 我尝试添加到我的index.html 文件中,但仍然没有任何内容。在 Safari 和 Chrome 上同样如此 我查找了解决方案,大多数都是关于 PWA 的,但这是一个静态网页。 我尝试添加到我的index.html 文件中,但仍然没有任何结果。 Safari 和 Chrome 上同样 <meta name='viewport' content='initial-scale=1, viewport-fit=cover'> 这就是我想要实现的目标 我希望黑条的颜色和网页一样 要更改颜色,请更改 index.html 中的代码 <meta name="theme-color" content="#0d436d" /> 根据您需要的颜色修改内容。


Excel、Power Query:将查询 2 中的多列添加到查询 1 中

我的问题的延续:Excel,查询:如何通过查找将查询 2 中的特定信息添加到查询 1 中 我有 2 个查询,“概述”和“数据”。我想添加


如何编写类型安全的函数签名来接受 amplify-js v6 graphql 订阅通知的回调函数?

使用版本 6.0.9 的 NPM 库 aws-amplify (不是 5.x.x!),我尝试将调用包装到 client.graphql({ query: typedGqlString, Variables}).subscribe({ next, error }),这样我就可以治疗...


MUI X DataGrid 在分页结果时仅显示一行

我正在使用 MUI X Data Grid v5 和 Tanstack React Query v4 我正在尝试在我的 Datagrid 组件上使用分页,当页面最初加载时,它会按预期正常获取并加载网格。


使用useSearchParams()在nextjs中获取动态数据

有人曾经在 nextjs 中从页面路由器迁移到应用程序路由器吗? 我在页面路由器上遇到动态数据迁移问题,它使用 useRouter().query 检索页面上的动态数据,其中...


如何使用Power Query解压GZ文件?

对于 zip 文件,我找到了这段代码和本教程,解释了如何使用该代码并且效果很好。 问题是我有 gz 文件而不是 zip 文件。 gz 文件包含一个 csv.txt 文件。 所以我尝试了


如何使用react-query停止在页面加载时重新获取数据

我有一个react-js页面。我正在使用 React 查询从 API 获取数据。我想将第一次页面访问时来自 API 的数据存储在缓存中,之后总是从...读取数据


从 Excel 进行 Outlook 查询时不显示事件

我正在制作一个 Excel 工作表来帮助我填写我们的工作表。为了实现此目的,我创建了一个 Power Query,它从 Outlook 日历中获取数据。然而,我注意到重复发生的事件只会......


如何从 SQL QUERY 查询的数据创建数据框,并为每列使用正确的数据类型

我在 python 中创建了一个函数,可以使用 pyodbc 库直接从 SQL 数据库查询数据。问题是函数中的 pd.read_csv 生成一个数据帧,其中列期望......


RTK-查询每 X 分钟获取数据并将其添加到存储的数据中

我有一个包含许多数据点的“实时图表”。 我想使用 rtk-query 获取从时间 A 到现在的数据并存储它。 然后,每隔 X 分钟,我想再次调用 API 以获取...


如何在 Google 表格中的查询结果中添加额外列

我有一个带有许多选项卡的 Google 表格。我想将每个工作表选项卡的单元格 AH1 中的值添加到以下公式的结果中: =QUERY({ALZR11!H2:Y; HGLG11!H2:Y};“选择 * 其中 Col8 不是


如何在 Power Query 中编写 COUNTIFS 函数,其中第二段 COUNTIF 正在搜索提前 7 天的日期值

我在 Excel 中编写了一个 COUNTIFS 函数,告诉我是否有距离索引行日期一周的日期,其中还包括一个条件。该函数如下: COUNTIFS(表1_1[查找2],表1_1[@Lo...


如何在webview中加载html字符串?

我有一个包含以下内容的html字符串: 我有一个包含以下内容的html字符串: <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1250"> <meta name="spanish press" content="spain, spanish newspaper, news,economy,politics,sports"> <title></title> </head> <body id="body"> <!-- The following code will render a clickable image ad in the page --> <script src="http://www.myscript.com/a"></script> </body> </html> 我需要将该网站显示到 Android 中的网络视图中。 我尝试过这一切: webView.loadDataWithBaseURL(null, txt, "text/html", "UTF-8", null); webView.loadDataWithBaseURL("x-data://base", txt, "text/html", "UTF-8", null); webView.loadDataWithBaseURL("notreal/", txt, "text/htm", "utf-8",null); 我还尝试删除 DOCTYPE 标签: txt=txt.replace("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">", ""); 这些人都没有工作。我刚刚实现了将字符串显示到 webview(html 代码)中,但不是必须使用该 html 代码创建的网站。 出了什么问题? 在 WebView 中加载数据。调用WebView的loadData()方法 wv.loadData(yourData, "text/html", "UTF-8"); 你可以查看这个例子 http://developer.android.com/reference/android/webkit/WebView.html [编辑1] 您应该在 -- " 之前添加 -- \ -- 例如 --> name=\"spanish press\" 下面的字符串对我有用 String webData = "<!DOCTYPE html><head> <meta http-equiv=\"Content-Type\" " + "content=\"text/html; charset=utf-8\"> <html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=windows-1250\">"+ "<meta name=\"spanish press\" content=\"spain, spanish newspaper, news,economy,politics,sports\"><title></title></head><body id=\"body\">"+ "<script src=\"http://www.myscript.com/a\"></script>şlkasşldkasşdksaşdkaşskdşk</body></html>"; 你也可以试试这个 final WebView webView = new WebView(this); webView.loadDataWithBaseURL(null, content, "text/html", "UTF-8", null); 从资产 html 文件中读取 ViewGroup webGroup; String content = readContent("content/ganji.html"); final WebView webView = new WebView(this); webView.loadDataWithBaseURL(null, content, "text/html", "UTF-8", null); webGroup.addView(webView); 我有同样的要求,我是按照以下方式完成的。你也可以试试这个。 使用loadData方法 web.loadData(""" <p style='text-align:center'> <img class='aligncenter size-full wp-image-1607' title='' src="+movImage+" alt='' width='240px' height='180px' /> </p> <p> <center> <U> <H2>"+movName+"("+movYear+")</H2> </U> </center> </p> <p><strong>Director : </strong>"+movDirector+"</p> <p><strong>Producer : </strong>"+movProducer+"</p> <p><strong>Character : </strong>"+movActedAs+"</p> <p><strong>Summary : </strong>"+movAnecdotes+"</p> <p><strong>Synopsis : </strong>"+movSynopsis+"</p> """, "text/html", "UTF-8" ); movDirector movProducer 都是我的字符串变量。 简而言之,我保留了 URL 的自定义样式。 如果您正在 JetpackCompose 中寻找某些内容,这可以帮助您: @Composable fun HtmlTextVisualizerComponent(textFromData: String) { val mimeType = "text/html" val encoding = "UTF-8" LazyColumn( modifier = Modifier .padding( start = 24.dp, end = 24.dp, top = 16.dp, bottom = 24.dp, ), ) { items(1) { val state = rememberWebViewState( url = "data:$mimeType;$encoding,$textFromData", ) val navigator = rememberWebViewNavigator() WebView( state = state, modifier = Modifier.fillMaxSize(), navigator = navigator, onCreated = { it.settings.javaScriptEnabled = true }, ) } } } 一定不要忘记在你的 gradle 中添加依赖项: implementation "com.google.accompanist:accompanist-webview:0.30.1"


如何让div在透明背景上有纯色?

<!DOCTYPE html> <html lang="pl"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link rel="stylesheet" href="style.css"> </head> <body> <div id="bg"> <div id="topbar"></div> </div> </body> </html> body { background: url(bg.jpg); margin: 0; } #bg { background-color: black; margin: 0; padding: 0; height: 100vh; opacity: 0.7; } #topbar { background-color: gray; height: 80px; width: 100%; } Ive tried adding opacity: 1 to the topbar div and rgba with alpha: 1. The result: there是一个图像,其上有黑色背景,不透明度为 0.7,顶部栏的不透明度也为 0.7。 我的目标是实现较暗的图像作为背景和纯色顶栏 div #topbar位于#bg内部,因此调整#bg的不透明度也会影响#topbar。我要做的是省略不透明度并将背景颜色更改为透明黑色。 看起来像这样: body { background: url(bg.jpg); margin: 0; } #bg { background-color: rgba(0, 0, 0, 0.7); margin: 0; padding: 0; height: 100vh; } #topbar { background-color: gray; height: 80px; width: 100%; } 这样只有背景颜色是透明的,而不是整个元素。


下拉按钮在 Bootstrap 5.3 上不起作用

我正在使用 Express、EJS 和 bootstrap 制作一个网站,但下拉按钮不起作用 代码: <%- include('../includes/head') %> 我正在使用 Express、EJS 和 bootstrap 制作一个网站,但下拉按钮不起作用 代码: <%- include('../includes/head') %> <div class="dropdown"> <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">Dropdown button</button> <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1"> <li><a class="dropdown-item" href="#">Action</a></li> <li><a class="dropdown-item" href="#">Another action</a></li> <li><a class="dropdown-item" href="#">Something else here</a></li> </ul> </div> <%- include('../includes/footer') %> 头: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> <title>Title</title> </head> <body> 页脚: <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script> </body> </html> 当我单击按钮时,它不显示下拉菜单的内容 我不知道这是否重要/有效,但尝试将引导脚本从页脚移动到页眉,它可能基于加载顺序。


尝试在Google表格上使用QUERY函数时总是出现公式解析错误

我正在尝试从谷歌表格上的表单响应中选择某些数据。如果一个单元格等于某个特定单词,我只想选择所有数据。我在同一个区域内创建了一个新工作表...


Power BI - 将每个最新日期(刷新历史记录)存储到表中或 Power bi 桌面中的其他技巧

我快要失去理智去解决以下问题了。对于通常使用 Power Query 的会员来说这很容易,但对我来说则不然,因为我已经用它做了一些工作(我一直使用 DAX)。 我是


带有使用 requireJS 的 javascript 模块的 Flutter Web 项目(Flutter Web 中的 Monaco 编辑器)

我正在尝试在 Flutter Web 中使用 Monaco 编辑器。 我看到的最简单的方法是同步加载所有资源示例。 这是一个独立的 html 文件: 我正在尝试在 Flutter Web 中使用 Monaco 编辑器。 我看到的最简单的方法是同步加载所有资源示例。 这是一个独立的 html 文件: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" data-name="vs/editor/editor.main" href="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.44.0/min/vs/editor/editor.main.css" /> <style> @font-face { font-family: "codicon", src: url("https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.44.0/min/vs/base/browser/ui/codicons/codicon.ttf") format("truetype") } </style> <title>Monaco</title> </head> <body> <h2>Monaco Editor Sync Loading Sample</h2> <div id="code" style="width: 800px; height: 600px; border: 1px solid grey"></div> <script> var require = { paths: { vs: "https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.44.0/min/vs" } }; </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.44.0/min/vs/loader.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.44.0/min/vs/editor/editor.main.nls.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.44.0/min/vs/editor/editor.main.js"></script> <script> var editor = monaco.editor.create(document.getElementById("code"), { value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'), language: "javascript", additionalCssClassName: "code" }); </script> </body> </html> 我的问题是:如何修改示例 Flutter Web 项目的 index.html 文件,以便加载所有必需的资源?线路好像有问题 var require = { paths: { vs: "https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.44.0/min/vs" } }; 因为 flutter 构建永远不会完成(卡在某个地方。)我看到 Flutter 本身使用 requirejs,并且可能存在我不知道如何解决的冲突。 如果您知道如何执行此操作,请发布一个 Fluter Web index.html 文件,该文件加载编辑器所需的所有 js 文件。 谢谢你, T https://github.com/Hua777/flutter_monaco_editor 我已经大致完成了flutter版的monaco编辑器。 但还不完美,希望对你有帮助。


从数据库中选择 SELECT 选项后如何显示/隐藏 DIV?

这是选择选项的代码; 这是选择选项的代码; <div class="modal-body row"> <form role="form" action="patient/addNew" class="clearfix" method="post" enctype="multipart/form-data"> <div class="form-group col-md-6"> <label for="exampleInputEmail1"><?php echo lang('categorie'); ?></label> <select class="form-control m-bot15" name="categorie" value='' id="p_category"> <option value="#"> Sélectionner catégorie</option> <?php foreach ($categories as $category) { ?> <option value="category"><?php if (!empty($setval)) { if ($category->category == set_value('category')) { echo 'selected'; } } if (!empty($patient->category)) { if ($category->category == $patient->category) { echo 'selected'; } } ?> > <?php echo $category->category; ?> </option> <?php } ?> </select> </div> 这是必须显示/隐藏的 div: <label for="exampleInputEmail1"><?php echo lang('name_Us'); ?></label> <input type="text" class="form-control" name="name_husband" id="nameUs" placeholder=""> <label for="exampleInputEmail1"><?php echo lang('number_pre'); ?></label> <input type="number" class="form-control" name="number_pre" id="nbreEnf" placeholder=""> </div> 这是 JavaScript 代码: $('.divUs').hide(); $(document.body).on('change', '#p_category', function () { var v = $("select.p_category option:selected").val() if (v == 'Fe_Ence') { $('.divUs').show(); } else { $('.divUs').hide(); } }); }); 我希望如果选择了元素(Fe_Ence),则可以显示 div,否则,它保持隐藏 例如,您可以使用 :has 选择器 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div id="thingtohide"> <h1>Hello</h1> </div> <div id="checkbox"> <input type="checkbox"> </div> <style> body:has(#checkbox input:checked) #thingtohide { visibility: hidden; } </style> </body> </html> 因此,如果父元素有一个选中的复选框,那么您可以定位与该父元素不同的子元素。


为什么我的全景切换按钮不起作用?

我正在尝试制作一个按钮,以便将其绑定到全景图中的特定位置。也就是说,当用户观看 360 度全景图时,按钮不应旋转。 我正在尝试制作一个按钮,以便将其绑定到全景图中的特定位置。也就是说,当用户查看 360 度全景图时,按钮不应旋转。 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>panoramas</title> <script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script> <style> #switchButton { cursor: pointer; } </style> </head> <body> <a-scene> <a-assets> <img id="panorama1" src="1.jpg"> <img id="panorama2" src="2.jpg"> </a-assets> <a-sky id="panorama" src="#panorama1" rotation="0 -130 0"></a-sky> <a-entity id="cameraRig"> <a-camera></a-camera> </a-entity> <a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#CCC" id="switchButton"></a-plane> </a-scene> <script> const button = document.querySelector('#switchButton'); let currentPanorama = 1; button.addEventListener('mouseenter', () => { const panorama = document.querySelector('#panorama'); if (currentPanorama === 1) { panorama.setAttribute('src', '#panorama2'); currentPanorama = 2; } else { panorama.setAttribute('src', '#panorama1'); currentPanorama = 1; } }); </script> </body> </html> 我正在尝试制作一个按钮,以便将其绑定到全景图中的特定位置。也就是说,当用户查看 360 度全景图时,按钮不应旋转。 我解决你的问题 您需要做的是添加一个光标来处理 onlcick 事件,这是唯一的方法。 <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width"> <title>A-Frame HTML Shader - Dynamic</title> <script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script> <script src="https://unpkg.com/[email protected]/dist/aframe-html-shader.min.js"></script> <script> let currentPanorama = 1; AFRAME.registerComponent("click-log", { init: function () { this.myFunction = function () { const panorama = document.querySelector('#panorama'); if (currentPanorama === 1) { panorama.setAttribute('src', '#panorama2'); currentPanorama = 2; } else { panorama.setAttribute('src', '#panorama1'); currentPanorama = 1; } }; this.el.addEventListener("click", this.myFunction); }, remove: function () { this.el.removeEventListener("click", this.myFunction); } }); </script> </head> <body> <a-scene update-html> <a-camera> <a-cursor material="color: red"></a-cursor> </a-camera> <a-assets> <img id="panorama1" src="https://l13.alamy.com/360/PWNBM9/testing-new-cameralens-combination-in-my-garden-in-aarhus-denmark-PWNBM9.jpg"> <img id="panorama2" src="https://aframe.io/aframe/examples/boilerplate/panorama/puydesancy.jpg"> </a-assets> <a-sky id="panorama" src="#panorama1" rotation="0 -130 0"></a-sky> <a-entity id="cameraRig"> <a-camera></a-camera> </a-entity> <a-plane click-log position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#CCC" id="switchButton"></a-plane> </a-scene> </body> </html>


按照路径流对 svg 填充进行动画处理

我有以下SVG;它类似于字母“P”。我想用黑色填充整个“P”,但要逐渐地遵循绘图的流程,就像正在绘制一样。 我有以下SVG;它类似于字母“P”。我想用黑色填充整个“P”,但要逐渐地遵循绘图的流程,就像正在绘制一样。 <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"> <g stroke="#000" stroke-width="1" fill="none"> <path d="M31.5294 14.2118C31.5294 18.8819 28.7623 22.9082 24.7793 24.7351C26.4612 23.3496 27.5322 21.248 27.5322 18.896C27.5322 14.7642 24.2259 11.4042 20.112 11.3205C20.0574 11.3167 20.0075 11.3167 19.9529 11.3167C19.8983 11.3167 19.8485 11.3167 19.7939 11.3205C18.2673 11.4033 17.0588 12.6663 17.0588 14.2108V28.6814C17.0588 33.4748 13.1699 37.3638 8.37646 37.3638V14.2118C8.37646 7.81928 13.5605 2.63528 19.9529 2.63528C26.3454 2.63528 31.5294 7.81928 31.5294 14.2118Z"/> </g> </svg> 如果我只是从下到上或从左到右填充,其他类似问题的解决方案,它不会遵循绘制时的“P”形状。请注意:我对 SVG 没有太多专业知识。 我举了一个例子来说明如何做到这一点。我知道这可能不完全是您想要的,但这说明了一条可以遵循的道路。 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link rel="stylesheet" href="style.css"> </head> <body> <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"> <style> @keyframes fade-in-right { from { clip-path: circle(0px); } to { clip-path: circle(40px); } } #path2 { animation: fade-in-right ease 4s infinite; } </style> <g stroke="#000000" stroke-width="1" fill="none" id="g1"> <path d="m 31.5294,14.2118 c 0,4.6701 -2.7671,8.6964 -6.7501,10.5233 1.6819,-1.3855 2.7529,-3.4871 2.7529,-5.8391 0,-4.1318 -3.3063,-7.4918 -7.4202,-7.5755 -0.0546,-0.0038 -0.1045,-0.0038 -0.1591,-0.0038 -0.0546,0 -0.1044,0 -0.159,0.0038 -1.5266,0.0828 -2.7351,1.3458 -2.7351,2.8903 v 14.4706 c 0,4.7934 -3.8889,8.6824 -8.68234,8.6824 v -23.152 c 0,-6.39252 5.18404,-11.57652 11.57644,-11.57652 6.3925,0 11.5765,5.184 11.5765,11.57652 z" id="path1" /> </g> <g stroke="#000000" stroke-width="1" fill="none" id="g2"> <path d="m 31.5294,14.2118 c 0,4.6701 -2.7671,8.6964 -6.7501,10.5233 1.6819,-1.3855 2.7529,-3.4871 2.7529,-5.8391 0,-4.1318 -3.3063,-7.4918 -7.4202,-7.5755 -0.0546,-0.0038 -0.1045,-0.0038 -0.1591,-0.0038 -0.0546,0 -0.1044,0 -0.159,0.0038 -1.5266,0.0828 -2.7351,1.3458 -2.7351,2.8903 v 14.4706 c 0,4.7934 -3.8889,8.6824 -8.68234,8.6824 v -23.152 c 0,-6.39252 5.18404,-11.57652 11.57644,-11.57652 6.3925,0 11.5765,5.184 11.5765,11.57652 z" id="path2" style="fill:#000000;fill-opacity:1;stroke:none" /> </g> </svg> </body> </html>


对于使用PHP的循环,我想使用PHP在数据库表中插入动态行,每行有10列

我有一个这样的数据库表 我想动态插入从 0000 到 0999 的数据,连续 10 个数据,如下所示 我正在尝试这样的事情 我有一个这样的数据库表 我想动态插入从 0000 到 0999 的数据,连续 10 个数据,如下所示 我正在尝试这样的事情 <?php for($i=0;$i<=999;$i++){ $num= str_pad($i, 4, "0", STR_PAD_LEFT); $x = 10; if ($i % $x == 0) { mysqli_query($con,"INSERT INTO `0000_0999` (`id`, `col1`, `col2`, `col3`, `col4`, `col5`, `col6`, `col7`, `col8`, `col9`, `col10`, `col11`) VALUES (NULL, '', '', '', '', '', '', '', '', '', '', '');") } } ?> 但我不知道如何传递列明智的数据。 您只需创建一个数组来保存每行的列值 对于每一行,您必须保存该列的值,您可以简单地创建一个数组来保存 并迭代循环并将数据插入数据库 使用此代码: for ($i = 0; $i <= 999; $i++) { $num = str_pad($i, 4, "0", STR_PAD_LEFT); // Create an array to hold column values for each row $rowData = array( 'col1' => '', 'col2' => '', 'col3' => '', 'col4' => '', 'col5' => '', 'col6' => '', 'col7' => '', 'col8' => '', 'col9' => '', 'col10' => '' ); // Convert the array values into a comma-separated string $values = "'" . implode("', '", $rowData) . "'"; // Your insert query $query = "INSERT INTO `0000_0999` (`id`, `col1`, `col2`, `col3`, `col4`, `col5`, `col6`, `col7`, `col8`, `col9`, `col10`, `col11`) VALUES (NULL, $values)";} 逐步解释 步骤 1 - 在此过程中,我创建了一个数组,并在该数组中设置了列值 步骤 2 - 我将数组值转换为字符串(逗号分隔) 第 3 步 - 插入值


在 HTML 文档中嵌入 TypeScript 代码

是否可以在网页中嵌入 TypeScript 代码?我想将 TypeScript 代码嵌入到脚本标签中,如下所示(以便它自动编译为 Javascript): <p>是否可以在网页中嵌入 TypeScript 代码?我想将 TypeScript 代码嵌入到脚本标签中,如下所示(以便它自动编译为 Javascript):</p> <pre><code>&lt;script type = &#34;text/typescript&#34;&gt; //TypeScript code goes here &lt;/script&gt; </code></pre> </question> <answer tick="true" vote="28"> <p>实际上有几个项目允许您使用类似的 TypeScript 代码 - <a href="https://github.com/niutech/typescript-compile" rel="noreferrer">TypeScript Compile</a>、<a href="https://github.com/ComFreek/ts-htaccess" rel="noreferrer">ts-htaccess</a>。</p> <p>这里的问题是 .ts 代码应该编译成 JavaScript - 它可以在客户端完成(速度慢;整个 TSC 也应该加载到客户端)或在服务器端完成(显然更快,而且它更快)在编译代码上利用缓存要容易得多)。</p> </answer> <answer tick="false" vote="18"> <p>这是我编写的版本,<strong>直接</strong>使用 Microsoft/TypeScript/master 的版本,因此它始终保持最新:<a href="https://github.com/basarat/typescript-script" rel="noreferrer">https://github.com/basarat/typescript-script</a></p> <p>您甚至可以将 <pre><code>ts</code></pre> 指向您可能拥有的任何其他 TypeScript 版本,它会正常工作 🌹</p> </answer> <answer tick="false" vote="6"> <p>已经为此目的开发了一个 JavaScript 库 - 它称为 <a href="https://github.com/niutech/typescript-compile" rel="noreferrer">TypeScript Compile</a>,它允许将 Typescript 嵌入到 HTML 中(如上所示。)</p> </answer> <answer tick="false" vote="0"> <p>我写这篇文章的目的是为了在浏览器中编译 TypeScript,以便我可以编写快速简单的示例来分享。</p> <p><a href="https://github.com/Sean-Bradley/text-typescript" rel="nofollow noreferrer">https://github.com/Sean-Bradley/text-typescript</a></p> <p>使用,</p> <pre><code>&lt;script type=&#34;text/typescript&#34;&gt; // Your TypeScript code here &lt;/script&gt; </code></pre> <p>并包含依赖项。</p> <pre><code>&lt;script src=&#34;https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" data-cfemail="67131e17021404150e1713275249544954">[email protected]</a>&#34;&gt;&lt;/script&gt; &lt;script defer src=&#34;https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" data-cfemail="3743524f431a434e47524454455e4743770619041907">[email protected]</a>&#34;&gt;&lt;/script&gt; </code></pre> <p>一个完整的示例,您可以复制/粘贴到 HTML 文档中并在本地尝试。</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang=&#34;en&#34;&gt; &lt;head&gt; &lt;meta charset=&#34;utf-8&#34; /&gt; &lt;meta name=&#34;viewport&#34; content=&#34;width=device-width, initial-scale=1&#34; /&gt; &lt;title&gt;&#34;text/typescript&#34; example&lt;/title&gt; &lt;meta name=&#34;description&#34; content=&#34;Transpiling and executing TypeScript in the browser&#34; /&gt; &lt;style&gt; body { overflow: hidden; margin: 0px; font-size: 15vw; } &lt;/style&gt; &lt;script type=&#34;text/typescript&#34;&gt; function foo(bar: string) { return &#34;Hello &#34; + bar; } let baz = &#34;World!&#34;; document.getElementById(&#34;root&#34;).innerHTML = foo(baz); &lt;/script&gt; &lt;script src=&#34;https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" data-cfemail="13676a63766070617a636753263d203d20">[email protected]</a>&#34;&gt;&lt;/script&gt; &lt;script defer src=&#34;https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" data-cfemail="ec98899498c198959c899f8f9e859c98acddc2dfc2dc">[email protected]</a>&#34;&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id=&#34;root&#34;&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>你可以看到它在这里、现在、今天发挥作用。</p> <p><a href="https://editor.sbcode.net/f1f4b5a73ec40283d1ddb37bb1e71f7e4e31b487" rel="nofollow noreferrer">https://editor.sbcode.net/f1f4b5a73ec40283d1ddb37bb1e71f7e4e31b487</a></p> </answer> </body></html>


© www.soinside.com 2019 - 2024. All rights reserved.