Archive

Archive for the ‘Javascript’ Category

How To: Get Current Site Collection URL or site URL in SharePoint 2010

June 21, 2013 2 comments

Guys,

Today, i was looking for ways to get current site collection url from loaded page using JavaScript.

One way is definitely Client Object Model.

But what if you don’t want to use Client OM. You don’t need to write any code to get such URL.

Here are ways:

L_Menu_BaseUrl: This contains URL of site or sub site

L_Menu_LCID: This contains the LCID setting of the current site.

L_Menu_SiteTheme: This contains the theme name of the current site.

_spUserId: This contains the id of the current user.

Ref:

http://vrdmn.blogspot.in/2011/08/javascript-lmenubaseurl-varaible-for.html

http://joshihemant.wordpress.com/2012/05/07/sharepoint-current-site-collection-or-site-url-in-javascript-3/

For, other kind of information, you can use this also:

http://blog.tedpattison.net/Lists/Posts/Post.aspx?ID=9

Happy SharePointing !!!

How To: Empty Recycle bin in one go in SharePoint 2010

October 5, 2011 2 comments

I was working in one of my project. And I got to know there are lots of files in recycle bin and for that my database is having lots of heavy data.

So I wanted to remove all items from recycle bin.

You can do it by “Delete Selction” or “Empty Recycle Bin” (Site Collection Administration >> Recycle bin).

But what happen when there are thousands of files are there in recycle bin.

No one want to delete 100 or 200 files one by one.

Solution:

Go to Recycle bin page >> address bar in browser >> javascript:emptyItems(); >> Press Enter.

Ref: http://rhythmiccoding.blogspot.com/2010/08/empty-sharepoint-recycle-bin-in-one-go.html

Enjoy Coding !!!