var tact = (eval("args.S_TACT") == undefined ? "" : "S_TACT=" + eval("args.S_TACT"));
In this case it is really evil, and dangerous !
specially if args is "somehow built" from document.URL
For those interested: code comes from big blue web site.
...the thoughts you may not like... ... but i want to remember ...
var tact = (eval("args.S_TACT") == undefined ? "" : "S_TACT=" + eval("args.S_TACT"));
This computer program contains valuable, confidential and proprietary
information.
IsUndefined = function (obj) { return (typeof obj == 'undefined'); }
IsNull = function (obj) { return (obj == null); }
IsValid = function (obj) { return (!IsNull(obj) && !IsUndefined(obj)); }
"Visual Studio 2010 will include more than 200 built-in snippets
that you can immediately use when you install the product."
If your not convinced that saved you that many keystrokes, theres another handy feature. See how the first "i" is highlightedCool but quite useless for while and for cycles.. but keep reading
and the second two are surrounded by dotted lines? That means that those variables are supposed to be the same - which mean
that if you edit the first "i" right after you insert the code snippet, the other "i"s change to the new name automatically.
That 'linkage' isn't kept around forever, as soon as you go and edit something other than the snippet, those dotted lines go
away and any changes that you make later on don't automatically get propagated. But pretty cool, eh?
This text is used as a shortcut for inserting the code snippet. The text value of a Shortcut element can only containfrom http://msdn.microsoft.com/en-us/library/ms171440(v=VS.80).aspx
alphanumeric characters, hyphens ( - ), and underscores ( _ ).
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Keywords>
<Keyword>construction</Keyword>
</Keywords>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>cnstr (jQuery style)</Title>
<Author>a.in.the.k</Author>
<Description>construction pattern ala jQuery</Description>
<HelpUrl>
</HelpUrl>
<Shortcut>aitkCnstr</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>cnstr</ID>
<ToolTip>cnstr</ToolTip>
<Default>cnstr</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>p</ID>
<ToolTip>p</ToolTip>
<Default>p</Default>
<Function>
</Function>
</Literal>
</Declarations>
<Code Language="jscript" Kind="type decl"><![CDATA[(function (window, undef) {
function $cnstr$($p$) {
/// <param name="$p$" type="String"></param>
/// <returns type="$cnstr$" />
return new $cnstr$.prototype.$cnstr$($p$);
}
$cnstr$.prototype = {
$cnstr$: function ($p$) {
this.$p$ = $p$;
}
};
$cnstr$.prototype.$cnstr$.prototype = $cnstr$.prototype;
// exports
window.$cnstr$ = $cnstr$;
})(window);]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>