Category:Code snippets: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
m (Documented Core example template and how it's used.)
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
List of pages with code snippets. Browse around, you might learn something new.
List of pages with code snippets. Browse around, you might learn something new.


<pre>If you see code like this it is usually a Good example but may not be verified.</pre>
<pre class='sample-bad'>
Code samples highlighted in red like this are bad ideas.
Usually, this code does not work, and the sample is to point out _that_ this code does not work.
</pre>


{{Core example |1=<pre style="border: none; margin: inherit;">If you see code like this it is usually a verified example but may not be good practice.
<pre class='sample-good'>
This is typically used in the Greasemonkey API</pre>}}
Code samples highlighted in green, however, _do_ work.
 
They are usually presented beside the bad examples, as an idea what should be done instead.
{{Good example |1=<pre style="border: none; margin: inherit;">If you see code like this it is usually a verified Good example.</pre>}}
</pre>
 
{{Fair example |1=<pre style="border: none; margin: inherit;">If you see code like this it is usually a Fair example and may have some pitfalls.</pre>}}
 
{{Bad example |1=<pre style="border: none; margin: inherit;">If you see code like this it is usually a Bad example and may have a high security risk.</pre>}}

Latest revision as of 21:27, 3 February 2010

List of pages with code snippets. Browse around, you might learn something new.

Code samples highlighted in red like this are bad ideas.
Usually, this code does not work, and the sample is to point out _that_ this code does not work.
Code samples highlighted in green, however, _do_ work.
They are usually presented beside the bad examples, as an idea what should be done instead.

This category currently contains no pages or media.