Stump the Panel: SharePoint Q&A

Immediate solutions for common SharePoint questions
It is currently Fri May 24, 2013 7:16 am

All times are UTC - 5 hours [ DST ]


Forum rules


What you are viewing is an archive of Stump the Panel. It remains for reference purposes. Please post all new questions on NothingButSharePoint.com
https://www.nothingbutsharepoint.com/sites/eusp/Forum



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 22 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: AJAX or Refreshing a DVWP in 2007
PostPosted: Thu May 12, 2011 12:00 pm 
Offline
User avatar

Joined: Mon Jan 04, 2010 1:15 am
Posts: 1839
Location: North Carolina
What would be the method to invoke that on a fixed interval as part of a document.ready function? .wait()? .load()? .delay? .setTimeOut?


Top
 Profile  
 
 Post subject: Re: AJAX or Refreshing a DVWP in 2007
PostPosted: Thu May 12, 2011 12:04 pm 
Offline
User avatar

Joined: Sat Jan 02, 2010 4:29 pm
Posts: 589
Location: Boston, MA, USA
I'd set it up to happen on a click of something until I got it right. Then you could use setTimeout if you wanted it to happen on a timed basis.

M.


Top
 Profile  
 
 Post subject: Re: AJAX or Refreshing a DVWP in 2007
PostPosted: Thu May 12, 2011 12:42 pm 
Offline
User avatar

Joined: Mon Jan 04, 2010 1:15 am
Posts: 1839
Location: North Carolina
I'm probably not doing something right. When I try to dump this into a CEWP, the dataview disappears and I have not link to click.
Code:
<script type="text/javascript>
reload() {
$.ajax({
   async: false,
   url: "https://mydomain/sites/sitecoll/pages/default.aspx",
   complete: function (xData, Status) {
      var DVWPMarkup = $(xData.responseText).find("#offerings").html();
      $(#offerings).html(DVWPMarkup);
    }
});

}
</script>
<div>
<a href="#" onClick="javascript:reload();return false">Reload</a>
</div>


Top
 Profile  
 
 Post subject: Re: AJAX or Refreshing a DVWP in 2007
PostPosted: Thu May 12, 2011 12:50 pm 
Offline
User avatar

Joined: Sat Jan 02, 2010 4:29 pm
Posts: 589
Location: Boston, MA, USA
Debugging time!

M.


Top
 Profile  
 
 Post subject: Re: AJAX or Refreshing a DVWP in 2007
PostPosted: Fri May 13, 2011 10:42 am 
Offline
User avatar

Joined: Sat Jan 02, 2010 4:29 pm
Posts: 589
Location: Boston, MA, USA
Sorry if I left you hanging. Any luck?

M.


Top
 Profile  
 
 Post subject: Re: AJAX or Refreshing a DVWP in 2007
PostPosted: Fri May 13, 2011 11:02 am 
Offline
User avatar

Joined: Mon Jan 04, 2010 1:15 am
Posts: 1839
Location: North Carolina
Not really. I might try to put it on a different page and just have an empty div on the default page that the script dumps it into.


Top
 Profile  
 
 Post subject: Re: AJAX or Refreshing a DVWP in 2007
PostPosted: Fri May 13, 2011 11:32 am 
Offline
User avatar

Joined: Sat Jan 02, 2010 4:29 pm
Posts: 589
Location: Boston, MA, USA
The best thing to do for debugging is to just add some alerts which show you what's going on.

For instance:
Code:
var DVWPMarkup = $(xData.responseText).find("#offerings").html();
alert(DVWPMarkup);

Would simply show you what you are getting (if anything) when you try to parse out the contents of the element with id="offerings".

M.


Top
 Profile  
 
 Post subject: Re: AJAX or Refreshing a DVWP in 2007
PostPosted: Fri May 13, 2011 11:39 am 
Offline
User avatar

Joined: Sat Jan 02, 2010 6:02 pm
Posts: 1035
Location: Silver Spring, MD
To piggyback Marc's thought, you could also use console.log. That way in the debugger, you'll have text that you can copy an paste into an editor and find out how you want to manipulate it.
Code:
complete: function (xData, Status) {
   console.log(xData.responseXML.xml);
}


Top
 Profile  
 
 Post subject: Re: AJAX or Refreshing a DVWP in 2007
PostPosted: Fri May 13, 2011 11:43 am 
Offline
User avatar

Joined: Sat Jan 02, 2010 4:29 pm
Posts: 589
Location: Boston, MA, USA
Not in IE, you can't. ;+)

M.


Top
 Profile  
 
 Post subject: Re: AJAX or Refreshing a DVWP in 2007
PostPosted: Fri May 13, 2011 1:28 pm 
Offline
User avatar

Joined: Sat Jan 02, 2010 6:02 pm
Posts: 1035
Location: Silver Spring, MD
You sure about that? I've been doing it for a while now...

https://picasaweb.google.com/RemyMaza/C ... 7489782722


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 22 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group