emphasized text
<apex:page >
<script>
var result = sforce.connection.query("Select Name,Id from User", {
onSuccess : success, onFailure : failure});
function success(result) {
var it = new sforce.QueryResultIterator(result);
while(it.hasNext()){
var record = it.next();
log(record.Name + " -- " + record.Id);
}
}
function failure(error) {
log("An error has occurred " + error);
}
</script>
<apex:form >
<apex:pageBlock >
<apex:commandButton value="get user info" onclick="chechDevMode();"/>
</apex:pageBlock>
</apex:form>
</apex:page>
this is my vf page,,am trying to get user info,by clcking the button get user info,,pls suggest how to do it.thanks in advance.
"Select Name,Id from User WHERE Id = '{!$user.Id}' "