• KaranNangru
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi guys i am trying to use the ajax toolkit in a homepage component, the problem is i have to login to get a session is there anyway i can do this without logging in. I have created an html area and added the following code:

 

 

<html>
<head>
	<script src="/soap/ajax/16.0/connection.js" type="text/javascript"></script>
	<script type="text/javascript">
		function ShowUser(){
		    //sforce.connection.login("**************8", "********");
			//sforce.connection.sessionId = '{!$Api.Session_ID}';
		    //var user = sforce.connection.getUserInfo();
			alert(document.cookie);
		}
		window.onload = ShowUser();
	</script>
</head>

<body>
</body>
</html>

 

But if i do not login it won't work?