I'm looking for something cleaner than what I have pasted below, which works 
fine but I don't feel like I'm taking advantage of Prototype magic, or maybe 
 object inheritance or something.  Please offer a suggestion to improve the 
below.  End Result:  Div container with unhandled error message, some 
instructions to resolve the error, and a simple hide button (which, by the 
way, isn't working for some reason, it doesn't hide the layer).

Thanks,
Karl..

Here's the code:

      catch(e) 
      { 
            var jsfile = 'mso.Common.js';
            var routine = 'init';
            
            var errormsg = new Element('p', {color:'red', 
style:'padding:4px' }).update('Unhandled Exceptin Occurred in ' + jsfile + 
':' + routine + ' Error:  ' + e.message);  
            var instructionmsg = new Element('p', {style:'padding:4px' 
}).update('Please try a browser hard refresh, CTRL + F5 (most browsers) -- 
alternatively try another browser.  If you are still having troubles, send 
us an email:  [email protected]');
            var recommendedbrowsers = new Element('p', 
{style:'padding:4px'}).update('We recommend the following browsers: 
 Google\'s Chrome browser or FireFox.  If you have IE, please try upgrading 
to IE 9');        
            var button = new Element('button', {style:'margin-top:12px', 
onclick:'$(\'errordlg\').hide();'}).update('Close');                

            var div = new Element('div', {'id':'errordlg', 'class': 
'console', 'style':'position:absolute; padding:4px; border:solid 1pt red; 
z-index:1000; background-color:#fff; width:600px; height:200px; 
text-align:center; top:10px; left:10px;'});
            div.insert(errormsg);
            div.insert(instructionmsg);
            div.insert(recommendedbrowsers);
            div.insert(button);
            
            var body = $$('body')[0];
            
            body.insert(div);
      }  

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to