javascript - Javascript 中的高级自定义字段 (Wordpress)
问题描述
我正在尝试在我的 Javascript 中显示转发器字段。我有一个图表,正在尝试与转发器字段混合:
这是我的代码:
jQuery(document).ready(function () {
jQuery("#mapsvg").mapSvg({
markerLastID: 20,
width: 600.4892,
height: 599.41095,
colors: {
baseDefault: "#ffffff",
selected: 40,
hover: 20,
directory: "#ffffff",
status: {},
base: "#f2642f",
stroke: "#1010108a",
background: "#fff"
},
regions: {
<?php if ( have_rows( 'towns' ) ) : ?>
<?php while ( have_rows( 'towns' ) ) : the_row(); ?>
"<?php the_sub_field( 'title_id' ); ?>": {
id: "<?php the_sub_field( 'title_id' ); ?>",
id_no_spaces: "<?php the_sub_field( 'title_id' ); ?",
title: " <?php the_sub_field( 'title' ); ?>",
disabled: true,
data: {},
},
<?php endwhile; ?>
<?php else : ?>
<?php
<?php endif; ?>
});
});
有人可以帮我解决这个问题吗?
解决方案
推荐阅读
- html - 如何在css网格中居中div
- pdf - PDF - 字符在 PDF 上显示为空白
- python - AttributeError:类型对象'Categories'在Django中没有属性'user_id__isnull'
- java - quarkus jaxrs 非阻塞误解
- r - 在 R 中按日期识别和计算重复 ID
- r - 在 R 中使用“lapply”从初始数据帧中创建 data.frames
- c++ - 引用返回的变量范围
- javascript - 使用 Google Scripts 应用程序删除两个重复的行
- java - dfs的空间复杂度
- python - 无法通过 crontab 执行 python 2.7 脚本,但可以手动执行。是什么赋予了?