Ignore:
Timestamp:
09/28/05 13:06:16 (14 years ago)
Author:
gocher
Message:

javascript error handler for ext_example, and two little mistakes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/ext_example-body.html

    r337 r353  
    1515 
    1616  <script type="text/javascript"> 
     17    function showError( sMsg, sUrl, sLine){ 
     18      document.getElementById('errors').value += 'Error: ' + sMsg + '\n' + 
     19                                                 'Source File: ' + sUrl + '\n' + 
     20                                                 'Line: ' + sLine + '\n'; 
     21      return false; 
     22    } 
     23    window.onerror = showError; 
     24    document.onerror = showError; 
     25 
    1726    var f = window.parent.menu.document.forms[0]; 
    1827    // You must set _editor_url to the URL (including trailing slash) where 
     
    161170      //check submitted values 
    162171      var submit = document.createElement('button'); 
    163       submit.type = "submit"; 
     172      submit.setAttribute('type', 'submit'); //submit.type = "submit"; 
    164173      submit.innerHTML = "Submit"; 
    165174      b.appendChild(submit); 
     
    172181<body> 
    173182  <form id="editors_here" method="post" action="ext_example-dest.php"> 
    174  
     183  <!-- <textarea id="errors" style="width:100%; height:100px; background:silver;display:none;"></textarea> --> 
    175184  </form> 
     185  <textarea id="errors" style="width:100%; height:100px; background:silver;"></textarea> 
    176186<script type="text/javascript"> 
    177187    var _oldSubmitHandler = null; 
Note: See TracChangeset for help on using the changeset viewer.