function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lee SinLee Sin 

Where can I see the logs and how can I debug this function on Chrome?

<apex:page showHeader="false" sidebar="false">
<script src="../../soap/ajax/32.0/connection.js" type="text/javascript"></script>
<script>
function setupPage(){
var content='';
result = sforce.connection.query("Select Name, Id from User");
records = result.getArray("records");
for (var i=0; i< records.length; i++) {
var record = records[i];
log(record.Name + " -- " + record.Id);
}
</script>
<body onload="setupPage();">
<div id="output"></div>
</body>
</apex:page>

I have 2 questions:
1. I want to add a break point to the scripts but I couldn't find the scripts in the chrome debug window. What's the name of the scripts that I wrote?
2. where can i see the logs specified here:
"log(record.Name + " -- " + record.Id);"


John PipkinJohn Pipkin
Lee, 

Check out this article from Chrome. You should be able to do everything with this: https://developer.chrome.com/devtools/docs/javascript-debugging
Lee SinLee Sin
Hi John,
Do you find any problem with this simple script? And where can I see the logs?
I kept getting error "setupPage() not defined".. 
John PipkinJohn Pipkin
For the log() call, put "console.log()". That works for me. 

Not exactly sure why the console is saying your function doesn't exist. Try putting the script tags at the bottom,