[Javascript] Firefox Prototyping -or does it?!`

Troy III Ajnej trojani2000 at hotmail.com
Sat Mar 31 00:39:42 CDT 2012


<!DOCTYPE html>
<html>
 <head>
   <title>An HTML Document</title>
   <script> String.prototype.Normalize=
 function(x){return(x||this).match(/\S+/gi).join(' ')};
 var str = " this    string has  to   many    spaces ";   </script>
 </head>
 <body class=example>
   <h1>Example</h1>
   <p>This is an example HTML document.
 </body>
</html>&lt;!DOCTYPE html&gt;
&lt;html&gt;
 &lt;head&gt;
   &lt;title&gt;An HTML Document&lt;/title&gt;
   &lt;script&gt;
     String.prototype.Normalize=
     function(x){return(x||this).match(/S+/gi).join(' ')};
     var str = ' this    string has  to   many    spaces ';
   &lt;/script&gt;
 &lt;/head&gt;
 &lt;body class=example&gt;
   &lt;h1&gt;Example&lt;/h1&gt;
   &lt;p&gt;This is an example HTML document.
 &lt;/body&gt;
&lt;/html&gt;" 
Now invoke your Firefox console 
(win: [ctrl+shift+k])type in:
str.Normailze();hit enter;
if you don't get:"TypeError: str.Normalize is not a function"I'm seeing things! But even than -it doesn't change the fact that you 
are rude or just another uneducated fan-boy that likes to insult other people. 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                Troy III
       progressive art enterprise
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 		 	   		  


More information about the Javascript mailing list