开发者

Can I use a JS file to render previews when using MarkItUp?

开发者 https://www.devze.com 2023-02-05 07:04 出处:网络
Is there a way I can use a JS file instead of 开发者_开发知识库a server side file eg. PHP to render my previews when using MarkItUp?what you could do is add a custom button to the tool bar if you want

Is there a way I can use a JS file instead of 开发者_开发知识库a server side file eg. PHP to render my previews when using MarkItUp?


what you could do is add a custom button to the tool bar if you want to be fancy, but for a simple way just add a link below let us say Preview then grap the code and past it to a div holder. Something like,

$('#preview').live('click',function(){
    $('#myDivHolder').html($('.markItUpEditor').val());
});

That is pretty much it. You can get way more fancy, do it on the keydown, put it in the setup file so it's on the toolbar.. tons of ways to skin that cat.. but that little bit of code should get you started. HTH Cheers -Jeremy

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号