org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-C3AAF370-D049-475B-9D21-3CFC5C83052F.html
author Eugene Ostroukhov <eugeneo@symbian.org>
Mon, 15 Mar 2010 17:56:08 -0700
changeset 268 ef733cd772bb
parent 229 716254ccbcc0
permissions -rw-r--r--
Bug 2213 - User is not prompted to save when debug session is started


<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="copyright" content="(C) Copyright 2009"/><meta name="DC.rights.owner" content="(C) Copyright 2009"/><meta name="DC.Type" content="mobileconcept"/><meta name="DC.Title" content="onchargerconnected"/><meta name="DC.Relation" scheme="URI" content="GUID-E6C99179-3126-49F6-8E40-FB07E6FF8E38"/><meta name="DC.Relation" scheme="URI" content="GUID-7C69DDA4-16F1-4A8F-BDB2-4CB0015B4E81"/><meta name="DC.Relation" scheme="URI" content="GUID-65AAF569-D347-462B-B59A-9D7CA184AB9C"/><meta name="DC.Relation" scheme="URI" content="GUID-1A678A11-0BDD-4F64-9F40-013F6CDB81D7"/><meta name="DC.Relation" scheme="URI" content="GUID-6521F749-FA06-493B-A11D-B47F4DC0E6D6"/><meta name="DC.Format" content="XHTML"/><meta name="DC.Identifier" content="GUID-C3AAF370-D049-475B-9D21-3CFC5C83052F"/><title>onchargerconnected </title><script type="text/javascript">
      function initPage() {}
    </script><link href="../PRODUCT_PLUGIN/book.css" rel="stylesheet" type="text/css"/><link href="css/s60/style.css" rel="stylesheet" type="text/css" media="all"/></head><body onload="initPage();"><div class="body"><div class="contentLeft prTxt"><h1 class="pageHeading" id="GUID-C3AAF370-D049-475B-9D21-3CFC5C83052F">onchargerconnected</h1><div>
<p><strong>Syntax:</strong></p>
<pre class="codeblock" id="GUID-8BF1A7E6-6EC4-4E5F-9C20-7EEEE674633C">sysinfo.onchargerconnected = "chargerConnectedEventHandler()";
function chargerConnectedEventHandler()
{
  // ...
}</pre>
<p><strong>Description:</strong></p>
<p>The <code>onchargerconnected</code> property is an event handler for the event of when the charger is plugged to or unplugged from the device.</p>
<p>Since the event is fired off much faster than the value is updated, it is recommended to read the value after a small delay. See example code for illustration.</p>
<p>For more general information on power consumption and widgets, see <a href="GUID-159FCC18-2C9D-49F0-BAC1-DFEAADCF1D89.html#GUID-159FCC18-2C9D-49F0-BAC1-DFEAADCF1D89">Saving battery time</a>.</p>
<p><strong>Example code:</strong></p>
<pre class="codeblock" id="GUID-2E0CF4FA-BD27-4765-9693-A83BD67FDAD6">window.onload = function(){
  // Assign an even handler for the charger 
  sysinfo.onchargerconnected = "chargerConnectedEvent()";
}
function chargerConnectedEvent()
{
   setTimeout("readValue();", 500);
}
function readValue()
{
   if (sysinfo.chargerconnected)
      alert("Charger is connected");
   else
      alert("Charger is not connected");
}</pre>
</div></div></div><div class="footer"><hr/><div class="copy">© Nokia 2009.</div></div></body></html>