-
AuthorPosts
-
March 22, 2017 at 4:43 pm #764866
Hi there,
I am trying to embed a t-shirt designer via javascript into my website. It works fine but always shows up at the bottom of the page, currently the code block should be the first item to see, followed by some text and the fotter, any ideas how to solve it?
page: http://www.kleidung-gestalten.de/frauen-kleidung-gestalten/
code: in private content or via source code
Thanks!March 25, 2017 at 4:26 pm #766652Hey excel-indianer,
Can you give us the full code that you’re using or give us temporary admin access to your website in the private content box below, so that we can have a closer look.
Best regards,
VictoriaMarch 25, 2017 at 8:59 pm #766728Hi Victoria,
Thanks. Full code and admin login in the private content.
BR
MichaelMarch 28, 2017 at 7:46 am #767924Hi,
You need to add baseId parameter and then create a div container with an id attribute based on the value of the parameter. I implemented it in a test page but it’s not working properly so I think there’s a missing parameter. Could you please provide the login details to the spreadshirt site so that we can access the documentation?
// https://help.spreadshirt.com/hc/en-us/articles/207487815-Website-integration-with-JavaScript
Best regards,
IsmaelMarch 28, 2017 at 9:26 am #767995Hi Ismael,
further information and documentation can be found here: http://spreadshirt.github.io/apps/tablomat (this is where I got the code). I could as well provide you access to my account but I do not think there is something to change here, if you still think it is necessary, please let me know. Thanks.
Best regards,
MichaelMarch 30, 2017 at 12:16 am #769192Hey!
Thank you for the info. Please add the “target” parameter.
target: document.getElementById("someDiv"),
“someDiv” is going to be the container.
<div id="someDiv"></div>
Regards,
IsmaelMarch 30, 2017 at 1:45 pm #769458Dear Ismael,
Thanks for the reply, I still do not get it (sorry!). Try to use following code in the code block, but nothing shows up, example on http://www.kleidung-gestalten.de/frauen-kleidung-gestalten/
<div id=”someDiv”></div>
<script type=”text/javascript” src=”//spreadshirt.github.io/apps/spreadshirt.min.js”></script>
<script type=”text/javascript”>
spreadshirt.create(“tablomat”, {
shopId: 1073659, // your shop id
platform: “EU” // or NA
target: document.getElementById(“someDiv”),
}, function(err, app) {if (err) {
// something went wrong
console.log(err);
} else {
// cool I can control the application (see below)
app.setProductTypeId(6);
}
});
</script>March 31, 2017 at 6:24 am #769726Hi!
There’s a missing “comma” after the “platform” parameter. You can find a working example in the following test page.
// http://www.kleidung-gestalten.de/t-shirt-script/
Regards,
IsmaelApril 2, 2017 at 1:37 pm #770620Sometimes the small things in life make the difference ;-) Great! Thanks a lot.
April 2, 2017 at 4:21 pm #770652 -
AuthorPosts
- The topic ‘Javascript Code Block always at the bottom’ is closed to new replies.