javascript - How can I run two of the same syndication scripts on the same page? -


i have script obtained our sharp dealership display machines on our website. when add twice different model (data-name) runs first , drops off image after flashes on page. did try changing div id of second did not work.

sample 1:

<script src='http://siica.sharpusa.com/desktopmodules/x3.sharp.productcatalog/js/getproduct.js' type='text/javascript' data-type='mfps' data-name='mx-3050n'></script> <div id='sharp-widget'></div> 

sample 2:

<script src='http://siica.sharpusa.com/desktopmodules/x3.sharp.productcatalog/js/getproduct.js' type='text/javascript' data-type='mfps' data-name='mx-3070n'></script> <div id='sharp-widget'></div> 

based on source code used above, can't, @ least not without kind of workaround.

the javascript used expect explicitly item id "sharp-widget", html doesn't validate repeated ids, jquery wont render it.

my suggestion contact provider of script let pass id parameter or, if it's not possible, workaround adding iframe second one, like:

<script src='http://siica.sharpusa.com/desktopmodules/x3.sharp.productcatalog/js/getproduct.js' type='text/javascript' data-type='mfps' data-name='mx-3050n'></script> <div id='sharp-widget'></div>  <iframe src="./inc.html" style="width: 100%; border: none">  </iframe> 

and inc.html

<script src='http://siica.sharpusa.com/desktopmodules/x3.sharp.productcatalog/js/getproduct.js' type='text/javascript' data-type='mfps' data-name='mx-3050n'></script> <div id='sharp-widget'></div> 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -