Comments on: JQuery for Everyone: Faster than Document.Ready http://www.endusersharepoint.com/2009/05/18/jquery-for-everyone-faster-that-documentready/ No GeekSpeak on SharePoint 2007 WSS and MOSS Mon, 27 Dec 2010 14:28:49 -0500 http://wordpress.org/?v=2.8.6 hourly 1 By: EndUserSharePoint http://www.endusersharepoint.com/2009/05/18/jquery-for-everyone-faster-that-documentready/comment-page-1/#comment-39641 EndUserSharePoint Mon, 01 Mar 2010 17:32:27 +0000 http://www.endusersharepoint.com/?p=1656#comment-39641 Tom - Example, please? -- Mark Tom – Example, please? — Mark

]]>
By: Tom Hamshere http://www.endusersharepoint.com/2009/05/18/jquery-for-everyone-faster-that-documentready/comment-page-1/#comment-39629 Tom Hamshere Mon, 01 Mar 2010 14:27:12 +0000 http://www.endusersharepoint.com/?p=1656#comment-39629 A simpler solution might be to use a noscript tag to hide a noscript.css. This ensures the page is rendered correctly in browsers without JS and will not be loaded for those with JS. . A simpler solution might be to use a noscript tag to hide a noscript.css. This ensures the page is rendered correctly in browsers without JS and will not be loaded for those with JS. .

]]>
By: AutoSponge http://www.endusersharepoint.com/2009/05/18/jquery-for-everyone-faster-that-documentready/comment-page-1/#comment-18020 AutoSponge Wed, 14 Oct 2009 12:14:28 +0000 http://www.endusersharepoint.com/?p=1656#comment-18020 @Danno, Document.ready only delays running the script until the document loads but it processes inline. When you called .layout, the layout.js file had not completely loaded. You must run the call to .layout after layout.js has loaded, so we use a callback function, like this: <pre lang="javascript"> $("head:first").includeFile({"url":"js/ui/jquery.layout.js"},function () { $("body").layout({ applyDefaultStyles: true }); }); </pre> Since that anonymous function affects the DOM, we'll still want to delay execution until the DOM loads, so you can wrap it in the document.ready (or equivalent): <pre lang="javascript"> $("head:first").includeFile({"url":"js/ui/jquery.layout.js"}, $(function(){ $("body").layout({ applyDefaultStyles: true }); }); ); </pre> I haven't tested this, but I hope it helps. @Danno,

Document.ready only delays running the script until the document loads but it processes inline. When you called .layout, the layout.js file had not completely loaded.

You must run the call to .layout after layout.js has loaded, so we use a callback function, like this:

$("head:first").includeFile({"url":"js/ui/jquery.layout.js"},function () {
$("body").layout({ applyDefaultStyles: true });
});

Since that anonymous function affects the DOM, we’ll still want to delay execution until the DOM loads, so you can wrap it in the document.ready (or equivalent):

$("head:first").includeFile({"url":"js/ui/jquery.layout.js"},
	$(function(){
		$("body").layout({ applyDefaultStyles: true });
	});
);

I haven’t tested this, but I hope it helps.

]]>
By: Danno http://www.endusersharepoint.com/2009/05/18/jquery-for-everyone-faster-that-documentready/comment-page-1/#comment-18014 Danno Tue, 13 Oct 2009 22:39:30 +0000 http://www.endusersharepoint.com/?p=1656#comment-18014 There seems to be an issue with this little jQuery plugin and Google's Chrome browser. Here's an example: I have the following page: Layout Example Center <a href="http://layout.jquery-dev.net/demos.html" rel="nofollow">Go to the Demos page</A> North South East West Simple.js contains the following: $("head:first").includeFile({"url":"js/ui/jquery.layout.js"}); $(document).ready(function () { $('body').layout({ applyDefaultStyles: true }); }); When I use the scriptLoader.js (my name for the above code), Chrome does not apply the layout. It seems to complain about 'body' not having a 'layout' method. IE and FF work with out error. If I move the jquery.layout.js include to a normal script tag in the html file (instead of having it be dynamically included), it works fine in all 3 browsers. Any idea what Chrome's issue might be? There seems to be an issue with this little jQuery plugin and Google’s Chrome browser. Here’s an example:

I have the following page:

Layout Example

Center
Go to the
Demos page

North
South
East
West

Simple.js contains the following:
$(”head:first”).includeFile({”url”:”js/ui/jquery.layout.js”});
$(document).ready(function () {
$(’body’).layout({ applyDefaultStyles: true });
});

When I use the scriptLoader.js (my name for the above code), Chrome does not apply the layout. It
seems to complain about ‘body’ not having a ‘layout’ method. IE and
FF work with out error. If I move the jquery.layout.js include to a
normal script tag in the html file (instead of having it be
dynamically included), it works fine in all 3 browsers.

Any idea what Chrome’s issue might be?

]]>
By: AutoSponge http://www.endusersharepoint.com/2009/05/18/jquery-for-everyone-faster-that-documentready/comment-page-1/#comment-13111 AutoSponge Mon, 25 May 2009 23:52:53 +0000 http://www.endusersharepoint.com/?p=1656#comment-13111 @Aaron, The link only shows when the page is viewed on the main page, as an individual article, the code is visible without clicking a link. The various scripts are just that. The only one I want to run ASAP (so users don't see the collapsing action) is accordion left nav. See a similar script here: http://www.endusersharepoint.com/?p=1640 @Aaron,

The link only shows when the page is viewed on the main page, as an individual article, the code is visible without clicking a link.

The various scripts are just that. The only one I want to run ASAP (so users don’t see the collapsing action) is accordion left nav. See a similar script here:

http://www.endusersharepoint.com/?p=1640

]]>
By: Aaron http://www.endusersharepoint.com/2009/05/18/jquery-for-everyone-faster-that-documentready/comment-page-1/#comment-13092 Aaron Mon, 25 May 2009 00:36:51 +0000 http://www.endusersharepoint.com/?p=1656#comment-13092 Interested in checking this out - but maybe its a monday morning thing but I cant find a "read more" link on the page. Addtionally, where do you source the accordion-nav.js, leftnav.css, expand-collapse-all.js and ows.js files from? Interested in checking this out – but maybe its a monday morning thing but I cant find a “read more” link on the page.

Addtionally, where do you source the accordion-nav.js, leftnav.css, expand-collapse-all.js and ows.js files from?

]]>
By: AutoSponge http://www.endusersharepoint.com/2009/05/18/jquery-for-everyone-faster-that-documentready/comment-page-1/#comment-13063 AutoSponge Fri, 22 May 2009 17:33:13 +0000 http://www.endusersharepoint.com/?p=1656#comment-13063 There was a problem with the script, it got munched by Wordpress. Example should be visible now. There was a problem with the script, it got munched by Wordpress. Example should be visible now.

]]>
By: EndUserSharePoint http://www.endusersharepoint.com/2009/05/18/jquery-for-everyone-faster-that-documentready/comment-page-1/#comment-13059 EndUserSharePoint Fri, 22 May 2009 15:29:24 +0000 http://www.endusersharepoint.com/?p=1656#comment-13059 Zuber - Sure does... just checked. How were you able to comment if the read more link didn't work :-) - Mark Zuber – Sure does… just checked. How were you able to comment if the read more link didn’t work :-) – Mark

]]>
By: Zuber Agwan http://www.endusersharepoint.com/2009/05/18/jquery-for-everyone-faster-that-documentready/comment-page-1/#comment-13058 Zuber Agwan Fri, 22 May 2009 15:11:26 +0000 http://www.endusersharepoint.com/?p=1656#comment-13058 "read more" does not work ????? “read more” does not work ?????

]]>