Javascript added at runtime just after the opening <head> tag conflicting with later scripts from our theme site.master

Jun 27, 2012 at 12:46 PM
The following scripts conflict with several scripts which we have added to the head in our theme site.master. It only actually causes problems in Internet Explorer 7, but we need to get it sorted. I'd appreciate any assistance with this.

<script type="text/javascript" src="/news/js.axd?path=%2fnews%2fScripts%2fjquery.js">
</script><script type="text/javascript" src="/news/js.axd?path=%2fnews%2fScripts%2fjquery.cookie.js"></script><script type="text/javascript" src="/news/js.axd?path=%2fnews%2fScripts%2fjquery.validate.min.js"></script><script type="text/javascript" src="/news/js.axd?path=%2fnews%2fScripts%2fjquery-jtemplates.js"></script><script type="text/javascript" src="/news/js.axd?path=%2fnews%2fScripts%2fjson2.js">

Jun 27, 2012 at 2:14 PM

Here is what is actually in conflict with it -

 

        <link rel="stylesheet" href="style.css" type="text/css" />
        <link rel="stylesheet" href="http://www.************.co.uk/resources/css/menu.css" type="text/css" media="screen" title="no title" charset="utf-8">
        <link rel="shortcut icon" href="http://www.************.co.uk/resources/images/favicon.ico" type="image/x-icon" />

        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>   
        <script type="text/javascript" src="http://www.************.co.uk/resources/js/menu.js" charset="utf-8"></script>
        <script type="text/javascript" src="http://www.************co.uk/resources/js/jquery.hoverIntent.minified.js" charset="utf-8"></script>
        <script src="http://www.************.co.uk/resources/js/jquery.cycle.all.latest.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript">
        $(document).ready(function() {
            $('.slideshow').cycle({
                fx: 'fade', speed: 500 // choose your transition type, ex: fade, scrollUp, shuffle, etc...
            });
        });
        </script>

Incidentally, deleting the contents of the /scripts directory stops the errors (and the script tags disappears) and the top navigation and slide show works, but then the admin section doesn't work properly (you can log in, but the list of posts shows up as empty).

Coordinator
Jun 27, 2012 at 3:00 PM

You can try remove conflicting scripts from the theme rather than /scripts.

Jun 27, 2012 at 4:47 PM

2.6 is adding jQuery to bottom of head... after your site.master scripts.

Add the files back to the script folder and add this to the custom code field as a temp fix:

        <script type="text/javascript" src="http://www.************.co.uk/resources/js/menu.js" charset="utf-8"></script>
        <script type="text/javascript" src="http://www.************co.uk/resources/js/jquery.hoverIntent.minified.js" charset="utf-8"></script>
        <script src="http://www.************.co.uk/resources/js/jquery.cycle.all.latest.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript">
        $(document).ready(function() {
            $('.slideshow').cycle({
                fx: 'fade', speed: 500 // choose your transition type, ex: fade, scrollUp, shuffle, etc...
            });
        });
        </script>
That will put your scripts after jQuery... if you take jQuery out the scripts folder I don't think the admin functions will work.
Jun 27, 2012 at 4:49 PM
Edited Jun 27, 2012 at 4:50 PM

The scripts from the theme were needed to enable a uniform top navigation throughout the site (this installation in a virtual directory of a parent site).

Anyway, I upgraded BlogEngine to the latest version, but it was still calling in a different version of jQuery from the /scripts/header/ directory. It wasn't clear to me how to stop it from calling that in, so I deleted the /Scripts/Header/01-jquery.js file and now the front end of the blog works on IE7 and the back end seems to work correctly on everything except IE7 and IE8.

 

EDIT - Just saw your post after I posted, echobitz!

Thanks for your replies both of you.