一旦调用并加载到页面,我试图从Highcharts图表中获取系列数据.
到目前为止,我只是成功地获得了一堆不是我明显的字符串.不知道有人可以帮我这个.
jQuery代码:
success: function (chartData) {
if(chart != undefined) {
$('#meterloader').hide();
$.each(chart.series[0], function(value) {
alert(value);
});
} else {
$('#meterloader').hide();
$('#meterbox').html("<div><p class='textcentre bold red'>There was an error loading the chart.</p></div>");
}
}
Run Code Online (Sandbox Code Playgroud)
提前致谢.
我知道这个问题已经被回答了几百次,但是我已经遇到了大量潜在的解决方案,但它们似乎都没有在我的实例中起作用.
以下是我提交表格的表格和代码.它会触发PHP脚本.现在我知道脚本本身不是提交的原因,因为我手动尝试了表单,它只提交一次.
jQuery代码的第一部分涉及打开一个灯箱并从下面的表中提取值,我已将其包含在内,无论出于何种原因它都是潜在的问题.
jQuery代码:
$(document).ready(function(){
$('.form_error').hide();
$('a.launch-1').click(function() {
var launcher = $(this).attr('id'),
launcher = launcher.split('_');
launcher, launcher[1], $('td .'+launcher[1]);
$('.'+launcher[1]).each(function(){
var field = $(this).attr('data-name'),
fieldValue = $(this).html();
if(field === 'InvoiceID'){
$("#previouspaymentsload").load("functions/invoicing_payments_received.php?invoice="+fieldValue, null, function() {
$("#previouspaymentsloader").hide();
});
} else if(field === 'InvoiceNumber'){
$("#addinvoicenum").html(fieldValue);
}
$('#'+field).val(fieldValue);
});
});
$("#addpayment_submit").click(function(event) {
$('.form_error').hide();
var amount = $("input#amount").val();
if (amount == "") {
$("#amount_error").show();
$("input#amount").focus();
return false;
}
date = $("input#date").val();
if (date == "") {
$("#date_error").show();
$("input#date").focus();
return false;
}
credit = $("input#credit").val();
invoiceID …Run Code Online (Sandbox Code Playgroud) 我有一个可以出现在不同页面上的表单,根据具体情况,并不总是需要这些字段.
我有隐藏div的代码,但不再需要输入字段.使用HTML5必需属性.无法使代码工作.代码如下:
$('#detailssame').click(function() {
if($(this).is(':checked')) {
$(\"#detailssamehide\").hide();
} else {
$(\"#detailssamehide\").show();
}
});
$('.fullboxform input[type=text], .fullboxform select').each(function() {
$(this).removeAttr('required');
});
Run Code Online (Sandbox Code Playgroud)
非常感谢所有帮助.
原来上面的代码确实可以正常工作,但使用prop可以选择其他答案
我尝试将Laravel Flysystem与 PHP League (league/flysystem-sftp) 的 sftp 适配器一起使用。使用 Laravel 5.4 和 Flysystem 3.7 版本。
当我尝试将文件放在服务器上时,我收到消息:
无法连接到 someadress.com:22。错误 13. 权限被拒绝
这是代码:
$box = new Filesystem(new SftpAdapter(Config::get('flysystem.connections.sftp')));
$box->put('test.txt', 'bar');
Run Code Online (Sandbox Code Playgroud)
以及配置中的连接详细信息:
'sftp' => [
'driver' => 'sftp',
'host' => 'someadress.com',
'port' => 22,
'username' => 'someuser',
'password' => 'ArndomPa55',
'privateKey' => '/home/user/.ssh/id_rsa',
'root' => '/var/www/html/site/box/',
'timeout' => 20,
],
Run Code Online (Sandbox Code Playgroud)
当我从运行该程序的服务器建立 SSH 连接时,它连接正常,没有密码提示,因此它使用私钥。所以不确定为什么这不起作用。
我检查了接收服务器上的安全日志,里面什么也没有。
我有一个PHP输出图表作为Javascript,它都显示正常,但是,x轴上的日期时间函数不是在正确的日期开始.
我已经设置了这样的图形:
xAxis: {
title:{
text: 'Day',
style: {
color: '#666666',
fontSize: '12px',
fontWeight: 'normal'
}
},
type: 'datetime',
dateTimeLabelFormats: {
day: '%e.%b'
},
showFirstLabel: false
},
Run Code Online (Sandbox Code Playgroud)
然后在系列数据级别:
series: [{
name: 'Office',
zIndex: '1',
data: [0, 0, 0, 0, 0, 0, 1.8, 17.67, 17.66, 74.8, 62.45, 71.21, 67.75, 22.28, 16.61, 16.26, 71.79, 72.85, 56.52, 48.68, 47.01, 0, 0, 33.8, 62.72, 40.28, 9.99, 26.06, 8.85, 9.46, ],
pointStart: Date.UTC(2012, 7, 14),
pointInterval: 24 * 3600 * 1000 //one day
}]
Run Code Online (Sandbox Code Playgroud)
所以这显然是设置为每日,并从2012年7月14日开始.但是,当图表显示时,它从今天的日期开始. …
我有PHP输出JSON多维数组,如下所示:
{"rates":[{"meter":"30","rate":"0.15060","ppd":"10.000"}]}
Run Code Online (Sandbox Code Playgroud)
但是,在尝试在JavaSCript端解码时,我一直遇到错误.
Uncaught TypeError: Cannot read property 'length' of null
Run Code Online (Sandbox Code Playgroud)
以下是jQuery方面的代码:
success: function (result) {
console.log(result);
$.each($.parseJSON(result), function (item, value) {
if (item == "rates") {
$.each($.parseJSON(value), function (i, object) {
console.log(i + "=" + object);
});
}
Run Code Online (Sandbox Code Playgroud)
第一个控制台日志给了我在顶部提到的输出,但由于某种原因我无法访问数组,因为我认为我会.
任何帮助是极大的赞赏 :)
我有一个 Flot 图表,我正在尝试制作它,以便当您单击特定的图例项目时,它会使该数据从图表中消失。
我在使其发挥作用方面取得的成功有限。我已经能够单击图例项并且删除系列线,但不能删除点,而且它似乎也是错误的线数据。
对此的任何帮助将非常感激:)
var Graphs = function () {
return {
//main function
initCharts: function () {
if (!jQuery.plot) {
return;
}
function showChartTooltip(x, y, xValue, yValue) {
$('<div id="tooltip" class="chart-tooltip">' + yValue + '<\/div>').css({
position: 'absolute',
display: 'none',
top: y - 40,
left: x - 40,
border: '0px solid #ccc',
padding: '2px 6px',
'background-color': '#fff'
}).appendTo("body").fadeIn(200);
}
if ($('#site_revenue').size() != 0) {
//site revenue
var previousPoint2 = null;
var plot_statistics = null;
var data = [];
togglePlot …Run Code Online (Sandbox Code Playgroud) jquery ×5
javascript ×4
highcharts ×2
php ×2
arrays ×1
attributes ×1
datetime ×1
flot ×1
flysystem ×1
form-submit ×1
forms ×1
graph ×1
html5 ×1
input ×1
json ×1
laravel-5 ×1
ssh ×1