I need to check whether the logged in user is a administrator or non-admin user by using JavaScript in sharepoint designer or content editor webpart.
Can anybody suggest?
You can use JQuery and SPServices to examine the group a logged in user belongs to, see my post here which explains the principle. In that case, it hides an element if a user belongs to a particular group.