Включите внешние файлы Javascript и CSS в DOM другого сайта
Я пытаюсь загрузить редактор Markdown, подобный тому, который StackExchange использует на своем сайте, на сайт Forrst.com с помощью Bookmarklet или расширения браузера.
В основном это выглядит как мне нужно ...
Load the CSS file into the Page
https://raw.github.com/ujifgc/pagedown/master/demo/browser/demo.css
Load these 3 Javascript files into the page
https://raw.github.com/ujifgc/pagedown/master/Markdown.Converter.js
https://raw.github.com/ujifgc/pagedown/master/Markdown.Editor.js
https://raw.github.com/ujifgc/pagedown/master/Markdown.Sanitizer.js
Load this Javascript into the page to make it all run...
<code>//Load and run this code in the page... // Find and replace the curent textarea with the HTML we // need for our markdown editor to work var htmlToReplace = ' \ <div class="wmd-panel"> \ <div id="wmd-button-bar"></div> \ <textarea class="wmd-input" id="wmd-input" name="description"></textarea> \ </div> \ <div id="wmd-preview" class="wmd-panel wmd-preview"></div>'; $("#description").replaceWith(htmlToReplace) //Run the markdown editor scripts (function () { var converter1 = Markdown.getSanitizingConverter(); var editor1 = new Markdown.Editor(converter1); editor1.run(); })(); </code>
Если бы кто-нибудь мог указать мне правильное направление, как сделать что-то подобное, я верю, что возможно, я был бы очень признателен за помощь.