2012-04-05 20 views

答えて

0

javascriptを使用して解析を実装すると、サーバー側のロジックが不要になります。

あなたがMarkItUpをダウンロードするときの例では、だから、あなただけ例えばwriteInPreviewであなたの解析ロジックを追加することができ、プレビュー

$.ajax({ 
    url:options.previewTemplatePath, 
    dataType: 'text', 
    global: false, 
    success: function(data) { 
    writeInPreview(localize(data, 1).replace(/<!-- content -->/g, $$.val())); 
    } 
}); 

function writeInPreview(data) { 
      if (options.previewInElement) { 
       $(options.previewInElement).html(data); 
      } else if (previewWindow && previewWindow.document) {   
       try { 
        sp = previewWindow.document.documentElement.scrollTop 
       } catch(e) { 
        sp = 0; 
       } 
       previewWindow.document.open(); 
       previewWindow.document.write(data); 
       previewWindow.document.close(); 
       previewWindow.document.documentElement.scrollTop = sp; 
      } 
     } 

を生成するためにJavaScriptを使用しています。

関連する問題