Move JS down...?

asak - September 28, 2008 - 15:14
Project:Drupal ajaxIM
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Well - thanks for this amazing module! in my opinion, it's one of the most needed (and most beautiful!) modules.

I'm using ver. 1.x-dev since i'm having more success with it then I did with the 2.x version.
The main problem is compatibility with modules depending on JS scripts (DHTML Menus, jGrowl.module, collapsing fieldsets, and many others...)

My question is - Could it possibly be that moving the top 2 lines of code to just above the rest of the scripts related to ajaIM will solve all of those issues? should there be a problem?

Right now my source looks something like this: (notice it starts with ajaxIM )

<script type="text/javascript">var base_path = "/sites/all/modules/ajaxim/ajaxim/";</script>
<script type='text/javascript'>var username='master';var fstatus='1';var fcurstatus='http://EXAMPLE.com/I\'m available';var pingTo = 'http://www.EXAMPLE.com/ajaxim_server';</script>
<style type="text/css" media="all">@import "/sites/all/modules/fasttoggle/fasttoggle.css";</style>
<style type="text/css" media="all">@import "/files/css/b4e70dfb346b3a6fd0b6b674ff88964e.css";</style>
<script type="text/javascript" src="/misc/jquery.js"></script>
<script type="text/javascript" src="/misc/drupal.js"></script>
<script type="text/javascript" src="/sites/all/modules/ajaxeditable/ajaxeditable.js"></script>
<script type="text/javascript" src="/sites/all/modules/ajaxeditable/form.js"></script>
<script type="text/javascript" src="/sites/all/modules/hovertip/....js"></script>
<script type="text/javascript" src="/sites/all/modules/jquery_update/....js"></script>
<script type="text/javascript" src="/sites/all/modules/fasttoggle/fasttoggle.js"></script>
<script type="text/javascript" src="/sites/all/modules/dhtml_menu/dhtml_menu.js"></script><b>
<script type="text/javascript" src="/sites/all/modules/ajaxim/ajaxim/js/....js"></script>
<script type="text/javascript" src="/sites/all/modules/ajaxim/ajaxim/js/....js"></script>
<script type="text/javascript" src="/sites/all/modules/ajaxim/ajaxim/js/....js"></script>
<script type="text/javascript" src="/sites/all/modules/ajaxim/ajaxim/js/json.js"></script>
<script type="text/javascript" src="/sites/all/modules/ajaxim/ajax_im.js"></script></b>
<script type="text/javascript">Drupal.extend({ settings: { "jstools": { "cleanurls": true, "basePath": "/" }, "tabs": { "slide": false, "fade": false, "speed": "slow", "auto_height": false, "next_text": "next", "previous_text": "previous" }, "quicktabs": { "effect": "none" }, "thickbox": { "close": "Close", "next": "Next \x3e", "prev": "\x3c Prev", "esc_key": "or Esc Key", "next_close": "Next / Close on last", "image_count": "Image !current of !total" }, "base_path": "/", "dhtmlMenu": { "useEffects": [ 1, 1 ] } } });</script>
<script type="text/javascript">
    // initialize tooltips in a separate thread
    $(document).ready(function() {
      window.setTimeout(hovertipInit, 1);
    });
</script>

I'm thinking this should work better:

<style type="text/css" media="all">@import "/sites/all/modules/fasttoggle/fasttoggle.css";</style>
<style type="text/css" media="all">@import "/files/css/b4e70dfb346b3a6fd0b6b674ff88964e.css";</style>
<script type="text/javascript" src="/misc/jquery.js"></script>
<script type="text/javascript" src="/misc/drupal.js"></script>
<script type="text/javascript" src="/sites/all/modules/ajaxeditable/ajaxeditable.js"></script>
<script type="text/javascript" src="/sites/all/modules/ajaxeditable/form.js"></script>
<script type="text/javascript" src="/sites/all/modules/hovertip/....js"></script>
<script type="text/javascript" src="/sites/all/modules/jquery_update/....js"></script>
<script type="text/javascript" src="/sites/all/modules/fasttoggle/fasttoggle.js"></script>
<script type="text/javascript" src="/sites/all/modules/dhtml_menu/dhtml_menu.js"></script><b>
<script type="text/javascript">var base_path = "/sites/all/modules/ajaxim/ajaxim/";</script>
<script type='text/javascript'>var username='master';var fstatus='1';var fcurstatus='http://EXAMPLE.com/I\'m available';var pingTo = 'http://www.EXAMPLE.com/ajaxim_server';</script>
<script type="text/javascript" src="/sites/all/modules/ajaxim/ajaxim/js/....js"></script>
<script type="text/javascript" src="/sites/all/modules/ajaxim/ajaxim/js/....js"></script>
<script type="text/javascript" src="/sites/all/modules/ajaxim/ajaxim/js/....js"></script>
<script type="text/javascript" src="/sites/all/modules/ajaxim/ajaxim/js/json.js"></script>
<script type="text/javascript" src="/sites/all/modules/ajaxim/ajax_im.js"></script></b>
<script type="text/javascript">Drupal.extend({ settings: { "jstools": { "cleanurls": true, "basePath": "/" }, "tabs": { "slide": false, "fade": false, "speed": "slow", "auto_height": false, "next_text": "next", "previous_text": "previous" }, "quicktabs": { "effect": "none" }, "thickbox": { "close": "Close", "next": "Next \x3e", "prev": "\x3c Prev", "esc_key": "or Esc Key", "next_close": "Next / Close on last", "image_count": "Image !current of !total" }, "base_path": "/", "dhtmlMenu": { "useEffects": [ 1, 1 ] } } });</script>
<script type="text/javascript">
    // initialize tooltips in a separate thread
    $(document).ready(function() {
      window.setTimeout(hovertipInit, 1);
    });
</script>

I've been experiencing pages loading showing only the code, starting somewhere in the scripts section, usually cut off. this might be related - but i don't know.

 
 

Drupal is a registered trademark of Dries Buytaert.