#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2009
    Posts
    21
    Rep Power
    0

    Hiding Rubbish Created by Coldfusion


    Hi, I have a page where I use some coldfusion elements like CFGrid, CFajximport etc. The problem is that at the runtime , Coldfusion inserts all JS scipts it needs at the TOP of the page,above the head section where the page title ,keywords are.
    Fom a SEO point of view I'm quite concerned because of this. For example below is a sample of what gets inserted in the HTML code as the first thing on page:
    Code:
    <head><script type="text/javascript">_cf_loadingtexthtml="<div align='center'><img src='/CFIDE/scripts/ajax/resources/cf/images/loading.gif'/>";
    _cf_contextpath="";
    _cf_ajaxscriptsrc="/CFIDE/scripts/ajax";
    _cf_jsonprefix='//';
    _cf_clientid='18CFA05CDD4E28DD6C99C9A46A602A3D';</script><script type="text/javascript" src="/CFIDE/scripts/ajax/messages/cfmessage.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/package/cfajax.js"></script>
    
    <script type="text/javascript">
    	ColdFusion.Ajax.importTag('CFAJAXPROXY');
    </script>
    
    <script type="text/javascript">
    	var _cf_actionjob=ColdFusion.AjaxProxy.init('/actionjob.cfc','actionobj');
    	_cf_actionjob.prototype.saveJob=function(jobid) { return ColdFusion.AjaxProxy.invoke(this, "saveJob", {jobid:jobid});};
    	_cf_actionjob.prototype.removelistJob=function(jobid) { return ColdFusion.AjaxProxy.invoke(this, "removelistJob", {jobid:jobid});};
    	_cf_actionjob.prototype.saveUserDetails=function(uname,usurname,uaddress1,uaddress2,utown,upostcode,ucountry,utel) { return ColdFusion.AjaxProxy.invoke(this, "saveUserDetails", {uname:uname,usurname:usurname,uaddress1:uaddress1,uaddress2:uaddress2,utown:utown,upostcode:upostcode,ucountry:ucountry,utel:utel});};
    	_cf_actionjob.prototype.getUserDetails=function() { return ColdFusion.AjaxProxy.invoke(this, "getUserDetails", {});};
    	_cf_actionjob.prototype.applyJob=function(jobid) { return ColdFusion.AjaxProxy.invoke(this, "applyJob", {jobid:jobid});};
    	_cf_actionjob.prototype.showorhideCV=function(truefalse) { return ColdFusion.AjaxProxy.invoke(this, "showorhideCV", {truefalse:truefalse});};
    	_cf_actionjob.prototype.removeallData=function() { return ColdFusion.AjaxProxy.invoke(this, "removeallData", {});};
    	_cf_actionjob.prototype.removeCV=function() { return ColdFusion.AjaxProxy.invoke(this, "removeCV", {});};
    </script>
    <script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
    
    <script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/cfformhistory.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/yui/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/yui/animation/animation-min.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/adapter/yui/ext-yui-adapter.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/ext-core.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/util.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/widget-core.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/data/data.js"></script>
    
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/dragdrop/dragdrop.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/form/form.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/button/button.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/source/widgets/View.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/source/widgets/MenuButton.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/toolbar/toolbar.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/grid/grid.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/grid/edit-grid.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/package/cfgrid.js"></script>
    
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/resizable.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/build/state/State-min.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/dialog/dialogs.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/package/cfwindow.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/tabs/tabs.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/ajax/package/cflayout.js"></script>
    
    <script type="text/javascript">
    	_cf_bind_init_1237289542571=function()
    	{
    		ColdFusion.Bind.register([['artGrid','','change']],{'bindTo':ColdFusion.empty,'bindToAttr':'true','callFunction':'todetail','bindExpr':[['artGrid','','id'],['artGrid','','posttitle']]},ColdFusion.Bind.jsBindHandler,false);
    	};ColdFusion.Event.registerOnLoad(_cf_bind_init_1237289542571);
    </script>
    Is there a way of getting rid of this, or at least making Coldfusion to insert this below the real head section (where the page title and keywords are?)

    Thanks
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,264
    Rep Power
    968
    Since the rendered markup in the HEAD element is valid XHTML, I'm not really sure what you think the issue is. The W3C spec states:

    Code:
    <!ENTITY % head.misc "(script|style|meta|link|object)*">
    
    <!-- content model is %head.misc; combined with a single
         title and an optional base element in any order -->
    
    <!ELEMENT head (%head.misc;,
         ((title, %head.misc;, (base, %head.misc;)?) |
          (base, %head.misc;, (title, %head.misc;))))>
    
    <!ATTLIST head
      %i18n;
      id          ID             #IMPLIED
      profile     %URI;          #IMPLIED
      >
    Since there is no order specified for the child elements, you can define them in any order you want. The search engines are smart enough to properly parse the elements regardless of their order.

    That said, what you're asking for would be difficult anyway. How would the server "know" where you think the generated elements should go? Since *you* can also define the elements in any order you like, as well as dynamically push content into the head section at any point during the reqeust, the server is simply taking the most efficient appraoch and adding it to the beginning of the element. Hopefully that makes sense.

IMN logo majestic logo threadwatch logo seochat tools logo