Archive for the ‘Javascript’ Category

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

June 21, 2013 2 comments


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.


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

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.


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


Enjoy Coding !!!