我的javascript中有这段代码
$('#process-title').html(projectData.process-title);
$('#process-description').html(projectData.process-description);
$('#process-wireframes').empty('');
$.each(projectData.process-wireframes, function(item) {
$('#process-images').append('<div class="project-gallery"><img src='+projectData.process-wireframes[item]+' /></div>')
});
由于某种原因无效,目前正在破坏我的网站http://darrenbachan.com/。我不知道如何解决这个问题,我没有javascript知识,而且我读过的帖子使得它更难以理解。我如何定义这些,呃,它们的功能是什么?
编辑:我忘了提到你需要点击一个项目才能看到错误。
答案 0 :(得分:3)
您不能使用这样的带连字符的属性。浏览器将其解释为这样的减法:
library(ggplot2)
library(reshape2)
# create sample data based on one of your last posts:
set.seed(1)
otumat = matrix(sample(1:100, 100, replace = TRUE), nrow = 10, ncol = 10)
rownames(otumat) <- paste0("OTU", 1:nrow(otumat))
colnames(otumat) <- paste0("Sample", 1:ncol(otumat))
df <- melt(otumat)
df <- rbind(df, df[which(df$Var1=="OTU10"), ])
# Build two plots - original one + aggregated one:
lst <- list(aes(x=Var2, y=value, fill=Var1),
geom_bar(stat="identity", color="black"),
labs(x=NULL, y=NULL))
p1 <- ggplot(df) + lst
p2 <- ggplot(aggregate(value~Var1+Var2, df, sum)) + lst
gridExtra::grid.arrange(p1, p2)
You need to access them using strings.
{{1}}