如何在div rel中插入HTML? [英] How to insert HTML inside a div rel?

查看:96
本文介绍了如何在div rel中插入HTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<div rel="wikiEditor-ui-view-preview" class="current">

当用户单击预览"时,该类将更改为当前".如何在其中插入其他HTML,而不是显示文本预览?

The class changes to 'current' when the user clicks on Preview. How can I insert some other HTML inside it, instead of displaying the preview of the text?

仅当用户在线并且我制作了一个解析器(一个JS文件)时,该预览功能才起作用.当用户离线时,该解析器可以成功地将WikiText解析为HTML.我想链接解析器的输出,即HTML,并将其链接到该div.

This preview thing only works if an user is online and I have made a parser (a JS file) which successfully parses WikiText to HTML when an user is offline. I want to link the output of the parser which is HTML and link it to this div.

推荐答案

如果我的想法正确,您将替换Wikieditor预览"选项卡的内容.这些内容是通过API调用生成的,一旦您单击预览",Wikieditor就会向服务器API发出AJAX请求( parse method )并显示结果.如果您想覆盖此行为,则应创建扩展程序,并使用 MediaWiki钩子之一获取API请求.

If i get your idea right, you're going to replace contents of Wikieditor "Preview" tab. These contents are generated from API call, once you clicked "Preview" Wikieditor makes AJAX request to server API ( parse method ) and display results. If you would like to override this behavior you should create extension and use one of Mediawiki hooks for API requests.

这篇关于如何在div rel中插入HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆