How to insert HTML inside a div rel?

╄→гoц情女王★ 提交于 2019-12-23 01:13:12

问题


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

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?

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.


回答1:


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.



来源:https://stackoverflow.com/questions/38975188/how-to-insert-html-inside-a-div-rel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!