javascript - How to replace HTML tag with js script during DOM creation -
i'm trying solve issue. have cms , i'm using ckeditor create html wysiwyg editor.
i want insert in html components (javascript): ckeditor of course cannot manage these components create plugin create placeholder.
the result html this:
<p>sample text</p> <p><widget data_id="2" data_type="gallery"></widget></p> <p>sample text</p>
now need replace during page load <widget>
tag widget. have api call can return gallery images or html snippet.
i don't want use iframe, think use vuejs render components never use it. other idea? ajax?
you can use
$(document).onload(function(){ //type code here });
Comments
Post a Comment