各位大家好,我正在尝试发布我的Facebook应用程序用户的活动,我一步一步地按照教程,但它无法正常工作...
警报消息显示错误"发生错误必须使用活动访问令牌来查询有关当前用户的信息"为什么?我是正确的.
代码是这样的:
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head prefix="og: http://ogp.me/ns# appnamespace:
http://ogp.me/ns/apps/appnamespace#">
<title>OG Tutorial App</title>
<meta property="fb:app_id" content="appID" />
<meta property="og:type" content="appnamespace:recipe" />
<meta property="og:title" content="Stuffed Cookies" />
<meta property="og:image" content="http://www.domain.com/logo.gif" />
<meta property="og:description" content="The Turducken of Cookies" />
<meta property="og:url" content="http://www.domain.com/activity.php">
<script type="text/javascript">
function postCook()
{
FB.api(
'/me/namespace:cook',
'post',
{ recipe: 'http://www.domain.com/activity.php' },
function(response) {
if (!response || response.error) {
alert('Error occured '+ response.error.message); // it shows "Error occured An active access token must be used to query …Run Code Online (Sandbox Code Playgroud) 我有下一个代码
var audioElement0 = document.createElement('audio');
audioElement0.setAttribute('src', 'notify.wav');
audioElement0.setAttribute('autoplay', 'autoplay');
audioElement0.Play();
var audioElement1 = document.createElement('audio');
audioElement1.setAttribute('src', 'notify.wav');
audioElement1.setAttribute('autoplay', 'autoplay');
audioElement1.Play();
var audioElement2 = document.createElement('audio');
audioElement2.setAttribute('src', 'notify.wav');
audioElement2.setAttribute('autoplay', 'autoplay');
audioElement2.Play();
Run Code Online (Sandbox Code Playgroud)
但它只播放一次......我该如何解决?
好!!!抱歉我的英语倒了.这是我与amcharts的问题.我在新的proyect中做了一些图形.该项目建立在MVC和PHP5之上.我们这样做是为了获得结果:
// var chartData = AmCharts.loadJSON(baseurl +'libs/jsonvalueconsumption.php?id = ...);
在amcharts的例子中给出了Amcharts.loadjson函数.
但现在我们正在通过AJAX做.问题????我们得到了相同的结果,代码的所有步骤都相同,但是控制台引发了一个问题:
无法读取undefined amstock.js.pagespeed.ce.sQT2FSFmcG.js的属性'construct':49
这是我们的js必须在div上绘制图形:
//AmCharts.ready(function() {
var firstData = $.ajax({
type: 'POST',
url: baseurl+'action/charts/SOME_FUNCTION',
data: { id : id },
dataType: 'JSON',
async: false,
success: function(getdata) {
return getdata;
}
}).responseText;
chart = new AmCharts.AmStockChart();
chart.pathToImages = "http://www.amcharts.com/lib/images/";
chart.dataDateFormat = "YYYY-MM-DD h:i:s";
var obj = JSON.parse(firstData);
for(i=0;i<obj.length;i++) {
var id_something = obj[i]['id'];
var secondData = $.ajax({
type: 'POST',
url: baseurl+'action/charts/ANOTHER_SOME_FUNCTION',
data: { id_something : id_something, value1 : value1, value2 : …Run Code Online (Sandbox Code Playgroud) 我正在使用 amcharts“带有细分切片的饼图”(https://www.amcharts.com/demos/pie-chart-broken-slices/)
当我添加两个图表时,我没有渲染问题。当我单击第一个图表时出现问题。这个图表被第二个图表取代,现在我有两个图表,其中包含第二个图表的信息。
第一个图表的源代码:
<div id="chartdevicesdiv" style="width: 100%; height: 500px"></div>
<script>
var chart;
var legend;
var selected;
var types = [{
type: "Smartphone",
percent: 45,
total: 150,
color: "#71c66b",
subs: [{
type: "iOS",
percent: 15
}, {
type: "Android",
percent: 35
}, {
type: "Other",
percent: 20
}]
}, {
type: "Tablet",
percent: 15,
total: 30,
color: "#f2a013",
subs: [{
type: "iOS",
percent: 15
}, {
type: "Android",
percent: 10
}, {
type: "Other",
percent: 5
}]
}, …Run Code Online (Sandbox Code Playgroud)