The jQuery scripts I have in a DVWP do not get executed when I enable Asychronous Load in the Ajax Options of the DVWP. They do execute when I disable Asychronous Load though. Any thoughts on this?

A few scripts I refer to in the XSLT of the DVWP are:

<!-- Table sorting JS -->
<script type="text/javascript" src="/_layouts/somefolder/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="/_layouts/somefolder/fancybox/jquery.fancybox-1.3.1.js"></script>
<link rel="stylesheet" type="text/css" href="/_layouts/somefolder/fancybox/jquery.fancybox-1.3.1.css" media="screen" />
<link rel="stylesheet" href="/_layouts/somefolder/jquery.simplemenu.css" type="text/css" media="screen" />

Try using the "defer"="defer" attribute in your script tags.


I see you're referencing jquery plugins, but where is your Jquery Library Reference?

Jquery Plugins will fail if the Library is not loaded before them. Cheers


Do they truly not execute or does it not give you the behaviour you were expecting?

Most likely your jQuery scripts run before your async data is loaded on the page. When the data arrives on the page, it will not be affected by the jQuery script that has already finished running.


I am guessing you are using your jQuery in the document ready function.

You need to wrap your code in a function and add it to the built in SharePoint functions which are called after async postbacks:


Reference: http://sharepointgoose.blogspot.com/2011/06/execute-code-after-asynchronous.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy