Posted - 08/22/2019 : 11:55:47
Ok, I originally got this from here - https://johannburkard.de/blog/programming/javascript/inc-a-super-tiny-client-side-include-javascript-jquery-plugin.html I had posted the tip in this thread - https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=108081 You do need jquery for it to work. https://www.w3schools.com/jquery/jquery_get_started.asp Then add this (1 single line of code) to the head of your page <script type="text/javascript">(function(a){a.fn.inc=function(b,c,d,e){return this.length&&b?this.each(function(){e=a(this);a.ajax({url:b,success:function(f,g,h){e.html(a.isFunction(c)?c(f,b):f);a.isFunction(d)&&d(b,g,h)}})}):this};a(function(){a('[class*="inc:"]').each(function(){var b=/inc:(\S+)/.exec(this.className||"");b&&a(this).inc(unescape(b[1]))})})})(jQuery);</script> Then in your product description, add your include line like this <p class="inc:some-page.html"></p> with some-page.html being the page you want to include.
Edited by - dbdave on 08/22/2019 11:56:29
|