Bug reports Found a bug? Post it here please.
Version 7.x > Bug reports > Javascript insertion issues View modes: 
User avatar
Certified Developer v6
Certified Developer v6
kmurphy-wakefly - 11/13/2012 1:31:36 PM
   
Javascript insertion issues
The order of parameters within a script block actually makes a difference in what is rendered on the page.

Example 1:
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js" ></script>
Renders as:
<script type="text/javascript"></script>

Example 2:
<script src="http://w.sharethis.com/button/buttons.js" type="text/javascript" ></script>
Renders as:
<script src="http://w.sharethis.com/button/buttons.js" type="text/javascript" ></script>

Both orders should not delete the source. This is causing many issues with upgrading to 7.

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 11/14/2012 2:43:17 AM
   
RE:Javascript insertion issues
Hi,

Could you please tell me in which way are you adding the JavaScript to the page?

I've tried to add it via CMSDesk -> Content -> Root page -> Master page tab and in both cases it's resolved correctly. I've tested this in v7 with no hotfix installed as well with the latest hotfix installed... working without a problem.

Best regards,
Martin Danko

User avatar
Certified Developer v6
Certified Developer v6
kmurphy-wakefly - 11/14/2012 8:48:42 AM
   
RE:Javascript insertion issues
Sure thing and thank you for your quick reply Martin. Here is how I added it, just like how you said.

http://screencast.com/t/bSsj3hYZX8EI

And here is the result.
http://screencast.com/t/HDVKorWbqPz

I created these screenshots for you on my company page, however I have seen this on my other Version 7 installations as well.

Maybe another bug? My version in Kentico says v7.0.6, but when I hover over it it says another number. Here's a video cast of that.

http://screencast.com/t/MqVR5HqRA4L


User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 11/14/2012 12:41:27 PM
   
RE:Javascript insertion issues
Hi,

I'm really sorry but I wasn't able to reproduce this issue at all... I've tried it in a different ways and combinations, also with comments but it's working correctly.

Could you please provide me with the link to your site?
Have you also tried to install a fresh instance of Kentico v7?

I would recommend you to take a look at the Event log and try to debug your site. Maybe also check your site with the FireBug.

Best regards,
Martin Danko

User avatar
Certified Developer 11
Certified Developer 11
jacksonj-bit-wizards - 11/17/2012 7:15:52 PM
   
RE:Javascript insertion issues
Hello,

We are experiencing the exact same issue as the original poster. Some of the script blocks are being rendered empty like: <script type="text/javascript"></script>

I don't know if this makes a difference in your test but this is a Azure project that was upgraded from version 6.

-JJ

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 11/22/2012 7:06:08 AM
   
RE:Javascript insertion issues
Hi JJ,

I've tried this also on v7 Azure project and everything is working fine. Maybe this could be caused by some upgrade changes. But unfortunately I still haven't been able to reproduce this behaviour.

Murphy... was your site also upgraded from previous version?

Best regards,
Martin Danko

User avatar
Member
Member
Accepted solutionAccepted solution
Tim King - 12/12/2012 12:58:08 AM
   
RE:Javascript insertion issues
I had the same issue. I fixed it by setting:

Site Manager -> Settings -> System -> Output Filter -> Excluded XHTML JavaScript filter URLs -> /

The problem is that now randomly css and js requests are returned with no content.

I have the same situation, this site is being upgrade from Kentico 6 (well actually from 5.5 originally).

Tim

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 12/20/2012 8:23:47 AM
   
RE:Javascript insertion issues
Hi,

could you please try to disable CSS and JS Minification: Developers Guide - Code minification and compression.

Best regards,
Martin Danko

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 12/14/2012 8:03:56 AM
   
RE:Javascript insertion issues
The different version numbers isn't a big deal. I believe the displayed value is the version and hotfix and the hover value is the actual build number.

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 12/20/2012 8:24:15 AM
   
RE:Javascript insertion issues
Yes, you are right :)

User avatar
Member
Member
rob.nisbet-sanlam - 1/16/2013 9:14:33 AM
   
RE:Javascript insertion issues
I'm also having this issue with a site originally upgraded from 3.

Since upgrade to v7 if type= is before src= I get a blank script element, however this is only when the <script> is inside a webpart.

For me, this is breaking my Google RECAPTCHA control. Please help !

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 1/23/2013 8:00:22 AM
   
RE:Javascript insertion issues
Hi,

The workaround for now should be just to switch the "type" and "src" properties. We still weren't able to reproduce this issue, so it could be some server configuration or maybe specific Kentico settings issue how it is handling the pages.

UPDATE: Could you please tell me if you have some specific settings set for the output filter?

Best regards,
Martin Danko

User avatar
Member
Member
dantahoua-gmail - 1/31/2013 2:18:02 PM
   
RE:Javascript insertion issues
I have the same issue... And no output filter... Nothing in the output filter... Import from a 5.5 export.
When I reverse like the other, the script want to load (no more blank script tag) but I have a 404 error... So the scripot do not load!

My script are in CMSScripts/jquery/xxxx.jx

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 2/27/2013 4:17:51 AM
   
RE:Javascript insertion issues
Hi guys,

So finally I was able to find out what's going on with a back-up from one of our customers (Thanks to Gitesh).

The reason is Output filter, so please go to CMS Site Manager -> Settings -> System -> Output filters and set Excluded XHTML filter URLs to "/" (this should be also set in the example sites by default).

However, our developers will fix this in the future version and probably also in one of the next hotfixes.

Best regards,
Martin Danko

User avatar
Certified Developer v6
Certified Developer v6
kmurphy-wakefly - 2/27/2013 2:26:57 PM
   
RE:Javascript insertion issues
So is that a tree-planting-able bug? :)

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 2/27/2013 2:46:02 PM
   
RE:Javascript insertion issues
Hi,

If the bug will be confirmed, then yes. However we (support) are not in charge of deciding this. There is a workaround available - so it may or may not be eligible for a tree.

Best regards,
Juraj Ondrus