?yb? 2015-09-14 18:19 采纳率: 100%
浏览 19

Ajax自定义模板引擎

I have a project that is simulating an exam system, except that it needs to display custom questions. I have a question regarding implementing this dynamic question section.

Here is what I have so far:

{q::lecture1::2::all}

I am pulling all the questions into JS using AJAX and what I want to do is find everything between {} and render questions. For the example above, it should do the following:

find {q::lecture1::2::all} parse based off of ::, so that you have [q][lecture1][2][all] then on the [2] index pull questions from the AJAX question list, and render

I have the parsing/exploding step done, but I can't figure out how find all of the {} on a page, and then pull in the question list and render just x questions (based off of that third index)

Background: it has to be custom code, no external templating engines are allowed.

Thank you so much for the help.

EDIT: the first step is done as well.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 程序不包含适用于入口点的静态Main方法
    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记