referenceerror 相关问题

尝试取消引用尚未声明的变量时抛出的与JavaScript ReferenceError相关的任何内容。

在 Next.js 中使用 setInterval 的问题

我正在使用 Next.js 和 tailwind.css 创建一个进度条组件,并使用 javascript setInterval() 函数为其设置动画。花点时间阅读代码。下面是代码: 进口重新...

回答 1 投票 0

未捕获的引用错误:选择器未定义

我正在制作一个有关制作基本聊天机器人的 Youtube 教程,我使用 JS、Python 3.11.4、HTML、Flask 和 CSS。大部分代码都是正确的,但每次运行时都会出现错误并且无法打开聊天

回答 1 投票 0

未捕获的引用错误:React 项目中未定义全局

我正在使用 React 库构建一个项目。当我尝试在本地主机上运行我的项目时,我遇到了下一个问题。 2GlobalStyles.js:13未捕获的ReferenceError:全局未定义 在

回答 0 投票 0

GitHub NIFTI-Reader-JS 测试不工作:“未捕获的 ReferenceError:nifti 未定义”

当我将 NIFTI-Reader-JS 存储库克隆到我的本地计算机并运行 canvas.html 或 browser.html 测试文件时,我得到一个 Uncaught ReferenceError: nifti is not defined when I choose a file to...

回答 1 投票 0

正在读取 Xliff 文件,但 xliff.js 不允许我创建新对象

我已经将 xliff.js 文件放在我的服务器上与我的 .html 文件相同的目录中,使用 在我的 javascript 代码中,我有以下获取命令。 ... 获取('translations.xliff') .then(响应=...

回答 0 投票 0

定义相互递归的 zod 模式

我是 TypeScript 的新手,我在以下代码中遇到错误: 从“zod”导入{z}; export const SpatialEntity = z.object({ dimension_units: z.string().optional(), 地方...

回答 1 投票 0

即使我通过 CDN 导入 Mediapipe 任务,也会出现“未定义 FilesetResolver”的错误

我从 Mediapipe 网站获得了以下设置,但是当我在本地加载页面时,我不断收到此错误:ReferenceError: FilesetResolver is not defined。当我注释掉...

回答 0 投票 0

Uncaught ReferenceError: viewLocation is not defined at HTMLAnchorElement.onclick

我通过 live_search.php 生成的标签调用 viewLocation() 时出错: 文件 live_search.php: ` 我通过 live_search.php 生成的标签调用 viewLocation() 时出错: 文件 live_search.php: ` // check biến $_GET có giá trị hay không if(isset($_GET['loaidat'])){ $loaidat = $_GET['loaidat']; $name = strtolower($loaidat); $query = "select *,st_x(ST_Centroid(geom)) as x ,st_y(ST_Centroid(geom)) as y from public.camhoangdc_1 where LOWER(loaidat) like '%$loaidat%'"; $result = pg_query($conn, $query); $tong_so_ket_qua = pg_num_rows($result); if($tong_so_ket_qua > 0) { while($dong = pg_fetch_array($result, null, PGSQL_ASSOC)) { $link = "<a href='javascript:void(0);' onclick='viewLocation(".$dong['x'].",".$dong['y'].")'>Xem ngay</a>"; echo "<div style='padding: 6px 0;'> <p>Loại đất: ".$dong['loaidat']." | Diện tích: ".$dong['dientich']."</p> ".$link." </div>"; } } else { echo "Không tìm thấy kết quả"; } } else { echo "Không tìm thấy thông tin"; } ?>**File main.js**$('#document').ready(函数(){ /** * 构成弹出窗口的元素。 / var container = document.getElementById('popup'); var closer = document.getElementById('popup-closer'); /* * 创建一个叠加层以将弹出窗口锚定到地图上。 / var overlay = new ol.Overlay(/* @type {olx.OverlayOptions} */({ 元素:容器, 自动平移:真, autoPanAnimation: { 持续时间:250 } })); var shouldUpdate = true; var center = [564348.28125, 2317798.5017235153]; var zoom = 17.716884608150796; var rotation = 0; // Add a click handler to hide the popup. // @return {boolean} Don't follow the href closer.onclick = function () { overlay.setPosition(undefined); closer.blur(); return false; }; var format = 'image/png'; var bounds = [564182.125, 2317466.0, 564514.4375, 2318014.0]; var vung = new ol.layer.Image({ source: new ol.source.ImageWMS({ ratio: 1, url: 'http://localhost:8888/geoserver/cam_hoang/wms', params: { 'FORMAT': format, 'VERSION': '1.1.0', STYLES: '', LAYERS: 'cam_hoang:camhoangdc_1', } }) }); var duong = new ol.layer.Image({ source: new ol.source.ImageWMS({ ratio: 1, url: 'http://localhost:8888/geoserver/cam_hoang/wms', params: { 'FORMAT': format, 'VERSION': '1.1.0', STYLES: '', LAYERS: 'cam_hoang:camhoanggt_1', } }) }); var diem = new ol.layer.Image({ source: new ol.source.ImageWMS({ ratio: 1, url: 'http://localhost:8888/geoserver/cam_hoang/wms', params: { 'FORMAT': format, 'VERSION': '1.1.0', STYLES: '', LAYERS: 'cam_hoang:camhoangtt_1', } }) }); var projection = new ol.proj.Projection({ code: 'EPSG:3405', units: 'm', axisOrientation: 'neu' }); var view = new ol.View({ projection: projection, center: center, zoom: zoom, rotation: rotation }); var map = new ol.Map({ target: 'map', layers: [vung, duong, diem], view: view, overlays: [overlay] }); if(window.location.hash != '') { var hash = window.location.hash.replace('#map', ''); var parts = hash.split('/'); if(parts.length === 4) { zoom = parseInt(parts[0], 10); center = [ parseFloat(parts[1]), parseFloat(parts[2]) ]; rotation = parseFloat(parts[3]); } } var styles = { 'MultiPolygon': new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'red', width: 3 }) }) }; var styleFunction = function (feature) { return styles[feature.getGeometry().getType()]; }; var vectorLayer = new ol.layer.Vector({ //source: vectorSource, style: styleFunction }); map.addLayer(vectorLayer); // map.getView().fitExtent(bounds, map.getSize()); map.getView().fit(bounds, map.getSize()); //Bài 5 $('#checkVung').change(function () { if($('#checkVung').is(':checked')) { vung.setVisible(true); $('#polygon')[0].classList.replace('hide', 'show'); } else { vung.setVisible(false); $('#polygon')[0].classList.add('hide'); } }); $('#checkDuong').change(function () { if($('#checkDuong').is(':checked')) { duong.setVisible(true); $('#line')[0].classList.replace('hide', 'show'); } else { duong.setVisible(false); $('#line')[0].classList.add('hide'); } }); $('#checkDiem').change(function () { if($("#checkDiem").is(':checked')) { diem.setVisible(true); $('#point')[0].classList.replace('hide', 'show'); } else { diem.setVisible(false); $('#point')[0].classList.add('hide'); } }); var updatePermalink = ()=> { if(!shouldUpdate) { shouldUpdate = true; return; } var center = view.getCenter(); var hash = '#map' + view.getZoom() + '/' + Math.round(center[0] * 100) / 100 + '/' + Math.round(center[1] * 100) / 100 + '/' + view.getRotation(); var state = { zoom: view.getZoom(), center: view.getCenter(), rotation: view.getRotation() } window.history.pushState(state, 'map', hash); } map.on('moveend', updatePermalink); window.addEventListener('popstate', (e)=> { if(e.state === null) { return; } map.getView().setCenter(e.state.center); map.getView().setZoom(e.state.zoom); map.getView().setRotation(e.state.rotation); shouldUpdate = false; }); function viewLocation(x, y) { var vi_tri = ol.proj.fromLonLat([x, y], projection); view.animate({ center: vi_tri, duration: 2000, zoom: 20 }); } //Bai 6 map.on('click', function (e) { var view = map.getView(); var viewResolution = view.getResolution(); var source = vung.getSource(); var url = source.getFeatureInfoUrl( e.coordinate, viewResolution, view.getProjection(), {'INFO_FORMAT': 'application/json', 'FEATURE_COUNT': 50 } ); if (url) { $.ajax({ type: 'POST', url: url, contentType: 'application/json', dataType: 'json', success: function(n) { var content = '<div>'; for (var i = 0; i < n.features.length; i++) { var feature = n.features[i]; var featureAttr = feature.properties; content += '<p>So thua: ' + featureAttr['sothututhu'] + '</p><p>So to ban do: ' + featureAttr['sohieutoba'] + '</p><p>Dien tich: ' + featureAttr['dientich'] + '</p><p>Loai dat: ' + featureAttr['loaiDat'] + '<p>------------------</p>' } content += '</div>'; $("#popup-content").html(content); overlay.setPosition(e.coordinate); var vectorSource = new ol.source.Vector({ features: (new ol.format.GeoJSON()).readFeatures(n) }); vectorLayer.setSource(vectorSource); } }) } }); });` 我试图修复它,但没有用

回答 0 投票 0

清除 2 个语法错误后遇到 ReferenceError

/home/container/index.js:119 const args = message.content.slice(config.prefix.length).trim().split(/ +/); ^ ReferenceError:消息未定义 在 Object.\ (/home/container/ind...

回答 0 投票 0

为什么会出现 ReferenceError: window is not defined in Nextjs

我正在尝试在 Nextjs 中使用带有 window 属性的 useState 挂钩。但是,我收到错误 ReferenceError: window is not defined。 目标:每当屏幕出现时更新大小状态...

回答 2 投票 0

如何定义未定义的变量[关闭]

我正在尝试使用 Stellarium 应用程序自动拍摄数百张不同星座的照片,而不会显示网格、艺术或其他星星。然后我试着发送那些屏幕……

回答 0 投票 0

代码不起作用,我不明白为什么[关闭]

我正在尝试使用 Stellarium 应用程序自动拍摄数百张不同星座的照片,而不会显示网格、艺术或其他星星。然后我试着发送那些屏幕……

回答 0 投票 0

ReferenceError: Kg is not defined

我正在为我的项目使用 Next.JS。突然间我收到了这个错误。 “ReferenceError: Kg is not defined”,调试后我找到了导致这个问题的文件。 文件名...

回答 2 投票 0

Browserify:Can't walk dependency graph: ENOENT: no such file or directory error

Browserify:Can't walk dependency graph: ENOENT: no such file or directory 错误, 在尝试捆绑包含 express 和 mongoose 的 index.js 时遇到这个问题,这样我就可以避免眉头......

回答 0 投票 0

我不明白为什么我会出现这个错误?[已关闭]

为什么我总是在没有定义myfunc()时得到一个错误信息?提交 function myfunc(){ let person = { name: ...</root>

回答 1 投票 0

ReferenceError.没有定义FontFaceObserver。未定义FontFaceObserver

我已经检查了一些其他的ReferenceError问题,但它们似乎没有适用的答案。我正在使用FontFaceObserver来加载网页字体,所以我已经将该文件添加到我的页面中。

回答 1 投票 0

使用mup-aws-beanstalk运行“ mup部署”会导致“无法加载插件mup-aws-beanstalk ReferenceError:未定义regeneratorRuntime”

我正在尝试使用Meteor Up插件mup-aws-beanstalk将项目部署到AWS。说明非常简单。安装插件,从您的AWS账户获取一些信息,使用与...

回答 1 投票 0

如果未在此Node.js上下文中定义require,如何使用?

我运行此命令:$ node检查cypress / support / reset-fixture.js拆解在该文件中,我调用了一个存在调试器的地方;声明。我输入c继续到那个地方。一旦我得到...

回答 1 投票 0

javascript什么时候抛出引用错误?

我有一个非常简单的问题,但是我找不到该问题的完整答案。 JavaScript的null和undefined是尚未初始化的变量的值以及您... ...>

回答 2 投票 0

ReferenceError:测试未用Jest定义

我正在尝试用Jest运行最基本的示例,但是我似乎没有能力。请按照此处的说明进行操作:https://jestjs.io/docs/en/getting-started.html npm init -y(对于基础项目)...

回答 1 投票 1

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