#1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,675
    Rep Power
    171

    Why "view source" shows the content of some of the scripts (and css)?


    Hello;

    This is very strange! I have two pages with exact same includes but when I view source they show totally different things! This is on top of both pages:
    PHP Code:
    <?php  include "sep_header_edited.php";?>
    <?php  
    include "nd_header_edited.php";?>
    This is the first page that I have finished validating and the source looks nice and clean:
    Code:
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Hotels2Go - Secure Booking Form</title>
    <meta name="description" content="Hotels2Go is dedicated to providing our customers with the best hotel accommodation deals available throughout Australia, New Zealand, Bali, Fiji, Indonesia, Thailand, Cook Islands, Vietnam and Hawaii"/>
    <meta name="Keywords" content=""/>
    <style type="text/css" media="all">@import "sep_css/default.css"; 
    </style>
    Invalid card<style type="text/css" media="all">
    	@import "css/calendar3.css";
    	@import "css/nd_skin.csss";
    	@import "jquery_ui.css";
    	@import "css/nd_style.css";
    </style>
    
    <script src="jquery_1_8.js"></script>
    <script src="jquery_1_9.js"></script>
    <script  src="js/lightbox.js"></script>
    <script  src="js/nd_button_hovers.js"></script>
    <script  src="js/fancy_dropdown.js"></script>
    <script  src="js/nd_jquery.jcarousel.min.js"></script>
    <script  src="js/nd_hotel_delas.js" ></script>
    <!--Details CARASEL-->
    <link rel="stylesheet" type="text/css" href="hotel_details_carasel/css/popeye/jquery.popeye.css" media="screen" />
    <link rel="stylesheet" type="text/css" href="hotel_details_carasel/css/popeye/jquery.popeye.style.css" media="screen" />
    <script  src="hotel_details_carasel/lib/popeye/jquery.popeye-2.1.js"></script>
    <!--End Details CARASEL-->
    <script >
    	var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-16711954-1']);
      _gaq.push(['_trackPageview']);
      (function() {
       var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
       ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
       var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    </script>
    
    
    <!--Login box-->
    <script>
    	 $(document).ready(function () {
    
    		 $("#show_login").click(function () {
    			 $("#login_box").toggle("slow");
    			 });
    	 
    	});
    </script>
    <script type='text/javascript'>
    $(document).ready(function(){
    	$("#sign_in").hover(function() {
    		$(this).attr("src","images/sign_in_nd_hover.jpg");
    			}, function() {
    		$(this).attr("src","images/sign_in_nd.jpg");
    	});
    });
    </script>
    <!--End login box-->
    
    </head>
    But the other page (that I am fixing the html with validator) has a horrible looking code. It shows all script contents and...
    Code:
    <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script src="http://1.2.3.4/bmi-int-js/bmi.js?version=1363970337" language="javascript"></script><title>Gallery_nd2.php</title> <style type="text/css" media="all">@import"sep_css/default.css";</style> <span title=""></span><script src="controller_js/controller_gallery_nd2.js"></script><style type="text/css" media="all">@import"css/calendar3.css";@import"css/nd_skin.csss";@import"jquery_ui.css";@import"css/nd_style.css";</style> <script src="jquery_1_8.js"></script> <script  style="display:none">(function($,undefined){var uuid=0,runiqueId=/^ui-id-\d+$/;$.ui=$.ui||{};if($.ui.version){return;} $.extend($.ui,{version:"1.9.1",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});$.fn.extend({_focus:$.fn.focus,focus:function(delay,fn){return typeof delay==="number"?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus();if(fn){fn.call(elem);}},delay);}):this._focus.apply(this,arguments);},scrollParent:function(){var scrollParent;if(($.ui.ie&&(/(static|relative)/).test(this.css('position')))||(/absolute/).test(this.css('position'))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.css(this,'position'))&&(/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));}).eq(0);}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));}).eq(0);} return(/fixed/).test(this.css('position'))||!scrollParent.length?$(document):scrollParent;},zIndex:function(zIndex){if(zIndex!==undefined){return this.css("zIndex",zIndex);} if(this.length){var elem=$(this[0]),position,value;while(elem.length&&elem[0]!==document){position=elem.css("position");if(position==="absolute"||position==="relative"||position==="fixed"){value=parseInt(elem.css("zIndex"),10);if(!isNaN(value)&&value!==0){return value;}} elem=elem.parent();}} return 0;},uniqueId:function(){return this.each(function(){if(!this.id){this.id="ui-id-"+(++uuid);}});},removeUniqueId:function(){return this.each(function(){if(runiqueId.test(this.id)){$(this).removeAttr("id");}});}});if(!$("<a>").outerWidth(1).jquery){$.each(["Width","Height"],function(i,name){var side=name==="Width"?["Left","Right"]:["Top","Bottom"],type=name.toLowerCase(),orig={innerWidth:$.fn.innerWidth,innerHeight:$.fn.innerHeight,outerWidth:$.fn.outerWidth,outerHeight:$.fn.outerHeight};function reduce(elem,size,border,margin){$.each(side,function(){size-=parseFloat($.css(elem,"padding"+this))||0;if(border){size-=parseFloat($.css(elem,"border"+this+"Width"))||0;} if(margin){size-=parseFloat($.css(elem,"margin"+this))||0;}});return size;} $.fn["inner"+name]=function(size){if(size===undefined){return orig["inner"+name].call(this);} return this.each(function(){$(this).css(type,reduce(this,size)+"px");});};$.fn["outer"+name]=function(size,margin){if(typeof size!=="number"){return orig["outer"+name].call(this,size);} return this.each(function(){$(this).css(type,reduce(this,size,true,margin)+"px");});};});} function focusable(element,isTabIndexNotNaN){var map,mapName,img,nodeName=element.nodeName.toLowerCase();if("area"===nodeName){map=element.parentNode;mapName=map.name;if(!element.href||!mapName||map.nodeName.toLowerCase()!=="map"){return false;} img=$("img[usemap=#"+mapName+"]")[0];return!!img&&visible(img);} return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:"a"===nodeName?element.href||isTabIndexNotNaN:isTabIndexNotNaN)&&visible(element);} function visible(element){return $.expr.filters.visible(element)&&!$(element).parents().andSelf().filter(function(){return $.css(this,"visibility")==="hidden";}).length;} $.extend($.expr["
    What is going on?
    1 - Why is the css NOT indented in the second one and indented in the first one?

    2 - Why does the second one show script content while the first one doesn't?

    3 - Why doesn;t the second page apply the css? For example: "css/nd_style.css";

    Thanks
    Last edited by zxcvbnm; March 26th, 2013 at 06:17 PM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    Sydney Australia
    Posts
    188
    Rep Power
    84
    Originally Posted by zxcvbnm
    Hello;

    This is very strange! I have two pages with exact same includes but when I view source they show totally different things!
    How are you viewing the page source?

    Both look the same to me in FF 19.0.2

    BTW, is this a typo?

    css/nd_skin.csss

    Firebug shows it as being devoid of content, which can mean you've got the wrong file name.
    Last edited by BarryG; March 26th, 2013 at 06:49 PM.
  4. #3
  5. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,675
    Rep Power
    171
    Originally Posted by BarryG
    How are you viewing the page source?

    Both look the same to me in FF 19.0.2
    Right click, View Page Source. Maybe my FF is bugged?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    Sydney Australia
    Posts
    188
    Rep Power
    84
    Originally Posted by zxcvbnm
    Right click, View Page Source.
    That's all I did.

    Have you got Firebug installed too? It makes debugging web MUCH easier.
  8. #5
  9. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,675
    Rep Power
    171
    Originally Posted by BarryG
    That's all I did.

    Have you got Firebug installed too? It makes debugging web MUCH easier.
    Thanks BarryG. Yes I have Firefox but I dont usually use it I guess i should get into it.

    My main wondering is howcome sometimes I see the content of the script and sometimes just the include code.

    For example <script source="jquery.js"></script> sometimes shows the whole script in the source!

    Not sure why.
  10. #6
  11. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,675
    Rep Power
    171
    BarryG;

    While I got you here, how do you recommend I improve the quality of html code in this page.

    Thank you
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    Sydney Australia
    Posts
    188
    Rep Power
    84
    Originally Posted by zxcvbnm
    Thanks BarryG. Yes I have Firefox but I dont usually use it I guess i should get into it.

    My main wondering is howcome sometimes I see the content of the script and sometimes just the include code.

    For example <script source="jquery.js"></script> sometimes shows the whole script in the source!

    Not sure why.
    Code:
    <script src="jquery.js"></script>
    will show just that (or should!)
    Code:
    <script>
    funtion myfunction() {
    // js code in here;
    }
    </script>
    should show just that. Exactly what's in the source.

    But, if you load Firebug, your scripts included as src= will show the source file name, with a + sign next to it.
    Expand the plus sign, and you'll see the included js code, if the file could be found, or the "404 File Not Found" message if not found.
    You can even debug the js code by picking a line to break at, and examine variables. Any faulty code (e.g. bad syntax) won't let you select it for a break point. Good for showing that js actually parses ok.
  14. #8
  15. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,675
    Rep Power
    171
    Originally Posted by BarryG
    Code:
    <script src="jquery.js"></script>
    will show just that (or should!)
    Code:
    <script>
    funtion myfunction() {
    // js code in here;
    }
    </script>
    should show just that. Exactly what's in the source.
    So why do I see this in the source?
    Code:
    <script src="jquery_1_8.js"></script>
    <script src="jquery_1_9.js"></script>
    <script  src="js/lightbox.js"></script>
    <script  src="js/nd_button_hovers.js"></script>
    <script  src="js/fancy_dropdown.js"></script>
    <script  src="js/nd_jquery.jcarousel.min.js"></script>
    <script  src="js/nd_hotel_delas.js" ></script>
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    Sydney Australia
    Posts
    188
    Rep Power
    84
    Originally Posted by zxcvbnm
    So why do I see this in the source?
    Code:
    <script src="jquery_1_8.js"></script>
    <script src="jquery_1_9.js"></script>
    <script  src="js/lightbox.js"></script>
    <script  src="js/nd_button_hovers.js"></script>
    <script  src="js/fancy_dropdown.js"></script>
    <script  src="js/nd_jquery.jcarousel.min.js"></script>
    <script  src="js/nd_hotel_delas.js" ></script>
    Because that the source of the html file that your php assembled for you.
    When your browser parses the html, it will GET the script files from the urls names so they can control the behaviour of your web page.
  18. #10
  19. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,675
    Rep Power
    171
    Originally Posted by BarryG
    Because that the source of the html file that your php assembled for you.
    When your browser parses the html, it will GET the script files from the urls names so they can control the behaviour of your web page.
    Well BarryG today I look at the source of the same page and this is what I see:
    Code:
    <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script src="http://1.2.3.4/bmi-int-js/bmi.js?version=1363970337" language="javascript"></script><title>Gallery_nd2.php</title> <style type="text/css" media="all">@import"sep_css/default.css";</style> <script src="controller_js/controller_gallery_nd2.js"></script><style type="text/css" media="all">@import"css/calendar3.css";@import"css/nd_skin.css";@import"jquery_ui.css";@import"css/nd_style.css";@import"css_nd.css";</style> <script src="jquery_1_8.js"></script> <script  style="display:none">(function($,undefined){var uuid=0,runiqueId=/^ui-id-\d+$/;$.ui=$.ui||{};if($.ui.version){return;} $.extend($.ui,{version:"1.9.1",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});$.fn.extend({_focus:$.fn.focus,focus:function(delay,fn){return typeof delay==="number"?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus();if(fn){fn.call(elem);}},delay);}):this._focus.apply(this,arguments);},scrollParent:function(){var scrollParent;if(($.ui.ie&&(/(static|relative)/).test(this.css('position')))||(/absolute/).test(this.css('position'))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.css(this,'position'))&&(/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));}).eq(0);}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));}).eq(0);} return(/fixed/).test(this.css('position'))||!scrollParent.length?$(document):scrollParent;},zIndex:function(zIndex){if(zIndex!==undefined){return this.css("zIndex",zIndex);} if(this.length){var elem=$(this[0]),position,value;while(elem.length&&elem[0]!==document){position=elem.css("position");if(position==="absolute"||position==="relative"||position==="fixed"){value=parseInt(elem.css("zIndex"),10);if(!isNaN(value)&&value!==0){return value;}} elem=elem.parent();}} return 0;},uniqueId:function(){return this.each(function(){if(!this.id){this.id="ui-id-"+(++uuid);}});},removeUniqueId:function(){return this.each(function(){if(runiqueId.test(this.id)){$(this).removeAttr("id");}});}});if(!$("<a>").outerWidth(1).jquery){$.each(["Width","Height"],function(i,name){var side=name==="Width"?["Left","Right"]:["Top","Bottom"],type=name.toLowerCase(),orig={innerWidth:$.fn.innerWidth,innerHeight:$.fn.innerHeight,outerWidth:$.fn.outerWidth,outerHeight:$.fn.outerHeight};function reduce(elem,size,border,margin){$.each(side,function(){size-=parseFloat($.css(elem,"padding"+this))||0;if(border){size-=parseFloat($.css(elem,"border"+this+"Width"))||0;} if(margin){size-=parseFloat($.css(elem,"margin"+this))||0;}});return size;} $.fn["inner"+name]=function(size){if(size===undefined){return orig["inner"+name].call(this);} return this.each(function(){$(this).css(type,reduce(this,size)+"px");});};$.fn["outer"+name]=function(size,margin){if(typeof size!=="number"){return orig["outer"+name].call(this,size);} return this.each(function(){$(this).css(type,reduce(this,size,true,margin)+"px");});};});} function focusable(element,isTabIndexNotNaN){var map,mapName,img,nodeName=element.nodeName.toLowerCase();if("area"===nodeName){map=element.parentNode;mapName=map.name;if(!element.href||!mapName||map.nodeName.toLowerCase()!=="map"){return false;} img=$("img[usemap=#"+mapName+"]")[0];return!!img&&visible(img);} return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:"a"===nodeName?element.href||isTabIndexNotNaN:isTabIndexNotNaN)&&visible(element);} function visible(element){return $.expr.filters.visible(element)&&!$(element).parents().andSelf().filter(function(){return $.css(this,"visibility")==="hidden";}).length;} $.extend($.expr[":"],{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName);};}):function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){return focusable(element,!isNaN($.attr(element,"tabindex")));},tabbable:function(element){var tabIndex=$.attr(element,"tabindex"),isTabIndexNaN=isNaN(tabIndex);return(isTabIndexNaN||tabIndex>=0)&&focusable(element,!isTabIndexNaN);}});$(function(){var body=document.body,div=body.appendChild(div=document.createElement("div"));div.offsetHeight;$.extend(div.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});$.support.minHeight=div.offsetHeight===100;$.support.selectstart="onselectstart" in div;body.removeChild(div).style.display="none";});(function(){var uaMatch=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];$.ui.ie=uaMatch.length?true:false;$.ui.ie6=parseFloat(uaMatch[1],10)===6;})();$.fn.extend({disableSelection:function(){return this.bind(($.support.selectstart?"selectstart":"mousedown")+ ".ui-disableSelection",function(event){event.preventDefault();});},enableSelection:function(){return this.unbind(".ui-disableSelection");}});$.extend($.ui,{plugin:{add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){ var i,set=instance.plugins[name];if(!set||!instance.element[0].parentNode||instance.element[0].parentNode.nodeType===11){return;} for(i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},contains:$.contains,hasScroll:function(el,a){if($(el).css("overflow")==="hidden"){return false;} var scroll=(a&&a==="left")?"scrollLeft":"scrollTop",has=false;if(el[scroll]>0){return true;} el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size));},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width);}});})(jQuery);(function($,undefined){var uuid=0,slice=Array.prototype.slice,_cleanData=$.cleanData;$.cleanData=function(elems){for(var i=0,elem;(elem=elems[i])!=null;i++){try{$(elem).triggerHandler("remove");}catch(e){}} _cleanData(elems);};$.widget=function(name,base,prototype){var fullName,existingConstructor,constructor,basePrototype,namespace=name.split(".")[0];name=name.split(".")[1];fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget;}// $.expr[":"][fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName);};$[namespace]=$[namespace]||{};existingConstructor=$[namespace][name];constructor=$[namespace][name]=function(options,element){if(!this._createWidget){return new constructor(options,element);} if(arguments.length){this._createWidget(options,element);}};$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]});basePrototype=new base();basePrototype.options=$.widget.extend({},basePrototype.options);$.each(prototype,function(prop,value){if($.isFunction(value)){prototype[prop]=(function(){var _super=function(){return base.prototype[prop].apply(this,arguments);},_superApply=function(args){return base.prototype[prop].apply(this,args);};return function(){var __super=this._super,__superApply=this._superApply,returnValue;this._super=_super;this._superApply=_superApply;returnValue=value.apply(this,arguments);this._super=__super;this._superApply=__superApply;return returnValue;};})();}});constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:basePrototype.widgetEventPrefix||name},prototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetBaseClass:fullName,widgetFullName:fullName});if(existingConstructor){$.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto);});delete existingConstructor._childConstructors;}else{base._childConstructors.push(constructor);} $.widget.bridge(name,constructor);};$.widget.extend=function(target){var input=slice.call(arguments,1),inputIndex=0,inputLength=input.length,key,value;for(;inputIndex<inputLength;inputIndex++){for(key in input[inputIndex]){value=input[inputIndex][key];if(input[inputIndex].hasOwnProperty(key)&&value!==undefined){if($.isPlainObject(value)){target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value);}else{target[key]=value;}}}} return target;};$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName;$.fn[name]=function(options){var isMethodCall=typeof options==="string",args=slice.call(arguments,1),returnValue=this;options=!isMethodCall&&args.length?$.widget.extend.apply(null,[options].concat(args)):options;if(isMethodCall){this.each(function(){var methodValue,instance=$.data(this,fullName);if(!instance){return $.error("cannot call methods on "+name+" prior to initialization; "+ "attempted to call method '"+options+"'");} if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for "+name+" widget instance");} methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return false;}});}else{this.each(function(){var instance=$.data(this,fullName);if(instance){instance.option(options||{})._init();}else{new object(options,this);}});} return returnValue;};};$.Widget=function(){};$.Widget._childConstructors=[];$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:false,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0];this.element=$(element);this.uuid=uuid++;this.eventNamespace="."+this.widgetName+this.uuid;this.options=$.widget.extend({},this.options,this._getCreateOptions(),options);this.bindings=$();this.hoverable=$();this.focusable=$();if(element!==this){$.data(element,this.widgetName,this);$.data(element,this.widgetFullName,this);this._on(this.element,{remove:function(event){if(event.target===element){this.destroy();}}});this.document=$(element.style?element.ownerDocument:element.document||element);this.window=$(this.document[0].defaultView||this.document[0].parentWindow);} this._create();this._trigger("create",null,this._getCreateEventData());this._init();},_getCreateOptions:$.noop,_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){this._destroy();this.element .unbind(this.eventNamespace) .removeData(this.widgetName) .removeData(this.widget
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    Sydney Australia
    Posts
    188
    Rep Power
    84
    Originally Posted by zxcvbnm
    Well BarryG today I look at the source of and this is what I see:
    When I look at the source with FF, it's laid out OK, when I look at the source with IE10, it's laid out OK. But I think the "View Source" windows are formatting the code to look OK.
    But the raw text layout in HTML is unimportant. HTML text is rendered according to style rules of default settings in the browser and your css style rules.
    Don't beat yourself up over text layout of html. You only need worry about how it renders.

    If you are really worried, and have nothing else to do, you can add \n\r carriage retuns in your html code being written by php. It might look better, but will take longer for the extra two bytes for each CRLF for each line. It really IS a waste of time.
    Originally Posted by zxcvbnm
    While I got you here, how do you recommend I improve the quality of html code in this page.
    All your $(document).ready(function() {}); calls should be merged into one, preferably in the head section.
    Other than that, use w3c validation service to show where your code can be improved.
    Last edited by BarryG; March 27th, 2013 at 11:26 PM.

IMN logo majestic logo threadwatch logo seochat tools logo