我正在使用PhoneGap开发者应用程序立即测试我的应用程序,因为今晚应用程序显示"下载",然后几秒钟后会显示"下载错误".在那之后,出现了一个弹出窗口
Unable to download archive from the server. Please upgrade the PhoneGap CLI or check your network settings.
那么,我该如何升级PhoneGap CLI以及我应该检查哪些设置?我没有更改任何网络设置,PhoneGap开发者应用程序在我的Macbook和iPhone上运行良好,但现在它说明了这一点.
有什么问题,如何解决?
编辑 我现在意识到现在正在发生这种情况,因为iOS的PhoneGap开发者应用程序已经更新(现在版本1.5.2).我根据升级PhoneGap的CLI来5.0.0-0.28.0版本,这是推荐的版本这从PhoneGap的博客文章
似乎桌面和移动应用程序现在通信的新方式出现了问题.
我有一个非常简单的 UPDATE 查询,当我在 PHPMyAdmin 中执行它时它可以工作(所以它不是 SQL 语法错误)。但是,当我尝试使用 PHP PDO 执行查询时,没有显示任何错误,并且没有一行受到查询的影响。
我有错误报告设置是这样的:PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION。但没有显示错误。我的 PHP 代码如下所示:
try {
$sql = "UPDATE user
SET username = :username,
activation_token = :activation_token,
activation_date_time = :activation_date_time,
activation_status = :activation_status
WHERE activation_token = :current_activation_token";
$stmt = $dbh->get_instance()->prepare($sql);
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
$stmt->bindParam(':activation_token', $empty_activation_token, PDO::PARAM_STR);
$stmt->bindParam(':activation_date_time', $datetime, PDO::PARAM_STR);
$stmt->bindParam(':activation_status', $active_status, PDO::PARAM_STR);
$stmt->bindParam(':current_activation_token', $activation_token, PDO::PARAM_STR);
$stmt->execute();
echo 'username: ' . $username;
}
catch(PDOException $e) {
echo $e;
}
Run Code Online (Sandbox Code Playgroud)
我还检查了我是否以某种方式使用了保留关键字或类似的东西,但我很确定事实并非如此。为什么这不起作用?
我有一个组件的代码:
反馈.tsx
import React, { useState } from 'react';
import './Feedback.css';
import FeedbackButton from './FeedbackButton';
function Feedback() {
const [isOpen, setIsOpen] = useState<boolean>(false)
return (
<div className="Feedback">
<FeedbackButton onClick={() => setIsOpen(!isOpen)} />
</div>
);
}
export default Feedback;
Run Code Online (Sandbox Code Playgroud)
该FeedbackButton组件如下所示:
反馈按钮.tsx
import React from 'react';
import feedbackicon from './feedback.svg';
import './Feedback.css';
function FeedbackButton() {
return (
<button className="Feedback-button" type="button">
<img src={feedbackicon} className="Feedback-button-icon" alt="feedback" />
</button>
);
}
export default FeedbackButton;
Run Code Online (Sandbox Code Playgroud)
在线<FeedbackButton onClick={() => setIsOpen(!isOpen)} />我收到错误Type '{ …
我正在创建一个允许人们上传照片的移动应用程序,但我在使用Image Manipulator Class调整图像大小时遇到问题,您可以在此处找到https://gist.github.com/philBrown/880506.
我的问题是,当我通过将手机保持在纵向模式拍照时,图像向右旋转90度.当我以横向模式拍照时,一切都很顺利.
这是我的裁剪PHP代码:
$manipulator = new ImageManipulator($_FILES['Filedata']['tmp_name']);
$width = $manipulator->getWidth();
$height = $manipulator->getHeight();
$centreX = round($width / 2);
$centreY = round($height / 2);
// our dimensions will be 600x450
$x1 = $centreX - 300; // 600 / 2
$y1 = $centreY - 225; // 450 / 2
$x2 = $centreX + 300; // 600 / 2
$y2 = $centreY + 225; // 450 / 2
// center cropping to 600x450
$newImage = $manipulator->crop($x1, $y1, $x2, $y2); …Run Code Online (Sandbox Code Playgroud) 我正在使用Chart.js在我的网站上绘制一系列图表,并且我编写了一个帮助方法来轻松绘制不同的图表:
drawChart(ctxElement, ctxType, ctxDataLabels, ctxDataSets, midLabel) {
var ctx = ctxElement;
var data = {
labels: ctxDataLabels,
datasets: ctxDataSets
};
Chart.pluginService.register({
beforeDraw: function(chart) {
var width = chart.chart.width,
height = chart.chart.height,
ctx = chart.chart.ctx;
ctx.restore();
var fontSize = (height / 114).toFixed(2);
ctx.font = fontSize + "em sans-serif";
ctx.textBaseline = "middle";
var text = midLabel,
textX = Math.round((width - ctx.measureText(text).width) / 2),
textY = height / 2;
ctx.fillText(text, textX, textY);
ctx.save();
}
});
var chart = new Chart(ctx, {
type: ctxType, …Run Code Online (Sandbox Code Playgroud) 我已经安装了 Scotch Box 并将 PHP 版本更新为 PHP7。但是,我似乎更新了 PHP CLI,而不是 Apache 使用的 PHP 版本。我在 SO 上看到其他答案说在 Apache httpd.conf 中有一行说loadModule php5或某事。我已经检查过了,在我的 httpd.conf 中它根本没有提到 loadModule。
我确实看到 PHP7 安装在路径/cli/中,而 PHP 5.6 安装在路径中/apache2/或apache其中。
简而言之,如何让 PHP7 在安装在 Scotch Box 上的 Apache 上运行?
我开始使用Webpack,但已遇到以下问题:我创建了一个app/index.js文件(如文档中所述).我还创建了一个index.html文件(从文档中复制了HTML和CSS).我在CLI中运行了正确的命令(包括生成dist/bundle.js文件).
代码:
<!DOCTYPE html>
<html lang="nl">
<head>
<meta charset="UTF-8">
<title>Webpack</title>
<!-- <script src="https://unpkg.com/lodash@4.16.6" type="text/javascript"></script> -->
<script src="dist/bundle.js" type="text/javascript"></script>
</head>
<body>
<!-- Markup here -->
<div id="root"></div>
<!-- <script src="app/index.js" type="text/javascript"></script> -->
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
JS:
// To bundle the lodash dependency with the index.js, we need to import lodash.
import _ from 'lodash';
function component () {
var element = document.createElement( 'div' );
/* lodash is required for the next line to work */
element.innerHTML = _.map( [ 'Hello, webpack' ], …Run Code Online (Sandbox Code Playgroud) 我很难弄清楚这一点。我想创建一个钩子,调用它来使用 fetch 提交表单。
这就是我现在所拥有的。持有表单的组件:
const MyForm = (): ReactElement => {
const [status, data] = useSubmitForm('https://myurl-me/', someData);
return <>
<div className='Feedback-form'>
<div className='body'>
<form>
<input type='text' name='username' placeholder='name' required />
<input type='email' name='email' placeholder='email' required />
<button className='submit-feedback-button' type='button'>Send feedback</button>
</form>
</div>
</div>
</>
}
Run Code Online (Sandbox Code Playgroud)
自定义钩子:
import { useState, useEffect } from 'react';
const useSubmitForm = (url: string, data: URLSearchParams): [string, []] => {
const [status, setStatus] = useState<string>('idle');
const [responseData, setData] = useState<[]>([]);
useEffect(() => {
if (!url) return; …Run Code Online (Sandbox Code Playgroud) 我有这个SQL查询的问题:
SELECT user_id, scrap_id, scrap_text, profile_id, add_date
FROM scraps
WHERE profile_id=52 AND user_id=68 OR user_id
IN(
SELECT user_id
FROM profilecontact
WHERE owner_id=68 AND profile_id=52
);
Run Code Online (Sandbox Code Playgroud)
这个查询的问题是这个OR运算符进入的部分.我需要SQL以下面的方式思考:
profile_id=52 <- This one should always be followed
user_id=68 OR user_id IN... <- The result may have user_id 68 OR a user_id that the sub query finds.
Run Code Online (Sandbox Code Playgroud)
SQL现在做的是它完全忽略了这一部分:
profile_id=52 AND user_id=68
Run Code Online (Sandbox Code Playgroud)
如何以我需要的方式使用OR和AND运算符?
我有这个HTML:
<li class="chatbox-item">
<div class="item">
<div class="item-header">
<a href="#" class="close-chatbox">X</a>
</div>
</div>
</li>
Run Code Online (Sandbox Code Playgroud)
当a.close-chatbox被点击时,该.item元素必须被隐藏.但是,我似乎无法上升两个级别来隐藏.item元素.
我有这个JS:
$(".close-chatbox").click(function() {
// not working
$(this).parent().parent().hide();
// not working, hides `.chatbox-item` element, and eq(1) doesn't do anything either
//$(this).parents().eq(2).hide();
});
Run Code Online (Sandbox Code Playgroud)
如何.item在.close-chatbox单击元素时隐藏元素?