Jump to content

How to put a script on the site? The system just strip it


Lefius

Recommended Posts

Hello, I'm trying to setup a prestashop but I need to add a script code to my site to load a chat module that's outside the site. But no matter where I put this code, the system always strip the code and just delete, I'd even tried to add the code to all the files on the prestashop and nothing works, it just dissapears.

 

When I gzip the pages, the code appears, but... The minic slider just dissapear and a lot of things get broken.. :/

 

Someone can help me please?

Link to comment
Share on other sites

I have tried to add this code

<script type="text/javascript"> setTimeout(function(){var a=document.createElement("script"); var b=document.getElementsByTagName("script")[0]; a.src=document.location.protocol+"//dnn506yrbagrg.cloudfront.net/pages/scripts/0014/2342.js?"+Math.floor(new Date().getTime()/3600000); a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,}, 1); </script>

I've tried in header.tpl, index.php, and a lot of other .tpl and .php. Nothing works. IT just dissapear when I upoad the file to the server.

Link to comment
Share on other sites

Do you have the right permissions? Are you allowed to edit files?

 

Maybe try to rename a file first and then upload the new one, and see if you are allowed to do that?

 

If that doesn't work: Can you edit the files directly on your server, using cPanel->File manager or so? Maybe that works...

 

My 2 cents,

pascal.

Link to comment
Share on other sites

Do you have the right permissions? Are you allowed to edit files?

 

Maybe try to rename a file first and then upload the new one, and see if you are allowed to do that?

 

If that doesn't work: Can you edit the files directly on your server, using cPanel->File manager or so? Maybe that works...

 

My 2 cents,

pascal.

 

I do have right permissions, I mean the file overwrites the other one and uploads correctly. It just dissapear when it uploaded to the server.

 

Please help!

Link to comment
Share on other sites

I have the same problem, I just updated a shop to v1.6, and if I type a script tag i tpl files, it gets removed when showing to page.

 

Specifically I had the Terms as a popup, created with a script adding fancybox() to the A tag.

 

-- EDIT --

 

On further investigation in v1.6 it appairs to be because all <script> tags er moved to the bottom of the html code before sending it to the user......

Edited by westsoftdevelopment (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...