0

我正在使用 SlickQuiz 运行测验,我正在修改 .js 文件,而不是通过文本显示问题,我想调用图像。这里是代码:

{
    "q": "This is the question area where I'd prefer to call an image?",
    "a": [
        {"option": "Answer 1",    "correct": false},
        {"option": "Answer 2",     "correct": true},
        {"option": "Answer 3",      "correct": false}// no comma here
    ],
    "correct": "<p><span>Well done!</span> The correct answer is Answer 2.</p>",
    "incorrect": "<p><span>Incorrect</span> The correct answer is Answer 2.</p>" // no comma here
}

所以“q”行是我要调用图像的地方。有人有什么想法吗?谢谢

4

2 回答 2

0

谢谢大家,最后为我指明了正确的方向。

只需要转义 img 标签中的引号;

"q": "<img src=\"../images/q1.png\" />",
于 2012-11-09T09:38:32.027 回答
0

是的,先生,这是一个非常简单的解决方法。只需尝试在下面添加此代码。它也对我有用。

<img src=\"your.image.whatever\"/>

于 2014-01-07T00:54:16.983 回答