Menu
Contact Us

E-junkie Guide

Tips and tools for beginners and experts alike.

  • E-junkie Help
  • Improving page-load performance with E-junkie Cart buttons

We provide Add to Cart and View Cart buttons as blocks of HTML code designed to be as easy as possible to copy and paste into your Web site; however, you can split up the View Cart code to improve your page-load performance. You do not need a View Cart with every single Add to Cart; rather, on each page with any number of Cart buttons, you only need one copy of the script portion of your View Cart code. For best page-load performance, you can put this block at the end of your page's source code, before the </body> tag and as close as possible to it:

<script language="javascript" type="text/javascript">
<!--
function EJEJC_lc(th) { return false; }
// -->
</script>
<script src='https://www.e-junkie.com/ecom/box.js' type='text/javascript'></script>

Then wherever you want to display an actual View Cart button for buyers to click, just paste this linked-button portion of your View Cart code (note that your own code would have your unique E-junkie Client ID in the XXXXXX part):

<a href="https://www.e-junkie.com/ecom/gb.php?c=cart&cl=XXXXXX&ejc=2" target="ej_ejc" class="ec_ejc_thkbx" onClick="javascript:return EJEJC_lc(this);"><img src="https://www.e-junkie.com/ej/ej_view_cart.gif" border="0" alt="View Cart"/></a>

This approach will improve your page load performance because browsers load everything on a page in order, going through its HTML source code from top to bottom. When they reach an image or script in the source, they pause to finish loading that file before proceeding to load anything below it. Your site visitors outside North America in particular may notice a brief pause while their browser loads our script directly from our datacenter in Tucson, Arizona. By putting that script reference at the end of your page, it lets the visible content of the page load first before pausing to load our script, so the latter doesn't hold up initial rendering of the page.

Was this article helpful?
Yes, thanks!
Not really

Can't find what you're looking for?

Contact Us