Search completed in 1.26 seconds.
1263 results for "variable":
Your results are loading. Please wait...
CSSVariableReferenceValue.variable - Web APIs
the variable property of the cssvariablereferencevalue interface returns the custom property name of the cssvariablereferencevalue.
... syntax var variable = cssvariablereferencevalue.variable; value a usvstring beginning with -- (that is, a custom property name).
... specifications specification status comment css typed om level 1the definition of 'variable' in that specification.
Storing the information you need — Variables - Learn web development
in this article, we will get down to the real basics, looking at how to work with the most basic building blocks of javascript — variables.
... objective: to gain familiarity with the basics of javascript variables.
... what is a variable?
...And 50 more matches
Variable fonts guide - CSS: Cascading Style Sheets
variable fonts are an evolution of the opentype font specification that enables many different variations of a typeface to be incorporated into a single file, rather than having a separate font file for every width, weight, or style.
...this article will give you all you need to know to get you started using variable fonts.
... warning: in order to use variable fonts on your operating system, you need to make sure that it is up to date.
...And 22 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
in this article we'll be using variables and props to make our app dynamic, allowing us to add and delete todos, mark them as complete, and filter them by status.
...we'll also create two variables to keep track of the total number of tasks and the completed tasks.
... the state of our component will be represented by these three top-level variables.
...And 21 more matches
Sharp variables in JavaScript - Archive of obsolete content
a sharp variable is a syntax in object initializers that allows serialization of objects that have cyclic references or multiple references to the same object.
... warning: sharp variables was a non-standard syntax for creating or serializing cyclic data graphs that used to be supported only by mozilla's spidermonkey js engine.
... form sharp variables have the form of a sharp sign (#) immediately followed by one or more digits.
...And 10 more matches
NSS environment variables
note: nss environment variables are subject to be changed and/or removed from nss.
... run-time environment variables these environment variables affect the run time behavior of nss shared libraries.
... there is a separate set of environment variables that affect how nss is built, documented below.
...And 10 more matches
ReferenceError: assignment to undeclared variable "x" - JavaScript
the javascript strict mode-only exception "assignment to undeclated variable" occurs when the value has been assigned to an undeclared variable.
... message referenceerror: assignment to undeclared variable "x" (firefox) referenceerror: "x" is not defined (chrome) referenceerror: variable undefined in strict mode (edge) error type referenceerror warning in strict mode only.
... a value has been assigned to an undeclared variable.
...And 10 more matches
Makefile - variables
variable name description add_to_def_file cpp_sources cpp_unit_tests a list of source files to compile as unit tests.
... xpidl_name name of extension to build see also configure.sh variables description build_project_arg command line/environment override configure_env_args command line/environment override directory variable dirs a list of subdirectories to build recursively.
... moz_ variable description moz_auto_deps moz_build_app moz_build_projects build multiple projects in the same sandbox.
...And 9 more matches
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
custom properties (sometimes referred to as css variables or cascading variables) are entities defined by css authors that contain specific values to be reused throughout a document.
...g css: .two { --test: 10px; } .three { --test: 2em; } in this case, the results of var(--test) are: for the class="two" element: 10px for the class="three" element: 2em for the class="four" element: 10px (inherited from its parent) for the class="one" element: invalid value, which is the default value of any custom property keep in mind that these are custom properties, not actual variables like you might find in other programming languages.
... custom property fallback values using the var() function, you can define multiple fallback values when the given variable is not yet defined; this can be useful when working with custom elements and shadow dom.
...And 6 more matches
Condition Variables
this chapter describes the api for creating and destroying condition variables, notifying condition variables of changes in monitored data, and making a thread wait on such notification.
... condition variable type condition variable functions conditions are closely associated with a single monitor, which typically consists of a mutex, one or more condition variables, and the monitored data.
... the association between a condition and a monitor is established when a condition variable is created, and the association persists for its life.
...And 5 more matches
SyntaxError: missing variable name - JavaScript
the javascript exception "missing variable name" occurs way too often as naming things is so hard.
... message syntaxerror: missing variable name (firefox) syntaxerror: unexpected token = (chrome) error type syntaxerror what went wrong?
... a variable is missing a name.
...And 5 more matches
Examine, modify, and watch variables - Firefox Developer Tools
examine variables when the code has stopped at a breakpoint, you can examine its state in the variables pane of the debugger: variables are grouped by scope: in function scope you'll see the built-in arguments and this variables as well as local variables defined by the function like user and greeting.
... similarly, in global scope you'll see global variables you've defined, like greetme, as well as built-in globals like localstorage and console.
... pointing your cursor at a variable's name displays a tooltip that provides additional information about the variable.
...And 4 more matches
Test your skills: variables - Learn web development
this aim of this skill test is to assess whether you've understood our storing the information you need — variables article.
... variables 1 in this task we want you to: declare a variable called myname.
... declare a variable called myage and initialize it with a value, on the same line.
...And 3 more matches
CSSVariableReferenceValue - Web APIs
the cssvariablereferencevalue interface of the css typed object model api allows you to create a custom name for a built-in css value.
... this object functionality is sometimes called a "css variable" and serves the same purpose as the var() function.
... constructor cssvariablereferencevalue.cssvariablereferencevalue() creates a new cssvariablereferencevalue object.
...And 3 more matches
TypeError: variable "x" redeclares argument - JavaScript
the javascript strict mode-only exception "variable redeclares argument" occurs when the same variable name occurs as a function parameter and is then redeclared using a var assignment in a function body again.
... message typeerror: variable "x" redeclares argument (firefox) error type typeerror warning in strict mode only.
... the same variable name occurs as a function parameter and is then redeclared using a var assignment in a function body again.
...And 3 more matches
<xsl:variable> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementvariable
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:variable> element declares a global or local variable in a stylesheet and gives it a value.
... because xslt permits no side-effects, once the value of the variable has been established, it remains the same until the variable goes out of scope syntax <xsl:variable name=name select=expression > template </xsl:variable> required attributes name gives the variable a name.
... optional attributes select defines the value of the variable through an xpath expression.
...And 2 more matches
<var>: The Variable element - HTML: Hypertext Markup Language
WebHTMLElementvar
the html variable element (<var>) represents the name of a variable in a mathematical expression or a programming context.
...this can be overridden in css, like this: var { font: bold 15px "courier", "courier new", monospace; } examples basic example here's a simple example, using <var> to denote variable names in a mathematical equation.
...in this example, variable names are rendered using bold courier if it's available, otherwise it falls back to the default monospace font.
... css var { font: bold 15px "courier", "courier new", monospace; } html <p>the variables <var>minspeed</var> and <var>maxspeed</var> control the minimum and maximum speed of the apparatus in revolutions per minute (rpm).</p> this html uses <var> to enclose the names of two variables.
Environment variables affecting crash reporting - Archive of obsolete content
the breakpad crash reporting used in mozilla projects supports some environment variables, primarily for testing purposes.
... the following environment variables affect crash reporting: moz_crashreporter_url sets the url that the crash reporter will submit reports to.
...this variable would cause the application to close as well.
CSSVariableReferenceValue() - Web APIs
creates a new cssvariablereferencevalue.
... syntax new cssvariablereferencevalue(variable[, fallback]]) parameters variable a custom property name.
... specifications specification status comment css typed om level 1the definition of 'cssvariablereferencevalue()' in that specification.
Using addresses of stack variables with NSPR threads on win16 - Archive of obsolete content
what is a hardship is that addresses of dynamic variables, those allocated on the call stack, in a function's local frame, are not valid across thread boundaries.
...what is probably more likely to cause problems is passing addresses of automatically allocated variables to a function that wends its way though arbitrary amounts of convoluted logic, and finds its way into an object that is shared.
Global variable - MDN Web Docs Glossary: Definitions of Web-related terms
a global variable is a variable that is declared in the global scope in other words, a variable that is visible from all other scopes.
... learn more general knowledge global variable on wikipedia ...
Local variable - MDN Web Docs Glossary: Definitions of Web-related terms
a variable whose name is bound to its value only within a local scope.
... example var global = 5; //is a global variable function fun(){ var local = 10; //is a local variable } ...
Variable - MDN Web Docs Glossary: Definitions of Web-related terms
a variable is a named reference to a value.
... learn more general knowledge variable (computer science) on wikipedia technical reference declaring variables in javascript var statement in javascript ...
CSSVariableReferenceValue.fallback - Web APIs
the fallback read-only property of the cssvariablereferencevalue interface returns the custom property fallback value of the cssvariablereferencevalue.
... syntax var fallback = cssvariablereferencevalue.fallback; value a cssunparsedvalue.
Custom properties (--*): CSS variables - CSS: Cascading Style Sheets
WebCSS--*
initial valuesee proseapplies toall elementsinheritedyescomputed valueas specified with variables substitutedanimation typediscrete syntax --somekeyword: left; --somecolor: #0000ff; --somecomplexvalue: 3px 6px rgb(20, 32, 54); <declaration-value> this value matches any sequence of one or more tokens, so long as the sequence does not contain an unallowed token.
... var(--first-color); color: var(--second-color); } #secondparagraph { background-color: var(--second-color); color: var(--first-color); } #container { --first-color: #48ff32; } #thirdparagraph { background-color: var(--first-color); color: var(--second-color); } result specifications specification status comment css custom properties for cascading variables module level 1the definition of '--*' in that specification.
CSS Custom Properties for Cascading Variables - CSS: Cascading Style Sheets
css custom properties for cascading variables is a css module that allows for the creation of custom properties that can be used over and over.
... css properties --* specifications specification status comment css custom properties for cascading variables module level 1 candidate recommendation initial definition ...
NPNVariable - Archive of obsolete content
note: npnvariable != nppvariable ...
NPPVariable - Archive of obsolete content
note: nppvariable != npnvariable ...
Grammar and types - JavaScript
« previousnext » this chapter discusses javascript's basic grammar, variable declarations, data types and literals.
...for example, the word früh (which means "early" in german) could be used as a variable name.
... let früh = "foobar" but, the variable früh is not the same as früh because javascript is case sensitive.
...And 36 more matches
JavaScript basics - Learn web development
you did this by using a function called queryselector() to grab a reference to your heading, and then store it in a variable called myheading.
... following that, the code set the value of the myheading variable's textcontent property (which represents the content of the heading) to hello world!.
... variables variables are containers that store values.
...And 33 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
javascript also supports functional programming — because they are objects, functions may be stored in variables and passed around like any other object.
...d access information about the string: 'hello'.charat(0); // "h" 'hello, world'.replace('world', 'mars'); // "hello, mars" 'hello'.touppercase(); // "hello" other types javascript distinguishes between null, which is a value that indicates a deliberate non-value (and is only accessible through the null keyword), and undefined, which is a value of type undefined that indicates an uninitialized variable — that is, a value hasn't even been assigned yet.
... we'll talk about variables later, but in javascript it is possible to declare a variable without assigning a value to it.
...And 32 more matches
Index - Archive of obsolete content
107 system/environment access, set and clear environment variables.
... 418 dehydra object reference dehydra represents c++ types and variables as javascript objects.
... 443 disabling interruptible reflow add the following variables to your environment to disable gecko interruptible reflow: 444 document loading - from load start to finding a handler docshell, outdated_articles, uriloader this document describes the beginning of the document loading process.
...And 30 more matches
Functions - JavaScript
function map(f, a) { let result = []; // create a new array let i; // declare variable for (i = 0; i != a.length; i++) result[i] = f(a[i]); return result; } in the following code, the function receives a function defined by a function expression and executes it for every element of the array received as a second argument.
... function map(f, a) { let result = []; // create a new array let i; // declare variable for (i = 0; i != a.length; i++) result[i] = f(a[i]); return result; } const f = function(x) { return x * x * x; } let numbers = [0, 1, 2, 5, 10]; let cube = map(f,numbers); console.log(cube); function returns: [0, 1, 8, 125, 1000].
... function scope variables defined inside a function cannot be accessed from anywhere outside the function, because the variable is defined only in the scope of the function.
...And 30 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
now we will see how components can also expose methods and variables.
...'check' : 'uncheck'} all</button> <button type="button" class="btn btn__primary" on:click={removecompleted}>remove completed</button> </div> we've also included a completed variable to toggle between checking and unchecking all tasks.
... sometimes svelte cannot detect changes to variables being watched.
...And 27 more matches
nsIXULTemplateQueryProcessor
the template builder will supply two variables, the reference variable and the member variable to further indicate what part of the datasource is to be examined in addition to the query itself.
...for instance, when examining an xml source, an xml query processor might begin at the node referred by the reference variable and end at a list of that node's children.
... some queries may not need the reference variable if the syntax or the form of the data implies the value.
...And 21 more matches
Index - Web APIs
WebAPIIndex
it consists of a list of string fragments and variable references.
... 498 cssvariablereferencevalue api, css typed object model api, cssvariablereferencevalue, experimental, houdini, interface, reference the cssvariablereferencevalue interface of the css typed object model api allows you to create a custom name for a built-in css value.
... this object functionality is sometimes called a "css variable" and serves the same purpose as the var() function.
...And 21 more matches
Closures - JavaScript
lexical scoping consider the following example code: function init() { var name = 'mozilla'; // name is a local variable created by init function displayname() { // displayname() is the inner function, a closure alert(name); // use variable declared in the parent function } displayname(); } init(); init() creates a local variable called name and a function called displayname().
...note that the displayname() function has no local variables of its own.
... however, since inner functions have access to the variables of outer functions, displayname() can access the variable name declared in the parent function, init().
...And 21 more matches
var - JavaScript
the var statement declares a function-scoped or globally-scoped variable, optionally initializing it to a value.
...[, varnamen [= valuen]]]; varnamen variable name.
... valuen optional initial value of the variable.
...And 21 more matches
Advanced Rules - Archive of obsolete content
it specifies the name of a variable in which is placed a reference to the root resource while the conditions are analyzed for a match.
...the syntax of the content element is as follows: <content uri="?var"/> the question mark indicates that the text following it is a variable.
... you can then use the variable 'var' within the remainder of the conditions.
...And 19 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
arrays are used to store multiple values in a single variable.
... this is compared to a variable that can store only one value.
...with variables, on the other hand, the programmer can assign a new value to a variable name already in use.
...And 19 more matches
TypeScript support in Svelte - Learn web development
type inference: enables you to take advantage of many typescript features even without declaring variable types.
...==================================== ./svelte-todo-typescript/src/components/alert.svelte:8:7 warn: variable 'visible' implicitly has an 'any' type, but a better type may be inferred from usage.
... (ts) let visible ./svelte-todo-typescript/src/components/alert.svelte:9:7 warn: variable 'timeout' implicitly has an 'any' type, but a better type may be inferred from usage.
...And 19 more matches
Bytecode Descriptions
this is how we implement typeof step 2, making typeof nonexistingvariable return "undefined" instead of throwing a referenceerror.
... variables and scopes initialization uninitialized stack: ⇒ uninitialized push magicvalue(js_uninitialized_lexical), a magic value used to mark a binding as uninitialized.
...nonsyntacticvariablesobjects break this optimization, so if the current script has a non-syntactic global scope, this acts like jsop::getname.
...And 19 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
it's mission is to enable completely automatic configuration of mozilla's apps preferences based on users properties either retrieved from system environement variables or on an organisation ldap directory.
...this centralized preference file can lock preferences (lockpref) or initialize them (defaultpref) based on environment variables (user, home...) and/or ldap queries (fetch email address, common name , language, homepage etc...) from the enterprise directory.
... thunderbird.cfg (version 1) here's the complete file, first we get the user login name from environment variables, then configure the ldap address book, create an email account, and configure imap and smtp: [root@calaz /usr/lib/thunderbird] $ cat thunderbird.cfg //put everything in a try/catch try { // 1) env variables if(getenv("user") != "") { // *nix settings var env_user = getenv("user"); var env_home = getenv("home"); } else { // windows settings var env_user = getenv("username"); var env...
...And 18 more matches
Dehydra Object Reference - Archive of obsolete content
introduction dehydra represents c++ types and variables as javascript objects.
... variable objects dehydra presents ast nodes as variables.
... these types are used to represent variables, functions, assignments, etc.
...And 18 more matches
Template Logging - Archive of obsolete content
no member variable found.
... action body should have an element with uri attribute the member variable could not be determined.
...either way, the member variable isn't known so it isn't clear what value to use for each generated result id.
...And 16 more matches
A first splash into JavaScript - Learn web development
the place where we'll be adding all our code is inside the <script> element at the bottom of the html: <script> // your javascript goes here </script> adding variables to store our data let's get started.
...er = math.floor(math.random() * 100) + 1; const guesses = document.queryselector('.guesses'); const lastresult = document.queryselector('.lastresult'); const loworhi = document.queryselector('.loworhi'); const guesssubmit = document.queryselector('.guesssubmit'); const guessfield = document.queryselector('.guessfield'); let guesscount = 1; let resetbutton; this section of the code sets up the variables and constants we need to store the data our program will use.
... variables are basically containers for values (such as numbers, or strings of text).
...And 16 more matches
Strict mode - JavaScript
this eliminates the concatenation problem and it means that you have to explicitly export any shared variables out of the function scope.
...changes generally fall into these categories: changes converting mistakes into errors (as syntax errors or at runtime), changes simplifying how the particular variable for a given use of a name is computed, changes simplifying eval and arguments, changes making it easier to write "secure" javascript, and changes anticipating future ecmascript evolution.
... first, strict mode makes it impossible to accidentally create global variables.
...And 15 more matches
Additional Navigation - Archive of obsolete content
« previousnext » retrieving literals the triples used so far have all had variables in both the subject and object.
...here is an example triple that we could use in the photos example: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="canal"/> </query> this new triple has a static value for the object attribute instead of a variable reference.
...for the first result, the value of the ?photo variable 'http://www.xulplanet.com/ndeakin/images/t/palace.jpg' will be used as the subject, the predicate will be 'http://purl.org/dc/elements/1.1/title', and the object will be 'canal'.
...And 14 more matches
Attribute Substitution - Archive of obsolete content
« previousnext » so far, attribute replacement in an action body has been used to replace an entire attribute with the value of a variable.
... however, you may also replace only part of attribute's value, or use multiple variables in one attribute.
... for instance, to include a prefix before a variable value, you can use: <label value="my name is ?name"/> the effect will be that the ?name part of the attribute will be replaced by the value of the variable ?name.
...And 14 more matches
How Mozilla's build system works
make echo-variable-static_dirs show the list of static source directories to iterate over, as determined by the tier list.
... assigning to a well-defined set of variables whose name is uppercase.
... creating new variables whose name is not uppercase (this includes defining functions).
...And 13 more matches
lang/type - Archive of obsolete content
let { isundefined } = require('sdk/lang/type'); var foo; isundefined(foo); // true isundefined(0); // false parameters value : mixed the variable to check.
... let { isnull } = require('sdk/lang/type'); isnull(null); // true isnull(false); // false parameters value : mixed the variable to check.
... let { isstring } = require('sdk/lang/type'); isstring('my string'); // true isstring(100); // false isstring('100'); // true parameters value : mixed the variable to check.
...And 12 more matches
RDF Modifications - Archive of obsolete content
effectively, if the result generation process was to evaluate this member statement, the same output would be supplied for the ?photo variable whether the new data is there or not.
...the subject and object are variables so the builder accepts this as a possible change, and moves on to the next step.
...similarly, if the triple didn't use a variable but a static value, this value would also need to match in order to continue processing.
...And 12 more matches
Basic math in JavaScript — numbers and operators - Learn web development
first of all, let's declare a couple of variables and initialize them with an integer and a float, respectively, then type the variable names back in to check that everything is in order: let myint = 5; let myfloat = 6.667; myint; myfloat; number values are typed in without quote marks — try declaring and initializing a couple more variables containing numbers before you move on.
... now let's check that both our original variables are of the same datatype.
... first try entering some simple examples of your own, such as 10 + 7 9 * 8 60 % 3 you can also try declaring and initializing some numbers inside variables, and try using those in the sums — the variables will behave exactly like the values they hold for the purposes of the sum.
...And 12 more matches
Rhino scopes and contexts
execution of scripts requires a scope for top-level script variable storage as well as a place to find standard objects like function and object.
...if two scripts use the same scope simultaneously, the scripts are responsible for coordinating any accesses to shared variables.
...in general, variables are looked up by starting at the current variable object (which is different depending on what code is being executed in the program), traversing its prototype chain, and then traversing the parent chain.
...And 12 more matches
Parser API
interface forstatement <: statement { type: "forstatement"; init: variabledeclaration | expression | null; test: expression | null; update: expression | null; body: statement; } a for statement.
... interface forinstatement <: statement { type: "forinstatement"; left: variabledeclaration | expression; right: expression; body: statement; each: boolean; } a for/in statement, or, if each is true, a for each/in statement.
... interface forofstatement <: statement { type: "forofstatement"; left: variabledeclaration | expression; right: expression; body: statement; } a for/of statement.
...And 12 more matches
Edit fonts - Firefox Developer Tools
this tool contains several useful features for viewing and manipulating fonts applied to any document loaded in the browser including inspection of all fonts applied to the page, and precise adjustment of variable font axis values.
...for non-variable fonts the slider ranges from 100 to 900 in increments of 100.
... note: for variable fonts (see below) that define a wght variation axis, this range is custom.
...And 12 more matches
let - JavaScript
the let statement declares a block-scoped local variable, optionally initializing it to a value.
... syntax let var1 [= value1] [, var2 [= value2]] [, ..., varn [= valuen]; parameters var1, var2, …, varn the names of the variable or variables to declare.
... value1, value2, …, valuen optional for each variable declared, you may optionally specify its initial value to any legal javascript expression.
...And 12 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
920 additional navigation xul, xul_template_guide the triples used so far have all had variables in both the subject and object.
... 922 attribute substitution xul, xul_template_guide the effect will be that the ?name part of the attribute will be replaced by the value of the variable ?name.
...you can include multiple variables in one attribute if desired: 923 bindings xul, xul_template_guide we can add more triples to the previous example to show more information.
...And 11 more matches
Silly story generator - Learn web development
objective: to test comprehension of javascript fundamentals, such as variables, numbers, operators, strings, and arrays.
... initial variables and functions: in the raw text file, copy all of the code underneath the heading "1.
... complete variable and function definitions" and paste it into the top of the main.js file.
...And 11 more matches
Useful string methods - Learn web development
when you create a string, for example by using let string = 'this is my string'; your variable becomes a string object instance, and as a result has a large number of properties and methods available to it.
... retrieving a specific string character on a related note, you can return any character inside a string by using square bracket notation — this means you include square brackets ([]) on the end of your variable name.
...to actually update the value of the browsertype variable in a real program, you'd have to set the variable value to be the result of the operation; it doesn't just update the substring value automatically.
...And 11 more matches
Componentizing our Svelte app - Learn web development
f all, we need to import it — add the following line at the top of the todos.svelte <script> section: import filterbutton from './filterbutton.svelte' now, replace the filters <div> with a call to the filterbutton component, which takes the current filter as a prop — the below line is all you need: <filterbutton {filter} /> note: remember that when the html attribute name and variable matches, they can be replaced with {variable}, that's why we could replace <filterbutton filter={filter} /> with <filterbutton {filter} />.
...that's because the filter variable flows down from the todos component to the filterbutton component through the prop, but changes occurring in the filterbutton component don't flow back up to its parent — the data binding is one-way by default.
... we will just declare the onclick prop assigning a dummy handler to prevent errors, like this: export let onclick = (clicked) => {} and we'll declare the following reactive statement — $: onclick(filter) — to call the onclick handler whenever the filter variable is updated.
...And 11 more matches
RDF Query Syntax - Archive of obsolete content
the seed result will be created like this: (?start = http://www.xulplanet.com/rdf/a) the variable ?start is determined from the tag's 'uri' attribute.
... you can use any variable you want; it's common to use the variable ?uri.
... however, all rules must use the same starting point variable.
...And 10 more matches
JS::Add*Root
this article covers features introduced in spidermonkey 31 register a variable as a member of the garbage collector's root set, to protect anything the root points at from garbage collection.
... vp js::heap<js::value> the address of the js::value variable to root.
... rp js::heap<jsstring *> the address of the jsstring * variable to root.
...And 10 more matches
nsIEnvironment
getservice(components.interfaces.nsienvironment); method overview void set(in astring aname, in astring avalue); astring get(in astring aname); boolean exists(in astring aname); methods set() set the value of an environment variable.
... void set( in astring aname, in astring avalue ); parameters aname the variable name to set.
... get() get the value of an environment variable.
...And 10 more matches
Web video codec guide - Web media technologies
these blocks are normally of a fixed size, in a grid, but there are forms of motion compensation that allow for variable block sizes, and even for blocks to overlap.
... profile color depths chroma subsampling main 8 or 10 4:0:0 (greyscale) or 4:2:0 high 8 or 10 4:0:0 (greyscale), 4:2:0, or 4:4:4 professional 8, 10, or 12 4:0:0 (greyscale), 4:2:0, 4:2:2, or 4:4:4 hdr support yes variable frame rate (vfr) support yes browser compatibility feature chrome edge firefox internet explorer opera safari av1 support 70 75 67 no 57 no container support isobmff[1], mpeg-ts, mp4, webm rtp / webrtc compatib...
... high 10 (hi10p) 8 to 10 4:0:0 (greyscale) and 4:2:0 high 4:2:2 (hi422p) 8 to 10 4:0:0 (greyscale), 4:2:0, and 4:2:2 high 4:4:4 predictive 8 to 14 4:0:0 (greyscale), 4:2:0, 4:2:2, and 4:4:4 hdr support yes; hybrid log-gamma or advanced hdr/sl-hdr; both are part of atsc variable frame rate (vfr) support yes browser compatibility feature chrome edge firefox internet explorer opera safari avc/h.264 support 4 12 35[1] 9 25 3.2 container support 3gp, mp4, webm rtp / webrtc compatible ye...
...And 10 more matches
MMgc - Archive of obsolete content
alloc is often used to allocate arrays and other objects of variable size that contain gc pointers or are otherwise desirable to have in managed memory.
...it must be used on a pointer to a gcobject/gcfinalizedobject, when that pointer is a member variable of a class derived from gcobject/gcfinalizedobject/rcobject/rcfinalizedobject.
...it must be used on a pointer to a rcobject/rcfinalizedobject, when that pointer is a member variable of a c++ class in unmanaged memory.
...And 9 more matches
Paddle and keyboard controls - Game development
let's define a few variables for that.
... add the following variables near the top of your code, beside your other variables: var paddleheight = 10; var paddlewidth = 75; var paddlex = (canvas.width-paddlewidth) / 2; here we're defining the height and width of the paddle and its starting point on the x axis for use in calculations further on down the code.
...we will need the following: two variables for storing information on whether the left or right control button is pressed.
...And 9 more matches
Functions — reusable blocks of code - Learn web development
you can also assign an anonymous function to be the value of a variable, for example: const mygreeting = function() { alert('hello'); } this function could now be invoked using: mygreeting(); this effectively gives the function a name; you can also assign the function to be the value of multiple variables, for example: let anothergreeting = mygreeting; this function could now be invoked using either of: mygreeting(); anothergreeting(); but this would just b...
...when you create a function, the variables and other things defined inside the function are inside their own separate scope, meaning that they are locked away in their own separate compartments, unreachable from code outside the functions.
...sometimes you don't want variables to be accessible from everywhere in the code — external scripts that you call in from elsewhere could start to mess with your code and cause problems because they happen to be using the same variable names as other parts of the code, causing conflicts.
...And 9 more matches
The Firefox codebase: CSS Guidelines
using css variables adding new variables before adding new css variables, please consider the following questions: is the variable value changed at runtime?
... (either from javascript or overriden by another css file) if the answer is no, consider using a preprocessor variable or simply inlining the value.
... is the variable value used multiple times?
...And 9 more matches
JSAPI User Guide
a jsruntime, or runtime, is the space in which the javascript variables, objects, scripts, and contexts used by your application are allocated.
...lastly, the global object contains all the classes, functions, and variables that are available for javascript code to use.
...then it adds whatever custom classes, functions, and variables (like window) the application wants to provide; see custom objects below.
...And 9 more matches
JS_Add*Root
register a variable as a member of the garbage collector's root set, to protect anything the root points at from garbage collection.
... vp jsval * (in js_addvalueroot and js_addnamedvalueroot) the address of the jsval variable to root spp jsstring ** (in js_addstringroot and js_addnamedstringroot) the address of the jsstring* variable to root opp jsobject ** (in js_addobjectroot and js_addnamedobjectroot) the address of the jsobject* variable to root rp void ** (in js_addgcthingroot and js_addnamedgcthingroot) the address of the jsstring* or jsobject* (not jsval) variable to...
... description the js_add*root and functions add a c/c++ variable to the garbage collector's root set, the set of variables used as starting points each time the collector checks to see what memory is reachable.
...And 9 more matches
Destructuring assignment - JavaScript
the destructuring assignment syntax is a javascript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.
... const x = [1, 2, 3, 4, 5]; the destructuring assignment uses similar syntax, but on the left-hand side of the assignment to define what values to unpack from the sourced variable.
... examples array destructuring basic variable assignment const foo = ['one', 'two', 'three']; const [red, yellow, green] = foo; console.log(red); // "one" console.log(yellow); // "two" console.log(green); // "three" assignment separate from declaration a variable can be assigned its value via destructuring separate from the variable's declaration.
...And 9 more matches
Actions - Archive of obsolete content
the uri attribute on the button is used to specify the ending or member variable.
... in this example, there's only one variable to use, ?relateditem, since ?start is the starting point and the start and end points cannot be the same.
...the id attribute of the new element will be set to the same value of the member variable, ?relateditem.
...And 8 more matches
Making decisions in your code — conditionals - Learn web development
if you help me by going and doing the shopping, i'll give you some extra allowance so you can afford that toy you wanted." in javascript, we could represent this like so: let shoppingdone = false; if (shoppingdone === true) { let childsallowance = 10; } else { let childsallowance = 5; } this code as shown always results in the shoppingdone variable returning false, meaning disappointment for our poor child.
... it'd be up to us to provide a mechanism for the parent to set the shoppingdone variable to true if the child did the shopping.
... when this function is run, we first set a variable called choice to the current value selected in the <select> element.
...And 8 more matches
Test your skills: Math - Learn web development
so, try updating the live code below to recreate the finished example, following these steps: create four variables that contain numbers.
... call the variables something sensible.
... add the first two variables together and store the result in another variable.
...And 8 more matches
Getting started with React - Learn web development
note that there is no variable name and no from directive.
...whereas most of the javascript community prefers camel-case names like helloworld, react components use pascal-case variable names, like helloworld, to make it clear that a given jsx element is a react component, and not a regular html tag.
... your final index.js file should look like this: import react from 'react'; import reactdom from 'react-dom'; import './index.css'; import app from './app'; reactdom.render(<app />, document.getelementbyid('root')); variables and props next, we'll use a few of our javascript skills to get a bit more comfortable editing components and working with data in react.
...And 8 more matches
Creating localizable web applications
take advantage of printf() (or equivalents) and use variables in the english strings.
...after that, it is tempting to use the $category or $tab variables in the interface.
...printf( /* l10n: %s is a date */ _("<strong>added:</strong> %s"), $persona['date']);?></p> the first bad snippet puts the <strong/> html elements inside the gettext function call and concatenates the $persona['date'] variable to it.
...And 8 more matches
Avoiding leaks in JavaScript XPCOM components
basics of memory management creating objects that are not a fixed size for the lifetime of the program (global variables) or a fixed size for the lifetime of a function (stack variables) requires a system for dynamic memory allocation: a system that allocates memory from a space called the heap.
...the roots include things like global variables and variables on the current call stack.
...for example, if an object's constructor adds the object to a list that is reachable from a global variable and nothing ever removes it from the list, the object will never be destroyed since it is always reachable from the list.
...And 8 more matches
Debugger.Environment - Firefox Developer Tools
a debugger.environment instance represents a lexical environment, associating names with variables.
... each debugger.frame instance representing a debuggee frame has an associated environment object describing the variables in scope in that frame; and each debugger.object instance representing a debuggee function has an environment object representing the environment the function has closed over.
...we say an environmentbinds an identifier if that environment itself associates the identifier with a variable, independently of its outer environments.
...And 8 more matches
WebGLRenderingContext.getUniformLocation() - Web APIs
part of the webgl api, the webglrenderingcontext method getuniformlocation() returns the location of a specific uniform variable which is part of a given webglprogram.
... the uniform variable is returned as a webgluniformlocation object, which is an opaque identifier used to specify where in the gpu's memory that uniform variable is located.
... syntax webgluniformlocation = webglrenderingcontext.getuniformlocation(program, name); parameters program the webglprogram in which to locate the specified uniform variable.
...And 8 more matches
Running Tamarin performance tests - Archive of obsolete content
running the performance tests requires the following steps: set the avm environment variable to the path of the avmshell executable.
... set the builtinabc environment variable to the path of the builtin.abc.
... (in the tamarin-redux/generated directory) set the shellabc environment variable to the path of the shell_toplevel.abc.
...And 7 more matches
Additional Template Attributes - Archive of obsolete content
declaring the container and member variables normally, the container and member variables are determined by the template builder automatically.
... the container or starting node variable is specified in the <content> tag inside a query, while the member variable is determined by the value of the uri attribute inside the action body.
... it is also possible to be explicit about the two variables by using two attributes on the <template> element.
...And 7 more matches
Multiple Rule Example - Archive of obsolete content
planet.com/ndeakin/images/t/palace.jpg, ?phototitle = palace from above) (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/canal.jpg, ?phototitle = canal) (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg, ?phototitle = obelisk) the first result matches the first rule and contains variables for the two additional predicates that were examined in the conditions.
... since the second rule doesn't refer to these variables, they will not be filled in.
... although the canal photo has a date, the second rule doesn't use it, so you cannot refer to the ?date variable in this rule.
...And 7 more matches
Simple Example - Archive of obsolete content
<query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> </query> the seed is set in a similar manner as the previous examples, effectively creating a single result with the ?start variable set to the reference resource 'http://www.xulplanet.com/rdf/myphotos'.
... the same starting variable is used in this example, but you can of course use any variable you wish.
...first, any known variables are filled into the member statement for the current result.
...And 7 more matches
XUL Template Primer - Bindings - Archive of obsolete content
the <bindings> element is used to create additional,optional variable bindings, in addition to those that are specified in a rule's <conditions>.
... this is different from the variables specified in the rule's conditions, where a value must be found for each variable for the rule to match.
... at least one of the <binding> elements must have a subject variable that appears in the <conditions>: this variable is the "hook" that is used to bootstrap the binding.
...And 7 more matches
Index - Learn web development
you can even create your own objects to encapsulate related functions and variables into efficient packages and act as handy data containers.
...you should also appreciate that objects are very useful as structures for storing related data and functionality — if you tried to keep track of all the properties and methods in our person object as separate variables and functions, it would be inefficient and frustrating, and we'd run the risk of clashing with other variables and functions that have the same names.
... 75 javascript first steps arrays, article, assessment, beginner, codingscripting, guide, javascript, landing, module, numbers, operators, variables, l10n:priority, maths, strings in our first javascript module, we first answer some fundamental questions such as "what is javascript?", "what does it look like?", and "what can it do?", before moving on to taking you through your first practical experience of writing javascript.
...And 7 more matches
Drawing graphics - Learn web development
you'll also see that we are chaining assignments together with multiple equals signs — this is allowed in javascript, and it is a good technique if you want to make multiple variables all equal to the same value.
... we wanted to make the canvas width and height easily accessible in the width/height variables, as they are useful values to have available for later (for example, if you want to draw something exactly halfway across the width of the canvas).
...the ctx variable now contains a canvasrenderingcontext2d object, and all drawing operations on the canvas will involve manipulating this object.
...And 7 more matches
Handling text — strings in JavaScript - Learn web development
creating a string to start with, enter the following lines: let string = 'the revolution will not be televised.'; string; just like we did with numbers, we are declaring a variable, initializing it with a string value, and then returning the value.
...try entering the following lines: let badstring = this is a test; let badstring = 'this is a test; let badstring = this is a test'; these lines don't work because any text without quotes around it is assumed to be a variable name, property name, a reserved word, or similar.
... the following will work if you previously defined the variable string — try it now: let badstring = string; badstring; badstring is now set to have the same value as string.
...And 7 more matches
Working with Svelte stores - Learn web development
we then create a local variable named alertcontent.
... remember that we can access top-level variables from the markup, and whenever they are modified the dom will update accordingly.
...in the callback function we just assign the value we receive to the local variable, which will trigger the update of the component's dom.
...And 7 more matches
Refcount tracing and balancing
how to run with refcount tracing on there are several environment variables that can be used.
... first, you select one of three environment variables to choose what kind of logging you want.
... note: due to an issue with the sandbox on windows (bug 1345568), refcount logging currently requires the moz_disable_content_sandbox environment variable to be set.
...And 7 more matches
Introduction to NSPR
nspr recognizes only two areas where a thread may be interrupted: waiting on a condition variable and waiting on i/o.
... in nspr, a mutual exclusion lock (or mutex) of type prlock controls locking, and associated condition variables of type prcondvar communicate changes in state among threads.
... locks and monitors in general, a monitor is a conceptual entity composed of a mutex, one or more condition variables, and the monitored data.
...And 7 more matches
Index
the common structure to store such an untyped block is secitem, which contains a size and an untyped c pointer variable.
...two variables can be used in the relative path: %root% and %temp%.
...for example: modutil -create -dbdir sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent.
...And 7 more matches
nss tech note8
since nss 1.0, up until nss 3.4, there were two global variables that contained the expected session lifetimes for ssl2 and ssl3 sessions.
... extern pruint32 ssl_sid_timeout; (the ssl2 session lifetime) extern pruint32 ssl3_sid_timeout; (the ssl3 session lifetime) each of these variables applied to both client and server sessions.
... these two variables were private, declared in a private header file.
...And 7 more matches
nsIXULTemplateResult
each result also contains a set of variable bindings.
... the value for a particular variable may be retrieved using the getbindingfor() and getbindingobjectfor() methods.
... methods getbindingfor() get the string representation of the value of a variable for this result.
...And 7 more matches
EventTarget.addEventListener() - Web APIs
that means that the variables and constants available to the containing function are also available to the event handler when using an arrow function.
... getting data into an event listener using "this" as mentioned above, you can use function.prototype.bind() to pass a value to an event listener via the this reference variable.
... getting data into an event listener using the outer scope property when an outer scope contains a variable declaration (with const, let), all the inner functions declared in that scope have access to that variable (look here for information on outer/inner functions, and here for information on variable scope).
...And 7 more matches
Functions - JavaScript
however, object references are values, too, and they are special: if the function changes the referred object's properties, that change is visible outside the function, as shown in the following example: /* declare the function 'myfunc' */ function myfunc(theobject) { theobject.brand = "toyota"; } /* * declare variable 'mycar'; * create and initialize a new object; * assign reference to it to 'mycar' */ var mycar = { brand: "honda", model: "accord", year: 1998 }; /* logs 'honda' */ console.log(mycar.brand); /* pass object reference to the function */ myfunc(mycar); /* * logs 'toyota' as the value of the 'brand' property * of the object, as changed to by the function.
...expression compare the following: a function defined with the function constructor assigned to the variable multiply: var multiply = new function('x', 'y', 'return x * y'); a function declaration of a function named multiply: function multiply(x, y) { return x * y; } // there is no semicolon here a function expression of an anonymous function assigned to the variable multiply: var multiply = function(x, y) { return x * y; }; a function expression of a function named func_name assigned to ...
...the variable multiply: var multiply = function func_name(x, y) { return x * y; }; differences all do approximately the same thing, with a few subtle differences: there is a distinction between the function name and the variable the function is assigned to.
...And 7 more matches
eval() - JavaScript
the expression can include variables and properties of existing objects.
...for example, suppose you have a variable x.
... you can postpone evaluation of an expression involving x by assigning the string value of the expression, say "3 * x + 2", to a variable, and then calling eval() at a later point in your script.
...And 7 more matches
Web audio codec guide - Web media technologies
supported bit rates arbitrary, up to 512 kbps variable bit rate (vbr) support yes supported sample formats 32-bit integer supported sample rates 8 khz - 96 khz recommended minimum bit rate for stereo sound 96 kbps at 48 khz sample rate compression lossy maximum audio channels 48 (plus 16 low frequency enhancement channels) audio frequency bandwidth 0 hz - 96 khz (standard aud...
... supported bit rates based on the sample format and sample rate, as well as the compression level variable bit rate (vbr) support no supported sample formats 16-bit, 20-bit, 24-bit, and 32-bit integer supported sample rates 1 hz to 384,000 hz recommended minimum bit rate for stereo sound n/a compression lossless; up to 45-60% maximum audio channels 8 (up to 7.1 surround) audio frequency bandwidth ?
... supported bit rates half rate (hr) and full rate (fr): 1.8 kbps, 4.75 kbps, 5.15 kbpz, 5.9 kbps, 6.7 kbps, 7.4 kbps, 7.95 kbps full rate (fr) only: 10.2 kbps and 12.2 kbps variable bit rate (vbr) support no supported sample formats 13-bit integer supported sample rates 8 khz recommended minimum bit rate for stereo sound n/a compression lossy maximum audio channels 1 audio frequency bandwidth 200 hz to 3,400 hz latency 25 ms browser compatibility feat...
...And 7 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
use the dist_files variable in the makefile to tell make to copy the file into the extension directory and (optional) xpi file.
...if so, try setting the moz_no_remote environment variable to "1" before running the development version of firefox.
...the makefiles in the base/ and advanced/ directories should look more or less like your original root makefile, remembering to change the depth variable to account for the fact that they've moved a level further away from the mozilla root.
...And 6 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
then you simply write variable names and the sentences or words that should appear to the final user.
... figure out javascript skeleton decide on method names and variable names for each of the processes you’ll need to implement these features, and put them into an overlay.js file.
...ar: function(event) { }, // dynamically generate menu items (event handler) createmenu: function(event) { }, // read file _readfile: function(afile) { }, // write file _writefile: function(afile, adata) { }, }; window.addeventlistener("load", function(){ gsessionstore.init(); }, false); window.addeventlistener("unload", function(){ gsessionstore.uninit(); }, false); wrap methods and variables as properties of objects you’ll note that in listing 15, i’ve defined a lot of different methods and variables as properties of a single object, gsessionstore.
...And 6 more matches
Sorting Results - Archive of obsolete content
to do this, place a sort attribute on a treecol element referring to the variable to sort by for that column.
... <treecol id="name" label="name" sort="?name" flex="1"/> <treecol id="date" label="date" sort="?date" flex="1"/> in this example, the first column will be sorted by the ?name variable and the second column by the ?date variable.
...the sort attribute should be set to the variable that holds the values to sort by.
...And 6 more matches
Implementing controls using the Gamepad API - Game development
the code explained below is from the full version of the hungry fridge game, but it's almost identical to the one from the demo — the only difference is that the full version uses the turbo variable to decide whether or not the game will be launched using super turbo mode.
... both functions are fairly simple: connect: function(evt) { gamepadapi.controller = evt.gamepad; gamepadapi.turbo = true; console.log('gamepad connected.'); }, the connect() function takes the event as a parameter and assigns the gamepad object to the gamepadapi.controller variable.
...(we could use the gamepad.connected boolean for this purpose, but we wanted to have a separate variable for turning on turbo mode without needing to have a gamepad connected, for reasons explained above.) disconnect: function(evt) { gamepadapi.turbo = false; delete gamepadapi.controller; console.log('gamepad disconnected.'); }, the disconnect function sets the gamepad.turbo property to false and removes the variable containing the gamepad object.
...And 6 more matches
Third-party APIs - Learn web development
for example: let map = l.mapquest.map('map', { center: [53.480759, -2.242631], layers: l.mapquest.tilelayer('map'), zoom: 12 }); here we are creating a variable to store the map information in, then creating a new map using the mapquest.map() method, which takes as its parameters the id of a <div> element you want to display the map in ('map'), and an options object containing the details of the particular map we want to display.
...initially the <script> element contains a number of variables needed for the setup of the example; below we'll fill in the required functionality.
...we start off by assembling the parts we deem as mandatory for this demo: the base url (taken from the baseurl variable).
...And 6 more matches
Working with JSON - Learn web development
", "damage resistance", "superhuman reflexes" ] }, { "name": "eternal flame", "age": 1000000, "secretidentity": "unknown", "powers": [ "immortality", "heat immunity", "inferno", "teleportation", "interdimensional travel" ] } ] } if we loaded this object into a javascript program, parsed in a variable called superheroes for example, we could then access the data inside it using the same dot/bracket notation we looked at in the javascript object basics article.
... for example, to access the third superpower of the second hero listed in the members list, you'd do this: superheroes['members'][1]['powers'][2] first we have the variable name — superheroes.
... note: we've made the json seen above available inside a variable in our jsontest.html example (see the source code).
...And 6 more matches
Getting started with Svelte - Learn web development
variables declared (or imported) at the top level are 'visible' from the component's markup.
... top-level variables is the way svelte handles the component state, and they are reactive by default.
... <script> export let name; </script> svelte uses the export keyword to mark a variable declaration as a property (or prop), which means it becomes accessible to consumers of the component (e.g.
...And 6 more matches
Setting up your own test automation environment - Learn web development
add the chromedriver and geckodriver driver's location to your system path variable.
... to set your path variable on mac os x/most linux systems: open your .bash_profile (or .bashrc) file (if you can't see hidden files, you'll need to display them, see show/hide hidden files in mac os x or show hidden folders in ubuntu).
... check that your new paths are in the path variable by entering the following into your terminal: echo $path you should see it printed out in the terminal.
...And 6 more matches
Debugging on Windows
command line parameters and environment variables vc++ 6.0: to change or set the command line options, go to project > settings..., debug tab and select general from the drop down list.
...vc 8 also allows you to set environment variables there.
... customizing the debugger's variable value view you can customize how visual c++ displays classes in the variable view.
...And 6 more matches
Build instructions
numerous optional features of nss builds are controlled through make variables.
...make variables may be set on the gmake command line, e.g., gmake variable=value variable=value target1 target2 or defined in the environment, e.g.
... (for posix shells), variable=value; export variable gmake target1 target2 here are some (not all) of the make variables that affect nss builds: build_opt: if set to 1, means do optimized non-debug build.
...And 6 more matches
Index - Firefox Developer Tools
19 debugger.environment a debugger.environment instance represents a lexical environment, associating names with variables.
... each debugger.frame instance representing a debuggee frame has an associated environment object describing the variables in scope in that frame; and each debugger.object instance representing a debuggee function has an environment object representing the environment the function has closed over.
... 30 devtoolscolors css this chart lists colors and css variables as implemented in the dark theme and light theme for developer tools.
...And 6 more matches
WebGLRenderingContext - Web APIs
webglrenderingcontext.bindattriblocation() binds a generic vertex index to a named attribute variable.
... webglrenderingcontext.getactiveattrib() returns information about an active attribute variable.
... webglrenderingcontext.getactiveuniform() returns information about an active uniform variable.
...And 6 more matches
font-variation-settings - CSS: Cascading Style Sheets
the font-variation-settings css property provides low-level control over variable font characteristics, by specifying the four letter axis names of the characteristics you want to vary, along with their values.
... syntax /* use the default settings */ font-variation-settings: normal; /* set values for variable font axis names */ font-variation-settings: "xhgt" 0.7; /* global values */ font-variation-settings: inherit; font-variation-settings: initial; font-variation-settings: unset; values this property's value can take one of two forms: normal text is laid out using default settings.
... <string> <number> when rendering text, the list of variable font axis names is passed to the text layout engine to enable or disable font features.
...And 6 more matches
Expressions and operators - JavaScript
arithmetic operators an arithmetic operator takes numerical values (either literals or variables) as their operands and returns a single numerical value.
...'adult' : 'minor'; this statement assigns the value "adult" to the variable status if age is eighteen or more.
...this operator is primarily used inside a for loop, to allow multiple variables to be updated each time through the loop.
...And 6 more matches
Working with objects - JavaScript
a property of an object can be explained as a variable that is attached to the object.
... object properties are basically the same as ordinary javascript variables, except for the attachment to objects.
...you access the properties of an object with a simple dot-notation: objectname.propertyname like all javascript variables, both the object name (which could be a normal variable) and property name are case sensitive.
...And 6 more matches
ReferenceError: "x" is not defined - JavaScript
the javascript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
... there is a non-existent variable referenced somewhere.
... this variable needs to be declared, or you need to make sure it is available in your current script or scope.
...And 6 more matches
undefined - JavaScript
that is, it is a variable in global scope.
...(even when this is not the case, avoid overriding it.) a variable that has not been assigned a value is of type undefined.
... a method or statement also returns undefined if the variable that is being evaluated does not have an assigned value.
...And 6 more matches
for - JavaScript
syntax for ([initialization]; [condition]; [final-expression]) statement initialization an expression (including assignment expressions) or variable declaration evaluated once before the loop begins.
... typically used to initialize a counter variable.
... this expression may optionally declare new variables with var or let keywords.
...And 6 more matches
Running Tamarin acceptance tests - Archive of obsolete content
running the tamarin test suite requires the following steps: set the avm environment variable to the path of the avmplus executable (avmshell).
...set the builtinabc environment variable to the path of the generated/builtin.abc.
...set the asc environment variable, as described above.
...And 5 more matches
Venkman Introduction - Archive of obsolete content
features such as breakpoint management, call stack inspection, and variable/object inspection are available from the user interface and from console commands, letting you work in the way you are most accustomed to.
... the local variables view the local variables view is on the left portion of the window, at the bottom.
... when the debugger is stopped, the local variables view displays values for the current function.
...And 5 more matches
NPN_SetValue - Archive of obsolete content
this call is used to inform the browser of variable information controlled by the plugin.
... syntax #include <npapi.h> nperror npn_setvalue(npp instance, nppvariable variable, void *value); parameters the function has the following parameters: instance pointer to the plugin instance setting the variable.
... variable values the function can set: nppvpluginwindowbool: sets windowed/windowless mode for plugin display; true=windowed, false=windowless nppvplugintransparentbool: sets transparent mode for display of a plugin; true=transparent, false=opaque nppvjavaclass nppvpluginwindowsize nppvplugintimerinterval nppvpluginscriptableinstance nppvpluginscriptableiid nppvjavascriptpushcallerbool: specifies whether you are pushing or popping the jscontext off the stack nppvpluginkeeplibraryinmemory: tells browser that the plugin dll should live longer than usual nppvpluginneedsxembed nppvpluginscriptablenpobject nppvformvalue nppvplugindrawingmodel value the value of the specified variable to be set.
...And 5 more matches
@set - Archive of obsolete content
the @set statement creates variables used with conditional compilation statements.
... syntax @set @varname = term parameters varname valid javascript variable name.
... term zero or more unary operators followed by a constant, conditional compilation variable, or parenthesized expression.
...And 5 more matches
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
it is important not to confuse a primitive itself with a variable assigned a primitive value.
... the variable may be reassigned a new value, but the existing value can not be changed in the ways that objects, arrays, and functions can be altered.
...it correctly finds our variable instantiated with our first statement after finding it, the expression is evaluated, foo is replaced by 5 and the javascript engine passes that value to the functions as an argument before executing the statements inside the functions' bodies, javascript takes a copy of the originally passed argument (which is a primitive) and creates a local copy.
...And 5 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
you probably want to create a variable that starts at 0, then increments by one every second using a constant loop.
...here, you're storing a reference to the <div> inside a constant, setting a rotatecount variable to 0, setting an uninitialized variable that will later be used to contain a reference to the requestanimationframe() call, and setting a starttime variable to null, which will later be used to store the start time of the requestanimationframe().
...this is the key to the whole operation — you are setting the variable defined earlier to an active requestanimation() call, which takes the draw() function as its parameter.
...And 5 more matches
Looping code - Learn web development
inside the parentheses we have three items, separated by semi-colons: an initializer — this is usually a variable set to a number, which is incremented to count the number of times the loop has run.
... it is also sometimes referred to as a counter variable.
...it usually serves to increment (or in some cases decrement) the counter variable, to bring it closer to the point where the condition is no longer true.
...And 5 more matches
Test your skills: Strings - Learn web development
you already have half of a famous quote inside a variable called quotestart; we would like you to: look up the other half of the quote, and add it to the example inside a variable called quoteend.
...save the result inside a variable called finalquote.
... strings 2 in this task you are provided with two variables, quote and substring, which contain two strings.
...And 5 more matches
DMD
to have dmd active while running it, you just need to set the environment variable dmd=1 when running.
...you can do this by running: adb push $objdir/dist/bin/libdmd.so /sdcard/ second, you will need to make an executable wrapper for fennec which sets an environment variable before launching it.
... (if you are familiar with the recommended "--es env0" method for setting environment variables when launching fennec, note that you cannot use this method here because those are processed too late in the startup process.
...And 5 more matches
Mozilla internal string guide
the most common uses of the concrete classes are as local variables, and members in classes or structs.
...you can concatenate n strings and store the result in a temporary variable: constexpr auto start = u"start "_ns; constexpr auto middle = u"middle "_ns; constexpr auto end = u"end"_ns; // create a string with 3 dependent fragments - no copying involved!
... // call handlepage(const nsastring&); // safe because the concatenated-string will live as long as its substrings handlepage(u"start "_ns + u"end"_ns); local variables local variables within a function are usually stored on the stack.
...And 5 more matches
Working with windows in chrome code
var ww = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(components.interfaces.nsiwindowwatcher); var win = ww.openwindow(null, "chrome://myextension/content/about.xul", "aboutmyextension", "chrome,centerscreen", null); window object note the win variable in the above section, which is assigned the return value of window.open.
...the return value of window.open (and similar methods) is a window object (usually chromewindow) – the same type as the window variable.
... technically speaking, it implements a number of interfaces, including nsidomjswindow and nsidomwindow, but it also contains the user-defined properties for global variables and functions of the window.
...And 5 more matches
Arrow function expressions - JavaScript
n an arrow function is `return`, we can remove `return` and remove // the surrounding curly brackets elements.map(element => element.length); // [8, 6, 7, 9] // in this case, because we only need the length property, we can use destructuring parameter: // notice that the `length` corresponds to the property we want to get whereas the // obviously non-special `lengthfoobarx` is just the name of a variable which can be changed // to any valid variable name you want elements.map(({ length: lengthfoobarx }) => lengthfoobarx); // [8, 6, 7, 9] // this destructuring parameter assignment can also be written as seen below.
...instead, the literal name // itself of the variable `length` is used as the property we want to retrieve from the object.
... this.age++; }, 1000); } var p = new person(); in ecmascript 3/5, the this issue was fixable by assigning the value in this to a variable that could be closed over.
...And 5 more matches
const - JavaScript
constants are block-scoped, much like variables defined using the let keyword.
...global constants do not become properties of the window object, unlike var variables.
...it does not mean the value it holds is immutable—just that the variable identifier cannot be reassigned.
...And 5 more matches
StringView - Archive of obsolete content
*/ awhole = new ftaview(noutptlen); for (var noutptidx = 0; noutptidx < noutptlen; awhole[noutptidx] = vsource[nstartidx + noutptidx++]); break conversionswitch; case 1: /* the source has a fixed-length encoding but the new stringview has a variable-length encoding...
...*/ for (var ninptidx = nstartidx, noutptidx = 0; noutptidx < noutptlen; ninptidx++) { noutptidx = fputoutptcode(awhole, vsource[ninptidx], noutptidx); } break conversionswitch; case 2: /* the source has a variable-length encoding but the new stringview has a fixed-length encoding...
...*/ for (var ninptidx = nstartidx, noutptidx = 0; noutptidx < noutptlen; ninptidx += fgetinptchrsize(nchrcode), noutptidx++) { nchrcode = fgetinptchrcode(vsource, ninptidx); awhole[noutptidx] = nchrcode; } break conversionswitch; case 3: /* both the source and the new stringview have a variable-length encoding...
...And 4 more matches
Creating a dynamic status bar extension - Archive of obsolete content
httprequest = new xmlhttprequest(); httprequest.open('get', fullurl, true); httprequest.onload = inforeceived; httprequest.send(null); } the httprequest variable will contain an xmlhttprequest object.
...the fullurl variable is the complete url to use when requesting a stock quote.
...we embed this function inside refreshinformation() so that its variable scope includes the variables used by that function.
...And 4 more matches
Anatomy of a video game - Game development
the first statement creates a function as a global variable called main().
... building a better main loop in javascript there are two obvious issues with our previous main loop: main() pollutes the window object (where all global variables are stored) and the example code did not leave us with a way to stop the loop unless the whole tab is closed or refreshed.
...let us assume that your game's functions and variables are built on a namespace that you called mygame.
...And 4 more matches
Hoisting - MDN Web Docs Glossary: Definitions of Web-related terms
conceptually, for example, a strict definition of hoisting suggests that variable and function declarations are physically moved to the top of your code, but this is not in fact what happens.
... instead, the variable and function declarations are put into memory during the compile phase, but stay exactly where you typed them in your code.
... hoisting works well with other data types and variables.
...And 4 more matches
Manipulating documents - Learn web development
to manipulate an element inside the dom, you first need to select it and store a reference to it inside a variable.
... inside your script element, add the following line: const link = document.queryselector('a'); now we have the element reference stored in a variable, we can start to manipulate it using properties and methods available to it (these are defined on interfaces like htmlanchorelement in the case of <a> element, its more general parent interface htmlelement, and node — which represents all nodes in a dom).
...add the following line, again at the bottom: link.href = 'https://developer.mozilla.org'; note that, as with many things in javascript, there are many ways to select an element and store a reference to it in a variable.
...And 4 more matches
Arrays - Learn web development
previous overview: first steps next in the final article of this module, we'll look at arrays — a neat way of storing a list of data items under a single variable name.
...array objects can be stored in variables and dealt with in much the same way as any other type of value, the difference being that we can access each value inside the list individually, and do super useful and efficient things with the list, like loop through it and do the same thing to every value.
... if we didn't have arrays, we'd have to store every item in a separate variable, then call the code that does the printing and adding separately for each item.
...And 4 more matches
Solve common problems in your JavaScript code - Learn web development
common beginner's mistakes correct spelling and casing if your code doesn't work and/or the browser complains that something is undefined, check that you've spelt all your variable names, function names, etc.
...for example: function myfunction() { alert('this is my function.'); }; this code won't do anything unless you call it with the following statement: myfunction(); function scope remember that functions have their own scope — you can't access a variable value set inside a function from outside the function, unless you declared the variable globally (i.e.
... what is a variable?
...And 4 more matches
GC and CC logs
on desktop firefox you can override the default location of the log files by setting the moz_cc_log_directory environment variable.
... to log every cycle collection, set the moz_cc_log_all environment variable.
...output to a file can be controlled with the moz_gctimer environment variable.
...And 4 more matches
Dynamic Library Linking
prlibrary *lib; void *funcptr; funcptr = pr_findsymbolandlibrary("functionname", &lib); when pr_findsymbolandlibrary returns, funcptr is the value of the function pointer you want to look up, and the variable lib references the main executable program.
... platform notes to use the dynamic library loading functions on some platforms, certain environment variables must be set at run time, and you may need to link your executable programs using special linker options.
...each platform has its own standard directories in which to look for dynamic libraries, plus a customizable list of directories specified by an environment variable.
...And 4 more matches
PR_NotifyCondVar
notifies a condition variable of a change in its associated monitored data.
... syntax #include <prcvar.h> prstatus pr_notifycondvar(prcondvar *cvar); parameter pr_notifycondvar has one parameter: cvar the condition variable to notify.
... if unsuccessful (for example, if the caller has not locked the lock associated with the condition variable), pr_failure.
...And 4 more matches
sslfnc.html
to that end, the function ssl_configmpserversidcache sets an environment variable named ssl_inheritance.
... the value of the variable is a printable ascii string, containing all the information needed to set up and use the inherited fds.
... there are two ways to transfer the content of ssl_inheritance from parent to child: the child inherits the parent's environment, which must include the ssl_inheritance variable.
...And 4 more matches
Tutorial: Embedding Rhino
in this document: runscript: a simple embedding entering a context initializing standard objects collecting the arguments evaluating a script printing the result exiting the context expose java apis using java apis implementing interfaces adding java objects using javascript objects from java using javascript variables calling javascript functions javascript host objects defining host objects counter example counter's constructors class name dynamic properties defining javascript "methods" adding counter to runscript runscript: a simple embedding about the simplest embedding of rhino possible is the runscript example.
...evaluation of the script looks up variables in scope, and errors will be reported with the filename <cmd> and line number 1.
... printing the result the code system.out.println(cx.tostring(result)); prints the result of evaluating the script (contained in the variable result).
...And 4 more matches
Hacking Tips
step next a few times, so that the "code" variable gets generated print code->code_, which is the address of the code disassembly code read at this address (using x/ni address, where n is the number of instructions you would like to see) here is an example.
...external programs such as iongraph, dot, and your png viewer are search into the path, otherwise custom one can either be configured with environment variables (gdb_iongraph, gdb_dot, gdb_pngviewer) before starting gdb, or with gdb parameters (set iongraph-bin <path>, set dot-bin <path>, set pngviewer-bin <path>) within gdb.
... using ionmonkey spew (js shell) ionmonkey spew is extremely verbose (not as much as the infer spew), but you can filter it to focus on the list of compiled scripts or channels, ionmonkey spew channels can be selected with the ionflags environment variable, and compilation spew can be filtered with ionfilter.
...And 4 more matches
Functions
when a name is evaluated that doesn't refer to a local variable, the interpreter consults the scope chain to find the variable.
...an algol-like function may read the local variables and arguments of its immediate enclosing function from the stack, as if by magic.
... (jscontext::display caches the enclosing function's stack frame.) if that function is also algol-like, its child can read locals and variables from the next enclosing function, and so on.
...And 4 more matches
JS::PersistentRooted
initial t an initial value for the persistent rooted variable.
... bool operator==(const t& other) const description js::persistentrooted<t> declares a variable of type t whose value is always rooted.
... this is typically used for global variables.
...And 4 more matches
Creating the Component Code
for example, mozilla_strict_api is a variable that shields you from certain private, non-xpcom headers.
... for example, including nsicomponentmanager.idl without mozilla_strict_api defined will include the following headers, which are not supported across versions (unfrozen): nscomponentmanagerutils.h nscomponentmanagerobsolete.h these variables are picked up by files that do not specify themselves as mozilla_strict_api.
... identifiers in xpcom the series of nsiid variables initialized here are actually classes created for handing the 128-bit identifiers that xpcom uses to support contractual relationships between the client and component interfaces.
...And 4 more matches
Index
MozillaTechXPCOMIndex
this is useful for privileged code, such as add-on code, to access variables and apis defined in web content.
...makes eval() use the last object on its 'obj' param's scope chain as the ecma 'variables object'.
...you can then wrap that statement with a wrapper, which implements nsixpcscriptable and provides scriptable helpers letting you execute the statement as a function, access bind variables by name as properties, etc.
...And 4 more matches
Drawing and Event Handling - Plugins
nperror npn_getvalue(npp instance, npnvariable variable, void *value); the instance parameter represents the current plug-in.
... unix and ms windows the queried information is returned in the variable parameter.
...the variable parameter contains plug-in information to set.
...And 4 more matches
Debugger.Object - Firefox Developer Tools
// display name: f (the given name) var g = function () {}; // display name: g o.p = function () {}; // display name: o.p var q = { r: function () {} // display name: q.r }; note that the display name may not be a proper javascript identifier, or even a proper expression: we attempt to find helpful names even when the function is not immediately assigned as the value of some variable or property.
... ifcode is not strict mode code, then variable declarations incode affect the referent global object.
... (in the terms used by the ecmascript specification, the variableenvironment of the execution context for the eval code is the referent.) theoptions argument is as for debugger.frame.prototype.eval.
...And 4 more matches
Timing element visibility with the Intersection Observer API - Web APIs
let's start with the global variables: let contentbox; let nextarticleid = 1; let visibleads = new set(); let previouslyvisibleads = null; let adobserver; let refreshintervalid = 0; these are used as follows: contentbox a reference to the <main> element's htmlelement object in the dom.
... nextarticleid each article is given a unique id number; this variable tracks the next id to use, starting with 1.
...to do so, we begin by saving the set of visible ads into a variable known as previouslyvisibleads to be sure we can restore them when the user tabs back into the document, and we then empty the visibleads set so they won't be treated as visible.
...And 4 more matches
env() - CSS: Cascading Style Sheets
WebCSSenv
the env() css function can be used to insert the value of a user agent-defined environment variable into your css, in a similar fashion to the var() function and custom properties.
... the difference is that, as well as being user-agent defined rather than user-defined, environment variables are globally scoped to a document, whereas custom properties are scoped to the element(s) on which they are declared.
... to tell the browser to use the whole available space on the screen, and so enabling us to use the env() variables, we need to add a new viewport meta value: <meta name="viewport" content="viewport-fit=cover" /> body { padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 20px) env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 20px); } in addition, unlike custom properties, which cannot be used outside of declarations, the env() function can be used in place of any part of a property value, or any part of a descriptor (e.g.
...And 4 more matches
font-stretch - CSS: Cascading Style Sheets
this enables variable fonts to offer something more like a continuum of character widths.
... for truetype or opentype variable fonts, the "wdth" variation is used to implement varying widths.
... the table below demonstrates the effect of supplying various different percentage values of font-stretch on two different fonts: 50% 62.5% 75% 87.5% 100% 112.5% 125% 150% 200% helvetica neue league mono variable helvetica neue, which is installed by default on macos, has a single condensed face in addition to the normal face.
...And 4 more matches
Index of archived content - Archive of obsolete content
tation (1999) tracevis transforming xml with xslt:mozilla xslt transforming xml with xslt:the netscape xslt treehydra treehydra build instructions treehydra manual tuning pageload urischeme uris and urls uriloader using addresses of stack variables with nspr threads on win16 using cross commit using gdb on wimpy computers venkman using breakpoints in venkman venkman internals venkman introduction video presentations when to use ifdefs writing textual data xml in mozilla ...
... msx emulator (jsmsx) old proxy api parallelarray properly using css and javascript in xhtml documents examples reference server-side javascript back to the server: server-side javascript on the rise sharp variables in javascript standards-compliant authoring tools stopiteration styling the amazing netscape fish cam page using javascript generators in firefox window.importdialog() writing javascript for xhtml xforms building mozilla xforms community developing mozilla xforms ...
... other resources requests for enhancement rfe to the custom controls rfe to the custom controls interfaces rfe to the xforms api troubleshooting xforms forms using xforms and php xforms api reference xforms config variables xforms custom controls xforms custom controls examples xforms styling background-size foreach beginner tutorials creating reusable content with css and xbl underscores in class and id names xml data xul user interfaces ...
...And 3 more matches
Simple Query Syntax - Archive of obsolete content
in the simple syntax, the builder will use the default query shown above, although the variable names are randomly generated.
...first, it evaluates the default query as above, except that no variables are used, or at least, not ones that are used externally.
...the data network will look something like this: (?1 = http://www.xulplanet.com/rdf/myphotos, ?2 = http://www.xulplanet.com/ndeakin/images/t/palace.jpg) (?1 = http://www.xulplanet.com/rdf/myphotos, ?2 = http://www.xulplanet.com/ndeakin/images/t/canal.jpg) (?1 = http://www.xulplanet.com/rdf/myphotos, ?2 = http://www.xulplanet.com/ndeakin/images/t/obselisk.jpg) the numbers are used here for the variable names, but they are really just randomly generated so you can't refer to them in any way.
...And 3 more matches
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
you don't even have to substitute in your application name for mccoy since it uses the app_name variable.
...in this case you can basically copy over the file as is, since once again variables are used for things like the application name and version.
... note that the locale manifest uses a variable to specify the name of the locale which has to be defined in the makefile (and you need to say #filter substitution in the manifest for the variable to be expanded).
...And 3 more matches
GLSL Shaders - Game development
the purpose of the vertex shader is to set up the gl_position variable — this is a special, global, and built-in glsl variable.
... the void main() function is a standard way of defining the gl_position variable.
... a vertex shader yields a variable containing how to project a vertex's position in 3d space onto a 2d screen.
...And 3 more matches
Desktop gamepad controls - Game development
first, we need an event listener to listen for the connection of the new device: window.addeventlistener("gamepadconnected", gamepadhandler); it's executed once, so we can create some variables we will need later on for storing the controller info and the pressed buttons: var controller = {}; var buttonspressed = []; function gamepadhandler(e) { controller = e.gamepad; output.innerhtml = "gamepad: " + controller.id; } the second line in the gamepadhandler function shows up on the screen when the device is connected: we can also show the id of the device — in the case abo...
...here's the gamepadapi object, which contains useful variables and functions: var gamepadapi = { active: false, controller: {}, connect: function(event) {}, disconnect: function(event) {}, update: function() {}, buttons: { layout: [], cache: [], status: [], pressed: function(button, state) {} } axes: { status: [] } }; the controller variable stores the information about the connec...
...ted gamepad, and there's an active boolean variable we can use to know if the controller is connected or not.
...And 3 more matches
Mobile touch controls - Game development
the good thing about using phaser is that it offers helper variables and functions for easier and faster development, but it's entirely up to you which approach you to choose.
...the function touchhandler will assign proper variables to the ship's position so that we can use it for both cases: when the player touches the screen but doesn't move it (touchstart), and when the finger is moved on the screen (touchmove): document.addeventlistener("touchstart", touchhandler); document.addeventlistener("touchmove", touchhandler); the touchhandler function looks like this: function touchhandler(e) { if(e.touches) { pl...
...we can get the first touch (e.touches[0], our example is not multitouch-enabled), extract the pagex and pagey variables and set the player's ship position on the screen by subtracting the canvas offset (distance from the canvas and the edge of the screen) and half the player's width and height.
...And 3 more matches
First-class Function - MDN Web Docs Glossary: Definitions of Web-related terms
a programming language is said to have first-class functions when functions in that language are treated like any other variable.
... for example, in such a language, a function can be passed as an argument to other functions, can be returned by another function and can be assigned as a value to a variable.
... example | assign a function to a variable javascript const foo = function() { console.log("foobar"); } // invoke it using the variable foo(); we assigned an anonymous function in a variable, then we used that variable to invoke the function by adding parentheses () at the end.
...And 3 more matches
Test your skills: Conditionals - Learn web development
conditionals 1 in this task you are provided with two variables: season — contains a string that says what the current season is.
... conditionals 2 for this task you are given three variables: machineactive — contains an indicator of whether the answer machine is switched on or not (true/false) score — contains your score in an imaginary game.
... you need to create an if...else structure that checks whether the machine is switched on and puts a message into the response variable if it isn't, telling the user to switch the machine on.
...And 3 more matches
Handling common JavaScript problems - Learn web development
making sure variables, etc.
...for a light introduction; you should also study examples like this one, which shows a typical pattern of saving a this scope to a separate variable, then using that variable in nested functions so you can be sure you are applying functionality to the correct this scope.
...each scope can be expanded to show the values of variables inside the scope when execution of the code was stopped.
...And 3 more matches
HTTP logging
go to the "logging section" adjust the location of the log file if you don't like the default adjust the list of modules that you want to log: this list has the exact same format as the moz_log environment variable (see below).
... logging http activity by manually setting environment variables sometimes the about:networking approach won't work, for instance if your bug occurs during startup, or you're running on mobile, etc.
... in that case you can set environment variables *before* you launch firefox.
...And 3 more matches
Leak-hunting strategies and tips
because (1) large graphs of leaked objects tend to include some objects pointed to by global variables that confuse gc-based leak detectors, which can make leaks look smaller (as in bug 99180) or hide them completely and (2) large graphs of leaked objects tend to hide smaller ones, it's much better to go after the large graphs of leaks first.
... [obscure] double-assignment into the same variable: if you release a member variable and then assign into it by calling another function that does the same thing, you can leak the object assigned into the variable by the inner function.
... destructors that should have been virtual: if you expect to override an object's destructor (which includes giving a derived class of it an nscomptr member variable) and delete that object through a pointer to the base class using delete, its destructor better be virtual.
...And 3 more matches
Monitors
monitor type monitor functions with a mutex of type prlock, a single thread may enter the monitor only once before it exits, and the mutex can have multiple associated condition variables.
... unlike a mutex of type prlock, a mutex of type prmonitor has a single, implicitly associated condition variable that may be used to facilitate synchronization of threads with the change in state of monitored data.
... for an introduction to nspr thread synchronization, including locks and condition variables, see introduction to nspr.
...And 3 more matches
NSS sources building testing
in order to run the tools, you should set your system environment to use the libraries of your build from the "lib" directory, e.g., using the ld_library_path or dyld_library_path environment variable.
...after the build on your computer has succeeded, before you can run the tests on your computer, it might be necessary to set additional environment variables.
...in other environments (for example in home networks), you could set the host and domsuf (for domain suffix) environment variables to tell the nss suite which hostname to use.
...And 3 more matches
NSS_3.12.3_release_notes.html
in anticipation of that, the nss team has provided ways to easily cause nss to revert to its previous behavior through the use of environment variables.
... here is a table of the new environment variables introduced in nss 3.12.3 and information about how they affect these new behaviors.
... the information in this table is excerpted from https://developer.mozilla.org/en/nss_reference/nss_environment_variables environment variable value type description nsrandcount integer (byte count) sets the maximum number of bytes to read from the file named in the environment variable nsrandfile (see below).
...And 3 more matches
Rhino Debugger
the rhino javascript debugger can debug scripts running in multiple threads and provides facilities to set and clear breakpoints, control execution, view variables, and evaluate arbitrary javascript code in the current scope of an executing script.
...when you select a stack frame the variables and watch windows are updated to reflect the names and values of the variables visible at that scope.
... viewing variables the lower-left (dockable) pane in the debugger main window contains a tab-pane with two tabs, labeled "this" and "locals".
...And 3 more matches
Index
this is typically used for local variables being passed to function which requires js::handlevaluearray or a pointer to js::value array.
... 26 js::autovectorrooter jsapi reference, reference, référence(2), spidermonkey js::autovectorrooter<t> holds a variable-size rooted array of type t.
...this is useful as a parameter type, or a temporal local variable for it.
...And 3 more matches
Invariants
"are we in a request on cx?", where cx is any variable of type jscontext *, is a static yes for most lines of code where such a variable exists.
... there are the usual invariants regarding locks: we do not reenter them (it would be nice to check this as there might be an exception or two); we do not wait on a condition variable unless the corresponding lock is held.
... if it cannot be statically proven that a name always refers to a specific variable (meaning either a parameter or a variable introduced by var/let/function/const) in the program, then a name op must be emitted.
...And 3 more matches
JIT Optimization Strategies
the function containing the arguments.length is allowed to use the arguments object in the following ways without disabling this optimization: access arguments.length access arguments.callee access individual args using arguments[i] save arguments into variables, as long as those variables cannot be accessed by any nested function, and as long as there exists no eval anywhere within the function or nested function definitions.
...the function containing the arguments.callee is allowed to use the arguments object in the following ways without disabling this optimization: access arguments.length access arguments.callee access individual args using arguments[i] save arguments into variables, as long as those variables cannot be accessed by any nested function, and as long as there exists no eval anywhere within the function or nested function definitions.
...if this optimization succeeds, the 'array' object is treated as a constant, and is not looked up or retrieved from a variable.
...And 3 more matches
Shell global objects
this page lists variables and functions available on spidermonkey 53.
... variables scriptargs an array that contains arguments passed to js shell.
... timesaccessed returns a number that indicates how many times this variable is accessed perfmeasurement see perfmeasurement.jsm.
...And 3 more matches
mozIJSSubScriptLoader
any top-level functions or variables created by the loaded script via var are created as properties of the targetobj target object (but things declared via let and const are not).
... additionally, properties of the targetobj target object can be referred to as variables in the loaded script.
... note: undeclared variables in the loaded script will be created as global variables in the caller (ie.: in the caller's global object).
...And 3 more matches
Set a breakpoint - Firefox Developer Tools
at this point you can do useful things like studying the value of different variables at that point, allowing you to work out why a problem is occurring.
... conditional breakpoints a conditional breakpoint is one where the code will pause execution when it is reached, only if a certain condition is met, such a variable having a certain value at the time.
... inline variable preview new in firefox 71, the source pane now gives you an inline preview of the variables on each line of code you've stepped through: this is a very useful timesaver when stepping through your code.
...And 3 more matches
font-weight - CSS: Cascading Style Sheets
in earlier versions of the font-weight specification, the property accepts only keyword values and the numeric values 100, 200, 300, 400, 500, 600, 700, 800, and 900; non-variable fonts can only really make use of these set values, although fine-grained values (e.g.
... 451) will be translated to one of these values for non-variable fonts.
... css fonts level 4 extends the syntax to accept any number between 1 and 1000, inclusive, and introduces variable fonts, which can make use of this much finer-grained range of font weights.
...And 3 more matches
font-weight - CSS: Cascading Style Sheets
in earlier versions of the font-weight specification, the property accepts only keyword values and the numeric values 100, 200, 300, 400, 500, 600, 700, 800, and 900; non-variable fonts can only really make use of these set values, although fine-grained values (e.g.
... 451) will be translated to one of these values for non-variable fonts using the fallback weights system.
... css fonts level 4 extends the syntax to accept any number between 1 and 1000 and introduces variable fonts, which can make use of this much finer-grained range of font weights.
...And 3 more matches
Memory Management - JavaScript
this can be done by reading or writing the value of a variable or an object property or even passing an argument to a function.
...// the other is referenced by virtue of being assigned to the 'x' variable.
... var y = x; // the 'y' variable is the second thing that has a reference to the object.
...And 3 more matches
SyntaxError: redeclaration of formal parameter "x" - JavaScript
the javascript exception "redeclaration of formal parameter" occurs when the same variable name occurs as a function parameter and is then redeclared using a let assignment in a function body again.
... the same variable name occurs as a function parameter and is then redeclared using a let assignment in a function body again.
... redeclaring the same variable within the same function or block scope using let is not allowed in javascript.
...And 3 more matches
The arguments object - JavaScript
the arguments object is a local variable available within all non-arrow functions.
...this technique is useful for functions that can be passed a variable number of arguments, such as math.min().
...that is, assigning new values to variables in the body of the function will not affect the arguments object.
...And 3 more matches
jpm - Archive of obsolete content
if -o is specified and path is omitted, jpm looks for the jetpack_root environment variable and use its value as the path.
...if -o is specified and path is omitted, jpm will look for the jetpack_root environment variable and use its value as the path.
...this is due to firefox 48, and later, not having the option to run add-ons which are unsigned.]: jpm run -b nightly you can set the jpm_firefox_binary environment variable with the path to the version of firefox you want to run.
...And 2 more matches
Extension Etiquette - Archive of obsolete content
global variables, such as top-level declarations on scripts loaded into shared windows or web pages.
...scripts can be loaded into their own globals, such as commonjs modules, javascript modules, or sandboxes, to avoid most global variable and prototype conflicts.
...global variables might all be defined as properties of the coolbeans object.
...And 2 more matches
Using Breakpoints in Venkman - Archive of obsolete content
when you set a breakpoint in a debugging application such as venkman, you can take advantage of the suspension to examine variables, objects, and other featues of the execution.
...one of the most important aspects of debugging a script or software program is the ability to examine variables—function return values, errors, counters, variable scopes—as they change over the course of the script execution.
... the onflipx function in figure 1, for example, uses the variable newsign to figure out what image to use for the fish.
...And 2 more matches
How to implement a custom XUL query processor component - Archive of obsolete content
ype = { queryinterface: xpcomutils.generateqi([components.interfaces.nsixultemplateresult]), // private storage _data: null, // right now our results are flat lists, so no containing/recursion take place iscontainer: false, isempty: true, mayprocesschildren: false, resource: null, type: "simple-item", get id() { return this._id; }, // return the value of that bound variable such as ?name getbindingfor: function(avar) { // strip off the ?
....generateqi([components.interfaces.nsixultemplatequeryprocessor]), classdescription: "sample xul template query processor", classid: components.id("{282cc4ea-a49c-44fc-81f4-1f03cbb7825f}"), contractid: "@mozilla.org/xul/xul-query-processor;1?name=simpledata", getdatasource: function(adatasources, arootnode, aistrusted, abuilder, ashoulddelaybuilding) { // todo: parse the adatasources variable // for now, ignore everything and let's just signal that we have data return this._data; }, initializeforbuilding: function(adatasource, abuilder, arootnode) { // perform any initialization that can be delayed until the content builder // is ready for us to start }, done: function() { // called when the builder is destroyed to clean up state }, compilequery: fun...
...ction(abuilder, aquery, arefvariable, amembervariable) { // outputs a query object.
...And 2 more matches
Bindings - Archive of obsolete content
the ?photo variable is filled in with the known value and then the arc is looked up the datasource, filling in the value for the ?description variable.
... the ?description variable would then be used in the action body.
...n/images/t/palace.jpg, ?title = 'palace from above') (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/canal.jpg, ?title = 'canal') (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg, ?title = 'obelisk') the second triple will add a ?description for the first photo, adding a fourth variable-value pair to the existing data.
...And 2 more matches
Building Trees - Archive of obsolete content
here, the simple rdf query syntax is used, so the member variable is rdf:*.
...the builder looks at the label for the corresponding cell, translates any variables or predicates into values, and returns the value.
...naturally, this will retrieve the value after any variables have been substituted.
...And 2 more matches
Result Generation - Archive of obsolete content
so, to summarize: start out with a one possible result as the seed iterate over the results determined so far and augment them with additional data add any new possible results remove any rejected results repeat steps 2 to 4 for each query statement once done, all remaining results become matches each possible result is made up of a set of variable-value pairs.
... for instance, a result would look something like the following: (?name = fred, ?age = 5) this result has two variables, ?name with the value 'fred' and ?age with the value 5.
... variables begin with a question mark, and values are rdf resources or literals.
...And 2 more matches
XML Assignments - Archive of obsolete content
it allows us to declare additional variables that may be used in the action body.
... the expr attribute specifies the xpath expression and the var attribute specifies the variable to assign to.
...for each result, the ?namelength variable will be assigned the length of the name attribute on the result node, and the ?siblings variable will be assigned the number of sibling nodes the result has.
...And 2 more matches
action - Archive of obsolete content
one descendant of the action body should have a uri attribute set to the member variable.
... this element and its descendants may use variables in place of attribute values.
... variables are a question mark followed by a name.
...And 2 more matches
NPN_GetValue - Archive of obsolete content
syntax #include <npapi.h> nperror npn_getvalue(npp instance, npnvariable variable, void *value); parameters this function has the following parameters: instance pointer to the current plug-in instance.
... variable information the call gets.
... values for npnvariable: npnvxdisplay =1: unix only: returns the current display npnvxtappcontext: unix only: returns the application's xtappcontext npnvnetscapewindow: ms windows and unix/x11 only: ms windows: gets the native window on which plug-in drawing occurs; returns hwnd unix/x11: gets the browser toplevel window in which the plug-in is displayed; returns window npnvjavascriptenabledbool: tells whether javascript is enabled; true=javascript enabled, false=not enabled npnvasdenabledbool: tells whether smartupdate (former name: asd) is enabled; true=smartupdate enabled, false=not enabled npnvisofflinebool: tells whether offline mode is enabled; true=offline mode enabled, false=not enabled npnvtoolkit: npnvsupportsxembedbool: npnvwindownpo...
...And 2 more matches
Processing XML with E4X - Archive of obsolete content
it is possible to interpolate variables into an xml literal to create an element name (or to create content).
...variables and expressions can be used to create attribute values by simply wrapping them with braces ({}) and omitting quotation marks that would normally go around an attribute value, as the following example illustrates: var a = 2; var b = <foo bar={a}>"hi"</foo>; upon execution the variable is evaluated and quotes are automatically added where appropriate.
... it is not possible to directly interpolate variables amidst other literal (or variable) attribute content, however (e.g., bar="a{var1}{var2}").
...And 2 more matches
Introduction - Archive of obsolete content
« previousnext » basic syntax with e4x enabled, basic xml elements are valid syntax for variables.
...variable declarations are not limited to one element, and as with all javascript, can span multiple lines.
...the most basic is appendchild var element1 = <foo/>; var element2 = <bar/>; element1.appendchild(element2); which produces exactly the xml document you'd expect <foo> <bar/> </foo> javascript variables the true power of e4x only begins to come to light, however, when the xml document can interact closely with other javascript.
...And 2 more matches
LiveConnect Overview - Archive of obsolete content
for example, you can create a java string object and assign it to the javascript variable mystring by using the new operator with the java constructor, as follows: var mystring = new java.lang.string("hello world"); in the previous example, the variable mystring is a javaobject because it holds an instance of the java object string.
...for example, the following code also assigns the value "h" to the variable c: var c = new java.lang.character(72); handling java exceptions in javascript when java code fails at run time, it throws an exception.
...ers) had been broken in gecko 1.9 (see bug 391642) as the mozilla-specific liveconnect code had not been maintained inside mozilla, with java 6 update 11 and 12 building support for reliance on mozilla's implementation of the generic (and cross-browser) npapi plugin code, this has again been fixed.) for example, suppose you are using the java forname method to assign the name of a java class to a variable called theclass.
...And 2 more matches
Desktop mouse and keyboard controls - Game development
the good thing about using phaser is that it offers helper variables and functions for easier and faster development, but it's totally up to you which approach you chose.
...inside them we can get the code of the key that was pressed from the keycode property of the event object, see which key it is, and then set the proper variable.
...on keydownhandler(event) { if(event.keycode == 39) { rightpressed = true; } else if(event.keycode == 37) { leftpressed = true; } if(event.keycode == 40) { downpressed = true; } else if(event.keycode == 38) { uppressed = true; } } the keyuphandler looks almost exactly the same as the keydownhandler above, but instead of setting the pressed variables to true, we would set them to false.
...And 2 more matches
2D maze game with device orientation - Game development
, 'img/loading-bg.png'); this.load.image('preloaderbar', 'img/loading-bar.png'); }, create: function() { this.game.scale.scalemode = phaser.scalemanager.show_all; this.game.scale.pagealignhorizontally = true; this.game.scale.pagealignvertically = true; this.game.state.start('preloader'); } }; the main ball object is defined and we're adding two variables called _width and _height that are the width and the height of the game canvas — they will help us position the elements on the screen.
...to implement this we have to create a variable for storing the actual number of seconds elapsed from the start of the game, and to show it for the player in the game.
... let’s define the variables in the create function first: this.timer = 0; // time elapsed in the current level this.totaltimer = 0; // time elapsed in the whole game then, right after that, we can initialize the necessary text objects to display this information to the user: this.timertext = this.game.add.text(15, 15, "time: "+this.timer, this.fontbig); this.totaltimetext = this.game.add.text(120, 30, "total time: "+this.totaltimer, this.fontsmall); we’re defining the top and left positions of the text, the content that will be shown and the styling applied to the text.
...And 2 more matches
Making asynchronous programming easier with async and await - Learn web development
instead of needing to chain a .then() block on to the end of each promise-based method, you just need to add an await keyword before the method call, and then assign the result to a variable.
...for example: let response = await fetch('coffee.jpg'); the response returned by the fulfilled fetch() promise is assigned to the response variable when that response becomes available, and the parser pauses on this line until that occurs.
...this includes promise.all() — you can quite happily await a promise.all() call to get all the results returned into a variable in a way that looks like simple synchronous code.
...And 2 more matches
Client-side storage - Learn web development
now type these lines into your javascript console: let myname = localstorage.getitem('name'); myname upon typing in the second line, you should see that the myname variable now contains the value of the name data item.
... below the constant declarations, add the following lines: // create an instance of a db object for us to store the open database in let db; here we are declaring a variable called db — this will later be used to store an object representing our database.
...ition — again inside the window.onload handler: // onerror handler signifies that the database didn't open successfully request.onerror = function() { console.log('database failed to open'); }; // onsuccess handler signifies that the database opened successfully request.onsuccess = function() { console.log('database opened successfully'); // store the opened database object in the db variable.
...And 2 more matches
Test your skills: Arrays - Learn web development
in this task we'd like you to create an array of three items, stored inside a variable called myarray.
...save the result in a variable called myarray.
... store the length of the array in a variable called arraylength.
...And 2 more matches
What is JavaScript? - Learn web development
the core client-side javascript language consists of some common programming features that allow you to do things like: store useful values inside variables.
... in the above example for instance, we ask for a new name to be entered then store that name in a variable called name.
...in the above example we take the string "player 1: " and join it to the name variable to create the complete text label, e.g.
...And 2 more matches
JNI.jsm
there also exists a jenv variable in the window scope, so if you need to run jni from the global scope, use a different variable name then jenv.
... return value this function has no return value, if you try to store the return value in a variable, it will be undefined.
... return value this function has no return value, if you try to store the return value in a variable, it will be undefined.
...And 2 more matches
BloatView
how to run with bloatview the are two environment variables that can be used.
... you can set these environment variables to any of the following values.
...this might indicate a global variable or service.
...And 2 more matches
Locks
lock type lock functions in nspr, a mutex of type prlock controls locking, and associated condition variables communicate changes in state among threads.
... in general, a monitor is a conceptual entity composed of a mutex, one or more condition variables, and the monitored data.
...in addition to prlock, nspr provides another mutex type, prmonitor, which is reentrant and can have only one associated condition variable.
...And 2 more matches
Logging
conditional compilation and execution log types and variables logging functions and macros use example conditional compilation and execution nspr's logging facility is conditionally compiled in and enabled for applications using it.
... execution-time control of nspr's logging uses two environment variables.
... these variables control which modules and levels are logged as well as the file name of the log file.
...And 2 more matches
NSS Developer Tutorial
variable, and function parameter names, always start with a lowercase letter.
... variables can be declared, at the point they are first used.
... public headers are in the exports variable.
...And 2 more matches
Scripting Java
rhino defines a top-level variable named packages.
... the properties of the packages variable are all the top-level java packages, such as java and com.
... for example, we can access the value of the java package: js> packages.java [javapackage java] as a handy shortcut, rhino defines a top-level variable java that is equivalent to packages.java.
...And 2 more matches
JS::Remove*Root
vp js::heap<js::value> address of the js::value variable to remove from the root set.
... rp js::heap<jsstring *> address of the jsstring * variable to remove from the root set.
... rp js::heap<jsobject *> address of the jsobject * variable to remove from the root set.
...And 2 more matches
JS::Rooted
this article covers features introduced in spidermonkey 17 local variable of type t whose value is always rooted.
... initial t an initial value for the rooted variable.
... bool operator==(const t &other) const description js::rooted<t> declares a local variable of type t whose value is always rooted.
...And 2 more matches
JS_Remove*Root
vp jsval * address of the jsval variable to remove from the root set.
... spp jsstring * address of the jsstring* variable to remove from the root set.
... opp jsobject * address of the jsobject* variable to remove from the root set.
...And 2 more matches
Web Replay
atomic variables can be handled by treating reads and writes as if they were wrapped by a lock acquire/release during recording.
... accesses on atomic variables/fields are recorded in a global data stream, as if they were all protected by a global lock.
... threads use file descriptors to wait on locks and notify each other, instead of using the native implementation for locking and condition variables.
...And 2 more matches
Getting Started Guide
all good getters addref the interface pointers they produce, thus providing you with an owning reference; you will hold onto the reference longer than the scope of the function in which you acquired it, e.g., you got it as a parameter, but you're hanging onto it in a member variable (see, for example, comparison 1, below).
... for instance, here is a typical snippet of code (at its most compact) where you assign a xpcom interface pointer into a member variable, i.e., the body of a `setter' function, side-by-side using raw xpcom interface pointers and nscomptrs.
...setting a member variable.
...And 2 more matches
The libmime module
struct foobarclass { parentclass superclass; ...any callbacks or class-variables...
... }; class definition this variable holds an instance of the one-and-only class record; the various instances of this class point to this object.
... (one interrogates the type of an instance by comparing the value of its class pointer with the address of this variable.) extern foobarclass foobarclass; instance declaration theis structure defines the per-instance data of an object, and a pointer to the corresponding class record.
...And 2 more matches
Debugger.Object - Firefox Developer Tools
// display name: f (the given name) var g = function () {}; // display name: g o.p = function () {}; // display name: o.p var q = { r: function () {} // display name: q.r }; note that the display name may not be a proper javascript identifier, or even a proper expression: we attempt to find helpful names even when the function is not immediately assigned as the value of some variable or property.
...regardless ofcode being strict mode code, variable declarations incode affect the referent global object.
... executeinglobalwithbindings(code,bindings, [options]) like executeinglobal, but evaluatecode using the referent as the variable object, but with a lexical environment extended with bindings from the objectbindings.
...And 2 more matches
font-stretch - CSS: Cascading Style Sheets
this enables variable fonts to offer something more like a continuum of character widths.
... for truetype or opentype variable fonts, the "wdth" variation is used to implement varying widths.
...g the table below shows the mapping between keyword values and numeric percentages: keyword percentage ultra-condensed 50% extra-condensed 62.5% condensed 75% semi-condensed 87.5% normal 100% semi-expanded 112.5% expanded 125% extra-expanded 150% ultra-expanded 200% variable fonts most fonts have a particular width which corresponds to one of the keyterm values.
...And 2 more matches
Loops and iteration - JavaScript
this expression can also declare variables.
...the for statement declares the variable i and initializes it to 0.
...et i = 0; let j = 10; checkiandj: while (i < 4) { console.log(i); i += 1; checkj: while (j > 4) { console.log(j); j -= 1; if ((j % 2) === 0) { continue checkj; } console.log(j + ' is odd.'); } console.log('i = ' + i); console.log('j = ' + j); } for...in statement the for...in statement iterates a specified variable over all the enumerable properties of an object.
...And 2 more matches
SyntaxError: applying the 'delete' operator to an unqualified name is deprecated - JavaScript
the javascript strict mode-only exception "applying the 'delete' operator to an unqualified name is deprecated" occurs when variables are attempted to be deleted using the delete operator.
... normal variables in javascript can't be deleted using the delete operator.
... in strict mode, an attempt to delete a variable will throw an error and is not allowed.
...And 2 more matches
delete operator - JavaScript
non-strict mode when in strict mode, if delete is used on a direct reference to a variable, a function argument or a function name, it will throw a syntaxerror.
... object.defineproperty(globalthis, 'variable1', { value: 10, configurable: true, }); object.defineproperty(globalthis, 'variable2', { value: 10, configurable: false, }); // syntaxerror in strict mode.
... console.log(delete variable1); // true // syntaxerror in strict mode.
...And 2 more matches
Function expression - JavaScript
you can't use function expressions before you create them: console.log(nothoisted) // undefined // even though the variable name is hoisted, the definition isn't.
... let math = { 'factit': function factorial(n) { console.log(n) if (n <= 1) { return 1; } return n * factorial(n - 1); } }; math.factit(3) //3;2;1; the variable the function expression is assigned to will have a name property.
... the name doesn't change if it's assigned to a different variable.
...And 2 more matches
export - JavaScript
xports: named exports (zero or more exports per module) default exports (one per module) // exporting individual features export let name1, name2, …, namen; // also var, const export let name1 = …, name2 = …, …, namen; // also var, const export function functionname(){...} export class classname {...} // export list export { name1, name2, …, namen }; // renaming exports export { variable1 as name1, variable2 as name2, …, namen }; // exporting destructured assignments with renaming export const { name1, name2: bar } = o; // default exports export default expression; export default function (…) { … } // also class, function* export default function name1(…) { … } // also class, function* export { name1 as default, … }; // aggregating modules export * from …; // doe...
...each type corresponds to one of the above syntax: named exports: // export features declared earlier export { myfunction, myvariable }; // export individual features (can export var, let, // const, function, class) export let myvariable = math.sqrt(2); export function myfunction() { ...
...t a default export can be imported with any name for example: // file test.js let k; export default k = 12; // some other file import m from './test'; // note that we have the freedom to use import m instead of import k, because k was default export console.log(m); // will log 12 you can also rename named exports to avoid naming conflicts: export { myfunction as function1, myvariable as variable }; re-exporting / aggregating it is also possible to "import/export" from different modules in a parent module so that they are available to import from that module.
...And 2 more matches
system - Archive of obsolete content
usage querying your environment using the system module you can access environment variables (such as path), find out which operating system your add-on is running on and get information about the host application (for example, firefox or fennec), such as its version.
... var system = require("sdk/system"); // path environment variable console.log(system.env.path); // operating system console.log("platform = " + system.platform); // processor architecture console.log("architecture = " + system.architecture); // compiler used to build host application console.log("compiler = " + system.compiler); // host application build identifier console.log("build = " + system.build); // host application uuid console.log("id = " + system.id); // host application name console.log("name = " + system.name); // host application version console.log("version = " + system.version); // host application vendor console.log("vendor = " + system.vendor); // host application profile directory console.log("profile directory = " + system.pathfor("profd")); quit the host application to quit...
... properties env this object provides access to environment variables.
... you can get the value of an environment variable by accessing the property with that name: var system = require("sdk/system"); console.log(system.env.path); you can test whether a variable exists by checking whether a property with that name exists: var system = require("sdk/system"); if ('path' in system.env) { console.log("path is set"); } you can set a variable by setting the property: var system = require("sdk/system"); system.env.foo = "bar"; console.log(system.env.foo); you can unset a variable by deleting the property: var system = require("sdk/system"); delete system.env.foo; you can't enumerate environment variables.
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
the local variables screen should always display variables and objects during step-by-step execution.
... with functions that include a lot of variables, this will be hard to read, so you can point out specific variables that you want to watch (figure 4).
... watched variables appear under the watches tab, and are updated every time they are evaluated.
... you can then continue with stepwise execution and watch the changes in the program and variables.
Setting Up a Development Environment - Archive of obsolete content
the install process requires using an environment variable called ostype, which is not exported.
...this is set in the profile_dir variable (set to "xulschool-dev" in this case).
... you should also set up your environment so that xpidl.exe (or just xpidl on other systems) is in the default executable path, and also add a variable called gecko_sdk, that points to your sdk build: export gecko_sdk=/path/to/your/sdk our build system should pick it up from there.
...you can inspect variables, keep track of watch expressions, and evaluate arbitrary js at any point in execution.
Multiple Rules - Archive of obsolete content
the query generates a list of the photos and assigns the title of each photo to the variable '?title'.
...the subject is the variable from the result that want to compare.
...note the assign element in the example above, used to calculate the '?letters' variable from the length of the name, minus one for the space character.
...as long as the variable matches one of the values, the where clause will match.
binding - Archive of obsolete content
a binding is used to bind a variable to a node.
... like the triple element in syntax, it can be used to bind a particular property of a matched node to a particular variable name.
...it can be a variable reference, an rdf resource uri, or an rdf literal value.
...it can be a variable reference or an rdf resource uri.
member - Archive of obsolete content
both the container and child attributes may use variables.
... a variable reference to a node that is expected to be a child of the element that is referred to by the container element.
... a variable reference to a node that is expected to be a container.
... if the variable is the same as the uri attribute on the content element, the resource must be a container element in order to match.
template - Archive of obsolete content
attributes container, member examples (example needed) attributes container type: string may optionally be set to the variable to use as the container or reference variable.
... if not specified, the variable specified in the uri attribute of the content tag in the template's first rule is used.
... member type: string may optionally be set to the variable to use as the member variable.
... if not specified, the variable specified in the uri attribute in the action body of the template's first rule is used.
NPP_GetValue - Archive of obsolete content
syntax #include <npapi.h> nperror npp_getvalue(void *instance, nppvariable variable, void *value); parameters the function has the following parameters: instance pointer to the plugin instance from which the value should come.
... variable variable for which the browser (caller) would like a value.
... value value for the requested variable.
... description npp_getvalue retrieves instance variables.
NPP_SetValue - Archive of obsolete content
this call is used to inform plugins of variable information controlled by the browser.
... syntax #include <npapi.h> nperror npp_setvalue(void *instance, npnvariable variable, void *value); parameters the function has the following parameters: instance pointer to plugin instance on which to set the variable.
... variable the variable being set.
... value value for the variable being set.
NPAPI plugin reference - Archive of obsolete content
this call is used to inform the browser of variable information controlled by the plugin.
... npnvariable see npn_getvalue.
...this call is used to inform plugins of variable information controlled by the browser.
... nppvariable see npn_setvalue.
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
so the plugin project should be aware of two new additions to nppvariable enumeration type which are now defined in npapi.h as: nppvpluginscriptableinstance = 10, nppvpluginscriptableiid = 11 and two analogous additions to nsplugininstancevariable type in nsplugindefs.h as: nsplugininstancevariable_scriptableinstance = 10, nsplugininstancevariable_scriptableiid = 11 what's in the plugin code?
...two new cases for the above mentioned new variables should be added to the plugin implementation of npp_getvalue (see example 3).
... argn[], char* argv[], npsaveddata* saved) { if(instance == null) return nperr_invalid_instance_error; // just prime instance->pdata with null for the purpose of this example // it will be assigned to the scriptable interface later to keep its // association with the specific plugin instance instance->pdata = null; return rv; } nperror npp_getvalue(npp instance, nppvariable variable, void *value) { if(instance == null) return nperr_invalid_instance_error; nperror rv = nperr_no_error; static nsiid scriptableiid = ns_itestplugin_iid; if (variable == nppvpluginscriptableinstance) { // nsitestplugin interface object should be associated with the plugin // instance itself.
...er) ns_addref(scriptablepeer); // addref for ourself, // don't forget to release on // shutdown to trigger its destruction } // add reference for the caller requesting the object ns_addref(scriptablepeer); *(nsisupports **)value = scriptablepeer; } else if (variable == nppvpluginscriptableiid) { nsiid* ptr = (nsiid *)npn_memalloc(sizeof(nsiid)); *ptr = scriptableiid; *(nsiid **)value = ptr; } return rv; } nperror npp_destroy (npp instance, npsaveddata** save) { if(instance == null) return nperr_invalid_instance_error; // release the scriptable object ns_if_release(instance->pdata); } original document inf...
Build the brick field - Game development
setting up the brick variables the overall aim of this lesson is to render a few lines of code for the bricks, using a nested loop that works through a two-dimensional array.
... first however we need to set up some variables to define information about the bricks such as their width and height, rows and columns, etc.
... add the following lines to your code below the variables which you have previously declared in your program.
...add the following just below your variables: var bricks = []; for(var c=0; c<brickcolumncount; c++) { bricks[c] = []; for(var r=0; r<brickrowcount; r++) { bricks[c][r] = { x: 0, y: 0 }; } } the code above will loop through the rows and columns and create the new bricks.
Move the ball - Game development
defining a drawing loop to keep constantly updating the canvas drawing on each frame, we need to define a drawing function that will run over and over again, with a different set of variable values each time to change sprite positions, etc.
...first, instead of a hardcoded position at (50,50) we will define a starting point at the bottom center part of the canvas in variables called x and y, then use those to define the position the circle is drawn at.
... first, add the following two lines above your draw() function, to define x and y: var x = canvas.width/2; var y = canvas.height-30; next update the draw() function to use the x and y variables in the arc() method, as shown in the following highlighted line: function draw() { ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } now comes the important part: we want to add a small value to x and y after every frame has been drawn to make it appear that the ball is moving.
...add the following below your x and y variable definitions: var dx = 2; var dy = -2; the last thing to do is to update x and y with our dx and dy variable on every frame, so the ball will be painted in the new position on every update.
Buttons - Game development
new variables we will need a variable to store a boolean value representing whether the game is currently being played or not, and another one to represent our button.
... add these lines below your other variable definitions: var playing = false; var startbutton; loading the button spritesheet we can load the button spritesheet the same way we loaded the ball's wobble animation.
... now we need to define the startgame() function referenced in the code above: function startgame() { startbutton.destroy(); ball.body.velocity.set(150, -150); playing = true; } when the button is pressed, we remove the button, sets the ball's initial velocity and set the playing variable to true.
...to stop this, we can take advantage of the playing variable and make the paddle movable only when the game has started.
Global object - MDN Web Docs Glossary: Definitions of Web-related terms
in a web browser, when scripts create global variables, they're created as members of the global object.
...any global variables or functions can be accessed as properties of the window object.
... access global variables var foo = "foobar"; foo === window.foo; // returns: true after defining a global variable foo, we can access its value directly from the window object, by using the variable name foo as a property name of the global object window.foo.
... explanation: the global variable foo was stored in the window object, like this: foo: "foobar" access global functions function greeting() { console.log("hi!"); } window.greeting(); // it is the same as the normal invoking: greeting(); the example above explains how global functions are stored as properties in the window object.
How to build custom form controls - Learn web development
needs to be initialized selectlist.foreach(function (select) { // as well as all its `option` elements var optionlist = select.queryselectorall('.option'); // each time a user hovers their mouse over an option, we highlight the given option optionlist.foreach(function (option) { option.addeventlistener('mouseover', function () { // note: the `select` and `option` variable are closures // available in the scope of our function call.
... highlightoption(select, option); }); }); // each times the user clicks on or taps a custom select element select.addeventlistener('click', function (event) { // note: the `select` variable is a closure // available in the scope of our function call.
... // we toggle the visibility of the list of options toggleoptlist(select); }); // in case the control gains focus // the control gains the focus each time the user clicks on it or each time // they use the tabulation key to access the control select.addeventlistener('focus', function (event) { // note: the `select` and `selectlist` variable are closures // available in the scope of our function call.
... // we activate the control activeselect(select, selectlist); }); // in case the control loses focus select.addeventlistener('blur', function (event) { // note: the `select` variable is a closure // available in the scope of our function call.
Graceful asynchronous programming with Promises - Learn web development
we are storing the promise object returned by fetch() inside a variable called promise.
... next, we call our function three times to begin the process of fetching and decoding the images and text and store each of the returned promises in a variable.
...here we use some fairly simple sync code to store the results in separate variables (creating object urls from the blobs), then display the images and text on the page.
... console.log(values); // store each value returned from the promises in separate variables; create object urls from the blobs let objecturl1 = url.createobjecturl(values[0]); let objecturl2 = url.createobjecturl(values[1]); let desctext = values[2]; // display the images in <img> elements let image1 = document.createelement('img'); let image2 = document.createelement('img'); image1.src = objecturl1; image2.src = objecturl2; document.body.appendchild(image1); document.body.appendchild(image2); // display the text in a paragraph let para = document.createelement('p'); para.textcontent = desctext; document.body.appendchild(para); save and refresh and you should see your ui components all loaded, albeit in a not particularly attractive way!
Video and Audio APIs - Learn web development
rd, 200); } } function mediaforward() { clearinterval(intervalrwd); rwd.classlist.remove('active'); if(fwd.classlist.contains('active')) { fwd.classlist.remove('active'); clearinterval(intervalfwd); media.play(); } else { fwd.classlist.add('active'); media.pause(); intervalfwd = setinterval(windforward, 200); } } you'll notice that first we initialize two variables — intervalfwd and intervalrwd — you'll find out what they are for later on.
... if it hasn't yet been set, we add the active class to the rwd button using classlist.add(), pause the video using htmlmediaelement.pause(), then set the intervalrwd variable to equal a setinterval() call.
...to stop a setinterval() running, you have to call clearinterval(), giving it the identifying name of the interval to clear, which in this case is the variable name intervalrwd (see the clearinterval() call earlier on in the function).
... then we initialize two more variables — minutevalue and secondvalue.
JavaScript First Steps - Learn web development
after that, we discuss some key building blocks in detail, such as variables, strings, numbers and arrays.
... storing the information you need — variables after reading the last couple of articles you should now know what javascript is, what it can do for you, how you use it alongside other web technologies, and what its main features look like from a high level.
... in this article we will get down to the real basics, looking at how to work with the most basic building blocks of javascript — variables.
... arrays in the final article of this module, we'll look at arrays — a neat way of storing a list of data items under a single variable name.
JavaScript object basics - Learn web development
object basics an object is a collection of related data and/or functionality (which usually consists of several variables and functions — which are called properties and methods when they are inside objects.) let's work through an example to understand what they look like.
... as with many things in javascript, creating an object often begins with defining and initializing a variable.
...s into your code, just below the closing curly brace of the person object: let mydataname = 'height'; let mydatavalue = '1.75m'; person[mydataname] = mydatavalue; now try saving and refreshing, and entering the following into your text input: person.height adding a property to an object using the method above isn't possible with dot notation, which can only accept a literal member name, not a variable value pointing to a name.
...you should also appreciate that objects are very useful as structures for storing related data and functionality — if you tried to keep track of all the properties and methods in our person object as separate variables and functions, it would be inefficient and frustrating, and we'd run the risk of clashing with other variables and functions that have the same names.
Test your skills: JSON - Learn web development
your task is to fill in the missing parts of the displaycatinfo() function to store: the names of the three mother cats, separated by commas, in the motherinfo variable.
... the total number of kittens, and how many are male and female, in the kitteninfo variable.
... the values of these variables are then printed to the screen inside paragraphs.
... you'll probably want to use an outer loop to loop through the cats and add their names to the motherinfo variable string, and an inner loop to loop through all the kittens, add up the total of all/male/female kittens, and add those details to the kitteninfo variable string.
Server-side web frameworks - Learn web development
for example, the django template system allows you to specify variables using a "double-handlebars" syntax (e.g.
... {{ variable_name }}), which will be replaced by values passed in from the view function when a page is rendered.
...continuing the "youngest team" example from the previous section, the html template is passed a list variable called youngest_teams by the view.
... inside the html skeleton we have an expression that first checks if the youngest_teams variable exists, and then iterates it in a for loop.
React interactivity: Events and state - Learn web development
usestate() returns these two things, so we are using array destructuring to capture them both in separate variables.
...we can make this a variable, too.
...'tasks' : 'task'; const headingtext = `${tasklist.length} ${tasksnoun} remaining`; now you can replace the list heading's text content with the headingtext variable.
...nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Vue conditional rendering: editing existing todos - Learn web development
specifically, we need to add a variable to track if the item is being edited, and a button to toggle that variable.
... for item-edited, you'll need to pass the item.id and the special $event variable.
... this is a special vue variable used to pass event data to methods.
...nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Adding a new CSS property
so first, you need to add a member variable (or variables) to the chosen style struct in nsstylestruct.h and fix the default constructor and the copy constructor of that struct in nsstylestruct.cpp.
... if this variable needs to be a tagged union, use nsstylecoord.
... the default constructor must initialize the variable to match the initial value of the property, as described in the "initial value:" line in the specification's definition of the property.
... in any case where the computation you do might vary between elements that match the same list of style rules, you need to set the canstoreinruletree variable to false.
Debugging OpenGL
opengl debug mode when running a debug build, you can enable the opengl debug mode by defining the environment variable moz_gl_debug.
... if you start up firefox with this variable defined, the following behavior changes occur: each time you issue an opengl call, a check is performed to ensure that the gl context is current, using a thread-local static variable to keep track of this.
... if you need more verbose debug output, you can enable the verbose debug mode by defining the environment variable moz_gl_debug_verbose.
... the moz_gl_debug_abort_on_error environment variable, if set, causes firefox to abort as soon as an opengl error occurs.
Following the Android Toasts Tutorial from a JNI Perspective
let sig = { context: 'landroid/content/context;', charsequence; 'ljava/lang/charsequence;', int: 'i', toast: 'landroid/widget/toast;', void: 'v', }; get java environment before we go on to declare the other important features, we need to load our environment variable.
... this is the template that will follow our object of signatures: var my_jenv = null; try { my_jenv = jni.getforthread(); // do the jni work here } finally { if (my_jenv) { jni.unloadclasses(my_jenv); } } the reason we choose my_jenv for a variable name, and not jenv, is because the global privileged window scope of firefox for android has a variable jenv already, and we don't want to mix.
...to load the class the following is done: let toast = jni.loadclass(my_jenv, sig.toast.substr(1, sig.toast.length - 2), { // declares of constructors, static_methods, methods, fields, and static_fields go here }); the variable name of toast was used, but it does not matter, you can use whatever you want.
... the first argument to loadclass is the java environment variable, my_jenv.
PerfMeasurement.jsm
method overview static bool canmeasuresomething(); void reset(); void start(); void stop(); member fields recorded data variables these variables provide access to the recorded data.
... variable type description cpu_cycles uint64 the number of cpu cycles elapsed.
... variable type description eventsmeasured eventmask a bit mask of the event types recorded; this can differ from the events requested if the platform doesn't support all of the event types you specified when creating the perfmeasurement object.
...for each enabled counter, the number of measured events of that type that occurred are added to the appropriate visible variable.
Localization content best practices
think of them as long variable names.
... string includes variables: always explain what will be the value of these variables at run-time.
... use ordered variables in string with multiple variables consider this string from /browser: generalsiteidentity=this website is owned by %s\nthis has been verified by %s first thing: always add a localization comment explaining what these variables mean, even if it seems obvious.
... using multiple %s give the impression that the order of variables if fixed, which is actually not.
JS::PerfMeasurement
the current implementation can measure eleven different types of low-level hardware and software events: events that can be measured bitmask passed to constructor counter variable what it measures perfmeasurement::cpu_cycles .cpu_cycles raw cpu clock cycles ::instructions .instructions total instructions executed ::cache_references .cache_references total number of memory accesses ::cache_misses .cache_misses memory accesses that missed the cache ::branch_instructions .branch_instructions bra...
... all the counter variables for events that are not being measured will have the fixed value (uint64)-1.
... the counter variables do not update in real time; they only change when stop is called.
...each potentially-measurable event corresponds to a regular old instance variable, which you can read and even modify.
Profiling with the Firefox Profiler
profiling firefox startup start your firefox with the environment variable moz_profiler_startup=1 set.
...it uses settings that can be configured with the environment variables moz_profiler_startup_entries, moz_profiler_startup_interval and moz_profiler_startup_filters: if it looks like the buffer is not large enough, you can tweak the buffer size with the env var moz_profiler_startup_entries.
... description of all available environment variables may be printed by starting firefox with moz_profiler_help=1 set.
... all options may be set in about:profiling or through the moz_profiler_startup_features environement variable.
Optimizing Applications For NSPR
this has disastrous implications on the generally accepted programming practice of taking the address of a stack variable and giving that address to another thread.
...the thread that created a stack variable sees his own stack variables correctly across thread switches.
...for complete cross platform portability, do not take the address of a stack variable and make that address available to another thread.
...make sure all possible values of your printn variables are within 2^16.
NSPR LOG MODULES
this environment variable specifies which log modules have logging enabled.
...these controls should be set in the nspr_log_modules environment variable at execution time to affect nspr's log service for your application.
...to enable all log module calls to pr_log, set the variable as follows: set nspr_log_modules=all:5 timestamp including timestamp results in a timestamp of the form "2015-01-15 21:24:26.049906 utc - " prefixing every logged line.
... set nspr_log_modules=timestamp,mozstorage:5 set nspr_log_file=/tmp/foo.log logging with try server for mochitest, edit variable nspr_log_modules in testing/mochitest/runtests.py before pushing to try.
NSPR Types
calling convention types these types are used to support cross-platform declarations of prototypes and implementations: pr_extern is used for declarations of external functions or variables.
... pr_implement is used for definitions of external functions or variables.
... prfloat64 native os integer types these types are most appropriate for automatic variables.
...variables of these types are suitable for storing a pointer or pointer subtraction.
PR_WaitCondVar
syntax #include <prcvar.h> prstatus pr_waitcondvar( prcondvar *cvar, printervaltime timeout); parameters pr_waitcondvar has the following parameters: cvar the condition variable on which to wait.
... if unsuccessful (for example, if the caller has not locked the lock associated with the condition variable or the thread was interrupted with pr_interrupt), pr_failure.
... description before the call to pr_waitcondvar, the lock associated with the condition variable must be held by the calling thread.
... when the condition variable is notified, a thread waiting on that condition moves from the "waiting on condition" state to the "ready" state.
NSS 3.12.5 release_notes
if an application depends on renegotiation feature, it can be enabled by setting the environment variable nss_ssl_enable_renegotiation to 1.
... by setting this environmental variable, the fix provided by these patches will have no effect and the application may become vulnerable to the issue.
... environment variables nss_fips will start nss in fips mode.
... bug 510435: remove unused make variable dso_ldflags bug 510436: add macros for build numbers (4th component of version number) to nssutil.h bug 511227: firefox 3.0.13 fails to compile on freebsd/powerpc bug 511312: nss fails to load softoken, looking for sqlite3.dll bug 511781: add new tls 1.2 cipher suites implemented in windows 7 to ssltap bug 516101: if pk11_importcert fails, it leaves the certificate undiscoverable by cert_pkixverifycert bug 518443: pk11_importandreturnprivatekey leaks an arena bug 518446: pk11_derencodepublickey leaks a certsubjectpublickeyinfo bug 518457: seckey_encodedersu...
NSS 3.16 release notes
(this requires nspr 4.10.4.) to build for the linux x32 target, set the environment variable use_x32=1 when building nss.
...it is no longer necessary to set the environment variable nss_enable_ecc=1 when building nss.
... to disable ecc, set the environment variable nss_disable_ecc=1 when building nss.
... bug 956082: if the nss_sdb_use_cache environment variable is set, skip the runtime test sdb_measureaccess.
nss tech note2
to enable the module logger, you must set the environment variable nss_debug_pkcs11_module to the name of the target module.
...for optimized builds, nss must be built with the variable debug_pkcs11 set.
...no additional environment variables are required for this mode.
... if the environment variable nss_output_file is set, its value will be used as the path name of the file to which the final output will be written.
Performance Hints
not only is it good programming practice, it can speed up your code by allowing the compiler to generate special code to access the variables.
... for example, you could rewrite function sum(a) { result = 0; for (i=0; i < a.length; i++) result += a[i]; return result; } as function sum(a) { var result = 0; for (var i=0; i < a.length; i++) result += a[i]; return result; } this is not equivalent code because the second version does not modify global variables result and i.
... however, if you don't intend for any other function to access these variables, then storing them globally is probably wrong anyway (what if you called another function that had a loop like the one in sum!).
... with using the with statement prevents the compiler from generating code for fast access to local variables.
JS_ConvertArguments
pointers to variables into which to store the converted values.
... variables for optional parameters must already be initialized, because if an optional parameter is not in argv, js_convertarguments does not modify the corresponding variable.
... the variables do not need to be rooted.
...if an optional argument is missing from argv, js_convertarguments neither assigns anything to any variable nor reports an error.
Secure Development Guidelines
malloc debugging can help detect those bugs use after free accessing data after a free() or delete can lead to undefined behavior some debug tools might be able catch some cases un-initialized data example: int main() { char *uninitialized_ptr; printf("0x%08x\r\n", uninitialized_ptr); return 0; } $ ./test 0x8fe0103 un-initialized data: prevention initialize your variables!
...(); delete ptr1; do_something_else(); ptr2 = new char[-1] // oom } catch (...) { delete ptr1; delete ptr2; } new will throw an exception — ptr1 is already freed in the try block then freed again in the catch block freeing un-initialized data free data in the catch block assumption is that it’s initialized in the try block if the try block throws before the variable is initialized, the catch block will operate on un-intialized data freeing un-initialized data example: int main(){ char *ptr; try { ptr = new char[-1]; // oom } catch(...) { delete ptr; } } freeing un-initialized data: prevention be careful when freeing data in catch blocks make sure the try block can’t throw before data is initialized initia...
...lize variables when they’re declared; for example, set pointers to null memory leaks usually occur when memory is allocated in a try block after the allocation, something throws in the try block before memory is freed in the try block the catch block does not foresee this and doesn't free the memory freeing un-initialized data example: int main(){ char *p; try { p = new char [1000]; ...
... } } memory leaks: prevention any acquired resource in a try block should be freed in a catch block (if the try block throws before the resource is freed) might be helpful to initialize variables null for pointers -1 for file descriptors ...
Starting WebLock
assuming there weren't any unexpected errors, the variable catman holds the nsicategorymanager interface pointer, which you can use to add the component as a startup observer by calling a method on the nsicategorymanager.
...in c++, this is considered a public variable and "compiled" into a get method (e.g., getsites).
...the type of this variable is print64, but this type is not represented as a primitive on all platforms.
...in this case, if the out parameter of getdata does not return something that is queryinterface-able to an nsisupportscstring, the variable will be set to null.
Using XPCOM Utilities to Make Things Easier
// returns a reference to a shared nsiid object\ static const nsiid iid1 = ns_get_iid(nsisupports); // constructs a new nsiid object static const nsiid iid2 = ns_isupports_iid; in order to use ns_impl_isupportsn, you must be sure that a member variable of type nsrefcnt is defined and named mrefcnt in your class.
...when you pass them to a getter, you must do something special, however: you must wrap the variable with the function getter_addrefs, as in the example above.
...if for some reason you need to adjust the reference count, you must assign the nscomptr to a new variable and addref that.
...this raw pointer can then be assigned to a variable and have its reference updated by ns_if_addref.
Components.utils.evalInWindow
this is useful for privileged code, such as add-on code, to access variables and apis defined in web content.
...example suppose a page script defines a variable: // page-script.js var somelocalvariable = { name: "selection1", node: document.documentelement }; an add-on script or other privileged script can access the variable using evalinwindow(): // add-on-script.js var result = components.utils.evalinwindow("somelocalvariable", contentwindow); console.log(result); // {"name":"selection1","node":{}} the add-on code can modify the variable as well,...
... of course: // add-on-script.js components.utils.evalinwindow("somelocalvariable.newprop = 42", contentwindow); // page-script.js console.log(window.somelocalvariable.newprop); // 42 but note that the add-on script must trust that the page script has not redefined the setter on somelocalvariable: unlike xraywrappers, evalinwindow() does not provide x-ray vision.
... if the returned object contains a function, calls to evalinwindow() will throw an error: // page-script.js function bar() { } var somelocalvariablecontainingafunction = {name: "selection1", foo : bar}; // add-on-script.js components.utils.evalinwindow("somelocalvariablecontainingafunction", contentwindow); // error, function can't be cloned ...
nsIURLFormatter
toolkit/components/urlformatter/public/nsiurlformatter.idlscriptable this interface exposes methods to substitute variables in url formats.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) variable names can contain 'a-z' letters and '_' characters.
...the set of known variables is predefined.
... if a variable is unknown, it is left unchanged and a non-fatal error is reported.
Using the clipboard
please note: the sourcewindow variable is a placeholder for whatever window owns the data being copied -- from any dom element you can obtain it via element.ownerdocument.defaultview.
... services.clipboard.setdata(trans, null, services.clipboard.kglobalclipboard); we get the system clipboard object and store it in the clip variable.
... the variable str now holds the data from the clipboard.
... we assign the string to the variable pastetext.
Plug-in Basics - Plugins
how gecko finds plug-ins when a gecko-based browser starts up, it checks certain directories for plug-ins, in this order: windows directory pointed to by moz_plugin_path environment variable.
... linux directory pointed to by moz_plugin_path environment variable.
...i checked also this command with above script (with environment variable) on my system and also working.
... firefox and opensuse probably use "moz_plugin_path environment variable" in script to run firefox, so in this way /usr/lib64/mozilla/plugins also should be supported.
Scripting plugins - Plugins
mozilla does this by calling the old plugin api call npp_getvalue with the new enumeration value that has been added to the nppvariable enumeration.
... the new nppvariable enumeration is defined in npapi.h as: nppvpluginscriptablenpobject = 15 threading model this api is not designed to be thread safe.
...the extensions are two additions to the npnvariables enumeration; the new enumerations are npnvwindownpobject and npnvpluginelementnpobject.
... the new npnvariable enumerations are defined in npapi.h as: npnvwindownpobject = 15, npnvpluginelementnpobject = 16 how to call plugin native methods the following html code will do the job: <embed type="application/plugin-mimetype"> <script> var embed = document.embeds[0]; embed.nativemethod(); alert(embed.nativeproperty); embed.nativeproperty.anothernativemethod(); </script> the api extensions the ...
Using the Debugger map scopes feature - Firefox Developer Tools
it enables you to see the variables from the original source.
... it’s also possible to inspect variables from the generated scopes (e.g., a bundle file with all concatenated module files).
... when you click the increment button on the page and hit the breakpoint, an additional section is added to the right-hand panel below the call stack to display variables mapped from the original scope, like this: as useful as this is, it would be even nicer if you could view the original code (before it was packages into the "bundle.js" file.
...and, since map has been checked in the scopes panel, you also see variable symbols from the original code.
Debugger.Frame - Firefox Developer Tools
ifcode is not strict mode code, then variable declarations incode affect the environment of this frame.
... (in the terms used by the ecmascript specification, the variableenvironment of the execution context for the eval code is the variableenvironment of the execution context that this frame represents.) if implementation restrictions prevent spidermonkey from extending this frame’s environment as requested, this call throws an error exception.
...for each own enumerable property ofbindings namedname whose value isvalue, include a variable in the environment in whichcode is evaluated namedname, whose value isvalue.
...(in the terms used by the ecmascript specification, the variableenvironment of the execution context for the eval code is the variableenvironment of the execution context that this frame represents, and thebindings appear in a new declarative environment, which is the eval code’s lexicalenvironment.) if implementation restrictions prevent spidermonkey from extending this frame’s environment as requested, this call throws an error exception.
Migrating from Firebug - Firefox Developer Tools
to see the call parameters in the devtools, you need to have a look at the variables side panel.
... examine variables the watch side panel in firebug displays the window object (the global scope) by default.
... with the script execution halted it shows the different variable scopes available within the current call stack frame.
...the devtools have a variables side panel, which works basically the same.
AuthenticatorAssertionResponse.authenticatorData - Web APIs
attestedcredentialdata (variable length) - the credential that was created.
... credentialid (variable length) - a unique identifier for this credential so that it can be requested for future authentications.
... credentialpublickey (variable length) - a cose encoded public key.
... extensions (variable length) - an optional cbor map of extensions.
Intersection Observer API - Web APIs
setting up first, we need to prepare some variables and install the observer.
... const numsteps = 20.0; let boxelement; let prevratio = 0.0; let increasingcolor = "rgba(40, 40, 190, ratio)"; let decreasingcolor = "rgba(190, 40, 40, ratio)"; // set things up window.addeventlistener("load", (event) => { boxelement = document.queryselector("#box"); createobserver(); }, false); the constants and variables we set up here are: numsteps a constant which indicates how many thresholds we want to have between a visibility ratio of 0.0 and 1.0.
... prevratio this variable will be used to record what the visibility ratio was the last time a threshold was crossed; this will let us figure out whether the target element is becoming more or less visible.
... finally, in order to track whether the intersection ratio is going up or down, we remember the current ratio in the variable prevratio.
Capabilities, constraints, and settings - Web APIs
defaults and variables first we have the default constraint sets, as strings.
... then we initialize the variables which will hold the mediatrackconstraints objects for the video and audio tracks, as well as the variables which will hold references to the video and audio tracks themselves, to null.
... when the stream is obtained, it's attached to the <video> element so that it's visible on screen, and we grab the audio track and video track into the variables audiotrack and videotrack.
... document.getelementbyid("stopbutton").addeventlistener("click", function() { if (videotrack) { videotrack.stop(); } if (audiotrack) { audiotrack.stop(); } videotrack = audiotrack = null; videoelement.srcobject = null; }); this simply stops the active tracks, sets the videotrack and audiotrack variables to null so we know they're gone, and removes the stream from the <video> element by setting htmlmediaelement.srcobject to null.
WebGL2RenderingContext - Web APIs
programs and shaders webgl2renderingcontext.getfragdatalocation() returns the binding of color numbers to user-defined varying out variables.
... uniforms and attributes webgl2renderingcontext.uniform[1234][uif][v]() methods specifying values of uniform variables.
... webgl2renderingcontext.uniformmatrix[234]x[234]fv() methods specifying matrix values for uniform variables.
... webgl2renderingcontext.gettransformfeedbackvarying() returns information about varying variables from webgltransformfeedback buffers.
WebGLRenderingContext.getAttribLocation() - Web APIs
the webglrenderingcontext.getattriblocation() method of the webgl api returns the location of an attribute variable in a given webglprogram.
... syntax glint gl.getattriblocation(program, name); parameters program a webglprogram containing the attribute variable.
... name a domstring specifying the name of the attribute variable whose location to get.
... return value a glint number indicating the location of the variable name if found.
Data in WebGL - Web APIs
WebAPIWebGL APIData
each kind of variable is accessible by one or both types of shader program (depending on the data store type) and possibly by the site's javascript code, depending on the specific type of variable.
... glsl data types <<document the basic types, vectors, etc; see data type (glsl) on the khronos webgl wiki>> glsl variables there are three kinds of "variable" or data storage available in glsl, each of which with its own purpose and use cases: attributes, varyings, and uniforms.
... attributes attributes are glsl variables which are only available to the vertex shader (as variables) and the javascript code.
...is in glsl gl.bindbuffer( gl.array_buffer, cbuffer ); gl.bufferdata( gl.array_buffer, flatten(vertexcolors), gl.static_draw ); var vcolor = gl.getattriblocation( program, "vcolor" ); gl.vertexattribpointer( vcolor, 4, gl.float, false, 0, 0 ); gl.enablevertexattribarray( vcolor ); //glsl attribute vec4 vcolor; void main() { fcolor = vcolor; } varyings varyings are variables that are declared by the vertex shader and used to pass data from the vertex shader to the fragment shader.
Taking still photos with WebRTC - Web APIs
initialization we start by wrapping the whole script in an anonymous function to avoid global variables, then setting up various variables we'll be using.
... (function() { var width = 320; // we will scale the photo width to this var height = 0; // this will be computed based on the input stream var streaming = false; var video = null; var canvas = null; var photo = null; var startbutton = null; those variables are: width whatever size the incoming video is, we're going to scale the resulting image to be 320 pixels wide.
...ideoheight / (video.videowidth/width); video.setattribute('width', width); video.setattribute('height', height); canvas.setattribute('width', width); canvas.setattribute('height', height); streaming = true; } }, false); this callback does nothing unless it's the first time it's been called; this is tested by looking at the value of our streaming variable, which is false the first time this method is run.
...finally, we set the streaming variable to true to prevent us from inadvertently running this setup code again.
Window.open() - Web APIs
WebAPIWindowopen
note on the use of window.open() to reopen an existing window with name windowname : this functionality is not valid for all browsers and more with variable conditions.
... best practices <script type="text/javascript"> var windowobjectreference = null; // global variable function openffpromotionpopup() { if(windowobjectreference == null || windowobjectreference.closed) /* if the pointer to the window object in memory does not exist or if such pointer exists but the window was closed */ { windowobjectreference = window.open("http://www.spreadfirefox.com/", "promotefirefoxwindowname", "resizable,scrollbars,status"); /* then create it.
... you can also parameterize the function to make it versatile, functional in more situations, therefore re-usable in scripts and webpages: <script type="text/javascript"> var windowobjectreference = null; // global variable function openrequestedpopup(url, windowname) { if(windowobjectreference == null || windowobjectreference.closed) { windowobjectreference = window.open(url, windowname, "resizable,scrollbars,status"); } else { windowobjectreference.focus(); }; } </script> (...) <p><a href="http://www.spreadfirefox.com/" target="promotefirefoxwindow" onclick="openrequestedpopup(this.h...
...ref, this.target); return false;" title="this link will create a new window or will re-use an already opened one" >promote firefox adoption</a></p> you can also make such function able to open only 1 secondary window and to reuse such single secondary window for other links in this manner: <script type="text/javascript"> var windowobjectreference = null; // global variable var previousurl; /* global variable that will store the url currently in the secondary window */ function openrequestedsinglepopup(url) { if(windowobjectreference == null || windowobjectreference.closed) { windowobjectreference = window.open(url, "singlesecondarywindowname", "resizable,scrollbars,status"); } else if(previousurl != url) { windowobjectreference = window.open(url, "sing...
Detecting CSS animation support - CSS: Cascading Style Sheets
me !== undefined ) { animation = true; } if( animation === false ) { for( var i = 0; i < domprefixes.length; i++ ) { if( elem.style[ domprefixes[i] + 'animationname' ] !== undefined ) { pfx = domprefixes[ i ]; animationstring = pfx + 'animation'; keyframeprefix = '-' + pfx.tolowercase() + '-'; animation = true; break; } } } for starters we define a few variables.
... then we check if the css animation-name property on the style collection for the element specified by the variable elem is set.
...all we do is set up a keyframes variable, prefixing each attribute as it's constructed.
... this variable, once constructed, contains the complete description of all the keyframes needed by our animation sequence.
Introduction - JavaScript
you do not have to declare all variables, classes, and methods.
...variables, parameters, and function return types are not explicitly typed.
... variable data types are not declared (dynamic typing, loosely typed).
... variable data types must be declared (static typing, strongly typed).
TypeError: invalid assignment to const "x" - JavaScript
message typeerror: invalid assignment to const "x" (firefox) typeerror: assignment to constant variable.
...maybe you meant to declare a block-scoped variable with let or global variable with var.
...it does not mean the value it holds is immutable, just that the variable identifier cannot be reassigned.
...this means that you can't mutate the value stored in a variable: const obj = {foo: 'bar'}; obj = {foo: 'baz'}; // typeerror: invalid assignment to const `obj' but you can mutate the properties in a variable: obj.foo = 'baz'; obj; // object { foo: "baz" } ...
Default parameters - JavaScript
function append(value, array = []) { array.push(value) return array } append(1) // [1] append(2) // [2], not [1, 2] this even applies to functions and variables: function callsomething(thing = something()) { return thing } let numberoftimescalled = 0 function something() { numberoftimescalled += 1 return numberoftimescalled } callsomething() // 1 callsomething() // 2 earlier parameters are available to later default parameters parameters defined earlier (to the left) are available to later default parameters: function greet(name, greeting...
... this means that functions and variables declared in the function body cannot be referred to from default value parameter initializers; attempting to do so throws a run-time referenceerror.
... it also means that variables declared inside the function body using var will mask parameters of the same name, instead of the usual behavior of duplicate var declarations having no effect.
... function go() { return ':p' } } ...and this function will print undefined because variable var a is hoisted only to the top of the scope created for the function body (and not the parent scope created for the parameter list): function f(a, b = () => console.log(a)) { var a = 1 b() // prints `undefined`, because default parameter values exist in their own scope } parameters without defaults after default parameters parameters are still set left-to-right, overwriting default parameters even if there are later parameters without defaults.
Date.prototype.getYear() - JavaScript
examples years between 1900 and 1999 the second statement assigns the value 95 to the variable year.
... var xmas = new date('december 25, 1995 23:15:00'); var year = xmas.getyear(); // returns 95 years above 1999 the second statement assigns the value 100 to the variable year.
... var xmas = new date('december 25, 2000 23:15:00'); var year = xmas.getyear(); // returns 100 years below 1900 the second statement assigns the value -100 to the variable year.
... var xmas = new date('december 25, 1800 23:15:00'); var year = xmas.getyear(); // returns -100 setting and getting a year between 1900 and 1999 the third statement assigns the value 95 to the variable year, representing the year 1995.
Symbol.unscopables - JavaScript
description the @@unscopables symbol (symbol.unscopables) can be defined on any object to exclude property names from being exposed as lexical variables in with with environment bindings.
... setting a property to true in an unscopables object will make it unscopable and therefore it won't appear in lexical scope variables.
... setting a property to false will make it scopable and thus it will appear in lexical scope variables.
...that means that inside with environment "keys" would now be the method and not the variable.
typeof - JavaScript
(logical not) operator are equivalent to boolean() // symbols typeof symbol() === 'symbol' typeof symbol('foo') === 'symbol' typeof symbol.iterator === 'symbol' // undefined typeof undefined === 'undefined'; typeof declaredbutundefinedvariable === 'undefined'; typeof undeclaredvariable === 'undefined'; // objects typeof {a: 1} === 'object'; // use array.isarray or object.prototype.tostring.call // to differentiate regular objects from arrays typeof [1, 2, 4] === 'object'; typeof new date() === 'object'; typeof /regex/ === 'object'; // see regular expressions section for historical results // the following are confusing, dangerous...
... but with the addition of block-scoped let and statements/const using typeof on let and const variables (or using typeof on a class) in a block before they are declared will throw a referenceerror.
... block scoped variables are in a "temporal dead zone" from the start of the block until the initialization is processed, during which, it will throw an error if accessed.
... typeof undeclaredvariable === 'undefined'; typeof newletvariable; // referenceerror typeof newconstvariable; // referenceerror typeof newclass; // referenceerror let newletvariable; const newconstvariable = 'hello'; class newclass{}; exceptions all current browsers expose a non-standard host object document.all with type undefined.
Introduction to using XPath in JavaScript - XPath
contextnode.documentelement : contextnode.ownerdocument.documentelement ); </pre> and then pass document.evaluate, the nsresolver variable as the namespaceresolver parameter.
... specifying the return type the returned variable xpathresult from document.evaluate can either be composed of individual nodes (simple types), or a collection of nodes (node-set types).
...on" country="usa"/> <phonenumber>202-456-1111</phonenumber> </person> <person> <name first="tony" last="blair" /> <address street="10 downing street" city="london" country="uk"/> <phonenumber>020 7925 0918</phonenumber> </person> </people> to make the contents of the xml document available within the extension, we create an xmlhttprequest object to load the document synchronously, the variable xmldoc will contain the document as an xmldocument object against which we can use the evaluate method javascript used in the extensions xul/js documents.
... while one can adapt the approach in the above section to test for namespaced elements regardless of the prefix chosen (using local-name() in combination with namespace-uri() instead of name()), a more challenging situation occurs, however, if one wishes to grab an element with a particular namespaced attribute in a predicate (given the absence of implementation-independent variables in xpath 1.0).
Private Properties - Archive of obsolete content
using closures another common technique, is to define private properties as variables and their getter and setter functions as a closure over these variables: function point(_x, _y) { this.getx = function () { return _x; }; this.setx = function (x) { _x = x; }; this.gety = function () { return _y; }; this.sety = function (y) { _y = y; }; } note that this technique requires member functions that need access to p...
...however, the use of closures makes private properties too restrictive: since there is no way to access variables in one closure from within another closure, there is no way for objects of the same class to access each other's private properties.
...among other things, add-ons should not be able to access variables that are supposed to be private.
Appendix D: Loading Scripts - Archive of obsolete content
additionally, any properties of the target object are available as variables in the script's global namespace, along with as any properties of the global associated with the target object.
... data sharing: as modules are loaded only once globally, every import has access to the same data and global variables no matter what context or window it was imported from.
...all variables named in the target script's exported_symbols global array will be copied into the current execution context.
JavaScript Object Management - Archive of obsolete content
if you have to use a reference to this inside the function, declare a variable called that that equals this, and use that in the anonymous function.
...this message has been shown 5 times." keep the counter as a variable in the browseroverlay object, and increment it every time the message is going to be shown.
...several objects, functions and variables can be declared on this file, but the only object visible from the outside will be 〈modulenamespace〉, which is a namespace in our case.
The Essentials of an Extension - Archive of obsolete content
all objects and variables we define in this javascript are global, meaning that scripts in firefox and other extensions can see them and interact with them.
...the first line in the body of the function declares a variable that will hold the stringbundle element defined in the overlay.
... the variable is declared using let, which is similar to var but with more restricted scope.
Adding preferences to an extension - Archive of obsolete content
["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice) .getbranch("extensions.stockwatcher2."); this.prefs.addobserver("", this, false); this.tickersymbol = this.prefs.getcharpref("symbol").touppercase(); this.refreshinformation(); window.setinterval(this.refreshinformation, 10*60*1000); } }, our object has two member variables.
... if the changed preference is "symbol", we grab the updated value of the preference by calling the nsiprefbranch.getcharpref() method, and stash it in our tickersymbol variable.
... once we have the symbol in the local variable symbol, we use that to construct the url and the string to display in the status bar panel.
Dehydra Function Reference - Archive of obsolete content
decl is a variable type object representing the function being processed body is an array of {loc:, statements:array of variable types} representing an outline of the function stripped down to variables, function calls and assignments.
... process_decl(decl) process_decl is called for every global variable, function, or template declaration.
... decl is a variable type input_end() called once at the end of the c++ source file before the compiler quits.
Drag and Drop JavaScript Wrapper - Archive of obsolete content
<script src="chrome://global/content/nsdraganddrop.js" /> <script src="chrome://global/content/nstransferable.js" /> this drag and drop library creates an object stored in the variable nsdraganddrop.
...in the above examples, this observer is stored in the buttonobserver and textobserver variables.
...var textobserver = { ondragstart: function (event, transferdata, action) { var htmltext = "<strong>cabbage</strong>"; var plaintext = "cabbage"; transferdata.data = new transferdata(); transferdata.data.adddataforflavour("text/html",htmltext); transferdata.data.adddataforflavour("text/unicode",plaintext); } } here, an observer has been declared and stored in the variable textobserver.
GRE - Archive of obsolete content
see environment variables below.
... dependent libraries and environment variables the xulrunner gre is designed so that the embedder does not need to set any environment variables such as path or ld_library_path before calling xpcomgluestartup(), because it dynamically loads the correct dependent libraries.
...embedders will need to set the ld_library_path environment variable and start a new process in order to embed a suite-based gre correctly.
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
the error message in figure 1 says that at aol.com, line 95 tries to access an undefined variable called is_ns70.
...it supports such standard debugging features as breakpoint management, call stack inspection, and variable/object inspection.
... a cross-browser event handling example follows (note that it means you can't define a global variable named event in your code): <div onclick="handleevent(event);">click me!</div> <script> function handleevent(aevent) { var myevent = window.event ?
Tamarin build documentation - Archive of obsolete content
- change the variable android_device in the makefile (near line 65) to point to your sdk/ndk top folder.
... build tamarin release shell - get tamarin-redux - export the following variables into the environment $ export android_toolchain=<full path to your android sdk/ndk top folder> $ export android_ndk=$android_toolchain/android-ndk $ export android_ndk_bin=$android_ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin $ export android_sdk=$android_toolchain/android-sdk-mac_86 $ export path=$path:$android_sdk/platform-tools:$android_ndk_bin - example commands to ...
... setup the shell environment with the following environment variables: # note: the include, lib and libpath must contain windows path information and separator and not cygwin paths.
Treehydra Manual - Archive of obsolete content
users only need to define their esp property variables, abstract values, and the flow semantics of gimple statements, and the library will do all of the substate tracking and fixed-point solving.
...in other words, a mapping from program variables to concrete values.
...for example, if the current abstract value of a variable x is nonzero, and the analysis goes inside an if statement with the condition x == 1, then in the new abstract value of x will be nonzero meet 1.
Document Object Model - Archive of obsolete content
for example, the following two lines which open a new window are functionally equivalent: window.open("test.xul","_new"); open("test.xul","_new"); when you declare a function or a variable at the top level of a script, that is outside another function, you are actually declaring a property of the global object.
... function gettext(){ return "message"; } alert(gettext()); alert(window.gettext()); thus, if you want to access variables or call a function declared in a script used by another window, you just need to access it using the other window's window object.
... the following example shows how to iterate over the children of the root node: var childnodes = document.documentelement.childnodes; for (var i = 0; i < childnodes.length; i++) { var child = childnodes[i]; // do something with child } the childnodes variable will hold the children of the document root element.
XPCOM Interfaces - Archive of obsolete content
you can get a component using javascript code like that below: var afile = components.classes["@mozilla.org/file/local;1"].createinstance(); the file component is retrieved and stored in the afile variable.
...you can also use any variable names of course.
...an example is shown below: var bmarks = components.classes["@mozilla.org/browser/bookmarks-service;1"].getservice(); bmarks.queryinterface(components.interfaces.nsibookmarksservice); bmarks.addbookmarkimmediately("http://www.mozilla.org","mozilla",0,null); first, the component "@mozilla.org/browser/bookmarks-service;1" is retrieved and its service is placed in the variable bmarks.
bindings - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used to specify a set of variable bindings for a rule.
...it can be a variable reference, an rdf resource uri, or an rdf literal value.
...it can be a variable reference or an rdf resource uri.
conditions - Archive of obsolete content
these may have attributes whose value is a variable name beginning with a question mark (?).
... when evaluating the rule for a particular rdf resource, the variables are replaced with values from the resource.
... if all variables can be replaced, the rule matched.
content - Archive of obsolete content
Ésto se utiliza para vincular una variable a un nodo de contenido cuando se emparejan.
... used to specify the variable name for the content.
...each resource is placed in the variable specified in the uri attribute in turn.
triple - Archive of obsolete content
both the subject and object attributes may be variables.
...it can be a variable reference, an rdf resource uri, or an rdf literal value.
...it can be a variable reference or an rdf resource uri.
Using SSH to connect to CVS - Archive of obsolete content
replace pserver with ext in your cvsroot environment variable.
...this sets environment variables that let cvs know how to find and use the agent.
...finally, note that ssh-add needs the environment variable home to be set with the cygwin path to your cygwin home directory.
ActiveXObject - Archive of obsolete content
to create an automation object, assign the new activexobject to an object variable: var excelapp = new activexobject("excel.application"); var excelsheet = new activexobject("excel.sheet"); this code starts the application creating the object (in this case, a microsoft excel worksheet).
... once an object is created, you refer to it in code using the object variable you defined.
... in the following example, you access properties and methods of the new object using the object variable excelsheet and other excel objects, including the application object and the activesheet.cells collection.
GetObject - Archive of obsolete content
assign the object returned by getobject to the object variable.
...once an object is activated, you reference it in code using the object variable you defined.
... in the preceding example, you access properties and methods of the new object using the object variable myobject.
for each...in - Archive of obsolete content
the for each...in statement iterates a specified variable over all values of object's properties.
... syntax for each (variable in object) { statement } variable variable to iterate over property values, optionally declared with the var keyword.
... this variable is local to the function, not to the loop.
Reference - Archive of obsolete content
inheritance and private variables the guide section links to an interesting document discussing how to create and use private variables in objects, which is great if you want to protect the various properties within an object from being poked at accidentally.
...well if you combine the two, you can have inherited private variables: function myclass(){ var property = 5; this.tellme = function(){ return property; } } function myotherclass(){ myclass.apply( this ); } var o = new myotherclass; alert( o.tellme() ); //alerts 5 as you'd expect — the preceding comment was added by psygnisfive (talk – contribs) on 22:23, 4 december 2006 terminology we need a terminology appendix.
...we could also put in layman definitions there for js constructs like functions and variables.
Archived open Web documentation - Archive of obsolete content
talk:javascript reference the guide section links to an interesting document discussing how to create and use private variables in objects, which is great if you want to protect the various properties within an object from being poked at accidentally.
...well if you combine the two, you can have inherited private variables: scope cheatsheet javascript with mozilla extensions has both function-scoped vars and block-scoped lets.
... sharp variables in javascript a sharp variable is a syntax in object initializers that allows serialization of objects that have cyclic references or multiple references to the same object.
Building up a basic demo with the PlayCanvas engine - Game development
there is one helper variable already included, which will store a reference to the <canvas> element.
...for time based animations we'll use a timer variable that will store the time that has passed since the start of the app by adding the deltatime to it on every update.
...add this line of code inside the app.on("update") callback function, right after the addition of the deltatime to the timer variable: box.rotate(deltatime*10, deltatime*20, deltatime*30); it will rotate the box by deltatime*10 on the x axis, deltatime*20 on the y axis and deltatime*30 on the z axis, on very frame — giving us a smooth animation.
Unconventional controls - Game development
we will need a few helper variables for our code to work — one for the purpose of calculating the degrees from radians, two for holding the horizontal and vertical amount of degrees our hand is leaning above the controller, one for the threshold of that lean, and one for the state of our hand's grab status.
... we next add these lines after all the event listeners for keyboard and mouse, but before the draw method: var todegrees = 1 / (math.pi / 180); var horizontaldegree = 0; var verticaldegree = 0; var degreethreshold = 30; var grabstrength = 0; right after that we use the leap's loop method to get the information held in the hand variable on every frame: leap.loop({ hand: function(hand) { horizontaldegree = math.round(hand.roll() * todegrees); verticaldegree = math.round(hand.pitch() * todegrees); grabstrength = hand.grabstrength; output.innerhtml = 'leap motion: <br />' + ' roll: ' + horizontaldegree + '° <br />' + ' pitch: ' + verticaldegree + '° <br />' + ' strength: ' + grabstrength + ''; } }); the code above is cal...
...when those variables are up-to-date, we can use them in the draw() function to move the ship: function draw() { ctx.clearrect(0, 0, canvas.width, canvas.height); // ...
Track the score and win - Game development
you need a variable to record the score.
... add the following into your javascript, after the rest of your variables: var score = 0; you also need a drawscore() function, to create and update the score display.
... to award a score each time a brick is hit, add a line to the collisiondetection() function to increment the value of the score variable each time a collision is detected.
Extra lives - Game development
new variables add the following new variables below the existing ones in your code: var lives = 3; var livestext; var lifelosttext; these respectively will store the number of lives, the text label that displays the number of lives that remain, and a text label that will be shown on screen when the player loses one of their lives.
...to make it easier for us to maintain in the future we can create a separate variable that will hold our styling, let's call it textstyle and place it before the text definitions: textstyle = { font: '18px arial', fill: '#0095dd' }; we can now use this variable when stlying our text labels — update your code so that the multiple instances of the text styling are replaced with the variable: scoretext = game.add.text(5, 5, 'points: 0', textstyle); livestext = game.add.text(gam...
...e.world.width-5, 5, 'lives: '+lives, textstyle); livestext.anchor.set(1,0); lifelosttext = game.add.text(game.world.width*0.5, game.world.height*0.5, 'life lost, click to continue', textstyle); lifelosttext.anchor.set(0.5); lifelosttext.visible = false; this way changing the font in one variable will apply the changes to every place it is used.
Load the assets and print them on screen - Game development
having a ball let's start by creating a javascript variable to represent our ball.
...block) and the preload() function: var ball; note: for the sake of this tutorial, we will use global variables.
... game.load.image('ball', 'img/ball.png'); } the first parameter we want to give the asset is the name that will be used across our game code — for example, in our ball variable name — so we need to make sure it is the same.
IIFE - MDN Web Docs Glossary: Definitions of Web-related terms
this prevents accessing variables within the iife idiom as well as polluting the global scope.
...the variable within the expression can not be accessed from outside it.
... (function () { var aname = "barry"; })(); // variable aname is not accessible from the outside scope aname // throws "uncaught referenceerror: aname is not defined" assigning the iife to a variable stores the function's return value, not the function definition itself.
Scope - MDN Web Docs Glossary: Definitions of Web-related terms
if a variable or other expression is not "in the current scope," then it is unavailable for use.
... a function serves as a closure in javascript, and thus creates a scope, so that (for example) a variable defined exclusively within the function cannot be accessed from outside the function or within other functions.
... for instance, the following is invalid: function examplefunction() { var x = "declared inside function"; // x can only be used in examplefunction console.log("inside function"); console.log(x); } console.log(x); // causes error however, the following code is valid due to the variable being declared outside the function, making it global: var x = "declared outside function"; examplefunction(); function examplefunction() { console.log("inside function"); console.log(x); } console.log("outside function"); console.log(x); learn more general knowledge scope (computer science) on wikipedia ...
MDN Web Docs Glossary: Definitions of Web-related terms
forbidden header name forbidden response header name fork fragmentainer frame rate (fps) ftp ftu function fuzz testing g gaia garbage collection gecko general header gif gij git global object global scope global variable glyph gonk google chrome gpl gpu graceful degradation grid grid areas grid axis grid cell grid column grid container grid lines grid row grid tracks guard gutters gzip compression h hash head hi...
... ip address ipv4 ipv6 irc iso isp itu j jank java javascript jpeg jquery json k key keyword l latency layout viewport lazy load lgpl ligature local scope local variable locale localization long task loop lossless compression lossy compression ltr (left to right) m main axis main thread markup mathml media media (audio-visual presentation) media (css) metadata method microsoft edge micros...
...ee shaking trident truthy ttl turn type type coercion type conversion u udp (user datagram protocol) ui undefined unicode uri url urn usenet user agent utf-8 ux v validator value variable vendor prefix viewport visual viewport voip w w3c wai wcag web performance web server web standards webassembly webdav webextensions webgl webidl webkit webm webp webrtc websockets webvtt ...
Build your own function - Learn web development
note: for function naming conventions, you should follow the same rules as variable naming conventions.
... this is fine, as you can tell them apart — function names appear with parentheses after them, and variables don't.
... first of all, update the first line of the function: function displaymessage() { to this: function displaymessage(msgtext, msgtype) { now when we call the function, we can provide two variable values inside the parentheses to specify the message to display in the message box, and the type of message it is.
Function return values - Learn web development
in the code above, the result of this return value is saved in the variable newstring.
...after the function calculates the value, it can return the result so it can be stored in a variable; and you can use this variable in the next stage of the calculation.
...there's also a <script> element, in which we have stored a reference to both html elements in two variables.
Fetching data from the server - Learn web development
we'll just use the get method here and set the url as our url variable.
...note that you could also choose to store your promise in a variable and chain .then() onto that instead.
...we set this to be the value of the products variable, then run initialize(products), which starts the process of displaying all the products in the user interface.
What went wrong? Troubleshooting JavaScript - Learn web development
the earliest instance you'll find in the javascript is on line 48: const loworhi = document.queryselector('loworhi'); at this point we are trying to make the variable contain a reference to an element in the document's html.
... search for the randomnumber variable, and the lines where the random number is first set.
...you should make sure that you don't mix up the assignment operator (=) — which sets a variable to be equal to a value — with the strict equality operator (===), which tests whether one value is equal to another, and returns a true/false result.
Object-oriented JavaScript for beginners - Learn web development
let's look at the constructor calls again: let person1 = new person('bob'); let person2 = new person('sarah'); in each case, the new keyword is used to tell the browser we want to create a new object instance, followed by the function name with its required parameters contained in parentheses, and the result is stored in a variable — very similar to how a standard function is called.
...i\'m ' + this.name + '.'); }; } after the new objects have been created, the person1 and person2 variables contain the following objects: { name: 'bob', greeting: function() { alert('hi!
... try entering this into your browser's javascript console: let person1 = new object(); this stores an empty object in the person1 variable.
Framework main features - Learn web development
unlike html, these languages know how to read data variables, and this data can be used to streamline the process of writing your ui.
... like jsx, handlebars uses curly braces to inject the value of a variable.
...nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Adding a new todo form: Vue events, methods, and models - Learn web development
to use v-model, you add an attribute with the structure v-model="variable" to the <input>.
...as mentioned earlier, v-model syncing works by updating the variable using events.
...nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Focus management with Vue refs - Learn web development
inside it, assign your ref to a variable, and then call the focus() method on the ref.
... mounted() { } inside your mounted() method, assign your labelinput ref to a variable, and then call the focus() function of the ref.
...nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Mozilla accessibility architecture
member variables in nsaccessible that keep track of the number of children (maccchildcount), the parent (mparent), the first child (mfirstchild) and the next sibling (mnextsibling).
...the member variables keeping track of the number of children, parent, first child and next sibling allow us to have instant traversal around accessible nodes that have already been visited.
...this is better than just traversing the accessibles by using the member variables mfirstchild and mnextsibling, because that would miss nsaccessnode's that are not nsaccessible's.
Configuring Build Options
create a blank mozconfig file: echo "# my first mozilla config" > mozconfig if your mozconfig isn't in your source directory, you can also use the mozconfig environment variable to specify the path to your mozconfig.
...for example, a mozconfig-dbg: mk_add_options moz_objdir=@topsrcdir@/obj-ff-dbg ac_add_options --enable-debug and a mozconfig-rel-opt: mk_add_options moz_objdir=@topsrcdir@/obj-ff-rel-opt ac_add_options --disable-debug ac_add_options --enable-optimize allow for building both versions by specifiying the configuration via the mozconfig environment variable: $ env mozconfig=/path/to/mozconfig-dbg ./mach build $ env mozconfig=/path/to/mozconfig-rel-opt ./mach build don't forget to set the mozconfig environment variable for the mach run command as well.
...it also saves you from having to export the mozconfig variable each time.
Eclipse CDT
select "c/c++ build > build variables", and add a variable "mozconfig", and set it to the path of your .mozconfig file relative to the top source directory.
... set any other environment variables you want to set for the build, then close the project properties window.
...(are these variables really necessary?
mach
if the mozconfig environment variable is set, use the file pointed to in that variable.
...$ mozconfig=/path/to/mozconfig ./mach build # alternatively (for persistent mozconfig usage): $ export mozconfig=/path/to/mozconfig $ ./mach build # let's pretend the mozconfig environment variable isn't set.
...$ cd objdir-firefox $ mach build adding mach to your shell's search path if you add mach to your path (by modifying the path environment variable to include your source directory, or by copying mach to a directory in the default path like /usr/local/bin) then you can type mach anywhere in your source directory or your objdir.
JavaScript Tips
xul tips when inserting code with an xul overlay, wrap functions and variables inside an object with a unique name to avoid conflicting with existing or future function and variable names.
...it is often faster to store the result in a temporary variable.
...instead, use instanceof, e,g,: if (target instanceof components.interfaces.nsirdfresource) return target.value; if (target instanceof components.interfaces.nsirdfliteral) return target.value; return null; don't test the return value of queryinterface, it always returns the original variable if it succeeds.
Localizing with Mercurial
part of the command line hg install for windows involves making sure the hg executable is in the system's %path% variable (tortoisehg doesn't need this step).
...if the utility modified your %path% successfully, a dialog will open saying, "%path% has been updated correctly." alternatively, you can edit the %path% variable manually.
... in order to do so, right-click on your computer icon, choose properties > advanced > environmental variables, select path and click edit.
gettext
consider the following code snippet: <?php $num = 1; printf(ngettext("%d user likes this.", "%d users like this.", $num), $num); ?> depending on the value of the $num variable, this code will either use the singular ("user likes) or the plural ("users like") form of the string.
... notice that you need to pass the $num variable twice.
...the second time the $num variable is passed in the printf() call, which at this point of interpretation looks something like printf("%d user likes this.", $num);.
L20n Javascript API
if passed, ctxdata is a simple hash object with a list of variables that extend the context data available for the evaluation of this entity.
... if passed, ctxdata is a simple hash object with a list of variables that extend the context data available for the evaluation of this entity.
... returns an object with the following properties: value: the string value of the entity, attributes: an object of evaluated attributes of the entity, globals: a list of global variables used while evaluating the entity, locale: locale code of the language the entity is in; it can be different than the first locale in the current fallback chain if the entity couldn't be evaluated and a fallback translation had to be used.
NSPR LOG FILE
this environment variable specifies the file to which log messages are directed.
... description use this environment variable to specify a log file other than the default.
...nspr logging, when enabled, writes to the file named in this environment variable.
PR_DestroyCondVar
destroys a condition variable.
... syntax #include <prcvar.h> void pr_destroycondvar(prcondvar *cvar); parameter pr_destroycondvar has one parameter: cvar a pointer to the condition variable object to be destroyed.
... description before calling pr_destroycondvar, the caller is responsible for ensuring that the condition variable is no longer in use.
PR_NewCondVar
creates a new condition variable.
... syntax #include <prcvar.h> prcondvar* pr_newcondvar(prlock *lock); parameter pr_newcondvar has one parameter: lock the identity of the mutex that protects the monitored data, including this condition variable.
... returns the function returns one of the following values: if successful, a pointer to the new condition variable object.
PR_NotifyAllCondVar
notifies all of the threads waiting on a specified condition variable.
... if unsuccessful (for example, if the caller has not locked the lock associated with the condition variable), pr_failure.
... a call to pr_notifyallcondvar causes all of the threads waiting on the specified condition variable to be promoted to a ready state.
NSPR API Reference
introduction to nspr nspr naming conventions nspr threads thread scheduling setting thread priorities preempting threads interrupting threads nspr thread synchronization locks and monitors condition variables nspr sample code nspr types calling convention types algebraic types 8-, 16-, and 32-bit integer types signed integers unsigned integers 64-bit integer types floating-point integer type native os integer types miscellaneous types size type pointer difference types boolean types status type for return values threads threading types and constants threading functions creating, joining, and identifying threads controlling thread priorities controlli...
...ng per-thread private data interrupting and yielding setting global thread concurrency getting a thread's scope process initialization identity and versioning name and version constants initialization and cleanup module initialization locks lock type lock functions condition variables condition variable type condition variable functions monitors monitor type monitor functions cached monitors cached monitor functions i/o types directory type file descriptor types file info types network address types types used with socket options functions type used with memory-mapped i/o offset interpretation for seek functions i/o functions functions that operate on pathnames functions that act on file descriptors directory i/o functions ...
... dynamic library search path exporting symbols from the main executable program process management and interprocess communication process management types and constants prprocess prprocessattr process management functions setting the attributes of a new process creating and managing processes multiwait receive system information and environment variables logging conditional compilation and execution log types and variables prlogmoduleinfo prlogmodulelevel nspr_log_modules nspr_log_file logging functions and macros pr_newlogmodule pr_setlogfile pr_setlogbuffering pr_logprint pr_logflush pr_log_test pr_log pr_assert pr_assert pr_not_reached use example instrumentation counters nam...
Building NSS
make -c nss nss_build_all use_64=1 the make-based build system for nss uses a variety of variables to control the build.
... below are some of the variables, along with possible values they may be set to.
... run the standard suite by: host=localhost domsuf=localdomain use_64=1 nss/tests/all.sh unit test configuration nss tests are configured using environment variables.
4.3.1 Release Notes
if an application depends on renegotiation feature, it can be enabled by setting the environment variable nss_ssl_enable_renegotiation to 1.
... by setting this environmental variable, the fix provided by these patches will have no effect and the application may become vulnerable to the issue.
...source may be viewed with a browser (via the mxr tool) at http://mxr.mozilla.org/mozilla/source/security/jss/ the run time behavior of jss can be affected by the nss environment variables.
NSS_3.12_release_notes.html
bug 429388: vfychain.main leaks memory bug 396044: warning: usage of uninitialized variable in ckfw/object.c(174) bug 396045: warning: usage of uninitialized variable in ckfw/mechanism.c(719) bug 401986: mac os x leopard build failure in legacydb bug 325805: diff considers mozilla/security/nss/cmd/pk11util/scripts/pkey a binary file bug 385151: remove the link time dependency from nss to softoken bug 387892: add entrust root ca certificate(s) to nss bug 433386: when system clock is off ...
...r bug 391770: ocsp_global.monitor is leaked on shutdown bug 403687: move pkix functions to certvfypkix.c, turn off ev_test_hack bug 428105: cert_setocsptimeout is not defined in any public header file bug 213359: enhance pk12util to extract certs from p12 file bug 329067: nss encodes cert distinguished name attributes with wrong string type bug 339906: sec_pkcs12_install_bags passes uninitialized variables to functions bug 396484: certutil doesn't truncate existing temporary files when writing them bug 251594: certificate from pkcs#12 file with colon in friendlyname not selectable for signing/encryption bug 321584: nss pkcs12 decoder fails to import bags without nicknames bug 332633: remove duplicate header files in nss/cmd/sslsample bug 335019: pk12util takes friendly name from key, not cert bug ...
...new and revised documents available since the release of nss 3.11 include the following: build instructions for nss 3.11.4 and above nss shared db nss environment variables compatibility nss 3.12 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.48 release notes
because using an iteration count higher than 1 with the legacy dbm (key3.db) storage creates files that are incompatible with previous versions of nss, applications that wish to enable it for key3.db are required to set environment variable nss_allow_legacy_dbm_iteration_count=1.
... applications may set environment variable nss_min_mp_pbe_iteration_count to request a higher iteration count than the library's default, or nss_max_mp_pbe_iteration_count to request a lower iteration count for test environments.
...t neon bug 1575411 - enable tls extended master secret by default bug 1590970 - ssl_settimefunc has incomplete coverage bug 1590678 - remove -wmaybe-uninitialized warning in tls13esni.c bug 1588244 - nss changes for delegated credential key strength checks bug 1459141 - add more cbc padding tests that missed nss 3.47 bug 1590339 - fix a memory leak in btoa.c bug 1589810 - fix uninitialized variable warnings from certdata.perl bug 1573118 - enable tls 1.3 by default in nss this bugzilla query returns all the bugs fixed in nss 3.48: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.48 compatibility nss 3.48 shared libraries are backward compatible with all older nss 3.x shared libraries.
Python binding for NSS
command line arg and variable changed from dbdir to db_name to reflect the database specification is no longer just a directory.
... review all ref counting, numerous ref counting fixes implement cyclic garbage collection support by adding object traversal and clear methods identify static variables, move to thread local storage remove python-nss specific httplib.py, no longer needed python-nss now compatible with standard library rewrite httplib_example.py to use standard library and illustrate ssl, non-ssl, connection class, http class usage the following classes were added: authkeyid basicconstraints crldistributionpoint crldistributionpts ...
...wing files were added: doc/examples/cert_dump.py test/test_cert_components.py release 0.8.0 release date 2009-09-21 scm tag pynss_release_0_8_0 source download change log general modifications: secitem's now support indexing and slicing on their data clean up parsing and parameter validation of variable arg functions the following were added: secitem.type secitem.len secitem.data pk11symkey.key_data pk11symkey.key_length pk11symkey.slot create_context_by_sym_key param_from_iv generate_new_param get_iv_length get_block_size get_pad_mechanism release 0.7.0 release date 2009-09-18 scm tag ...
GC Rooting Guide
gc things on the stack js::rooted<t> all gc thing pointers stored on the stack (i.e., local variables and parameters to functions) must use the js::rooted<t> class.
...what will happen is that the return statement will pull the bare jsobject* out of the rooted obj variable and either put it in the stack or store it in the return value register.
... summary use js::rooted<t> typedefs for local variables on the stack.
JSAPI Cookbook
*/ js::rootedvalue r(cx); if (!js_callfunctionname(cx, js_getglobalobject(cx), "foo", 0, null, &r)) return false; calling a js function via a local variable // javascript var r = f(); // where f is a local variable /* jsapi * * suppose f is a local c variable of type js::value.
...since javascript values are usually stored in js::value variables, a cast or conversion is usually needed.
... create global variable __dirname to retrieve the current javascript file name, like in nodejs ...
JS::Value
a c++ variable of type js::value represents a value in javascript: a string, number, object (including arrays and functions), boolean, symbol, null, or undefined.
...if an application has a js::value variable that refers to a jsobject, the garbage collector might not know you're using the jsobject.
...in some places, spidermonkey provides already-rooted js::values which you can use for variables.
SpiderMonkey 1.8.8
64_t, int64_t mozilla/stdint.h uintn, intn unsigned (also known as unsigned int), int n/a jsdouble double n/a jsuintn, jsintn unsigned (also known as unsigned int), int n/a jspackedbool n/a n/a jsrefcount n/a n/a the fixed-size integer types are defined in one of the following ways: if the environment variable moz_custom_stdint_h is set, that file will be included to provide definitions for these types.
... the environment variable is provided as a solution for embedders whose code requires particular definitions of those types, and those particular definitions are incompatible with the standard definitions or the custom implementation needed for older versions of visual studio.
... in the long run we anticipate removing the environment variable-based overriding when we drop support for versions of visual studio prior to 2010.
SpiderMonkey 17
64_t, int64_t mozilla/stdint.h uintn, intn unsigned (also known as unsigned int), int n/a jsdouble double n/a jsuintn, jsintn unsigned (also known as unsigned int), int n/a jspackedbool n/a n/a jsrefcount n/a n/a the fixed-size integer types are defined in one of the following ways: if the environment variable moz_custom_stdint_h is set, that file will be included to provide definitions for these types.
... the environment variable is provided as a solution for embedders whose code requires particular definitions of those types, and those particular definitions are incompatible with the standard definitions or the custom implementation needed for older versions of visual studio.
... in the long run we anticipate removing the environment variable-based overriding when we drop support for versions of visual studio prior to 2010.
SpiderMonkey 24
typedef changes the fixed-size integer types introduced in spidermonkey 17 are defined in one of the following ways (xxx update for msvc<10 deprecation): if the environment variable moz_custom_stdint_h is set, that file will be included to provide definitions for these types.
... the environment variable is provided as a solution for embedders whose code requires particular definitions of those types, and those particular definitions are incompatible with the standard definitions or the custom implementation needed for older versions of visual studio.
... in the long run we anticipate removing the environment variable-based overriding when we drop support for versions of visual studio prior to 2010.
Redis Tips
you just have to be careful that you check the result type of an exec() when you're watching variables.
... you get to make up names of channels on the fly just like variable names.
...ign here are some things i keep in mind when creating keys: keys are like urls and should read like nice urls keys are like urls with paths separated by a colon, ':' (this is convention only) use a common prefix for all keys in your app (like a domain) be careful about possible name collisions key names should make it obvious what the values are for redis data structures are like program variables; how would you structure your data types in your program?
Interfacing with the XPCOM cycle collector
add the appropriate ns_impl_cycle_collection_# macro, where # is the number of member variables in your class.
... for instance, if nsfoo contains two member variables, mbar and mbaz, we'd add ns_impl_cycle_collection_2(nsfoo, mbar, mbaz) in nsfoo.cpp.
...hence, we need to tell the cycle collector about any such member variables.
XPCshell Test Manifest Expressions
variables variables are supported as a series of letters, digits or underscores beginning with a letter or an underscore.
... there are a fixed set of variables provided by the test harness via mozinfo.py, with many of the values initialized at configure time by writemozinfo.py which writes mozinfo.json into the root of the build directory.
... see also the official docs for this set of variables.
nsIXULRuntime
this is taken from the os_target configure variable.
...this is taken from the moz_widget_toolkit configure variable.
...this is taken from the target_xpcom_abi configure variable.
Storage
nsresult myclass::myfunction() { // mspecialstatement is a member variable of the class that contains a statement.
... nscomptr<mozistoragestatement> statement; // mdbconn is a database connection that is stored a member variable of the class.
... nsresult myclass::myfunction() { // mdbconn is a member variable of our mozistorageconnection.
Step through code - Firefox Developer Tools
ance to the next line in the function, unless on a function call, in which case enter the function being called step out: run to the end of the current function, in which case, the debugger will skip the return value from a function, returning execution to the caller split console when paused, you can press the esc key to open and close the split console to gain more insight into errors and variables: pause on breakpoints overlay since firefox 70, when your code is paused on a breakpoint an overlay appears on the viewport of the tab you are debugging.
... inline variable preview new in firefox 71, the source pane now gives you an instant preview of the variables on each line of code you've stepped through.
... see set a breakpoint > inline variable preview for more information.
UI Tour - Firefox Developer Tools
for example, the logpoint at line 85 logs the value of the tablerow variable to the console and the conditional breakpoint at line 100 breaks if the contents of the todolist is undefined.
... inline variable preview: enabled by default, this option displays variable values within the source pane when the debugger is paused.
...they will be evaluated when code execution is paused: variable tooltip hover on a variable show a tooltip with its value inside: call stack when the debugger's paused, you'll see a call stack: each level of the call stack gets a line, with the name of the function and the filename and line number.
Examine and edit CSS - Firefox Developer Tools
while you're editing css, the context menu you'll see is the normal one for working with editable text: css variable autocompletion css variable names will auto-complete depending on the variables defined in the css.
... if you enter var( into a property value and then type a dash (-), any variables you have declared in your css will then appear in an autocomplete list, which shows a color swatch so you can see exactly what color each variable choice is storing (bug 1451211).
... in addition, hovering over a css variable name brings up a tooltip showing what color value is stored in that variable (bug 1431949).
Console messages - Firefox Developer Tools
for responses that contain objects or variables, the following context menu options are available: reveal in inspector shows the selected dom node in the inspector pane.
... store as global variable creates a global variable (with a name like temp0, temp1, etc.) whose value is the selected object.
... the name of the variable appears as an input to the interpreter, and its value appears as a response.
AudioWorkletProcessor() - Web APIs
// test-processor.js class testprocessor extends audioworkletprocessor { constructor (options) { super() console.log(options.numberofinputs) console.log(options.processoroptions.someusefulvariable) } process (inputs, outputs, parameters) { return true } } registerprocessor('test-processor', testprocessor) next, in our main script file we'll load the processor, create an instance of audioworkletnode passing it the name of the processor and options object.
... in the options object we pass processoroptions with a map instance under someusefulvariable key.
... const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('test-processor.js') const testnode = new audioworkletnode(audiocontext, 'test-processor', { processoroptions: { someusefulvariable: new map([[1, 'one'], [2, 'two']]) } }) the console output will be as follows: > 1 // audioworkletnode options.numberofinputs set to default > map(2) {1 => "one", 2 => "two"} // a cloned map under someusefulvariable specifications specification status comment web audio apithe definition of 'audioworkletprocessor()' in that specification.
Background Tasks API - Web APIs
variable declarations let tasklist = []; let totaltaskcount = 0; let currenttasknumber = 0; let taskhandle = null; these variables are used to manage the list of tasks that are waiting to be performed, as well as status information about the task queue and its execution: tasklist is an array of objects, each representing one task waiting to be run.
... let totaltaskcountelem = document.getelementbyid("totaltaskcount"); let currenttasknumberelem = document.getelementbyid("currenttasknumber"); let progressbarelem = document.getelementbyid("progress"); let startbuttonelem = document.getelementbyid("startbutton"); let logelem = document.getelementbyid("log"); next we have variables which reference the dom elements we need to interact with.
... let logfragment = null; let statusrefreshscheduled = false; finally, we set up a couple of variables for other items: logfragment will be used to store a documentfragment that's generated by our logging functions to create content to append to the log when the next animation frame is rendered.
CSS Object Model (CSSOM) - Web APIs
reference animationevent caretposition css csscharsetrule cssconditionrule csscounterstylerule cssfontfacerule cssfontfeaturevaluesmap cssfontfeaturevaluesrule cssgroupingrule cssimportrule csskeyframerule csskeyframesrule cssmarginrule cssmediarule cssnamespacerule csspagerule cssrule cssrulelist cssstyledeclaration cssstylesheet cssstylerule csssupportsrule cssvariablesmap cssviewportrule elementcssinlinestyle fontface fontfaceset fontfacesetloadevent geometryutils getstyleutils linkstyle medialist mediaquerylist mediaquerylistevent mediaquerylistlistener screen stylesheet stylesheetlist transitionevent several other interfaces are also extended by the cssom-related specifications: document, window, element, htmlelement, htmlimageelement, ran...
...ywordvalue cssmathinvert cssmathmax cssmathmin cssmathnegate cssmathproduct cssmathsum cssmathvalue cssmatrixcomponent cssnumericarray cssnumericvalue cssperspective csspositionvalue cssrotate cssscale cssskew cssskewx cssskewy cssstylevalue csstransformcomponent csstransformvalue csstranslate cssunitvalue cssunparsedvalue cssvariablereferencevalue stylepropertymap stylepropertymapreadonly obsolete cssom interfaces cssprimitivevalue cssvalue cssvaluelist tutorials determining the dimensions of elements (it needs some updating as it was made in the dhtml/ajax era).
... screen orientation api working draft css fonts module level 3 candidate recommendation css animations working draft css transitions working draft css custom properties for cascading variables module level 1 candidate recommendation css conditional rules module level 3 candidate recommendation defined the css interface.
Using the Gamepad API - Web APIs
to start with, we declare some variables: the gamepadinfo paragraph that the connection info is written into, the ball that we want to move, the start variable that acts as the id for requestanimation frame, the a and b variables that act as position modifiers for moving the ball, and the shorthand variables that will be used for the requestanimationframe() and cancelanimationframe() cross browser forks.
...instead of constantly storing the gamepad's latest state in a variable it only stores a snapshot, so to do the same thing in chrome you have to keep polling it and then only use the gamepad object in code when it is available.
...in each execution of the loop we check if one of four buttons is being pressed; if so, we update the values of the a and b movement variables appropriately, then update the left and top properties, changing their values to the current values of a and b respectively.
WebGLActiveInfo - Web APIs
properties webglactiveinfo.name the read-only name of the requested variable.
... webglactiveinfo.size the read-only size of the requested variable.
... webglactiveinfo.type the read-only type of the requested variable.
WebGLRenderingContext.getProgramParameter() - Web APIs
gl.active_attributes: returns a glint indicating the number of active attribute variables to a program.
... gl.active_uniforms: returns a glint indicating the number of active uniform variables to a program.
... gl.transform_feedback_varyings: returns a glint indicating the number of varying variables to capture in transform feedback mode.
WebGLRenderingContext.uniform[1234][fi][v]() - Web APIs
the webglrenderingcontext.uniform[1234][fi][v]() methods of the webgl api specify values of uniform variables.
... all active uniform variables defined in a program object are initialized to 0 when the program object is linked successfully.
... value, v0, v1, v2, v3 a new value to be used for the uniform variable.
Adding 2D content to a WebGL context - Web APIs
the vertex shader must perform the needed transforms on the vertex's position, make any other adjustments or calculations it needs to make on a per-vertex basis, then return the transformed vertex by saving it in a special variable provided by glsl, called gl_position.
...the color is then returned to the webgl layer by storing it in the special variable gl_fragcolor.
...uniforms are similar to javascript global variables.
Using DTMF with WebRTC - Web APIs
global variables first, we establish global variables.
... dialbutton and logelement these variables will be used to store references to the dial button and the <div> into which logging information will be written.
...this variable will let the example operate even on browsers not yet implementing the newer addtrack() method; we'll do so by falling back to the older addstream() method.
Movement, orientation, and motion: A WebXR example - Web APIs
setup and utility functions next, we declare the variables and constants used throughout the application, starting with those used to store webgl and webxr specific information: let polyfill = null; let xrsession = null; let xrinputsources = null; let xrreferencespace = null; let xrbutton = null; let gl = null; let animationframerequestid = 0; let shaderprogram = null; let programinfo = null; let buffers = null; let texture = null; let mouseyaw = 0; le...
... the last four variables declared are storage for references to the <div> elements into which we'll output the matrices when we want to show them to the user.
... next, we compile the shader programs; get references to its variables; initialize the buffers that store the array of each position; the indexes into the position table for each vertex; the vertex normals; and the texture coordinates for each vertex.
WebXR performance guide - Web APIs
this section will combine information from https://github.com/immersive-web/webxr/blob/master/explainer.md#controlling-depth-precision and https://github.com/immersive-web/webxr/blob/master/explainer.md#preventing-the-compositor-from-using-the-depth-buffer optimizing memory use when using libraries that perform things such as matrix mathematics, you typically have a number of working variables through which various vectors, matrices, and quaternions pass over time.
...but it's inefficient, because it allocates as local variables a number of things, including at least two matrices, an array of vertices, and more.
... } } now, instead of allocating variables every loop iteration, we're using global constants(or class member constants).
Controlling multiple parameters with ConstantSourceNode - Web APIs
setting up let's start by looking at the global variable initialization.
... let context = null; let playbutton = null; let volumecontrol = null; let oscnode1 = null; let oscnode2 = null; let oscnode3 = null; let constantnode = null; let gainnode1 = null; let gainnode2 = null; let gainnode3 = null; let playing = false; these variables are: context the audiocontext in which all the audio nodes live.
... function toggleplay(event) { if (playing) { playbutton.innerhtml = "▶️"; stoposcillators(); } else { playbutton.innerhtml = "⏸"; startoscillators(); } } if the playing variable indicates we're already playing the oscillators, we change the playbutton's content to be the unicode character "right-pointing triangle" (▶️) and call stoposcillators() to shut down the oscillators.
Using Web Workers - Web APIs
ou want to send a message to the worker, you post messages to it like this (main.js): first.onchange = function() { myworker.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.postmessage([first.value,second.value]); console.log('message posted to worker'); } so here we have two <input> elements represented by the variables first and second; when the value of either is changed, myworker.postmessage([first.value,second.value]) is used to send the value inside both to the worker, as an array.
... we use the ports attribute of this event object to grab the port and store it in a variable.
...age(n); return; } for (var i = 1; i <= 2; i++) { var worker = new worker('fibonacci.js'); worker.onmessage = resultreceiver; worker.onerror = errorreceiver; worker.postmessage(n - i); } }; the worker sets the property onmessage to a function which will receive messages sent when the worker object's postmessage() is called (note that this differs from defining a global variable of that name, or defining a function with that name.
CSS Fonts - CSS: Cascading Style Sheets
WebCSSCSS Fonts
p { width: 600px; margin: 0 auto; font-family: "helvetica neue", "arial", sans-serif; font-style: italic; font-weight: 100; font-variant-ligatures: normal; font-size: 2rem; letter-spacing: 1px; } <p>three hundred years ago<br> i thought i might get some sleep<br> i stretched myself out onna antique bed<br> an' my spirit did a midnite creep</p> the result is as follows: variable fonts examples you can find a number of variable fonts examples at v-fonts.com and axis-praxis.org; see also our variable fonts guide for more information and usage information.
... variable fonts guide variable fonts are an evolution of the opentype font specification that enables many different variations of a typeface to be incorporated into a single file, rather than having a separate font file for every width, weight, or style.
... this article will give you all you need to know to get you started using variable fonts.
var() - CSS: Cascading Style Sheets
WebCSSvar
the var() css function can be used to insert the value of a custom property (sometimes called a "css variable") instead of any part of a value of another property.
...(doing so usually produces invalid syntax, or else a value whose meaning has no connection to the variable.) syntax the first argument to the function is the name of the custom property to be substituted.
...onent’s style: */ .component .header { color: var(--header-color, blue); /* header-color isn’t set, and so remains blue, the fallback value */ } .component .text { color: var(--text-color, black); } /* in the larger application’s style: */ .component { --text-color: #080; } specifications specification status comment css custom properties for cascading variables module level 1the definition of 'var()' in that specification.
Writing forward-compatible websites - Developer guides
javascript prefix all global variable access in onfoo attributes with “window.” when an event handler content attribute (onclick, onmouseover, and so forth) is used on html element, all name lookup in the attribute first happens on the element itself, then on the element's form if the element is a form control, then on the document, and then on the window (where the global variables you have defined are).
... what this means is that any time you access a global variable in an event handler content attribute, including calling any function declared globally, you can end up with a name collision if a specification adds a new dom property to elements or documents which has the same name as your function or variable, and a browser implements it.
... to avoid this, fully qualify global variable access using "window.", like so: <script> function localname() { alert('function localname has been called'); } </script> <div onclick="window.localname()">clicking me should show an alert<div> don't concatenate scripts you don't control the "use strict;" directive in ecmascript, when used on the file level, applies to everything in the file.
<sub>: The Subscript element - HTML: Hypertext Markup Language
WebHTMLElementsub
marking up the subscript in mathematical variable numbers (although you may also consider using a mathml formula for this).
... see variable subscripts.
...this is a common use case for <sub>: <p>according to the computations by nakamura, johnson, and mason<sub>1</sub> this will result in the complete annihilation of both particles.</p> the resulting output looks like this: variable subscripts in mathematics, families of variables related to the same concept (such as distances along the same axis) are represented using the same variable name with a subscript following.
JavaScript data types and data structures - JavaScript
variables in javascript are not directly associated with any particular value type, and any variable can be assigned (and re-assigned) values of all types: let foo = 42; // foo is now a number foo = 'bar'; // foo is now a string foo = true; // foo is now a boolean data and structure types the latest ecmascript standard defines nine types: six data types that are primitives, checked by t...
... undefined type a variable that has not been assigned a value has the value undefined.
... determining types using the typeof operator the typeof operator can help you to find the type of your variable.
Control flow and error handling - JavaScript
in older javascript, variables introduced within a block are scoped to the containing function or script, and the effects of setting them persist beyond the block itself.
...(in c or java, the equivalent code would have outputted 1.) since ecmascript2015, the let and const variable declarations are block-scoped.
...if the value does not correspond to a month number (1–12), an exception is thrown with the value "invalidmonthno" and the statements in the catch block set the monthname variable to 'unknown'.
Details of the object model - JavaScript
once these properties are set, javascript returns the new object and the assignment statement sets the variable mark to that object.
... upon return from the constructor, javascript assigns the new object to the jane variable.
...for example, assume you change the preceding code to the following: function employee() { this.dept = 'general'; // note that this.name (a local variable) does not appear here } employee.prototype.name = ''; // a single copy function workerbee() { this.projects = []; } workerbee.prototype = new employee; var amy = new workerbee; employee.prototype.name = 'unknown'; in this case, the name property of amy becomes "unknown".
Regular expressions - JavaScript
'd(b+)d' as shown in the second form of this example, you can use a regular expression created with an object initializer without assigning it to a variable.
...for this reason, if you use this form without assigning it to a variable, you cannot subsequently access the properties of that regular expression.
...if you need to access the properties of a regular expression created with an object initializer, you should first assign it to a variable.
ReferenceError: can't access lexical declaration`X' before initialization - JavaScript
the javascript exception "can't access lexical declaration `variable' before initialization" occurs when a lexical variable was accessed before it was initialized.
... a lexical variable was accessed before it was initialized.
... examples invalid cases in this case, the variable "foo" is redeclared in the block statement using let.
SyntaxError: identifier starts immediately after numeric literal - JavaScript
the names of variables, called identifiers, conform to certain rules, which your code must adhere to!
... examples variable names starting with numeric literals variable names can't start with numbers in javascript.
... the following fails: var 1life = 'foo'; // syntaxerror: identifier starts immediately after numeric literal var foo = 1life; // syntaxerror: identifier starts immediately after numeric literal alert(1.foo); // syntaxerror: identifier starts immediately after numeric literal you will need to rename your variable to avoid the leading number.
TypeError: "x" is read-only - JavaScript
the javascript strict mode-only exception "is read-only" occurs when a global variable or object property that was assigned to is a read-only property.
... the global variable or object property that was assigned to is a read-only property.
... the global variable undefined is also read-only, so you can't silence the infamous "undefined is not a function" error by doing this: 'use strict'; undefined = function() {}; // typeerror: "undefined" is read-only valid cases 'use strict'; var obj = object.freeze({name: 'score', points: 157}); obj = {name: obj.name, points: 0}; // replacing it with a new object works 'use strict'; var lung_count = 2; // a `...
JavaScript error reference - JavaScript
o access property "x"internalerror: too much recursionrangeerror: argument is not a valid code pointrangeerror: invalid array lengthrangeerror: invalid daterangeerror: precision is out of rangerangeerror: radix must be an integerrangeerror: repeat count must be less than infinityrangeerror: repeat count must be non-negativereferenceerror: "x" is not definedreferenceerror: assignment to undeclared variable "x"referenceerror: can't access lexical declaration "x" before initializationreferenceerror: deprecated caller or arguments usagereferenceerror: invalid assignment left-hand sidereferenceerror: reference to undefined property "x"syntaxerror: "0"-prefixed octal literals and octal escape seq.
...operatorsyntaxerror: missing variable namesyntaxerror: missing } after function bodysyntaxerror: missing } after property listsyntaxerror: redeclaration of formal parameter "x"syntaxerror: return not in functionsyntaxerror: test for equality (==) mistyped as assignment (=)?syntaxerror: unterminated string literaltypeerror: "x" has no propertiestypeerror: "x" is (not) "y"typeerror: "x" is not a constructortypeerror: "x" is not a funct...
...e non-configurable property "x"typeerror: cannot use "in" operator to search for "x" in "y"typeerror: cyclic object valuetypeerror: invalid "instanceof" operand "x"typeerror: invalid array.prototype.sort argumenttypeerror: invalid argumentstypeerror: invalid assignment to const "x"typeerror: property "x" is non-configurable and can't be deletedtypeerror: setting getter-only property "x"typeerror: variable "x" redeclares argumenturierror: malformed uri sequencewarning: 08/09 is not a legal ecma-262 octal constantwarning: -file- is being assigned a //# sourcemappingurl, but already has onewarning: date.prototype.tolocaleformat is deprecatedwarning: javascript 1.6's for-each-in loops are deprecatedwarning: string.x is deprecated; use string.prototype.x insteadwarning: expression closures are deprecat...
WebAssembly.Global() constructor - JavaScript
a webassembly.global() constructor creates a new global object representing a global variable instance, accessible from both javascript and importable/exportable across one or more webassembly.module instances.
... value the value the variable contains.
... this can be any value, as long as its type matches the variable's data type.
WebAssembly.Global - JavaScript
a webassembly.global object represents a global variable instance, accessible from both javascript and importable/exportable across one or more webassembly.module instances.
... global.prototype.value the value contained inside the global variable — this can be used to directly set and get the global's value.
... instance methods global.prototype.valueof() old-style method that returns the value contained inside the global variable.
Lexical grammar - JavaScript
identifiers are used for functiondeclaration, functionexpression, variabledeclaration and so on.
... `string text` `string text line 1 string text line 2` `string text ${expression} string text` tag `string text ${expression} string text` automatic semicolon insertion some javascript statements must be terminated with semicolons and are therefore affected by automatic semicolon insertion (asi): empty statement let, const, variable statement import, export, module declaration expression statement debugger continue, break, throw return the ecmascript specification mentions three rules of semicolon insertion.
... here ++ is not treated as a postfix operator applying to variable b, because a line terminator occurs between b and ++.
Assignment (=) - JavaScript
the simple assignment operator (=) is used to assign a value to a variable.
...chaining the assignment operator is possible in order to assign a single value to multiple variables the source for this interactive example is stored in a github repository.
... syntax operator: x = y examples simple assignment and chaining // assuming the following variables // x = 5 // y = 10 // z = 25 x = y // x is 10 x = y = z // x, y and z are all 25 specifications specification ecmascript (ecma-262)the definition of 'assignment operators' in that specification.
for await...of - JavaScript
syntax for await (variable of iterable) { statement } variable on each iteration a value of a different property is assigned to variable.
... variable may be declared with const, let, or var.
...in that case it internally awaits emitted values before assign them to the loop control variable.
for...of - JavaScript
syntax for (variable of iterable) { statement } variable on each iteration a value of a different property is assigned to variable.
... variable may be declared with const, let, or var.
... examples iterating over an array const iterable = [10, 20, 30]; for (const value of iterable) { console.log(value); } // 10 // 20 // 30 you can use let instead of const too, if you reassign the variable inside the block.
Statements and declarations - JavaScript
declarations var declares a variable, optionally initializing it to a value.
... let declares a block scope local variable, optionally initializing it to a value.
... for each...in iterates a specified variable over all values of object's properties.
Transitioning to strict mode - JavaScript
differences from non-strict to strict syntax errors when adding 'use strict';, the following cases will throw a syntaxerror before the script is executing: octal syntax var n = 023; with statement using delete on a variable name delete myvariable; using eval or arguments as variable or function argument name using one of the newly reserved keywords (in prevision for ecmascript 2015): implements, interface, let, package, private, protected, public, static, and yield declaring function in blocks if (a < b) { function f() {} } obvious errors declaring twice the same name for a property name in an object liter...
... setting a value to an undeclared variable function f(x) { 'use strict'; var a = 12; b = a + x * 35; // error!
... change to eval in strict mode code, eval doesn't create a new variable in the scope from which it was called.
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
const webpush = require('web-push'); if (!process.env.vapid_public_key || !process.env.vapid_private_key) { console.log("you must set the vapid_public_key and vapid_private_key "+ "environment variables.
...you can see the variables from the index.js file being used: payload, delay and ttl.
...event.data.text() : 'no payload'; event.waituntil( self.registration.shownotification('serviceworker cookbook', { body: payload, }) ); }); all it does is add a listener for the push event, create the payload variable consisting of the text taken from the data (or create a string to use if data is empty), and then wait until the notification is shown to the user.
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElement
for example, assume that a variable "image-dir" is defined as follows: <xsl:variable name="image-dir">/images</xsl:variable> the expression to be evaluated is placed inside curly brackets: <img src="{$image-dir}/mygraphic.jpg"/> this would result in the following: <img src="/images/mygraphic.jpg"/> the element annotations that follow include a description, a syntax listing, a list of required and optional attributes, a descri...
...l:call-template><xsl:choose><xsl:comment><xsl:copy-of><xsl:copy><xsl:decimal-format><xsl:element><xsl:fallback><xsl:for-each><xsl:if><xsl:import><xsl:include><xsl:key><xsl:message><xsl:namespace-alias><xsl:number><xsl:otherwise><xsl:output><xsl:param><xsl:preserve-space><xsl:processing-instruction><xsl:sort><xsl:strip-space><xsl:stylesheet><xsl:template><xsl:text><xsl:transform><xsl:value-of><xsl:variable><xsl:when><xsl:with-param> <xsl:apply-imports> <xsl:apply-templates> <xsl:attribute> <xsl:attribute-set> <xsl:call-template> <xsl:choose> <xsl:comment> <xsl:copy> <xsl:copy-of> <xsl:decimal-format> <xsl:element> <xsl:fallback> (not supported) <xsl:for-each> <xsl:if> <xsl:import> (mostly supported) <xsl:include> <xsl:key> <xsl:message> <xsl:namespace-alias> (not supported) <x...
...sl:number> (partially supported) <xsl:otherwise> <xsl:output> (partially supported) <xsl:param> <xsl:preserve-space> <xsl:processing-instruction> <xsl:sort> <xsl:strip-space> <xsl:stylesheet> (partially supported) <xsl:template> <xsl:text> (partially supported) <xsl:transform> <xsl:value-of> (partially supported) <xsl:variable> <xsl:when> <xsl:with-param> ...
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
the javascript loads the .xsl file only on the first sort and sets the xslloaded variable to true once it has finished loading the file.
... 52 <xsl:variable> element, reference, xslt, variable the <xsl:variable> element declares a global or local variable in a stylesheet and gives it a value.
... because xslt permits no side-effects, once the value of the variable has been established, it remains the same until the variable goes out of scope 53 <xsl:when> element, reference, xslt, when the <xsl:when> element always appears within an <xsl:choose> element, acting like a case statement.
Compiling from Rust to WebAssembly - WebAssembly
macro takes two arguments in this case, a format string, and a variable to put in it.
...it contains {}s, where variables will be interpolated.
... the variable we're passing is name, the argument to the function, so if we call greet("steve") we should see "hello, steve!".
Using the WebAssembly JavaScript API - WebAssembly
globals webassembly has the ability to create global variable instances, accessible from both javascript and importable/exportable across one or more webassembly.module instances.
... to create a webassembly global instance from inside your javascript, you use the webassembly.global() constructor, which looks like this: const global = new webassembly.global({value:'i32', mutable:true}, 0); you can see that this takes two parameters: an object that contains two properties describing the global variable: value: its data type, which can be any data type accepted within webassembly modules — i32, i64, f32, or f64.
... a value containing the variable's actual value.
Content Scripts - Archive of obsolete content
for example, consider a page that adds a variable foo to the window object using a page script: <!doctype html"> <html> <head> <script> window.foo = "hello from page script" </script> </head> </html> another script loaded into the page after this script will be able to access foo.
... event listeners you can listen for dom events in a content script just as you can in a normal page script, but there are two important differences: first, if you define an event listener by passing it as a string into setattribute(), then the listener is evaluated in the page's context, so it will not have access to any variables defined in the content script.
io/file - Archive of obsolete content
join(...) takes a variable number of strings, joins them on the file system's path separator, and returns the result.
...: strings a variable number of strings to join.
system/environment - Archive of obsolete content
access, set and clear environment variables.
... usage var { env } = require('sdk/system/environment'); you can get the value of an environment variable, by accessing the property with the name of the desired variable: var path = env.path; you can check for the existence of an environment variable by checking whether a property with that variable name exists: console.log('path' in env); // true console.log('foo' in env); // false you can set the value of an environment variable by setting the property: env.foo = 'foo'; env.path += ':/my/path/' you can unset an environment variable by deleting the property: delete env.foo; limitations there is no way to enumerate existing environment variables, also env won't have any enumerable properties: console.log(object.keys(env)); // [] environment variable will be unset, show up as non-exi...
Preferences - Archive of obsolete content
using preference observers changes a user makes to your extension's preferences, such as through an options dialog, may not take effect until the browser is restarted (e.g., if you have initialized local variables when the browser loads).
...when a change is made to the preferences, you can take the appropriate action (such as reinitializing variables or toggling display properties in xul components).
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
you cannot mix string variables and literals in comparison operators.
...instead of passing getter_copies(astring) to a method expecting a character pointer out parameter, you will need to use a temporary variable and copy the result.missing headers some headers are included from idl files only when mozilla_internal_api is defined (actually, they shouldn't be there at all).
Custom XUL Elements with XBL - Archive of obsolete content
properties and fields the field and property tags allow you to handle element variables and access them from outside of the element.
...it's very similar to a js object variable, and we generally use a field for private variables inside of the element.
Tabbed browser - Archive of obsolete content
getting access to the browser from main window code running in firefox's global chromewindow, common for extensions that overlay into browser.xul, can access the tabbrowser element using the global variable gbrowser.
...if your code is executed from a firefox browser.xul overlay (for example, it is a toolbar button or menu click handler), you can access the current window with the window pre-defined variable.
Firefox addons developer guide - Archive of obsolete content
rules: file and directory names: italic method and variable names: class name if you want to add a fixme, add: fixme: a message notes: the original document is in japanese and distributed via the xuldev.org website.
... variable and function names use <code> styling.
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
but adding a third column to the mix created too many width variables for some browsers to dynamically calculate a total.
...besides the idea that we're changing our entire color scheme every day of the week by merely pointing to a different css file and altering an image variable?
Underscores in class and ID Names - Archive of obsolete content
it is a fairly common practice in many programming languages to use the underscore character (_) in the place of a "space" in variable and function names.
... for example, a function whose job is to "get the length of a string" might be called get_string_length, and a variable representing the number of people who voted republican might be voted_republican.
Exception logging in JavaScript - Archive of obsolete content
alternatively, you can set the environment variable moz_report_all_js_exceptions.
...if the variable exists, all exceptions from inner frames will be reported.
First run - Archive of obsolete content
a manifest is simply an object set to a variable named manifest.
... you may define this variable anywhere in the global namespace of your jetpack.
First Run - Archive of obsolete content
a manifest is simply an object set to a variable named manifest.
... you may define this variable anywhere in the global namespace of your jetpack.
Settings - Archive of obsolete content
because it is still under development, the api currently lives in the future and must be imported before it is used: specifying settings in a manifest to specify its settings, a jetpack defines a variable named manifest in its global namespace before it imports the settings api.
... the value of this variable must be an object that contains a property named settings.
Settings - Archive of obsolete content
because it is still under development, the api currently lives in the future and must be imported before it is used: jetpack.future.import("storage.settings"); specifying settings in a manifest to specify its settings, a jetpack defines a variable named manifest in its global namespace before it imports the settings api.
... the value of this variable must be an object that contains a property named settings.
Modularization techniques - Archive of obsolete content
nsresult refreshfoo(ifoo **afoo) { if (afoo == null || *afoo == null) { return ns_error_null_parameter; } if ((*afoo)->stale()) { ns_release(*afoo); *afoo = mfoo; ns_addref(*afoo); } return ns_ok; } global and member variables both global and member variables have lifetimes that can be changed by any number of functions.
... therefore one should call addref() on any global or member variable that is being passed to a function, and call release() afterward.
Porting NSPR to Unix Platforms - Archive of obsolete content
if the return value of <tt>uname -s</tt> is too long or ambiguous, you can modify it in <tt>mozilla/nsprpub/config/arch.mk</tt> (the makefile variable <tt>os_arch</tt>).
...i usually print out every element in the <tt>jmp_buf</tt> and see which one is the closest to the address of a local variable (local variables are allocated on the stack).
Build - Archive of obsolete content
go into the prism/ directory and create a .mozconfig file mk_add_options moz_objdir=@topsrcdir@/mozilla-obj/prism ac_add_options --with-libxul-sdk=../dist ac_add_options --enable-application=prism you need to define an environment variable to point the build to the new .mozconfig.
... this variable is called mozconfig export mozconfig=$pwd/.mozconfig #this should point to mozilla/prism/.mozconfig go back to the mozilla/ directory and do another build, this time, prism will get built cd ../ make -f client.mk build congratulations, you have just built prism.
File object - Archive of obsolete content
getting started in order to use the file object from your javascript programs, you must enable it by setting the make variable js_has_file_object during the compilation of your spidermonkey engine.
... if you are building a standalone version of spidermonkey (see: spidermonkey build documentation), this variable can be added on the make command line, like so: cd mozilla/js/src make -f makefile.ref js_has_file_object=1 alternatively, if you are building a larger product (such as a browser) and want to include the file object, you may need to perform minor makefile surgery.
Supporting private browsing mode - Archive of obsolete content
pbs = components.classes["@mozilla.org/privatebrowsing;1"] .getservice(components.interfaces.nsiprivatebrowsingservice); var oldprivatemode = pbs.privatebrowsingmode; pbs.privatebrowsingenabled = true; /* this is all private */ pbs.privatebrowsingenabled = oldprivatemode; in this example, we save the current state of the private browsing mode setting in the oldprivatemode variable, then turn on private browsing by setting its value to true.
...private browsing for plug-in authors plug-ins can detect whether or not private browsing mode is in effect by using the npn_getvalue() function to check the current value of the npnvprivatemodebool variable.
Venkman Internals - Archive of obsolete content
venkman-msg.js localization code, reads venkman.properties from a subdirectory of "locale" and injects variables.
... things like msg.alert define variables msg_alert.
Install script template - Archive of obsolete content
the keys are written according to the specification: http://mozilla.org/projects/plugins/first-install-problem.html and follows the plid specification: http://mozilla.org/projects/plugins/plugin-identifier.html **/ // define some global variables var plugin_file = "npmyplugin.dll"; // this plugin consists of an xpt file because it is scriptable // http://mozilla.org/projects/plugins/scripting-plugins.html var component_file = "npmypluginscriptable.xpt"; var plugin_size = 2000; // (dll file) reserve a little extra so it is not required to update too often var component_size = 10; // (xpi file) reserve a little extra so it is...
..._user = "hkey_current_user"; var reg_moz_path = "software\\mozillaplugins"; // my own error code in case secondary installation fails var nosecondaryinstall = 1; // error return codes need some memory var err; // error return codes when we try and install to the current browser var errblock1; // error return codes when we try and do a secondary installation var errblock2 = 0; // global variable containing our secondary install location var secondaryfolder; //special error values used by the cycore developers (www.cycore.com) who helped make this install script var exceptionoccurederror = -4711; var winregisnullerror = -4712; var invalidrootkeyerror = -4713; var registrykeynotwritableerror = -4714; //initinstall block //the installation is initialized here --...
member - Archive of obsolete content
« xul reference home member type: string may optionally be set to the variable to use as the member variable.
... if not specified, the variable specified in the uri attribute in the action body of the template's first rule is used.
template.container - Archive of obsolete content
« xul reference home container type: string may optionally be set to the variable to use as the container or reference variable.
... if not specified, the variable specified in the uri attribute of the content tag in the template's first rule is used.
Getting File Information - Archive of obsolete content
this example will check if a file on the desktop exists and set the variable 'filesize' to the size of the file.
... if the file is not present, the 'filesize' variable will not be changed from the default value of 0.
container - Archive of obsolete content
a variable reference to a node that is expected to be a container.
... if the variable is the same as the uri attribute on the content element, the resource must be a container element in order to match.
uri - Archive of obsolete content
ArchiveMozillaXULPropertyuri
used to specify the variable name for the content.
...each resource is placed in the variable specified in the uri attribute in turn.
Multiple Queries - Archive of obsolete content
one important distinction is that the determination of duplicates is only based on the member variable, in this case the ?photo variable.
... it doesn't matter whether other variables are the same or not.
Adding Properties to XBL-defined Elements - Archive of obsolete content
the special variable val holds the value that the property should be assigned to.
...this script uses the value passed in the val variable and assigns it to the size property of the banana in some manner.
Modifying a XUL Interface - Archive of obsolete content
note that for all these functions, the object referred to by the variable referencechild or the variables newchild and oldchild must already exist or an error occurs.
... likewise the object referred to by the variable child which is to be removed must already exist or an error occurs.
assign - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] for xml templates, specifies an additional variable to assign a value to.
... var type: string for the xul assign attribute, this is the variable to assign the value to; otherwise it's a reference to a template variable such as "?name".
Mozilla release FAQ - Archive of obsolete content
when i try to use cvs on windows, i get an error about no home directory you need to set the home environment variable to a valid directory, as cvs was designed with unix in mind, and wants to put a file in your home directory (the password file) i'm on a unix system, and still am having problems building here's a brief guide to common build problems: cc1: invalid option 'foo' cc: no such file or directory 'foo' these are almost always caused by your platform-specific makefile being incorrect for your system, ei...
...you can find the binaries at mozilla.org's binaries page on win32, it fails to build, with the message '.\win32' unexpected you didn't properly set the environment variables -- you must not include a space at the end of the set statements (be careful if you are cut'n'pasting).
NPN_GetValueForURL - Archive of obsolete content
syntax #include <npapi.h> typedef enum { npnurlvcookie = 501, npnurlvproxy } npnurlvariable; nperror npn_getvalueforurl(npp instance, npnurlvariable variable, const char *url, char **value, uint32_t *len); parameters this function has the following parameters: instance pointer to the current plug-in instance.
... variable selects the type of information to be retrieved (npnurlvcookie or npnurlvproxy) url the url for which to fetch information.
NPN_SetValueForURL - Archive of obsolete content
(while the api theoretically allows the preferred proxy for a given url to be changed, doing so does not have much meaning given how proxies are configured, and is not supported.) syntax #include <npapi.h> typedef enum { npnurlvcookie = 501, npnurlvproxy } npnurlvariable; nperror npn_setvalueforurl(npp instance, npnurlvariable variable, const char *url, const char *value, uint32_t len); parameters this function has the following parameters: instance pointer to the current plug-in instance.
... variable selects the type of information to be changed.
NP_GetValue - Archive of obsolete content
syntax #include <npapi.h> nperror np_getvalue(void *instance, nppvariable variable, void *value); parameters the function has the following parameters: instance pointer to the current plug-in instance.
... variable plug-in information the call gets.
Adobe Flash - Archive of obsolete content
example 2 shows the use of macromedia flash's setvariable method being invoked from javascript.
... var myflash = document.getelementbyid("myflash").setvariable("myvar", sendtext); a more expanded code example that shows how example 2 was created is shown in this source listing.
Settings - Archive of obsolete content
show panes on startup when this option is enabled, the debugger's variables pane is visible when you first start the debugger.
... show variables filter box enabling this option adds a "filter variables" search box to the variables pane, so that you can filter the displayed list of variables.
Old Proxy API - Archive of obsolete content
calltrap is a variable-argument function(args) { return any; } that reifies “proxy(args)”.
... constructtrap is an optional variable-argument function(args) { return any-object; } that reifies “new proxy(args)”.
Writing JavaScript for XHTML - Archive of obsolete content
if your code contains either of these, you can work around this with cdata sections: <script type="text/javascript"> <![cdata[ // is the variable a non-negative integer less than 10?
... if (variable < 10 && variable >= 0) action(); ]]> </script> note that the cdata section is only necessary because of the < in the code; otherwise you could have ignored it.
Common causes of memory leaks in extensions - Extensions
for example: var windows = []; function injavascriptcodemodule(window) { // forgetting or failing to pop the window again windows.push(window); } both of these cases can happen if you forget to declare local variables with var or let, which means they end up belonging to the global scope.
... for example: function implicitdeclarationleak(window) { // implicit variable declaration in the js global, holding a strong ref to the document doc = window.document; } implicitly declared variables can be avoided by using ecmascript 5's strict mode.
Building up a basic demo with Babylon.js - Game development
there is one helper variable already included, which will store a reference to the <canvas> element.
...define a helper variable — t — that we will use for animations, just before the renderloop, and decrement it on every frame inside the loop, like this: var t = 0; var renderloop = function () { scene.render(); t -= 0.01; // animation code goes here }; engine.runrenderloop(renderloop); the t variable will be incremented on every rendered frame.
Building up a basic demo with Three.js - Game development
there are two helper variables already included, which store the window's width and height.
...first, we implement a helper variable, called t, for counting elapsed time.
WebVR — Virtual Reality for the Web - Game development
i] instanceof positionsensorvrdevice && devices[i].hardwareunitid === ghmd.hardwareunitid) { gpositionsensor = devices[i]; break; } } } }); this code will loop through the available devices and assign proper sensors to the headsets — the first devices array contains the connected devices, and a check is done to find the hmdvrdevice, and assign it to the ghmd variable — using this you can set up the scene, getting the eye parameters, setting the field of view, etc.
... for example: function setcustomfov(up,right,down,left) { var testfov = new vrfieldofview(up,right,down,left); ghmd.setfieldofview(testfov,testfov,0.01,10000.0); } the gpositionsensor variable holds the positionsensorvrdevice — using this you can get the current position or orientation state (for example to update the scene view on every frame), or reset the sensor.
Bounce off the walls - Game development
to make the calculations easier let's define a variable called ballradius that will hold the radius of the drawn circle and be used for calculations.
... add this to your code, somewhere below the existing variable declarations: var ballradius = 10; now update the line that draws the ball inside the drawball() function to this: ctx.arc(x, y, ballradius, 0, math.pi*2); bouncing off the top and bottom there are four walls to bounce the ball off — let's focus on the top one first.
Create the Canvas and draw on it - Game development
var canvas = document.getelementbyid("mycanvas"); var ctx = canvas.getcontext("2d"); here we're storing a reference to the <canvas> element to the canvas variable.
... then we're creating the ctx variable to store the 2d rendering context — the actual tool we can use to paint on the canvas.
Finishing up - Game development
let's first add a variable to store the number of lives in the same place where we declared our other variables: var lives = 3; drawing the life counter looks almost the same as drawing the score counter — add the following function to your code, below the drawscore() function: function drawlives() { ctx.font = "16px arial"; ctx.fillstyle = "#0095dd"; ctx.filltext("lives: "+lives, canvas.width-65, 20); } ...
...ex logic to it as given below: lives--; if(!lives) { alert("game over"); document.location.reload(); clearinterval(interval); // needed for chrome to end game } else { x = canvas.width/2; y = canvas.height-30; dx = 2; dy = -2; paddlex = (canvas.width-paddlewidth)/2; } now, when the ball hits the bottom edge of the screen, we're subtracting one life from the lives variable.
Player paddle and controls - Game development
rendering the paddle from the framework point of view the paddle is very similar to the ball — we need to add a variable to represent it, load the relevant image asset, and then do the magic.
... loading the paddle first, add the paddle variable we will be using in our game, right after the ball variable: var paddle; then, in the preload function, load the paddle image by adding the following new load.image() call: function preload() { // ...
The score - Game development
we will use a separate variable for storing the score and phaser's text() method to print it out onto the screen.
... new variables add two new variables right after the previously defined ones: // ...
Visual typescript game engine - Game development
*/ private appusenetwork = false; /** * appuseaccountssystem if you don't want to use session * in your application just setup this variable to the false.
... */ private appusebroadcaster: boolean = false; /** * possible variant by default : * "register", "login" */ private startuphtmlform: string = "register"; private gamelist: any[]; /** * implement default gameplay variable's */ private defaultgameplaylevelname: string = "level1"; private autostartgameplay: boolean = true; start the dependency system from app.ts the first game template is platformer.
Constant - MDN Web Docs Glossary: Definitions of Web-related terms
with variables, on the other hand, the programmer can assign a new value to a variable name already in use.
... like variables, some constants are bound to identifiers.
Constructor - MDN Web Docs Glossary: Definitions of Web-related terms
syntax // this is a generic default constructor class default function default() { } // this is an overloaded constructor class overloaded // with parameter arguments function overloaded(arg1, arg2, ...,argn){ } to call the constructor of the class in javascript, use a new operator to assign a new object reference to a variable.
... function default() { } // a new reference of a default object assigned to a // local variable defaultreference var defaultreference = new default(); learn more general knowledge constructor on wikipedia technical reference the constructor in object oriented programming for javascript on mdn new operator in javascript on mdn ...
Mutable - MDN Web Docs Glossary: Definitions of Web-related terms
mutable is a type of variable that can be changed.
... (you can make a variable name point to a new value, but the previous value is still held in memory.
Parameter - MDN Web Docs Glossary: Definitions of Web-related terms
a parameter is a named variable passed into a function.
... parameter variables are used to import arguments into functions.
Signature (functions) - MDN Web Docs Glossary: Definitions of Web-related terms
that means you don't have to declare the type of a variable ahead of time.
...you have to declare types of variables in your code in order to be able to run the java code.
Static typing - MDN Web Docs Glossary: Definitions of Web-related terms
a statically-typed language is a language (such as java, c, or c++) where variable types are known at compile time.
... in most of these languages, types must be expressly indicated by the programmer; in other cases (such as ocaml), type inference allows the programmer to not indicate their variable types.
Array - MDN Web Docs Glossary: Definitions of Web-related terms
arrays are used to store multiple values in a single variable.
... this is compared to a variable that can store only one value.
Loop - MDN Web Docs Glossary: Definitions of Web-related terms
example: for(var i = 0; i < 10; i++){ console.log(i) } //this loop will print numbers 0-9, will stop when condition is met (i = 10) for the above example, the syntax is as follows: statement 1 sets the variable for the loop (var i = 0).
... example: var i = 0; while(i < 5){ console.log(i) i++ } //this loop will print number 0-4, will stop when condition becomes false (i >=5) for the above example, the syntax is as follows: the code block will continue to run as long as the variable (i) is less than 5.
undefined - MDN Web Docs Glossary: Definitions of Web-related terms
undefined is a primitive value automatically assigned to variables that have just been declared, or to formal arguments for which there are no actual arguments.
... example var x; //create a variable but assign it no value console.log("x's value is", x) //logs "x's value is undefined" learn more general knowledge undefined value on wikipedia technical reference javascript data types and data structures ...
Organizing your CSS - Learn web development
defining variables css now has native custom properties, making this feature increasingly less important, however one of the reasons you might use sass is to be able to define all of the colors and fonts used in a project as settings, then use that variable around the project.
... if we created a variable called $base-color as in the first line below, we could then use it through the stylesheet anywhere that required that color.
Sizing items in CSS - Learn web development
if you have a box that might contain a variable amount of content, and you always want it to be at least a certain height, you could set the min-height property on it.
... this is very useful for dealing with variable amounts of content while avoiding overflow.
Web fonts - Learn web development
variable fonts there is a newer font technology available in browsers called variable fonts — these are fonts that allow many different variations of a typeface to be incorporated into a single file, rather than having a separate font file for every width, weight, or style.
... they are somewhat advanced for our beginner's course, but if you fancy stretching yourself and looking into them, read our variable fonts guide.
What are browser developer tools? - Learn web development
find out more find more out about the inspector in different browsers: firefox page inspector ie dom explorer chrome dom inspector (opera's inspector works the same as this) safari dom inspector and style explorer the javascript debugger the javascript debugger allows you to watch the value of variables and set breakpoints, places in your code that you want to pause execution and identify the problems that prevent your code from executing properly.
... in the image, the first section, watch expressions, shows that the listitems variable has been added.
Introducing asynchronous JavaScript - Learn web development
ateobjecturl(myblob); image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); }).catch((error) => { console.log('there has been a problem with your fetch operation: ' + error.message); }); console.log ('all done!'); the browser will begin executing the code, see the first console.log() statement (starting) and execute it, and then create the image variable.
...' + image.src + 'displayed.'); you should now get an error in your console instead of the third message: typeerror: image is undefined; can't access its "src" property this is because at the time the browser tries to run the third console.log() statement, the fetch() block has not finished running so the image variable has not been given a value.
Inheritance in JavaScript - Learn web development
a getter returns the current value of the variable and its corresponding setter changes the value of the variable to the one it defines.
...if you find yourself creating a bunch of related variables and functions and want to track them all together and package them neatly, an object is a good idea.
Test your skills: Object basics - Learn web development
object basics 1 in this task you are provided with an object literal, and your tasks are to store the value of the name property inside the catname variable, using bracket notation.
... once you've done this, you should then write a string to the variable bandinfo, which will contain a small biography detailing their name, nationality, years active, and style, and the title and release date of their first album.
JavaScript — Dynamic client-side scripting - Learn web development
after that, we discuss some key javascript features in detail, such as variables, strings, numbers and arrays.
...you can even create your own objects to encapsulate related functions and variables into efficient packages.
Componentizing our React app - Learn web development
remember: when you're in the middle of a jsx expression, you use curly braces to inject the value of a variable.
...nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
React interactivity: Editing, filtering, conditional rendering - Learn web development
do each of the following, and remember to use curly braces to read these variables!
...nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Creating our first Vue component - Learn web development
your component object should now look like this: <script> export default { props: { label: { required: true, type: string }, done: { default: false, type: boolean } } }; </script> using registered props with these props defined inside the component object, we can now use these variable values inside our template.
...nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Understanding client-side JavaScript frameworks - Learn web development
dynamic behavior in svelte: working with variables and props now that we have our markup and styles ready we can start developing the required features for our svelte to-do list app.
... in this article we'll be using variables and props to make our app dynamic, allowing us to add and delete todos, mark them as complete, and filter them by status.
Accessibility/LiveRegionDevGuide
(at-spi only) a global variable can be set in a document:load:complete event listener and reset in a object:state-changed:busy listener.
... this variable can then be used to quickly determine if an event was triggered by the document being loaded.
Browser chrome tests
note: be careful when naming your functions and variables.
... since the test files are executed in the same scope as the browser window, conflicting variable names could cause trouble while running the tests.
Gecko Logging
if (moz_log_test(slogger, loglevel::warning)) { int elapsed = time::nowms() - start; if (elapsed > 1000) { moz_log(slogger, loglevel::warning, ("loop took %dms!", elapsed)); } } if (i != 10) { moz_log(slogger, loglevel::error, ("i should be 10!")); } } enabling logging the log level for a module is controlled by setting an environment variable before launching the application.
... redirecting logging output to a file logging output can be redirected to a file by passing its path via an environment variable.
Frame script environment
however, any top-level variables defined by a script are not stored on the global: instead, top-level variables are stored in a special per-script object that delegates to the per-tab global.
... this means you don't have to worry about global variables you define conflicting with global variables defined by another frame script.
Frame script environment
however, any top-level variables defined by a script are not stored on the global: instead, top-level variables are stored in a special per-script object that delegates to the per-tab global.
... this means you don't have to worry about global variables you define conflicting with global variables defined by another frame script.
How to add a build-time test
for standalone executables, if one sets up the right variables, then the rules.mk file will do lots of magic and most of the heavy lifting.
... note that the following variables are supplied by the rules.mk file: cppsrcs, simple_programs, run_test_program.
Examples
in the example below we try alerting an undefined variable.
...cting this promise'); return promise.resolve('yay success'); // this makes the success function trigger with asuccessreason being 'yay success' but because i commented out the var 2 lines above, it will error out on the throw and never get to this success line becuase i throw an error on the line before this } catch(ex) { return promise.reject(ex); } } in this example even though the variable is defined, the proimse is rejected because i threw an error.
Using JavaScript code modules
scope 1: components.utils.import("resource://app/my_module.jsm"); bar = "foo"; alert(bar); // displays "foo" scope 2: components.utils.import("resource://app/my_module.jsm"); alert(bar); // displays "[object object]" the main effect of the by-value copy is that global variables of simple types won't be shared across scopes.
... always put variables in a wrapper class and export the wrapper (such as bar in the above example).
Localization Use Cases
asymmetry the example above could benefit from another of l20n's features: local variables.
... in the javascript code, the developer needs to pass sizeinfo.unit instead of a localized value: function showformatedsize(element, l10nid, size) { // … element.textcontent = document.l10n.get(l10nid, { size: sizeinfo.size, unit: sizeinfo.unit }); } and then use the $unit variable verbatim in the english message: <availablesize "{{ $size }} {{ $unit }} available"> in french, the localizer can then use the value of $unit to match it against a translated abbreviation, like so: <_unitedemesure { b: "o", kb: "ko", mb: "mo", gb: "go", tb: "to" }> <availablesize "il reste {{ $size }} {{ _unitedemesure[unit] }}"> similarly, other local variables could be used to...
About NSPR
this mechanism provides the basic mutual exclusion (mutex) and thread notification facilities (condition variables) implemented by nspr.
...such timers are normally used to specify timeouts on i/o, waiting on condition variables and other rudimentary thread scheduling.
PRCondVar
structure for a condition variable.
... syntax #include <prcvar.h> typedef struct prcondvar prcondvar; description an nspr condition variable is an opaque object identified by a pointer.
PR_AtomicDecrement
description pr_atomicdecrement first decrements the referenced variable by one.
... the value returned is the referenced variable's final value.
4.3 Release Notes
new sqlite-based shareable certificate and key databases by prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.initialize method or using the nss environment variable nss_default_db_type.
... source may be viewed with a browser (via the mxr tool) at http://mxr.mozilla.org/mozilla/source/security/jss/ the run time behavior of jss can be affected by the nss environment variables.
Build instructions for JSS 4.3.x
cvs co -r jss_4_3_1_rtm mozilla/security/jss or cvs co -r jss_4_3_rtm mozilla/security/jss setup environment variables needed for compiling java source.
... the java_home variable indicates the directory containing your java sdk installation.
NSS Key Log Format
key logging is enabled by setting the environment variable sslkeylogfile to point to a file.
...distributors can re-enable it at compile time though (using the nss_allow_sslkeylogfile=1 make variable) which is done for the official firefox binaries.
NSS Memory allocation
to accomplish that, set an environment variable prior to the initialization of nss and nspr.
...set the environment variable nss_disable_arena_free_list to have any non-empty value, e.g.
NSS 3.12.6 release notes
the behavior of nss for renegotiation can be changed through api function calls, or with the following environment variables: nss_ssl_enable_renegotiation values: [0|n|n]: ssl_renegotiate_never never allow renegotiation - that was the default for 3.12.5 release.
... new error codes in sslerr.h ssl_error_unsafe_negotiation ssl_error_rx_unexpected_uncompressed_record new types in sslt.h sslextensiontype new environment variables sqlite_force_proxy_locking 1 means force always use proxy, 0 means never use proxy, null means use proxy for non-local files only.
NSS 3.23 release notes
notable changes in nss 3.23 the copy of sqlite shipped with nss has been updated to version 3.10.2 (bug 1234698) the list of tls extensions sent in the tls handshake has been reordered to increase compatibility of the extended master secret with servers (bug 1243641) the build time environment variable nss_enable_zlib has been renamed to nss_ssl_enable_zlib (bug 1243872).
... the build time environment variable nss_disable_chachapoly was added, which can be used to prevent compilation of the chacha20/poly1305 code.
Migration to HG
most parts of the nss build instructions remain valid, especially the instructions about setting environment variables.
... updated instructions for building nss with nspr can be found at: /docs/nss_reference/building_and_installing_nss/build_instructions it's best to refer to the above document to learn about the various environment variables that you might have to set to build on your platform (this part hasn't changed).
NSS tools : modutil
two variables can be used in the relative path: %root% and %temp%.
...for example: modutil -create -dbdir sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be added to the ~/.bashrc file to make the change permanent.
NSS tools : modutil
MozillaProjectsNSStoolsmodutil
two variables can be used in the relative path: %root% and %temp%.
...for example: modutil -create -dbdir sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent.
Pork Tool Development
then any post-location variables refer to "foo" and pre-location variables refer to "my_foo".
...cppsourceloc will change the previously provided location information (in variable cpp_source_loc._loc) from post-location to pre-location.
Rhino optimization
simple data and type flow analysis is performed to determine which javascript variables can be allocated to java vm registers, and which variables are used only as numbers.
...all local variables and parameters are allocated to java vm registers.
SpiderMonkey Build Documentation
specifying compilers and compiler flags if you want to use a compiler other than the one the configure script chooses for you by default, you can set the cxx variable in the environment when you run configure.
... if you'd like to pass certain flags to the compiler, you can set the cxxflags environment variable when you run configure.
JS::AutoVectorRooter
this article covers features introduced in spidermonkey 17 base class that roots an internal variable-size array of type t.
... description js::autovectorrooter<t> holds a variable-size rooted array of type t.
JSPropertyOp
points to a js::value variable.
... the meaning of this variable is different for each of the hooks; see below.
JS_DumpNamedRoots
rp void * a pointer to the rooted variable, array element, or field.
...it points to a variable, array element, or field of type jsval, jsobject *, jsstring *, or jsdouble *.
JS_EnterLocalRootScope
js_addroot roots a variable, ensuring that whatever the variable points to at any given moment is protected from gc.
...there is no need to tell the js engine about each variable that may point to such a value.
JS_ExecuteScript
variable initialization is performed.
... if the jsoption_varobjfix option is in effect (recommended), then the last object in the scope chain is used as the variable object.
JS_ExecuteScriptVersion
variable initialization is performed.
... if the jsoption_varobjfix option is in effect (recommended), then the last object in the scope chain is used as the variable object.
JS_GetScopeChain
a scope chain is a sequence of objects whose properties are searched whenever a script or function refers to a variable.
... these objects represent the lexical scope of the currently executing statement or expression, not the call stack, so they include: the variable objects of any enclosing functions or let statements or expressions, and any objects selected by enclosing with statements, in order from the most-nested scope outward; lastly the global object against which the function was created.
JS_HasOwnProperty
foundp bool * non-null pointer to a variable of type bool.
... on success, js_hasownproperty stores true in this variable if obj has an own property with the given name, and false if not.
JS_HasProperty
foundp bool * non-null pointer to a variable of type bool.
... on success, js_hasproperty stores true in this variable if obj has a property with the given name, and false if not.
JS_SetOptions
mxr id search for jsoption_werror jsoption_varobjfix make js_evaluatescript() use the last object on its obj param's scope chain (that is, the global object) as the ecma "variables object".
... without it, the two scripts "x = 1" and "var x = 1", where no variable x is in scope, do two different things.
JS_THREADSAFE
for each thread that is in a request: almost any call into the jsapi may trigger garbage collection; but garbage collection does not happen at any other time (such as, for example, at the moment before the return value of js_newobject is assigned to a rooted variable).
...multiple threads can end up accessing private data or c/c++ global variables at the same time.
Thread Sanitizer
to use it, either make sure the llvm-symbolizer binary is in your path or set the environment variable tsan_options="external_symbolizer_path=/path/to/llvm-symbolizer" before running the process.
... if you've built tsan as described above, then you will want to set the variable to $llvm_home/build/bin/llvm-symbolizer.
An Overview of XPCOM
the requirements of a factory class can be handled in a strictly functional way, with state being held by global variables, but there are benefits to using classes for factories.
... variable mappings nsrefcnt default reference count type.
Building the WebLock UI
a boolean wlocked variable can do this: // initialize the wlocked variable as unlocked var wlocked = 0; then the functions that get called from the interface and call through to the lock and unlock methods of the weblock component must also adjust this variable accordingly: function wlock() { // check to see if locking is on or off weblock.lock(); wlocked = 1; } function wunlock() { // check to see if locking ...
...as you can see, weblock is initialized as a global javascript variable, available in the scope of these functions and others: var weblock = components.classes["@dougt/weblock"] .getservice() .queryinterface(components.interfaces.iweblock); in addition to this basic setup, you must also write javascript that uses the addsite method to add new sites to the white list.
Components.lastResult
in cases where components.lastresult is used, it is best to get it right away after the target call is made and save it in a local variable to test its value rather than doing multiple tests against components.lastresult.
... example in the following example, the local variable i contains the actual result returned by bar() (assuming that bar() is called via xpconnect), and components.lastresult contains the success code returned by bar().
mozIStorageConnection
pass -1 for variable-argument functions.
...pass -1 for variable-argument functions.
nsIMsgDBView
return values count upon return, the count variable may contain the number of messages in the folder.
... return values acount upon return, the count variable may contain the number of messages loaded.
nsIMsgWindow
to create an instance, use: msgwindow = components.classes["@mozilla.org/messenger/msgwindow;1"] .createinstance(components.interfaces.nsimsgwindow); in thunderbird the default message window is stored in the global variable msgwindow.
...you should not store this in a global variable.
nsIXULTemplateBuilder
optionally, the rule may have a <bindings> section which may be used to define additional variables to be used within an action body.
...the builder will resynchronize any variables that are referenced in the action body.
Setting HTTP request headers
// adds "x-hello: world" header to the request httpchannel.setrequestheader("x-hello", "world", false); in the example code above we have a variable named httpchannel which points to an object implementing nsihttpchannel.
... (this variable could have been named anything though.) the setrequestheader method takes 3 parameters.
Troubleshooting XPCOM components registration
(the -r switch from gnu ldd lists function relocations; adjust as suitable for your version) trace shared library loading by setting the environment variable ld_debug=all while launching firefox (see `man ld.so` for details).
... use dyld environment variables to trace binary component loading: dyld_print_apis=1 dyld_print_libraries=1 (see `man dyld` for details).
Reference Manual
it can be used as a member variable without introducing bloat.
...when nscap_feature_debug_ptr_types is turned on, instead of holding its underlying pointer in a variable of type nsisupports*, the nscomptr holds it in a pointer matching the underlying type.
XPIDL
note that optional out parameters still pass in a variable for the parameter, but its value will be ignored.
... resources (mostly outdated) some unsorted notes including a keyword list xpidl is a tool for generating c++ headers, java interfaces, xpconnect typelibs, and html documentation from xpidl files generating xpt files on windows a google groups post with instructions on how to use variable-length argument lists using xpidl.
Index
since window is a global variable you can use it directly from your javascript file.
... 108 folders and message lists guide, thunderbird the folderdisplaywidget for the current folder can be accessed via the global variable gfolderdisplay.
Using Objective-C from js-ctypes
objc_msgsend function, receives the instance which receives the message, the selector, and variable argument list for the message, returning the returned value from the method.
...probably used in more * complex block scenarios involving actual closure variables needing storage * (in `nodobjc`, javascript closures are leveraged instead).
Working with data
var i = ctypes.int32_t(9); // create a c integer whose value is 9 var p = i.address(); // create a pointer to the integer variable i if (p.contents == 9) { // look at the contents of the pointer // the value is 9 } else { // the value isn't 9 } setting data referenced by pointer you can also use the contents property to set the value pointed to by a variable.
... var i = ctypes.int32_t(9); // create a c integer variable whose value is 9 var p = i.address(); // get a pointer to i p.contents = 12; // change the value of i to 12 checking to see if a pointer is null this example demonstrates the use of the isnull() method to determine whether or not a pointer is null.
Version, UI, and Status Information - Plugins
this code declares variables to hold the version numbers and calls npn_version to return the major and minor version numbers for the browser and the plug-in api.
... int plugin_major, plugin_minor, netscape_major, netscape_minor; // declare variables to hold version numbers void npn_version( &plugin_major, &plugin_minor, &netscape_major, &netscape_minor ); // find version numbers finding out if a feature exists a plug-in can figure out whether it is running in a version of the browser that supports a particular feature by using version or npvers constants (see version feature constants).
Break on DOM mutation - Firefox Developer Tools
inline variable preview new in firefox 71, the source pane now gives you an instant preview of the variables on each line of code you've stepped through.
... see set a breakpoint > inline variable preview for more information.
Set a logpoint - Firefox Developer Tools
you can use any variable or function available in the current scope.
... logpoints are useful to log the value of a variable at a specific point in the code.
Set an XHR breakpoint - Firefox Developer Tools
inline variable preview new in firefox 71, the source pane now gives you an instant preview of the variables on each line of code you've stepped through.
... see set a breakpoint > inline variable preview for more information.
Set event listener breakpoints - Firefox Developer Tools
inline variable preview new in firefox 71, the source pane now gives you an instant preview of the variables on each line of code you've stepped through.
... see set a breakpoint > inline variable preview for more information.
Debugger-API - Firefox Developer Tools
a debugger.environment represents an environment, associating variable names with storage locations.
... environments may belong to a running stack frame, captured by a function closure, or reflect some global object’s properties as variables.
Dominators view - Firefox Developer Tools
for example: variables allocated on the stack need to be rooted, or internal caches may need to root their​ elements.
... each connection in the graph is labeled with the variable name for the referenced object.
Tips - Firefox Developer Tools
right-click a node and click "use in console" to command line as tempn variable.
... right-click a node in the inspector and click "use in console" to create a tempn variable for it.
Web Console remoting - Firefox Developer Tools
the variable view needs to update objects and it does so by binding _self to the debugger.object of the objectactor that is being viewed.
... as such, variable view sends strings like these for evaluation: _self["prop"] = value; the frameactor property is an optional frameactor id.
AudioWorkletGlobalScope - Web APIs
as the global execution context is shared across the current baseaudiocontext, it's possible to define any other variables and perform any actions allowed in worklets — apart from defining audioworkletprocessor-derived classes.
...onsole.log(currenttime) } // the process method is required - simply output silence, // which the outputs are already filled with process (inputs, outputs, parameters) { return true } } // the sample rate is not going to change ever, // because it's a read-only property of a baseaudiocontext // and is set only during its instantiation console.log(samplerate) // you can declare any variables and use them in your processors // for example it may be an arraybuffer with a wavetable const usefulvariable = 42 console.log(usefulvariable) registerprocessor('test-processor', testprocessor) next, in our main scripts file we'll load the processor, create an instance of audioworkletnode — passing the name of the processor to it — and connect the node to an audio graph.
BaseAudioContext.decodeAudioData() - Web APIs
older callback syntax in this example, the getdata() function uses xhr to load an audio track, setting the responsetype of the request to arraybuffer so that it returns an array buffer as its response that we then store in the audiodata variable .
... note: you can run the example live (or view the source.) // define variables var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var source; var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); // use xhr to load an audio track, and // decodeaudiodata to decode it and stick it in a buffer.
CSSUnparsedValue - Web APIs
it consists of a list of string fragments and variable references.
... custom properties are represented by cssunparsedvalue and var() references are represented using cssvariablereferencevalue.
Using the CSS Painting API - Web APIs
here we have provided one argument: the rendering context (we'll look at more in due course), often refered to by the variable name ctx.
...by positioning some decorative generated content with ::before, or including background: linear-gradient(yellow, yellow) 0 15px / 200px 20px no-repeat; what makes the css painting api so interesting and powerful is that you can create complex images, passing variables, that automatically resize.
CSS Typed Object Model API - Web APIs
it consists of a list of string fragments and variable references.
...it consists of a list of string fragments and variable references.
Basic animations - Web APIs
var img = new image(); // user variables - customize these to change the image being scrolled, its // direction, and the speed.
...note that the width and height specified here must match the values of the canvasxzsize and canvasysize variables in the javascript code.
Console API - Web APIs
the console api provides functionality to allow developers to perform debugging tasks, such as logging messages or the values of variables at set points in your code, or timing how long an operation takes to complete.
... by far the most commonly-used method is console.log, which is used to log the current value contained inside a specific variable.
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
only be one), // and then select the zeroth (or first) such element mybody = document.getelementsbytagname("body")[0]; // now, get all the p elements that are descendants of the body mybodyelements = mybody.getelementsbytagname("p"); // get the second item of the list of p elements myp = mybodyelements[1]; myp.style.background = "rgb(255,0,0)"; } in this example, we set the myp variable to the dom object for the second p element inside the body: first, we get a list of all the body elements via mybody = document.getelementsbytagname("body")[0] since there is only one body element in any valid html document, this list will have only one item, which we retrieve by selecting the first element in that list using [0].
...to retrieve the value of the attribute, use the getattribute method: mytable.getattribute("border"); hiding a column by changing style properties once you have the object in your javascript variable, you can set style properties directly.
HTMLElement.dir - Web APIs
WebAPIHTMLElementdir
syntax var currentwritingdirection = elementnodereference.dir; elementnodereference.dir = newwritingdirection; currentwritingdirection is a string variable representing the text writing direction of the current element.
... newwritingdirection is a string variable representing the text writing direction value.
HTMLElement.lang - Web APIs
WebAPIHTMLElementlang
syntax var languageused = elementnodereference.lang; // get the value of lang elementnodereference.lang = newlanguage; // set new value for lang languageused is a string variable that gets the language in which the text of the current element is written.
... newlanguage is a string variable with its value setting the language in which the text of the current element is written.
In depth: Microtasks and the JavaScript runtime environment - Web APIs
using execution contexts in this manner, each program and function is able to have its own set of variables and other objects.
...by using the contexts and the context stack in this manner, many of the fundamentals of how a program operates can be managed, including local and global variables, function calls and returns, and so forth.
IDBDatabase.name - Web APIs
WebAPIIDBDatabasename
example this example shows a database connection being opened, the resulting idbdatabase object being stored in a db variable, and the name property then being logged.
...ar dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being // opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
Using IndexedDB - Web APIs
another subtlety here is that you don't actually save the request object to a variable.
...we then put the result of that request in a variable (data), update the age property of this object, then create a second request (requestupdate) to put the customer record back into the objectstore, overwriting the previous value.
Long Tasks API - Web APIs
high/variable input latency.
... high/variable event handling latency.
MediaDevices.ondevicechange - Web APIs
ick", function() { navigator.mediadevices.getusermedia({ video: { width: 160, height: 120, framerate: 30 }, audio: { samplerate: 44100, samplesize: 16, volume: 0.25 } }).then(stream => { videoelement.srcobject = stream; updatedevicelist(); }) .catch(err => log(err.name + ": " + err.message)); }, false); we set up global variables that contain references to the <ul> elements that are used to list the audio and video devices: let audiolist = document.getelementbyid("audiolist"); let videolist = document.getelementbyid("videolist"); getting and drawing the device list now let's take a look at updatedevicelist() itself.
...this uses destructuring assignment (a new feature of ecmascript 6) to assign the values of the first three items in the array returned by string.match() to the variables kind, type, and direction.
MediaDevices - Web APIs
example 'use strict'; // put variables in global scope to make them available to the browser console.
...relement = document.queryselector('#errormsg'); navigator.mediadevices.getusermedia(constraints) .then(function(stream) { var videotracks = stream.getvideotracks(); console.log('got stream with constraints:', constraints); console.log('using video device: ' + videotracks[0].label); stream.onremovetrack = function() { console.log('stream ended'); }; window.stream = stream; // make variable available to browser console video.srcobject = stream; }) .catch(function(error) { if (error.name === 'constraintnotsatisfiederror') { errormsg('the resolution ' + constraints.video.width.exact + 'x' + constraints.video.height.exact + ' px is not supported by your device.'); } else if (error.name === 'permissiondeniederror') { errormsg('permissions have not been granted to u...
Selection API - Web APIs
concepts and usage to retrieve the current text range the user has selected, you can use the window.getselection() or document.getselection() method, storing the return value — a selection object — in a variable for futher use.
... once your selection is in a variable, you perform a variety of operations on it, for example copying the selection to a text string using selection.tostring(), adding a range (as represented by a standard range object) to the selection (or removing one) with selection.addrange()/selection.removerange(), or changing the selection to be the entire contents of a dom node using selection.selectallchildren().
WebGL2RenderingContext.getFragDataLocation() - Web APIs
the webgl2renderingcontext.getfragdatalocation() method of the webgl 2 api returns the binding of color numbers to user-defined varying out variables.
... name a domstring specifying the name of the user-defined varying out variable.
WebGL2RenderingContext.getTransformFeedbackVarying() - Web APIs
the webgl2renderingcontext.gettransformfeedbackvarying() method of the webgl 2 api returns information about varying variables from webgltransformfeedback buffers.
... index a gluint specifying the index of the varying variable whose information to retrieve.
WebGL2RenderingContext.transformFeedbackVaryings() - Web APIs
varyings an array of domstring specifying the the names of the varying variables to use.
... buffermode a glenum specifying the mode to use when capturing the varying variables.
WebGL2RenderingContext.uniform[1234][uif][v]() - Web APIs
the webgl2renderingcontext.uniform[1234][uif][v]() methods of the webgl api specify values of uniform variables.
... data, v0, v1, v2, v3 a new value to be used for the uniform variable.
WebGLRenderingContext.bindAttribLocation() - Web APIs
the webglrenderingcontext.bindattriblocation() method of the webgl api binds a generic vertex index to an attribute variable.
... name a domstring specifying the name of the variable to bind to the generic vertex index.
Clearing by clicking - Web APIs
var canvas = document.queryselector("#canvas-view"); var button = document.queryselector("#color-switcher"); canvas.addeventlistener("click", switchcolor, false); button.addeventlistener("click", switchcolor, false); // a variable to hold the webglrenderingcontext.
... function switchcolor () { // referring to the externally defined gl variable.
Scissor animation - Web APIs
eem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } ;(function(){ "use strict" window.addeventlistener("load", setupanimation, false); // variables to hold the webgl context, and the color and // position of animated squares.
...t.queryselector("strong").innerhtml = "stop"; timer = setinterval(drawanimation, 17); drawanimation(); } function stopanimation(evt) { button.removeeventlistener(evt.type, stopanimation, false); button.addeventlistener("click", startanimation, false); document.queryselector("strong").innerhtml = "start"; clearinterval(timer); } stopanimation({type: "click"}); } // variables to hold the size and velocity of the square.
Animating objects with WebGL - Web APIs
the first thing we'll need is a variable in which to track the current rotation of the square: var squarerotation = 0.0; now we need to update the drawscene() function to apply the current rotation to the square when drawing it.
...we can do that by creating a new variable to track the time at which we last animated (let's call it then), then adding the following code to the end of the main function var then = 0; // draw the scene repeatedly function render(now) { now *= 0.001; // convert to seconds const deltatime = now - then; then = now; drawscene(gl, programinfo, buffers, deltatime); requestanimationframe(render); } requestani...
Getting started with WebGL - Web APIs
your browser or machine may not support it."); return; } // set clear color to black, fully opaque gl.clearcolor(0.0, 0.0, 0.0, 1.0); // clear the color buffer with specified clear color gl.clear(gl.color_buffer_bit); } window.onload = main; the first thing we do here is obtain a reference to the canvas, assigning it to a variable named canvas.
... if the context is successfully initialized, the variable gl is our reference to it.
WebGL model view projection - Web APIs
homogeneous coordinates the main line of the previous clip space vertex shader contained this code: gl_position = vec4(position, 1.0); the position variable was defined in the draw() method and passed in as an attribute to the shader.
... this is a three dimensional point, but the gl_position variable that ends up getting passed down through the pipeline is actually 4 dimensional — instead of (x, y, z) it is (x, y, z, w).
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
we set a boolean variable, makingoffer to true to mark that we're preparing an offer.
... perfect negotiation with the updated api as shown in the section implementing perfect negotiation, we can eliminate this problem by introducing a variable (here called makingoffer) which we use to indicate that we are in the process of sending an offer, and making use of the updated setlocaldescription() method: let makingoffer = false; pc.onnegotiationneeded = async () => { try { makingoffer = true; await pc.setlocaldescription(); signaler.send({ description: pc.localdescription }); } catch(err) { console.error(err); } fina...
Signaling and video calling - Web APIs
le (listelem.firstchild) { listelem.removechild(listelem.firstchild); } msg.users.foreach(function(username) { var item = document.createelement("li"); item.appendchild(document.createtextnode(username)); item.addeventlistener("click", invite, false); listelem.appendchild(item); }); } after getting a reference to the <ul> which contains the list of user names into the variable listelem, we empty the list by removing each of its child elements.
... then we copy the name of the user we're calling into the variable targetusername and call createpeerconnection(), a function which will create and do basic configuration of the rtcpeerconnection.
Starting up and shutting down a WebXR session - Web APIs
the global variable webxrpolyfill is used only to retain a reference to the polyfill in order to ensure that it remains available until you no longer need it.
... session.onvisibilitychange = (event) => { switch(event.session.visibilitystate) { case "hidden": myframerate = 10; break; case "blurred-visible": myframerate = 30; break; case "visible": default: myframerate = 60; break; } }; this example changes a variable myframerate depending on the visibility state as it changes.
Advanced techniques: Creating and sequencing audio - Web APIs
we can allow the user to control these using range inputs on the interface: <label for="attack">attack</label> <input name="attack" id="attack" type="range" min="0" max="1" value="0.2" step="0.1" /> <label for="release">release</label> <input name="release" id="release" type="range" min="0" max="1" value="0.5" step="0.1" /> now we can create some variables over in javascript and have them change when the input values are updated: let attacktime = 0.2; const attackcontrol = document.queryselector('#attack'); attackcontrol.addeventlistener('input', function() { attacktime = number(this.value); }, false); let releasetime = 0.5; const releasecontrol = document.queryselector('#release'); releasecontrol.addeventlistener('input', function() { r...
... let tempo = 60.0; const bpmcontrol = document.queryselector('#bpm'); bpmcontrol.addeventlistener('input', function() { tempo = number(this.value); }, false); then we'll create variables to define how far ahead we want to look, and how far ahead we want to schedule: let lookahead = 25.0; // how frequently to call scheduling function (in milliseconds) let scheduleaheadtime = 0.1; // how far ahead to schedule audio (sec) let's create a function that moves the note forwards by one beat, and loops back to the first when it reaches the 4th (last) one: let currentnote = 0; let next...
Example and tutorial: Simple synth keyboard - Web APIs
tion: absolute; left: 0; display: table-cell; vertical-align: middle; } .left span, .left input { vertical-align: middle; } .right { width: 50%; position: absolute; right: 0; display: table-cell; vertical-align: middle; } .right span { vertical-align: middle; } .right input { vertical-align: baseline; } javascript the javascript code begins by initializing a number of variables.
... let notefreq = null; let customwaveform = null; let sineterms = null; let cosineterms = null; finally, global variables that will be used when constructing waveforms are created: notefreq will be an array of arrays; each array represents one octave, each of which contains one entry for each note in that octave.
Visualizations with Web Audio API - Web APIs
vasctx.fillrect(0, 0, width, height); set a line width and stroke colour for the wave we will draw, then begin drawing a path canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.beginpath(); determine the width of each segment of the line to be drawn by dividing the canvas width by the array length (equal to the frequencybincount, as defined earlier on), then define an x variable to define the position to move to for drawing each segment of the line.
... we also set a barheight variable, and an x variable to record how far across the screen to draw the current bar.
Using the Web Speech API - Web APIs
the following variable is defined to hold our grammar: var colors = [ 'aqua' , 'azure' , 'beige', 'bisque', 'black', 'blue', 'brown', 'chocolate', 'coral' ...
... setting variables first of all, we capture references to all the dom elements involved in the ui, but more interestingly, we capture a reference to window.speechsynthesis.
Window.window - Web APIs
WebAPIWindowwindow
this means: global variables of your script are in fact properties of window: var global = {data: 0}; alert(global === window.global); // displays "true" you can access built-in properties of the window object without having to type window.
...for example, if we refer to "this.window.location.href", a javascript module could define a property called "window" inside of a class it defined (since no global "window" variable exists for it by default) which could be created after passing in a window object to the module class' constructor.
viewport-fit - CSS: Cascading Style Sheets
it is highly recommended to make use of the safe area inset variables to ensure that important content doesn't end up outside the display.
... accessibility concerns when using the viewport-fit descriptor, one must keep in mind that not all device displays are rectangular, and should therefore make use of the safe area inset variables.
calc() - CSS: Cascading Style Sheets
WebCSScalc
then, the following html makes use of this css: <form> <div id="formbox"> <label>type something:</label> <input type="text"> </div> </form> nested calc() with css variables you can also use calc() with css variables.
... consider the following code: .foo { --widtha: 100px; --widthb: calc(var(--widtha) / 2); --widthc: calc(var(--widthb) / 2); width: var(--widthc); } after all variables are expanded, widthc's value will be calc( calc( 100px / 2) / 2), then when it's assigned to .foo's width property, all inner calc()s (no matter how deeply nested) will be flattened to just parentheses, so the width property's value will be eventually calc( ( 100px / 2) / 2), i.e.
font-style - CSS: Cascading Style Sheets
variable fonts variable fonts can offer a fine control over the degree to which an oblique face is slanted.
... for truetype or opentype variable fonts, the "slnt" variation is used to implement varying slant angles for oblique, and the "ital" variation with a value of 1 is used to implement italic values.
exsl:node-set() - EXSLT
WebEXSLTexslnode-set
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes exsl:node-set() returns a node-set from a result tree fragment, which is what you get when you look at the xsl:variable instead of its select attribute to fetch a variable's value.
... this lets you process the xml created within a variable to process it in multiple steps.
Common (exsl) - EXSLT
WebEXSLTexsl
exsl:node-set()exsl:node-set() returns a node-set from a result tree fragment, which is what you get when you look at the xsl:variable instead of its select attribute to fetch a variable's value.
... this lets you process the xml created within a variable to process it in multiple steps.exsl:object-type()exsl:object-type() returns a string that indicates the type of the specified object.
Getting Started - Developer guides
you can also add an always-different get parameter, like a timestamp or random number (see bypassing the cache) note 3: if the httprequest variable is used globally, competing functions calling makerequest() can overwrite each other, causing a race condition.
... declaring the httprequest variable local to a closure containing the ajax functions avoids this.
Video player styling basics - Developer guides
as mentioned earlier, a `data-state` variable is used to indicate which state such buttons are currently in.
...in order to facilitate this, a new function is defined called changebuttonstate(), which accepts a type variable indicating the button's functionality: var changebuttonstate = function(type) { // play/pause button if (type == 'playpause') { if (video.paused || video.ended) { playpause.setattribute('data-state', 'play'); } else { playpause.setattribute('data-state', 'pause'); } } // mute button else if (type == 'mute') { mute.setattribute('data-...
Creating a cross-browser video player - Developer guides
a number of variables pointing to html elements are required: var videocontainer = document.getelementbyid('videocontainer'); var video = document.getelementbyid('video'); var videocontrols = document.getelementbyid('video-controls'); as mentioned earlier, the browser's default controls now need to be disabled, and the custom controls need to be displayed: // hide the default controls video.controls = false; // ...
...display the user defined video controls videocontrols.style.display = 'block'; with that done, a variable pointing to each of the buttons is now required: var playpause = document.getelementbyid('playpause'); var stop = document.getelementbyid('stop'); var mute = document.getelementbyid('mute'); var volinc = document.getelementbyid('volinc'); var voldec = document.getelementbyid('voldec'); var progress = document.getelementbyid('progress'); var progressbar = document.getelementbyid('progress-bar'); var fullscreen = document.getelementbyid('fs'); using these handles, events can now be attached to each of the custom control buttons making them interactive.
<input type="color"> - HTML: Hypertext Markup Language
WebHTMLElementinputcolor
here we establish some variables, setting up a variable that contains the color we'll set the color well to when we first load up, and then setting up a load handler to do the main startup work once the page is fully loaded.
...e); initialization once the page is loaded, our load event handler, startup(), is called: function startup() { colorwell = document.queryselector("#colorwell"); colorwell.value = defaultcolor; colorwell.addeventlistener("input", updatefirst, false); colorwell.addeventlistener("change", updateall, false); colorwell.select(); } this gets a reference to the color <input> element in a variable called colorwell, then sets the color input's value to the value in defaultcolor.
<input type="date"> - HTML: Hypertext Markup Language
WebHTMLElementinputdate
// define variables var nativepicker = document.queryselector('.nativedatepicker'); var fallbackpicker = document.queryselector('.fallbackdatepicker'); var fallbacklabel = document.queryselector('.fallbacklabel'); var yearselect = document.queryselector('#year'); var monthselect = document.queryselector('#month'); var dayselect = document.queryselector('#day'); // hide fallback initially fallbackpicker.style.disp...
...opulate the days and years dynamically // (the months are always the same, therefore hardcoded) populatedays(monthselect.value); populateyears(); } function populatedays(month) { // delete the current set of <option> elements out of the // day <select>, ready for the next set to be injected while(dayselect.firstchild){ dayselect.removechild(dayselect.firstchild); } // create variable to hold new number of days to inject var daynum; // 31 or 30 days?
<input type="datetime-local"> - HTML: Hypertext Markup Language
// define variables var nativepicker = document.queryselector('.nativedatetimepicker'); var fallbackpicker = document.queryselector('.fallbackdatetimepicker'); var fallbacklabel = document.queryselector('.fallbacklabel'); var yearselect = document.queryselector('#year'); var monthselect = document.queryselector('#month'); var dayselect = document.queryselector('#day'); var hourselect = document.queryselector('#hou...
... // (the months are always the same, therefore hardcoded) populatedays(monthselect.value); populateyears(); populatehours(); populateminutes(); } function populatedays(month) { // delete the current set of <option> elements out of the // day <select>, ready for the next set to be injected while(dayselect.firstchild){ dayselect.removechild(dayselect.firstchild); } // create variable to hold new number of days to inject var daynum; // 31 or 30 days?
Concurrency model and the event loop - JavaScript
function foo(b) { let a = 10 return a + b + 11 } function bar(x) { let y = 3 return foo(x * y) } console.log(bar(7)) //returns 42 when calling bar, a first frame is created containing bar's arguments and local variables.
... when bar calls foo, a second frame is created and pushed on top of the first one containing foo's arguments and local variables.
Indexed collections - JavaScript
in addition to a newly defined variable as shown above, arrays can also be assigned as a property of a new or an existing object: let obj = {} // ...
...if you know that none of the elements in your array evaluate to false in a boolean context—if your array consists only of dom nodes, for example—you can use a more efficient idiom: let divs = document.getelementsbytagname('div') for (let i = 0, div; div = divs[i]; i++) { /* process div in some way */ } this avoids the overhead of checking the length of the array, and ensures that the div variable is reassigned to the current item each time around the loop for added convenience.
Warning: JavaScript 1.6's for-each-in loops are deprecated - JavaScript
the javascript warning "javascript 1.6's for-each-in loops are deprecated; consider using es6 for-of instead" occurs when a for each (variable in obj) statement is used.
... javascript 1.6's for each (variable in obj) statement is deprecated, and will be removed in the near future.
SyntaxError: for-in loop head declarations may not have initializers - JavaScript
message syntaxerror: for-in loop head declarations cannot have an initializer (edge) syntaxerror: for-in loop head declarations may not have initializers (firefox) syntaxerror: for-in loop variable declaration may not have an initializer.
...that is, a variable is declared and assigned a value |for (var i = 0 in obj)|.
SyntaxError: a declaration in the head of a for-of loop can't have an initializer - JavaScript
message syntaxerror: for-of loop head declarations cannot have an initializer (edge) syntaxerror: a declaration in the head of a for-of loop can't have an initializer (firefox) syntaxerror: for-of loop variable declaration may not have an initializer.
...that is, a variable is declared and assigned a value |for (var i = 0 of iterable)|.
TypeError: "x" is not a constructor - JavaScript
the javascript exception "is not a constructor" occurs when there was an attempt to use an object or a variable as a constructor, but that object or variable is not a constructor.
... there was an attempt to use an object or a variable as a constructor, but that object or variable is not a constructor.
SyntaxError: "x" is a reserved identifier - JavaScript
the javascript exception "variable is a reserved identifier" occurs when reserved keywords are used as identifiers.
... "use strict"; var package = ["potatoes", "rice", "fries"]; // syntaxerror: package is a reserved identifier you'll need to rename these variables.
arguments.callee - JavaScript
1 : factorial(n - 1)*n; }); this has numerous benefits: the function can be called like any other from inside your code it does not create a variable in the outer scope (except for ie 8 and below) it has better performance than accessing the arguments object another feature that was deprecated was arguments.callee.caller, or more specifically function.caller.
...therefore if there is no accessible variable referring to it, the only way the function can refer to itself is by arguments.callee.
Array.prototype[@@iterator]() - JavaScript
examples iteration using for...of loop html <ul id="letterresult"> </ul> javascript var arr = ['a', 'b', 'c']; var earr = arr[symbol.iterator](); var letterresult = document.getelementbyid('letterresult'); // your browser must support for..of loop // and let-scoped variables in for loops // const and var could also be used for (let letter of earr) { letterresult.innerhtml += "<li>" + letter + "</li>"; } result alternative iteration var arr = ['a', 'b', 'c', 'd', 'e']; var earr = arr[symbol.iterator](); console.log(earr.next().value); // a console.log(earr.next().value); // b console.log(earr.next().value); // c console.log(earr.next().value); // d console.log...
... function logiterable(it) { if (!(symbol.iterator in object.getprototypeof(it) /* or "symbol.iterator in object.__proto__" or "it[symbol.iterator]" */)) { console.log(it, ' is not an iterable object...'); return; } var iterator = it[symbol.iterator](); // your browser must support for..of loop // and let-scoped variables in for loops // const and var could also be used for (let letter of iterator) { console.log(letter); } } // array logiterable(['a', 'b', 'c']); // a // b // c // string logiterable('abc'); // a // b // c logiterable(123); // 123 " is not an iterable object..." specifications specification ecmascript (ecma-262)the definition of 'array.prototype[@@iterator]()...
Array - JavaScript
setting or accessing via non-integers using bracket notation (or dot notation) will not set or retrieve an element from the array list itself, but will set or access a variable associated with that array's object property collection.
... array.of() creates a new array instance with a variable number of arguments, regardless of number or type of the arguments.
Error - JavaScript
rangeerror creates an instance representing an error that occurs when a numeric variable or parameter is outside of its valid range.
... typeerror creates an instance representing an error that occurs when a variable or parameter is not of a valid type.
Function.prototype.apply() - JavaScript
arguments is a local variable of a function.
...and, because push accepts a variable number of arguments, you can also push multiple elements at once.
Function.arguments - JavaScript
use the simple variable arguments instead.
...the recommended way to access the arguments object available within functions is simply to refer to the variable arguments.
ReferenceError() constructor - JavaScript
the referenceerror object represents an error when a non-existent variable is referenced.
... examples catching a referenceerror try { let a = undefinedvariable } catch (e) { console.log(e instanceof referenceerror) // true console.log(e.message) // "undefinedvariable is not defined" console.log(e.name) // "referenceerror" console.log(e.filename) // "scratchpad/1" console.log(e.linenumber) // 2 console.log(e.columnnumber) // 6 console.log(e.stack) ...
ReferenceError - JavaScript
the referenceerror object represents an error when a non-existent variable is referenced.
... examples catching a referenceerror try { let a = undefinedvariable } catch (e) { console.log(e instanceof referenceerror) // true console.log(e.message) // "undefinedvariable is not defined" console.log(e.name) // "referenceerror" console.log(e.filename) // "scratchpad/1" console.log(e.linenumber) // 2 console.log(e.columnnumber) // 6 console.log(e.stack) ...
String.prototype.charAt() - JavaScript
var str = 'a \ud87e\udc04 z'; // we could also use a non-bmp character directly for (var i = 0, chr; i < str.length; i++) { if ((chr = getwholechar(str, i)) === false) { continue; } // adapt this line at the top of each loop, passing in the whole string and // the current iteration and returning a variable to represent the // individual character console.log(chr); } function getwholechar(str, i) { var code = str.charcodeat(i); if (number.isnan(code)) { return ''; // position not found } if (code < 0xd800 || code > 0xdfff) { return str.charat(i); } // high surrogate (could change last hex to 0xdb7f to treat high private // surrogates as single characters) if (0xd800 <...
...v > 0xdbff) { throw 'low surrogate without preceding high surrogate'; } // we can pass over low surrogates now as the second component // in a pair which we have already processed return false; } in an ecmascript 2016 environment which allows destructured assignment, the following is a more succinct and somewhat more flexible alternative in that it does increment for an incrementing variable automatically (if the character warrants it in being a surrogate pair).
String.prototype.indexOf() - JavaScript
const str = 'brave new world' console.log('index of first w from start is ' + str.indexof('w')) // logs 8 console.log('index of "new" from start is ' + str.indexof('new')) // logs 6 indexof() and case-sensitivity the following example defines two string variables.
... the variables contain the same string, except that the second string contains uppercase letters.
Addition assignment (+=) - JavaScript
the addition assignment operator (+=) adds the value of the right operand to a variable and assigns the result to the variable.
... syntax operator: x += y meaning: x = x + y examples using addition assignment // assuming the following variables // foo = 'foo' // bar = 5 // baz = true // number + number -> addition bar += 2 // 7 // boolean + number -> addition baz += 1 // 2 // boolean + boolean -> addition baz += false // 1 // number + string -> concatenation bar += 'foo' // "5foo" // string + boolean -> concatenation foo += false // "foofalse" // string + string -> concatenation foo += 'bar' // "foobar" specifications ...
Division assignment (/=) - JavaScript
the division assignment operator (/=) divides a variable by the value of the right operand and assigns the result to the variable.
... syntax operator: x /= y meaning: x = x / y examples using division assignment // assuming the following variable // bar = 5 bar /= 2 // 2.5 bar /= 'foo' // nan bar /= 0 // infinity specifications specification ecmascript (ecma-262)the definition of 'assignment operators' in that specification.
Exponentiation assignment (**=) - JavaScript
the exponentiation assignment operator (**=) raises the value of a variable to the power of the right operand.
... syntax operator: x **= y meaning: x = x ** y examples using exponentiation assignment // assuming the following variable // bar = 5 bar **= 2 // 25 bar **= 'foo' // nan specifications specification ecmascript (ecma-262)the definition of 'assignment operators' in that specification.
Multiplication assignment (*=) - JavaScript
the multiplication assignment operator (*=) multiplies a variable by the value of the right operand and assigns the result to the variable.
... syntax operator: x *= y meaning: x = x * y examples using multiplication assignment // assuming the following variable // bar = 5 bar *= 2 // 10 bar *= 'foo' // nan specifications specification ecmascript (ecma-262)the definition of 'assignment operators' in that specification.
Nullish coalescing operator (??) - JavaScript
in other words, if you use || to provide some default value to another variable foo, you may encounter unexpected behaviors if you consider some falsy values as usable (eg.
...0; console.log(vala); // "default for a" console.log(valb); // "" (as the empty string is not null or undefined) console.log(valc); // 42 assigning a default value to a variable earlier, when one wanted to assign a default value to a variable, a common pattern was to use the logical or operator (||): let foo; // foo is never assigned any value so it is still undefined let somedummytext = foo || 'hello!'; however, due to || being a boolean logical operator, the left hand-side operand was coerced to a boolean for the evaluation and any falsy value (0, '', nan, null, u...
Object initializer - JavaScript
oftentimes, there are variables in your code that you would like to put into an object.
... let __proto__ = 'variable' let obj1 = {__proto__} assert(object.getprototypeof(obj1) === object.prototype) assert(obj1.hasownproperty('__proto__')) assert(obj1.__proto__ === 'variable') let obj2 = {__proto__() { return 'hello'; }} assert(obj2.__proto__() === 'hello') let obj3 = {['__prot' + 'o__']: 17} assert(obj3.__proto__ === 17) specifications specification ecmascript (ecma-262)the definition...
Property accessors - JavaScript
const variable = object.property_name; object.property_name = value; const object = {}; object.$1 = 'foo'; console.log(object.$1); // 'foo' object.1 = 'bar'; // syntaxerror console.log(object.1); // syntaxerror here, the method named createelement is retrieved from document and is called.
... const variable = object[property_name] object[property_name] = value; this does the exact same thing as the previous example.
Remainder assignment (%=) - JavaScript
the remainder assignment operator (%=) divides a variable by the value of the right operand and assigns the remainder to the variable.
... syntax operator: x %= y meaning: x = x % y examples using remainder assignment // assuming the following variable // bar = 5 bar %= 2 // 1 bar %= 'foo' // nan bar %= 0 // nan specifications specification ecmascript (ecma-262)the definition of 'assignment operators' in that specification.
Subtraction assignment (-=) - JavaScript
the subtraction assignment operator (-=) subtracts the value of the right operand from a variable and assigns the result to the variable.
... syntax operator: x -= y meaning: x = x - y examples using subtraction assignment // assuming the following variable // bar = 5 bar -= 2 // 3 bar -= 'foo' // nan specifications specification ecmascript (ecma-262)the definition of 'assignment operators' in that specification.
this - JavaScript
var obj = {a: 'custom'}; // we declare a variable and the variable is assigned to the global window as its property.
... var o = {f: function() { return this.a + this.b; }}; var p = object.create(o); p.a = 1; p.b = 4; console.log(p.f()); // 5 in this example, the object assigned to the variable p doesn't have its own f property, it inherits it from its prototype.
Expressions and operators - JavaScript
arithmetic operators arithmetic operators take numerical values (either literals or variables) as their operands and return a single numerical value.
... [a, b] = [1, 2] {a, b} = {a:1, b:2} destructuring assignment allows you to assign the properties of an array or object to variables using syntax that looks similar to array or object literals.
block - JavaScript
examples block scoping rules with var or function declaration in non-strict mode variables declared with var or created by function declarations in non-strict mode do not have block scope.
... variables introduced within a block are scoped to the containing function or script, and the effects of setting them persist beyond the block itself.
switch - JavaScript
block-scope variables within switch statements with ecmascript 2015 (es6) support made available in most modern browsers, there will be cases where you would want to use let and const statements to declare block-scoped variables.
...ultimately, this is due to both let statements being interpreted as duplicate declarations of the same variable name within the same block scope.
with - JavaScript
the recommended alternative is to assign the object whose properties you want to access to a temporary variable.
...note, however, that in many cases this benefit can be achieved by using a temporary variable to store a reference to the desired object.
JavaScript
the complete modules available there are as follows: javascript first steps answers some fundamental questions such as "what is javascript?", "what does it look like?", and "what can it do?", along with discussing key javascript features such as variables, strings, numbers, and arrays.
... strict mode strict mode defines that you can not use any variable before initializing it.
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
it is done in a controlled environment where variable like geography, network, device, browser, and cached status are predetermined.
... controlling for environmental variables is helpful in understanding where performance bottlenecks have been occurring and identifying the source of any performance issues.
Add to Home screen - Progressive web apps (PWAs)
first of all, we declare a deferredprompt variable (which we'll explain later on), get a reference to our install button, and set it to display: none initially: let deferredprompt; const addbtn = document.queryselector('.add-button'); addbtn.style.display = 'none'; we hide the button initially because the pwa will not be available for install until it follows the a2hs criteria.
... store the event object in the deferredprompt variable so it can be used later on to perform the actual installation.
Tutorials
after that, we discuss some key javascript features in detail, such as variables, strings, numbers and arrays.
...you can even create your own objects to encapsulate related functions and variables into efficient packages.
current - XPath
<xsl:value-of select="current()"/> <xsl:value-of select="foo/bar[current() = x]"/> <xsl:variable name="current" select="current()"/> <xsl:value-of select="foo/bar[$current = x]"/> and the next code is also semantically equivalent to the latter two, since the .
... <xsl:variable name="current" select="."/> <xsl:value-of select="foo/bar[$current = x]"/> but the .
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
it is not an error to specify a parameter name that does not exist in the stylesheet (or that is a variable in the stylesheet).
... no variables are available.
Understanding WebAssembly text format - WebAssembly
declaring globals in webassembly webassembly has the ability to create global variable instances, accessible from both javascript and importable/exportable across one or more webassembly.module instances.
... atomic memory accesses a number of new wasm instructions have been added that can be used to implement higher level features like mutexes, condition variables, etc.
Interacting with page scripts - Archive of obsolete content
in this example a page script adds a string variable foo to the window: <!doctype html"> <html> <head> <script> window.foo = "hello from page script" </script> </head> </html> the content script can see this object if it uses unsafewindow.foo instead of window.foo: // main.js var tabs = require("sdk/tabs"); var mod = require("sdk/page-mod"); var self = require("sdk/self"); var pageurl = self.data.url("page.html") var pagemod =...
Modules - Archive of obsolete content
a commonjs module defines three global variables: require, which is a function that behaves like loadscript in our examples, exports, which behaves like the exports object, and module, which is an object representing the module itself.
/loader - Archive of obsolete content
module() the module() function takes a module id and uri and creates a module instance object that is exposed as the module variable in the module scope.
chrome - Archive of obsolete content
this module should not be confused with the "chrome" global variable that webextensions can use to access apis.
event/target - Archive of obsolete content
adding listeners eventtarget interface defines on method, that can be used to register event listeners on them for the given event type: target.on('message', function onmessage(message) { // note: `this` pseudo variable is an event `target` unless // intentionally overridden via `.bind()`.
lang/functional - Archive of obsolete content
: function takes a variable number of functions as arguments and composes them from right to left.
system/child_process - Archive of obsolete content
however, there are a few differences to be aware of: you need to require() the module using require("sdk/system/child_process") fork() is not supported gid and uid are not supported in node.js, spawn() and exec() inherit the environment variables from the parent process, by default.
ui/sidebar - Archive of obsolete content
on the sidebar end of the conversation, sidebar scripts get a global variable addon that contains a port for sending and receiving messages.
Low-Level APIs - Archive of obsolete content
system/environment access, set and clear environment variables.
Modifying Web Pages Based on URL - Archive of obsolete content
communicating with the content script your add-on script and content scripts can't directly access each other's variables or call each other's functions, but they can send each other messages.
Modifying the Page Hosted by a Tab - Archive of obsolete content
ton/action").actionbutton({ id: "load-several", label: "load several scripts", icon: "./icon-16.png", onclick: function () { tabs.activetab.attach({ contentscriptfile: [self.data.url('first.js'), self.data.url('second.js')] }); } }); communicating with the content scripts your add-on script and content scripts can't directly access each other's variables or call each other's functions, but they can send each other messages.
Forms related code snippets - Archive of obsolete content
similar to variables declared with the let statement, constants declared with const will be block-scoped.
Default Preferences - Archive of obsolete content
you may not set variables inside of it, nor may do any kind of program flow control (ifs, loops etc.) nor even calculated values (i.e.
Adding windows and dialogs - Archive of obsolete content
it's ok to use this function if you're just debugging some problem and want to see if the program reaches a specific line of code, or to inspect the value of a variable, but your final extension should not have alert calls anywhere.
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
// this will encapsulate local variables such as _original and // not pollute the global namespace.
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
in these cases, multiple attributes should be used, one for each variable: function clickify(elem, address) { elem.setattribute("href", address); elem.setattribute("onclick", "openwindow(this.getattribute('href'))"); } escaping functions when the code fragment in question is not an event handler attribute and there is no feasible way to pass the data through other means, they must be escaped with functions such as uneval, string.quote, json.stringify, or num...
Intercepting Page Loads - Archive of obsolete content
we store the handler function in a private variable because later we want to remove it when we do not need it anymore.
Local Storage - Archive of obsolete content
, formatter); appender.level = log4moz.level["all"]; root.addappender(appender); after that, you can create a logger object for any object in your project like this: this._logger = log4moz.repository.getlogger("xulschool.someobject"); this._logger.level = log4moz.level["all"]; note: we recommend that you create a logger instance in the constructor of every object and store it in a private variable.
Extensions support in SeaMonkey 2 - Archive of obsolete content
seamonkey on the other hand defaults to not support them so they either need to be expanded to their proper forms or matching constants/variables need to be defined in custom code.
Session store API - Archive of obsolete content
ed with a tab at any time (whether the tab is in the process of being restored or not), using code similar to the following: var ss = components.classes["@mozilla.org/browser/sessionstore;1"] .getservice(components.interfaces.nsisessionstore); var currenttab = gbrowser.selectedtab; var retrieveddata = ss.gettabvalue(currenttab, "key-name-here"); after this code executes, the variable retrieveddata contains the value saved for the key "key-name-here".
Setting up an extension development environment - Archive of obsolete content
alternatively, you can set the moz_purge_caches environment variable.
Signing an XPI - Archive of obsolete content
you can either set this permanently via control panel->system properties->advanced->environment variables->system variables or do it each time you run the tools from the command-line (preferably using a batch file).
Promises - Archive of obsolete content
the variable addon_id must be defined to the id of the add-on the code is being used in.
CSS3 - Archive of obsolete content
css custom properties for cascading variables module level 1 candidate recommendation defines a mechanism allowing to define variables in css.
JXON - Archive of obsolete content
similar to variables declared with the let statement, constants declared with const will be block-scoped.
Localizing an extension - Archive of obsolete content
then we replace any occurrences of the literal strings with the appropriate variables: samplepanel.tooltiptext = changestring + fieldarray[4] + " | " + openstring + fieldarray[5] + " | " + lowstring + fieldarray[6] + " | " + highstring + fieldarray[7] + " | " + volumestring + fieldarray[8]; localizing the description in install.rdf see localizing extension descriptions.
Visualizing an audio spectrum - Archive of obsolete content
the function handling the loadedmetadata event stores the metadata of the audio element in global variables; the function for the mozaudioavailable event does an fft of the samples and displays them in a canvas.
How Mozilla finds its configuration files - Archive of obsolete content
the value contained in this key is a litteral value, no variables (such as %userprofile%/mozprofile) allowed.
How Thunderbird and Firefox find their configuration files - Archive of obsolete content
the value contained in this key is a litteral value, no variables (such as %userprofile%/mozprofile) allowed.
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
notice that we defined the instance of xmlhttprequest as a global variable.
Creating a Release Tag - Archive of obsolete content
rm mozilla/client.mk cvs co -r mozilla_0_9_4_1_release_mini_branch mozilla/client.mk in each of the build scripts find the variables defining the branch and change it from the branch you originally pulled from to the new tag you are creating.
Editor Embedding Guide - Archive of obsolete content
cmd_var toggles variable style on selection.
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
there is a static variable on the // nsieventqueueservice that contains the id of the special ui event queue.
Disabling interruptible reflow - Archive of obsolete content
add the following variables to your environment to disable gecko interruptible reflow: gecko_reflow_interrupt_mode=counter gecko_reflow_interrupt_frequency=1000000 gecko_reflow_interrupt_checks_to_skip=1000000 now start firefox within this environment.
JavaScript Client API - Archive of obsolete content
the score the '''score''' is stored in this.score, a variable defined by the base tracker class.
Jetpack Snippets - Archive of obsolete content
</body></html>, width: 800, //wide enough to use firebug onselect: function(slide) { slide.slide(800, true); }}); calling into a slidebar from the global jetpack scope jetpack.slidebar.append({ onready: function (slide) { // call out to a global function, passing the slidebar object exinitslidebar(slide); }, ...});function exinitslidebar(aslidebar) { // this variable will now be global slider = aslidebar;} // then, accessing the slidebar htmlvar tl = slider.contentdocument.getelementbyid("thumblist"); // or calling slidebar api methods or accessing propertiesslider.notify(); ...
Simple Storage - Archive of obsolete content
note that these examples create a mystorage variable to emphasize the fact that jetpack.storage.simple is just a normal javascript object.
Simple Storage - Archive of obsolete content
note that these examples create a mystorage variable to emphasize the fact that jetpack.storage.simple is just a normal javascript object.
jspage - Archive of obsolete content
urn $try(function(){return new xmlhttprequest();},function(){return new activexobject("msxml2.xmlhttp"); },function(){return new activexobject("microsoft.xmlhttp");});};browser.features.xhr=!!(browser.request());browser.plugins.flash=(function(){var a=($try(function(){return navigator.plugins["shockwave flash"].description; },function(){return new activexobject("shockwaveflash.shockwaveflash").getvariable("$version");})||"0 r0").match(/\d+/g);return{version:parseint(a[0]||0+"."+a[1],10)||0,build:parseint(a[2],10)||0}; })();function $exec(b){if(!b){return b;}if(window.execscript){window.execscript(b);}else{var a=document.createelement("script");a.setattribute("type","text/javascript"); a[(browser.engine.webkit&&browser.engine.version<420)?"innertext":"text"]=b;document.head.appendchild(a);document.
Metro browser chrome tests - Archive of obsolete content
adding a new browser chrome test to the tree to add a new metro browser chrome test add the test file to the browser_tests variable in /browser/metro/base/tests/mochitest/makefile.in.
Monitoring downloads - Archive of obsolete content
the download manager instance is cached into a member variable in the downloadlogger object for reuse later, and its addlistener() method is called to start listening for download status updates.
Mozilla Application Framework - Archive of obsolete content
tools venkman a javascript debugger with support for breakpoints, conditional breakpoints, local variable inspection, watch variables, single step, stop on error, profile data collection, report generation, code reformatting (pretty printing), and more.
New Skin Notes - Archive of obsolete content
--nickolay do you know if there's a localsettings variable to have the edit-section links off by default?
Reading textual data - Archive of obsolete content
ngs that contain embedded nulls such as utf-16 and utf-32 // first, get and initialize the converter var converter = components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createinstance(components.interfaces.nsiscriptableunicodeconverter); converter.charset = /* the character encoding you want, using utf-8 here */ "utf-8"; // this assumes that 'file' is a variable that contains the file you want to read, as an nsifile var fis = components.classes["@mozilla.org/network/file-input-stream;1"] .createinstance(components.interfaces.nsifileinputstream); fis.init(file, -1, -1, 0); var lis = fis.queryinterface(components.interfaces.nsilineinputstream); var linedata = {}; var cont; do { cont = lis.readline(linedata); var line = converter.co...
Standard Makefile Header - Archive of obsolete content
this header sets variables which tell the makefile where it is and where the source directory is, and then include autoconf.mk, to pick up makefile variables which are set during configuration.
String Quick Reference - Archive of obsolete content
onversion() nsautostring widestring; widestring.assignwithconversion("some string"); callwidefunction(widestring); // use widestring again, but need a const prunichar* callwidewithflatstring(widestring.get()) nsautostring widestring2; widestring2.assignwithconversion("another string"); callwidefunction(widestring2); new way: use ns_literal_string or ns_named_literal_string // pre-declare the variable if you'll use it multiple times ns_named_literal_string(widestring, "some string"); callwidefunction(widestring); // use widestring again, but need a const prunichar* callwidewithflatstring(widestring.get()); // inline the string with ns_literal_string callwidefunction(ns_literal_string("another string")); converting literal strings to string objects what: converting from const prunichar*/...
Actionscript Acceptance Tests - Archive of obsolete content
testname.as.avm_args this file specifies additional arguments to pass to the shell when running the test - the user can use the special variable $dir to refer to the current directory.
Actionscript Performance Tests - Archive of obsolete content
similar to the acceptance tests set the environment variables avm, asc, builtinabc.
Cmdline tests - Archive of obsolete content
two use cases for the cmdline testsuite: use case 1: test the interactive cmdline debugger test contents: start avmshell -d test.abc, set breakpoint on a line, show local variable value, quit from cmdutils import * def run(): r=runtestlib() r.run_test( 'debugger locals', '%s -d testdata/debug.abc'%r.avmrd, input='break 53\ncontinue\nnext\ninfo locals\nnext\ninfo locals\nquit\n', expectedout=['local1 = undefined','local2 = 10','local2 = 15'] ) use case 2: test -memstats returns memory logs to stdout test contents: start avmshell -memstat...
When To Use ifdefs - Archive of obsolete content
this variable marks any application that is using the "toolkit".
Elements - Archive of obsolete content
note: all properties of the binding are "imported" as local variables in a constructor's scope.
Using XPInstall to Install Plugins - Archive of obsolete content
the variables that determine the plugin name, however, can be easily modified.
cancelInstall - Archive of obsolete content
example use the following code to abort or to finalize an installation, based on a variable you set earlier in your code: initinstall("royal airways tripplanner","/royalairways/ tripplanner","1.0.0.0"); ...
performInstall - Archive of obsolete content
example use the following code to abort or to finalize an installation, based on a variable you set earlier in your code: initinstall("royal airways tripplanner", "/royalairways/tripplanner", "1.0.0.0"); ...
Learn XPI Installer Scripting by Example - Archive of obsolete content
this input is defined in line 22, where getfolder() is used to assign a value to the communicatorfolder variable representing the "program" folder on the local system: var communicatorfolder = getfolder("program"); spaceavailable = filegetdiskspaceavailable(dirpath); spacerequired, the other expected input to the verifydiskspace function, is given as 17311 kilobytes on line 19.
object - Archive of obsolete content
it can be a variable reference, an rdf resource uri, or an rdf literal value.
onchange - Archive of obsolete content
window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> function myfunction(e){ /* do something cool here or just ...
subject - Archive of obsolete content
it can be a variable reference or an rdf resource uri.
var - Archive of obsolete content
ArchiveMozillaXULAttributevar
« xul reference home var type: string for the xul assign attribute, this is the variable to assign the value to; otherwise it's a reference to a template variable such as "?name".
where.subject - Archive of obsolete content
« xul reference home subject type: string the variable or string to compare.
Working With Directories - Archive of obsolete content
if the time is higher, the lastmod variable is updated as needed.
appendNotification - Archive of obsolete content
example: function testnotificationboxwithbuttons() { //create some common variables if they do not exist.
Extensions - Archive of obsolete content
while the popup is open, the gcontextmenu global variable is set to an object which handles all of the functionality specific to the firefox context menu.
OpenClose - Archive of obsolete content
a simple example: somemenu.open = true; this single line of code will open a menu referenced by the variable 'somemenu'.
PopupEvents - Archive of obsolete content
<menu label="edit"> <menupopup onpopupshowing="if (gdisallowed) event.preventdefault();"> <menuitem label="undo"/> <menuitem label="redo"/> </menupopup> </menu> in this example, a global variable gdisallowed is checked and the preventdefault method is called.
child - Archive of obsolete content
ArchiveMozillaXULPropertychild
a variable reference to a node that is expected to be a child of the element that is referred to by the container element.
object - Archive of obsolete content
it can be a variable reference, an rdf resource uri, or an rdf literal value.
subject - Archive of obsolete content
it can be a variable reference or an rdf resource uri.
Containment Properties - Archive of obsolete content
what happens is that the builder generates additional possible values for the ?child variable, so it creates an additional result for each one.
Filtering - Archive of obsolete content
the value attribute is assigned the ?country variable so that the applyfilter function can use this value easily for filtering.
Recursive Generation - Archive of obsolete content
since the ?start variable points to item c and the ?relateditem variable points to d, the buttons will be created with these labels.
Special Condition Tests - Archive of obsolete content
" querytype="xml"> <template> <query expr="*"/> <rule parent="vbox"> <action> <groupbox uri="?"> <caption label="?name"/> </groupbox> </action> </rule> <rule> <action> <label uri="?" value="?name"/> </action> </rule> </template> </vbox> previously, an assign element was used to assign the tagname of the result to a variable, which was then compared in a rule condition.
Using Recursive Templates - Archive of obsolete content
in this next example, an assign element is used to assign the local name of the node is to the variable ?type.
XML Templates - Archive of obsolete content
for an rdf query, the uri attribute specifies the member variable; for an xml query the member variable is always '?' so the value of the uri attribute for xml templates should always be the single question mark character as in this example.
textbox (Toolkit autocomplete) - Archive of obsolete content
window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> function myfunction(e){ /* do something cool here or just ...
Textbox (XPFE autocomplete) - Archive of obsolete content
window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> function myfunction(e){ /* do something cool here or just ...
The Joy of XUL - Archive of obsolete content
developers who are equipped with the software and knowledge required to compile mozilla can set an optional environment variable and build the calendar themselves.
Adding Methods to XBL-defined Elements - Archive of obsolete content
the names of the parameters are defined as variables in the script as if they had been passed as parameters.
Open and Save Dialogs - Archive of obsolete content
var nsifilepicker = components.interfaces.nsifilepicker; var fp = components.classes["@mozilla.org/filepicker;1"].createinstance(nsifilepicker); fp.init(window, "select a file", nsifilepicker.modeopen); first, a new file picker object is created and stored in the variable 'fp'.
Skinning XUL Files by Hand - Archive of obsolete content
to avoid this, the makers of the css specification have created some rules of precedence that look at how many different rules have been defined for an element, where the style definitions appear (i.e., externally in a css file or inline), where the elements themselves appear, and other esoteric variables.
XPCOM Examples - Archive of obsolete content
this window, stored in the switchwindow variable, is the same as the javascript window object.
XUL Questions and Answers - Archive of obsolete content
change this line var settings = printutils.getprintsettings(); to this var settings = printutils.getprintsettings().clone(); settings.docurl = " "; // suppress url on printout other options you can modify are documented here: http://www.xulplanet.com/references/...tsettings.html how can i send xml/xul document fragment to the server instead of using get or post variables?
The Implementation of the Application Object Model - Archive of obsolete content
a single content node could be initialized with its uri by its parent node, it could store its uri in a member variable, and it could use that as a basis for resolving the pluggable data source from which it would obtain its information.
colorpicker - Archive of obsolete content
window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> function myfunction(e){ /* do something cool here or just ...
listbox - Archive of obsolete content
if you wish to create a list with variable height rows, or with non-text content, you should instead use the richlistbox element.
preference - Archive of obsolete content
window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> function myfunction(e){ /* do something cool here or just ...
rule - Archive of obsolete content
ArchiveMozillaXULrule
the bindings element is optional and may specify additional variable bindings to be used.
treeitem - Archive of obsolete content
set the uri attribute to the variable name to bind to a content node during matching.
where - Archive of obsolete content
ArchiveMozillaXULwhere
er than the value before the string value of subject must come before value alphabetically after the string value of subject must come after value alphabetically startswith the value of subject must start with the value endswith the value of subject must end with the value contains the value of subject must contain the value as a substring subject type: string the variable or string to compare.
Building XULRunner with Python - Archive of obsolete content
if you plan to checkout often into empty folders you could modify it to set the cvsroot environment variable.
Debugging a XULRunner Application - Archive of obsolete content
to log js errors to disk, set the environment variable xre_console_log to the path to the filename.
Make your xulrunner app match the system locale - Archive of obsolete content
from xpcom import components ps_cls = components.classes["@mozilla.org/preferences-service;1"] ps = ps_cls.getservice(components.interfaces.nsiprefservice) branch = ps.getbranch("general.useragent.") branch.setcharpref("locale", lang) i also set the language environment variable to match the system locale so that python's gettext functionality will work (it pulls straight from language instead of using setlocale): os.environ["language"] = lang ...
xulauncher - Archive of obsolete content
-f "$1" ] then echo "\"$1\" is not a file" exit fi # define some variables ############################################################################## wd=/tmp ext=".xul" xulfile=`basename $1` xulname=${xulfile%$ext} xuldir="$wd/$xulname/chrome/$xulname/" xulprefdir="$wd/$xulname/defaults/preferences" xulappini="$wd/$xulname/application.ini" xulmanifest="$wd/$xulname/chrome/chrome.manifest" xulprefs="$wd/$xulname/defaults/preferences/prefs.js" # make minimal direc...
Archived Mozilla and build documentation - Archive of obsolete content
resources are identified by uri "uniform resource identifier" (taken from rfc 2396): urischeme list of mozilla supported uri schemes using addresses of stack variables with nspr threads on win16 this is a cautionary note that may be old information for some of you.
2006-11-10 - Archive of obsolete content
he stated that he set is home variable to c:\mozilla, and is not sure what he is doing wrong.
2006-09-29 - Archive of obsolete content
called while * constructing the nshtmlreflowstate to be used to reflow the frame, * in order to fill its mcomputedwidth and mcomputedheight member * variables.
Supporting private browsing in plugins - Archive of obsolete content
detecting private browsing mode plug-ins can detect whether or not private browsing mode is in effect by using the npn_getvalue() function to check the current value of the npnvprivatemodebool variable.
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
once you've verified that the browser has the compatibility you require, you can modify your npp_getvalue call like so: nperror npp_getvalue(void *future, nppvariable variable, void *value) { nperror err = nperr_no_error; switch (variable) { case nppvpluginneedsxembed: *((prbool *)value) = pr_true; break; default: err = nperr_generic_error; } return err; } once you have set those variables, it should be relatively easy to set up a plugin.
Scratchpad - Archive of obsolete content
any variables you declare outside of a function will be added to the global object for that tab.
Browser Detection and Cross Browser Support - Archive of obsolete content
imagine attempting to maintain a web site which uses many of the browser variables available from the ultimate browser sniffer.
E4X for templating - Archive of obsolete content
ting to mix in context with the surrounding declarative xml: var a = <a><b/><c/><d/></a>; var b = <bar>{function () { var content = <></>; for each (var el in a) { el.@att = 'val'; content += el; } return content; }()}</bar>; giving: <bar> <b att="val"/> <c att="val"/> <d att="val"/> </bar> one may still wish to remove complex business logic and supply as variables to the e4x, but the above allows the shaping of resulting content to be made more clear (and sometimes design logic also calls for extra processing).
Using JavaScript Generators in Firefox - Archive of obsolete content
you can opt in in html as follows: <script type="text/javascript;version=1.7" src="myscript.js"></script> then your myscript.js file might look like this: // need to stash the generator in a global variable.
Array comprehensions - Archive of obsolete content
new variables (such as i in the example) are treated as if they had been declared using let.
Debug.write - Archive of obsolete content
example this example uses the debug.write function to display the value of the variable in the immediate window of the script debugger.
Debug.writeln - Archive of obsolete content
example this example uses the debug.writeln function to display the value of the variable in the immediate window of the microsoft script debugger.
Debug - Archive of obsolete content
examples print the value of a variable this example uses the write function to display the value of the variable.
Enumerator - Archive of obsolete content
syntax enumobj = new enumerator([collection]) parameters enumobj the variable name to which the enumerator object is assigned.
VBArray - Archive of obsolete content
syntax varname = new vbarray(safearray) parameters varname the variable name to which the vbarray is assigned.
@cc_on - Archive of obsolete content
it is not common to use conditional compilation variables in scripts written for asp or asp.net pages or command-line programs because the capabilities of the compilers can be determined by using other methods.
@if - Archive of obsolete content
it is not common to use conditional compilation variables in scripts written for asp or asp.net pages or command-line programs.
New in JavaScript 1.7 - Archive of obsolete content
se: <script type="application/javascript;version=1.7"></script> when using the javascript shell, you need to set the version you wish to use using the -version 170 switch on the command line or using the version() function: version(170); the features that require the use of the new keywords "yield" and "let" require you to specify version 1.7 because existing code might use those keywords as variable or function names.
New in JavaScript 1.8.5 - Archive of obsolete content
bug 492844 array.isarray() checks if a variable is an array.
New in JavaScript 1.8 - Archive of obsolete content
the features that require the use of the new keywords "yield" and "let" require you to specify version 1.7 or higher because existing code might use those keywords as variable or function names.
Object.prototype.eval() - Archive of obsolete content
the expression can include variables and properties of existing objects.
Archived JavaScript Reference - Archive of obsolete content
see also the newer version of date.prototype.tolocaledatestring().ecmascript 2016 to es.next support in mozillaexpression closuresexpression closures are a shorthand function syntax for writing simple functions.for each...inthe for each...in statement iterates a specified variable over all values of object's properties.
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
if you don’t already have it, you’ll need to also download the jdbc driver for mysql, extract the class files, and include the path in your classpath environment variable.
Developing Mozilla XForms - Archive of obsolete content
to activate this logging output, set the nspr_log_modules environment variable: export nspr_log_modules=schemavalidation:5 this only works on a debug build as described above.
XForms - Archive of obsolete content
xforms user preferences a description of the about:config variables that xforms uses.
RDF in Mozilla FAQ - Archive of obsolete content
<template> <rule> <query>...</query> <binding>...</binding> <action> <text value="?some-variable" /> </action> </rule> </template> the above template will create a content model that runs a series of text nodes together.
The Business Benefits of Web Standards - Archive of obsolete content
all these great experiences can be enjoyed by the user regardless of platform, software, operating system, or any one of a dozen other variables including screen size, text resolution, javascript activation, or any disabilty the user may have.
Windows Media in Netscape - Archive of obsolete content
for programming convenience, the object could be assigned to a temporary variable, e.g.
XQuery - Archive of obsolete content
it offers powerful and yet intuitive searching based on xpath, has sql-like syntax for the query portion, and has scripting features such as function and variable definitions, xml-inclusion, etc.
Archive of obsolete content
it offers powerful and yet intuitive searching based on xpath, has sql-like syntax for the query portion, and has scripting features such as function and variable definitions, xml-inclusion, etc.
Bounding volume collision detection with THREE.js - Game development
we assume our scene variable to be simply called scene.
Building up a basic demo with A-Frame - Game development
we are passing some initial variables to that shape: the radius of the outer edge of the torus, the radius of the tube, and number of segments along the circumference of the tube face respectively.
Building up a basic demo with PlayCanvas editor - Game development
add the following line inside this function, to rotate the cube on every frame: this.entity.rotate(dt*10, dt*20, dt*30); in the line above this.entity refers to the object to which the script will be attached (the box); using the dt variable, which contains the delta time passed since the previous frame, we can rotate the box by a different amount around all three axes.
Implementing game control mechanisms - Game development
} this will be executed whenever the mouse button is pressed, and it will be checked against the input's isdown boolean variable on every frame of the game.
Square tilemaps implementation: Scrolling maps - Game development
in our demo the shifting amount is stored in the offsetx and offsety variables.
Collision detection - Game development
for better readability of the code we will define the b variable for storing the brick object in every loop of the collision detection: function collisiondetection() { for(var c=0; c<brickcolumncount; c++) { for(var r=0; r<brickrowcount; r++) { var b = bricks[c][r]; // calculations } } } if the center of the ball is inside the coordinates of one of our bricks, we'll change the direction of the ball.
Build the brick field - Game development
defining new variables first, let's define the needed variables — add the following below your previous variable definitions: var bricks; var newbrick; var brickinfo; the bricks variable will be used to create a group, newbrick will be a new object added to the group on every iteration of the loop, and brickinfo will store all the data we need.
Initialize the framework - Game development
we are initializing it by creating a new phaser.game object and assigning it to the game variable.
Physics - Game development
this kind of functionality is just the tip of the iceberg — there are various functions and variables that can help you manipulate the physics objects.
Plug-in Development Overview - Gecko Plugin API Reference
starting in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7), you can get the origin of the document in a secure, convenient way by calling npn_getvalue() to retrieve the value of the variable npnvdocumentorigin.
Boolean - MDN Web Docs Glossary: Definitions of Web-related terms
/* javascript if statement */ if (boolean conditional) { // code to execute if the conditional is true } if (boolean conditional) { console.log("boolean conditional resolved to true"); } else { console.log("boolean conditional resolved to false"); } /* javascript for loop */ for (control variable; boolean conditional; counter) { // code to execute repeatedly if the conditional is true } for (var i=0; i < 4; i++) { console.log("i print only when the boolean conditional is true"); } the boolean value is named after english mathematician george boole, who pioneered the field of mathematical logic.
Dynamic programming language - MDN Web Docs Glossary: Definitions of Web-related terms
for example, in javascript it is possible to change the type of a variable or add new properties or methods to an object while the program is running.
Dynamic typing - MDN Web Docs Glossary: Definitions of Web-related terms
dynamically-typed languages are those (like javascript) where the interpreter assigns variables a type at runtime based on the variable's value at the time.
Function - MDN Web Docs Glossary: Definitions of Web-related terms
a function is a code snippet that can be called by other code or by itself, or a variable that refers to the function.
Global scope - MDN Web Docs Glossary: Definitions of Web-related terms
learn more learn about it introduction to variable scope in javascript scope on wikipedia ...
Identifier - MDN Web Docs Glossary: Definitions of Web-related terms
an identifier is a sequence of characters in the code that identifies a variable, function, or property.
Local scope - MDN Web Docs Glossary: Definitions of Web-related terms
local scope is a characteristic of variables that makes them local (i.e., the variable name is only bound to its value within a scope which is not the global scope).
NaN - MDN Web Docs Glossary: Definitions of Web-related terms
practically speaking, if i divide two variables in a javascript program, the result may be nan, which is predefined in javascript as "undefined".
PHP - MDN Web Docs Glossary: Definitions of Web-related terms
examples basic syntax // start of php code <?php // php code goes here ?> // end of php code printing data on screen <?php echo "hello world!"; ?> php variables ​​​​​​​​​​​​​​<?php // variables $nome='danilo'; $sobrenome='santos'; $pais='brasil'; $email='danilocarsan@gmailcom'; ​​​​​​​ // printing the variables echo $nome; echo $sobrenome; echo $pais; echo $email; ?> ...
Packet - MDN Web Docs Glossary: Definitions of Web-related terms
it is usually of variable length, up to a maximum that is set by the network protocol and sometimes the equipment on the route.
Reference - MDN Web Docs Glossary: Definitions of Web-related terms
in computing, a reference is a value that indirectly accesses data to retrieve a variable or a record in a computer's memory or other storage device.
Value - MDN Web Docs Glossary: Definitions of Web-related terms
in the context of a variable or property, the value can be either a primitive or an object reference.
Hash - MDN Web Docs Glossary: Definitions of Web-related terms
the hash function takes a variable length message input and produces a fixed-length hash output.
minification - MDN Web Docs Glossary: Definitions of Web-related terms
minification can include the removal of code comments, white space, and unused code, as well as the shortening of variable and function names.
Practical positioning examples - Learn web development
settabhandler(tab, tabpos) { tab.onclick = function() { for(i = 0; i < tabs.length; i++) { tabs[i].classname = ''; } tab.classname = 'active'; for(i = 0; i < panels.length; i++) { panels[i].classname = ''; } panels[tabpos].classname = 'active-panel'; } } this code does the following: first we save a reference to all the tabs and all the panels in two variables called tabs and panels, so we can easily do things to them later on.
CSS FAQ - Learn web development
LearnCSSHowtoCSS FAQ
however, assigning multiple classes to a single element can provide the same effect, and css variables now provide a way to define style information in one place that can be reused in multiple places.
The HTML5 input types - Learn web development
he current value, and update it as it changed, you must use javascript, but this is relatively easy to do: const price = document.queryselector('#price'); const output = document.queryselector('.price-output'); output.textcontent = price.value; price.addeventlistener('input', function() { output.textcontent = price.value; }); here we store references to the range input and the output in two variables.
Sending form data - Learn web development
<?php // the global $_post variable allows you to access the data sent with the post method by name // to access the data sent with the get method, you can use $_get $say = htmlspecialchars($_post['say']); $to = htmlspecialchars($_post['to']); echo $say, ' ', $to; ?> this example displays a page with the data we sent.
Sending forms through JavaScript - Learn web development
window.addeventlistener( 'load', function () { // these variables are used to store the form data const text = document.getelementbyid( "thetext" ); const file = { dom : document.getelementbyid( "thefile" ), binary : null }; // use the filereader api to access file content const reader = new filereader(); // because filereader is asynchronous, store its // result when it finishes to read the file reader.addeventlistener...
Advanced text formatting - Learn web development
<var>: for specifically marking up variable names.
Choosing the right approach - Learn web development
elevant function to decode its contents if(type === 'blob') { return response.blob(); } else if(type === 'text') { return response.text(); } }) .catch(e => { console.log(`there has been a problem with your fetch operation for resource "${url}": ` + e.message); }); } // call the fetchanddecode() method to fetch the images and the text, and store their promises in variables let coffee = fetchanddecode('coffee.jpg', 'blob'); let tea = fetchanddecode('tea.jpg', 'blob'); let description = fetchanddecode('description.txt', 'text'); // use promise.all() to run code only when all three function calls have resolved promise.all([coffee, tea, description]).then(values => { console.log(values); // store each value returned from the promises in separate variables; create...
Test your skills: Functions - Learn web development
functions 2 for our second functions-related task, you need to create a function that draws a rectangle on the provided <canvas> (reference variable canvas, context available in ctx), based on the five provided input variables: x — the x coordinate of the rectangle.
Test your skills: Loops - Learn web development
you are given three variables to begin with: i — starts off with a value of 0; intended to be used as an iterator.
Introduction to web APIs - Learn web development
we know the response will be successfully returned and available after the load event has fired (unless an error occurred), so we save the response containing the returned json in the superheroes variable, then pass it to two different functions for further processing.
Adding features to our bouncing balls demo - Learn web development
in your css file, add the following rule at the bottom: p { position: absolute; margin: 0; top: 35px; right: 5px; color: #aaa; } in your javascript, make the following updates: create a variable that stores a reference to the paragraph.
Object building practice - Learn web development
note that we are chaining multiple assignments together, to get the variables all set quicker — this is perfectly ok.
Introducing JavaScript objects - Learn web development
you can even create your own objects to encapsulate related functions and variables into efficient packages and act as handy data containers.
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Getting started with Ember - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Ember interactivity: Events, classes and state - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Ember resources and troubleshooting - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Routing in Ember - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Ember app structure and componentization - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Introduction to client-side frameworks - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Accessibility in React - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
React resources - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Beginning our React todo list - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Starting our Svelte Todo list app - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Deployment and next steps - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Using Vue computed properties - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Getting started with Vue - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Rendering a list of Vue components - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Vue resources - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Styling Vue components with CSS - Learn web development
nt rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Handling common HTML and CSS problems - Learn web development
store a reference to this element in a variable, for example: const test = document.getelementbyid('hplogo'); now try to set a new value for the css property you are interested in on that element; you can do this using the style property of the element, for example try typing these into the javascript console: test.style.transform = 'rotate(90deg)' test.style.webkittransform = 'rotate(90deg)' as you start to type the property name r...
Client-side tooling overview - Learn web development
for example: sass/scss: this css extension allows you to use variables, nested rules, mixins, functions, and many other features, some of which are available in native css (such as variables), and some of which aren't.
Chrome Worker Modules
to make the value public, you just have to add it to either global value exports, as follows: /* file mymodule.js */ let secretkey = "this is a secret"; let publickey = "this is public"; exports.key = publickey; // secretkey is not exported // publickey is exported with name "key" alternatively, if you prefer that style, you may write // variable |module| is a special global introduced by require() module.exports = { key: publickey }; once this is done, we may load the module and use the values that have been exported // assuming that mymodule.js is installed to resource://gre/modules/mymodule.js let module = require("resource://gre/modules/mymodule.js") foo(module.key); // module.key == "this is public"; // however, secretkey is n...
Embedding API for Accessibility
setcharpref("font.name.sans-serif.x-western", newfontname); /* for other i18n charsets, change x-western to x-central-euro, x-cyrillic, x-unicode, x-user-def, x-baltic, el, tr, he, ar, th, ja, zh-cn or zh-tw */ setintpref("font.size.fixed.x-western", newfontsize); setintpref("font.size.variable.x-western", newfontsize); /* for other i18n charsets, change the name as explained above for font face*/ setcharpref("font.default","serif"); /* or "sans-serif" */ setintpref("browser.use_document_fonts", whichfonts); /* whichfonts: 0=no, 1=yes */ ...
Adding a new event
all new member variables of event classes must be with "m" prefix.
Adding a new word to the en-US dictionary
the script only works if you have the environment variable editor set to the executable of an editor program; if you don't have it set, you can do editor=vim sh edit-dictionary to edit using vim (or you can substitute some other editor), or you can just do sh edit-dictionary if you have an editor already specified.
Benchmarking
the poisoning can be disabled by setting the environment variable jsgc_disable_poisoning=1 before starting the browser.
Debugging Frame Reflow
enter this line in the text file * 1 this should look like: point the gecko_display_reflow_rules_file environment variable to the path of the reflow_rules.txt file.
Debugging JavaScript
console.log in browser console you can dump variables in the browser console from addon code, by adding this line to import the console utility: const { console } = components.utils.import("resource://gre/modules/devtools/console.jsm", {}); this has an advantage over dump in that you can list out properties of an object logged with console.log.
Debugging on Mac OS X
also in the "arguments" panel, you may want to add an environment variable moz_debug_child_process set to the value 1 to help with debugging e10s.
Building Firefox with Debug Symbols
see https://dxr.mozilla.org/mozilla/source/toolkit/crashreporter/tools/upload_symbols.sh for more information about the environment variables used by this target.
Makefile - macro values
variable values moz_widget_toolkit cocoa ...
Makefiles - Best practices and suggestions
use variable assignments, autogen paths and dynamic file gathering.
Installing headers using EXPORTS
this is accomplished by setting make variables telling the build system which module the headers are for (since headers are organized by module under <tt>dist/include</tt>), and which headers need to be created from idl files by xpidl.
Windows SDK versions
(this was certainly the case for 64 bit windows 7 on a late 2008 macbook pro.) warning: due to a bug in windows 7 sdk, if you get "sdksetup encountered an error: expecting path %systemroot% to represent a valid system volume" error you may require to set environmental variable %windir% to something like "c:\windows" instead of "%systemroot%".
ESLint
node.js is not recognized add it to your path environment variable by running path="$path:/path/to/node.js/".
Displaying Places information using views
to put it in terms of javascript, say you have a variable named treeview that references your places tree view: var treeview = document.getelementbyid("myplacestreeview"); points 1 and 2 apply to this variable.
Message manager overview
the content frame message manager provides the global object for frame scripts (but note that there is trickery to ensure that top-level variables defined by frame scripts are not shared).
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
first, we declare a searchactive variable as false, which influences behaviour later on.
How test harnesses work
python runner the python runner: sets up the testing environment sets up environment variables (mozrunner, currently) creates a profile (mozprofile via mozrunner) sets appropriate test preferences inserts a shim extension in the profile (for non-marionette tests) gathers the tests (manifestdestiny) potentially sets up an http server for test data (mozhttpd) invokes the binary (mozrunner) it is the job of the shim extension to shut down the browser ...
How to get a stacktrace for a bug report
if you want breakpad to leave the .dump and .extra files on your computer so that you can examine them locally, then set the moz_crashreporter_no_delete_dump environment variable to 1.
Code Samples
ules/addonmanager.jsm"); addonmanager.getaddonbyid("youraddon@youraddon.com", function(addon) { addon.uninstall(); }); disable an add-on components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("youraddon@youraddon.com", function(addon) { if (addon.isactive) addon.userdisabled = addon.isactive; }); listening for add-on uninstall this example sets a variable beinguninstalled that you can check when you get a profile-before-change message to do cleanup for your add-on on uninstall.
Log.jsm
(); newoutputstream(); outputstream reset(); structuredformatter(); length: 0 keys of prototype: format(); method overview enumerateinterfaces(); length: 0 enumerateproperties(); length: 2 member fields variable type description level object contains the following fields: field name value all 0 config 30 debug 20 desc { 0: "all", 10: "trace", 20: "debug", 30: "config", 40: "info", 50: "warn", 60: "error", 70: "fatal" } er...
OS.File.Info
(as of firefox 38 this attribute is not found, see screen shots below, bugzilla :: bug 1156060) screenshot of info object in variable viewer macosx 10.10.1 ubuntu 14.04.1 windows 8.1 see also os.file.directoryiterator.entry ...
Sqlite.jsm
assume we open an opened connection in the conn variable.
XPCOMUtils.jsm
return value a function that will return the factory for the components and can be assigned to nsgetfactory global variable.
Encodings for localization files
this is tricky to hook up in the build process, so here it goes: file encoding notes toolkit/installer/windows/charset.mk ascii the win_installer_charset variable must be set to an encoding which matches toolkit/installer/windows/install.it charset= parameter.
Localization: Frequently asked questions
how can i not display a variable in a .properties entry?
Localizing XLIFF files for iOS
keep in mind the following sets of characters that need to remain untranslated: $(some_text_here) is a variable format, %1$@ is another variable format.
Writing localizable code
think of them as long variable names.
Mozilla Framework Based on Templates (MFBT)
it should be used only for static-storage-duration variables, such as global variables or static class members.
Mozilla Web Developer FAQ
in the standards mode mozilla does not generate implicit top-level javascript variable bindings for elements with the id or name attribute.
Mozilla Development Tools
mxr you can browse the up-to-the-minute latest version of the source code online through a massively-hyperlinked source code browser (based on lxr) that lets you cross-reference function and variable names.
Gecko Profiler FAQ
start the browser with the environment variable moz_profiler_startup=1 set.
Leak Gauge
getting a log file to get a log file, run the browser with the following environment variables set.
Profiling with Xperf
you can also modify the _nt_symbol_path and _nt_symcache_path environment variables to make these changes permanent.
TimerFirings logging
set the following environment variable to enable it.
TraceMalloc
because this log includes the contents of heap blocks, leaksoup can analyze the graph of live objects and determine which allocations are roots (within that graph, of course -- stack allocations and global variables don't count).
javascript.options.strict
example : <html> <head> <title>sample</title> </head> <body> <label id="name">enter you first name</label> <p id ="sample"></p> <script> "use strict" name1= "john" ; // this will cause and an error as variable not declared .
Crash reporting
see also understanding crash reports a guide to searching crash reports crash-stats crash pings (telemetry) and crash reports (socorro/crash stats) building firefox with debug symbols environment variables affecting crash reporting in-code documentation crash reporter crash manager crash ping ...
NSPR Contributor Guide
the following are some general guidelines to use when implementing new features: don't export global variables your code must be thread safe you must provide test cases that test all apis you are adding.
NSPR Poll Method
declare two print16 variables to receive the return value and the out_flags output argument of the poll method.
NSPR build instructions
you may override the compilers (the cc environment variable) or specify options.
I/O Functions
do not use pollable events for general thread synchronization; use condition variables instead.
Interval Timing
such parameters are common in nspr functions such as those used for i/o operations and operations on condition variables.
PRBool
otherwise, use prbool for variables and parameter types.
PRIntn
this type is one of the most appropriate for automatic variables.
PRUintn
this (unsigned) type is one of the most appropriate for automatic variables.
PR_AtomicIncrement
description the referenced variable is incremented by one.
PR_AtomicSet
returns the function returns the prior value of the referenced variable.
PR_EXTERN
used to define the prototypes for functions or variables that are to be exported from a shared library.
PR_LOG
possible values are: pr_log_none = 0 pr_log_always = 1 pr_log_error = 2 pr_log_warning = 3 pr_log_debug = 4 pr_log_notice = pr_log_debug pr_log_warn = pr_log_warning pr_log_min = pr_log_debug pr_log_max = pr_log_debug _args a variable length argument list, as if to printf.
PR_NewLogModule
if the environment variable nspr_log_modules contains the specified name, then the associated level value from the variable is associated with the new prlogmoduleinfo structure.
PR_Poll
pr_poll uses the out_flags fields as scratch variables during the call.
PR_WaitSemaphore
returns the value of the environment variable.
Threads
for api reference information related to thread synchronization, see locks and condition variables.
An overview of NSS Internals
the common structure to store such an untyped block is secitem, which contains a size and an untyped c pointer variable.
JSS FAQ
MozillaProjectsNSSJSSJSS FAQ
either use the win 95 version of nspr/nss/jss components (essentially all non-fiber builds) or set the environment variable nspr_native_threads_only=1.
Using JSS
MozillaProjectsNSSJSSUsing JSS
setup your runtime environment you need to set some environment variables before building and running java applications with jss.
NSS_3.12.1_release_notes.html
in nss/lib bug 434398: libpkix cannot find issuer cert immediately after checking it with ocsp bug 434808: certutil -b deadlock when importing two or more roots bug 434860: coverity 1150 - dead code in ocsp_createcertid bug 436428: remove unneeded assert from sec_pkcs7encryptlength bug 436430: make nss public headers compilable with no_nspr_10_support defined bug 436577: uninitialized variable in sec_pkcs5createalgorithmid bug 438685: libpkix doesn't try all the issuers in a bridge with multiple certs bug 438876: signtool is still using static libraries.
NSS_3.12.2_release_notes.html
bug 200704: pkcs11: invalid session handle 0 bug 205434: fully implement new libpkix cert verification api from bug 294531 bug 302670: use the installed libz.so where available bug 305693: shlibsign generates pqg for every run bug 311483: exposing includecertchain as a parameter to sec_pkcs12addcertandkey bug 390527: get rid of pkixerrormsg variable in pkix_error bug 391560: libpkix does not consistently return pkix_validatenode tree that truly represent failure reasons bug 408260: certutil usage doesn't give enough information about trust arguments bug 412311: replace pr_interval_no_wait with pr_interval_no_timeout in client initialization calls bug 423839: add multiple pkcs#11 token password command line option to nss tools.
NSS 3.14.2 release notes
on red hat enterprise linux 5.x systems, install the binutils220 package and add /usr/libexec/binutils220 to the beginning of your path environment variable.
NSS 3.14 release notes
support for md5 may be manually enabled (but is discouraged) by setting the environment variable of "nss_hash_alg_support=+md5" or by using the nss_setalgorithmpolicy function.
NSS 3.15 release notes
new types in secitem.h secitemarray - represents a variable-length array of secitems.
NSS 3.17 release notes
on windows, the new build variable use_static_rtl can be used to specify the static c runtime library should be used.
NSS 3.22 release notes
set the nss_disable_gtests variable to 1 to disable building these tests.
NSS 3.24 release notes
disable (by default) nss support in optimized builds for logging ssl/tls key material to a logfile if the sslkeylogfile environment variable is set.
NSS 3.37 release notes
(the classic implementation for rng seeding on the linux/unix platform, which may use additional sources for the default seeding, is still available and will be used if seed_only_dev_urandom is undefined.) with nss 3.37, this alternative implementation for linux/unix can be selected in "make" builds by defining the environment variable nss_seed_only_dev_urandom.
NSS 3.44 release notes
er async server authentication break when using record layer separation 1521578 - x25519 support in pk11pars.c 1540205 - freebl build fails with -dnss_disable_chachapoly 1532312 - post-handshake auth doesn't interoperate with openssl 1542741 - certutil -f crashes with segmentation fault 1546925 - allow preceding text in try comment 1534468 - expose chacha20 primitive 1418944 - quote cc/cxx variables passed to nspr 1543545 - allow to build nss as a static library 1487597 - early data that arrives before the handshake completes can be read afterwards 1548398 - freebl_gtest not building on linux/mac 1548722 - fix some coverity warnings 1540652 - softoken/sdb.c: logically dead code 1549413 - android log lib is not included in build 1537927 - ipsec usage is too restrictive for existing de...
NSS 3.47.1 release notes
bugs fixed in nss 3.47.1 cve-2019-11745 - encryptupdate should use maxout, not block size bug 1590495 - fix a crash that could be caused by client certificates during startup bug 1589810 - fix compile-time warnings from uninitialized variables in a perl script this bugzilla query returns all the bugs fixed in nss 3.47: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.47 compatibility nss 3.47.1 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.51 release notes
t' and 'unsigned long' in security/nss/lib/freebl/ecl/ecp_25519.c:88 bug 1609751 - add test for mp_int clamping bug 1582169 - don't attempt to read the fips_enabled flag on the machine unless nss was built with fips enabled bug 1431940 - fix a null pointer dereference in blake2b_update bug 1617387 - fix compiler warning in secsign.c bug 1618400 - fix a openbsd/arm64 compilation error: unused variable 'getauxval' bug 1610687 - fix a crash on unaligned cmaccontext.aes.keyschedule when using aes-ni intrinsics this bugzilla query returns all the bugs fixed in nss 3.51: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.51 compatibility nss 3.51 shared libraries are backward compatible with all older nss...
NSS 3.52 release notes
bugs fixed in nss 3.52 bug 1633498 - fix unused variable 'getauxval' error on ios compilation.
nss tech note1
sec_asn1_choice: allows decoding of components that are of variable type.
Installation guide
if you install the libraries in a directory other than /usr/lib, you usually need to set the ld_library_path environment variable.
Sample manual installation
/usr/include, /usr/lib and /usr/bin for a linux system), you need to edit the corresponding environment variables or compiler/linker arguments.
FC_FindObjects
description fc_findobjects returns the next set of object handles matching the criteria set up by the previous call to fc_findobjectsinit and sets the object count variable to their number or to zero if there are none.
FC_GetFunctionList
syntax ck_rv fc_getfunctionlist(ck_function_list_ptr *ppfunctionlist); parameters fc_getfunctionlist has one parameter: ppfunctionlist [output] the address of a variable that will receive a pointer to the list of function pointers.
FC_GetMechanismList
syntax ck_rv fc_getmechanismlist( ck_slot_id slotid, ck_mechanism_type_ptr pmechanismlist, ck_ulong_ptr puscount ); parameters fc_getmechanismlist takes three parameters: slotid [input] pinfo [output] the address of a variable that will receive a pointer to the list of function pointers.
FC_GetSlotList
pulcount [out] pointer to a ck_ulong variable which receives the slot count.; description fc_getslotlist obtains a list of slots in the system.
NSS tools : certutil
for example: $ certutil -l -d sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent.
NSS tools : pk12util
for example: # pk12util -i /tmp/cert-files/users.p12 -d sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent.
NSS reference
nss environment variables nss cryptographic module nss tech notes nss tech notes nss memory allocation tools based on nss tools documentation.
NSS troubleshooting
list of environment variables ...
NSS Tools modutil
two variables can be used in the relative path: "%root%" and "%temp%".
certutil
for example: $ certutil -l -d sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent.
NSS tools : pk12util
for example: # pk12util -i /tmp/cert-files/users.p12 -d sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent.
NSS tools : signtool
status path ------------ ------------------- verified test.f using netscape signing tool with a zip utility to use netscape signing tool with a zip utility, you must have the utility in your path environment variable.
NSS tools : signver
MozillaProjectsNSStoolssignver
for example: # signver -a -s signature -d sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent.
Rhino Examples
the foo class - extending scriptableobject foo.java is a simple javascript host object that includes a property with an associated action and a variable argument method.
Rhino shell
all its enumeratable properties define the corresponding environment variable names.
Bytecodes
local slots: holds the local variables used by the current code.
Exact Stack Rooting
note: spidermonkey can gc because of any error, gc because of timers, gc because we are low on memory, gc because of environment variables, gc because of cosmic rays, etc.
Statistics API
there are several ways to get access to this data: the environment variable moz_gctimer controls text dumping of gc stats.
Garbage collection
gc/root.h defines classes for noting variables as gc roots.
Property cache
(informally: if another variable or property shadows x'.p, the shape of x' will change.) o this object is x, perhaps a call object.
Self-hosted builtins in SpiderMonkey
to include self-hosted frames in stack traces (in debug builds only), set the environment variable moz_show_all_js_frames.
Introduction to the JavaScript shell
environment options there are some environment variables that can be set to alter js shell behavior.
JIT Optimization Outcomes
the interpreted callee function contains variables bindings that are closed over.
INT_FITS_IN_JSVAL
example the following code snippet illustrates how a c variable, item, is conditionally tested in an if statement to see if it is a legal jsval integer value.
JS::AutoValueArray
this is typically used for local variables being passed to function which requires js::handlevaluearray or a pointer to js::value array.
JS::HandleValueArray
this is useful as a parameter type, or a temporal local variable for it.
JSErrorReport
to use jserrorreport, your application must define a variable of type jserrorreport and allocate a buffer to hold the text that generated the error condition.
JSIdArray
use js_idarraylength and js_idarrayget to access the property, and js_destroyidarray to free, or use js::autoidarray as a local variable.
JSVAL_IS_DOUBLE
example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a js double data type.
JSVAL_IS_INT
example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a js integer data type.
JSVAL_IS_NULL
(note: jsval_is_object(jsval_null) is also true.) example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it contains a null value.
JSVAL_IS_NUMBER
example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a js integer or double value.
JSVAL_IS_STRING
example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is a string.
JSVAL_IS_VOID
example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it is void.
JS_CallFunction
rval is a pointer to a variable that will hold the function's return value, if any, on successful function execution.
JS_ContextIterator
iterp must point to a variable of type jscontext *.
JS_GetFunctionObject
but in the jsapi there are two separate concepts: a jsobject is what is exposed to scripts and has properties and can be stored in variables; and the corresponding jsfunction contains the code of a function.
JS_GetGlobalForObject
for example, if the function refers to a global variable foo, then foo is a property of the object returned by js_getglobalforobject.
JS_GetGlobalObject
(in javascript, global variables are stored as properties of the global object.) syntax jsobject * js_getglobalobject(jscontext *cx); name type description cx jscontext * the context from which to retrieve the global object.
JS_InitClass
(this is the nearest javascript equivalent of public static member variables in c++ or public static fields in java.) static_fs jsfunctionspec * either null or a pointer to the first element of an array of jsfunctionspecs, terminated by js_fs_end.
JS_InitStandardClasses
this means that scripts executed in cx will see the properties of obj as global variables.
JS_MakeStringImmutable
applications must call js_makestringimmutable before sharing a jsstring among threads by storing it in a c/c++ variable, field, or array element that another thread can read.
JS_NewDoubleValue
this can be avoided by using the address of a rooted variable as rval.
JS_NewNumberValue
this can be avoided by using the address of a rooted variable as rval.
JS_PushArguments
various (in js_pusharguments) a variable number of arguments to be converted to jsvals.
JS_ReportError
error message variables to insert into the format string.
JS_SetFunctionCallback
note that debuggers should probably use js_setcallhook in preference to this function, because it is invoked when the javascript stack is guaranteed to be in a consistent state (and therefore it is valid to inspect and modify local variables, generate stack traces, and set breakpoints.) callback syntax typedef void (* jsfunctioncallback)(const jsfunction *fun,const jsscript *scr, const jscontext *cx, int entering); name type description fun const jsfunction * the javascript function being invoked or exited.
JS_ValueToObject
(implementation note: the object's jsobjectops.defaultvalue method is called with hint=jstype_object.) the resulting object is subject to garbage collection unless the variable *objp is protected by a local root scope, an object property, or the js_addroot function.
JSAPI reference
if a variable is a root, then anything it points to will not be freed by the garbage collector.
JSDBGAPI
baselinenumber js_getscriptlineextent js_getscriptversion js_gettopscriptfilenameflags js_getscriptfilenameflags js_flagscriptfilenameprefix jsfilename_null jsfilename_system jsfilename_protected evaluating debug code js_evaluateinstackframe examining object properties typedef jspropertydesc jspd_enumerate jspd_readonly jspd_permanent jspd_alias jspd_argument jspd_variable jspd_exception jspd_error typedef jspropertydescarray js_propertyiterator js_getpropertydesc js_getpropertydescarray js_putpropertydescarray hooks js_setdebuggerhandler js_setsourcehandler js_setexecutehook js_setcallhook js_setobjecthook js_setthrowhook js_setdebugerrorhook js_setnewscripthook js_setdestroyscripthook js_getglobaldebughooks js_setcontextdebughooks ...
Split object
more indirectly, suppose there's a javascript function defined in page b that refers to global variables in page b.
Aggregating the In-Memory Datasource
return ns_ok; } it may be tempting to keep a pointer to the aggregate's nsirdfdatasource in a member variable, butyou can't do that.
Creating a Python XPCOM component
this is probably best done by setting a pythonpath variable pointing at the 'bin/python' directory in the application.
Preface
italic variables appear in italic.
Creating XPCOM components
f the tutorial following along with the examples conventions acknowledgements an overview of xpcom the xpcom solution gecko components interfaces interfaces and encapsulation the nsisupports base interface xpcom identifiers cid contract id factories xpidl and type libraries xpcom services xpcom types method types reference counting status codes variable mappings common xpcom error codes using xpcom components component examples cookie manager the webbrowserfind component the weblock component component use in mozilla finding mozilla components using xpcom components in your cpp xpconnect: using xpcom components from script component internals creating components in cpp xpcom initialization xpcom reg...
Components.results
elements in this array can be used to test against unknown nsresult variables or they can be 'thrown' to indicate failure...
Components.utils.exportFunction
suppose the content window defines a local variable bar: // page-script.js var bar = {}; now the add-on script can attach the function to bar: // addon-script.js components.utils.exportfunction(greetme, contentwindow.bar, {defineas: "greetme"}); // page-script.js var value = bar.greetme("bob"); console.log(value); // "hello bob" ...
Profiling XPCShell
to use it, you need to enable it in your mozconfig: ac_add_options --enable-xpctools now you can profile an entire script by setting the environment variable <tt>mozilla_js_profiler_output</tt> to a filename where you want the output file.
Language bindings
this is useful for privileged code, such as add-on code, to access variables and apis defined in web content.components.utils.exportfunctionthis function provides a safe way to expose a function from a privileged scope to a less-privileged scope.components.utils.forcegccomponents.utils.forcegc lets scripts force a garbage collection cycle.
NS_Alloc
return values this function returns a pointer to the allocated block of memory, which is suitably aligned for any kind of variable, or null if the allocation failed.
NS_Realloc
return values this function returns a pointer to the allocated block of memory, which is suitably aligned for any kind of variable, or null if the allocation failed.
RefPtr
this is done using the functions addref() and release(), which respectively modify a variable of type nsautorefcnt, which basically is a wrapper around a count of the number of references refering to the class.
XPCOM glue classes
this is done using the functions addref() and release(), which respectively modify a variable of type nsautorefcnt, which basically is a wrapper around a count of the number of references refering to the class.nsstringclass declarationnsstring externalclass declarationnsstringcontainer (external)class declarationnssupportsweakreferenceinherit from this c++ class to add canonical support for nsisupportsweakreference.nsxpidlcstringclass declarationnsxpidlstringclass declarationpromiseflatcs...
jsdIStackFrame
makes eval() use the last object on its 'obj' param's scope chain as the ecma 'variables object'.
mozIStorageAggregateFunction
sample code both of the following code samples assume that the variable dbconn is an opened mozistorageconnection.
mozIStorageFunction
sample code both of the following code samples assume that the variable dbconn is an opened mozistorageconnection.
mozIStorageStatementWrapper
you can then wrap that statement with a wrapper, which implements nsixpcscriptable and provides scriptable helpers letting you execute the statement as a function, access bind variables by name as properties, etc.
nsIDebug
assertion() shows an assertion and triggers optional behavior based on the xpcom_debug_break environment variable, defaulting to calling break() on windows and os/2 and warning on other platforms.
nsIFile
on linux and other unix platforms, it is the value returned from nl_langinfo (codeset), which usually corresponds to the value of the lc_all, lc_ctype and lang environment variables (with the precedence the same as the order they're enumerated).
nsIFrameScriptLoader
by default, frame scripts each have their own scope, so they can declare global variables without causing conflicts with any other frame scripts.
nsIMsgIncomingServer
if password is obtained from password manager, set the password member variable.
nsIPrivateBrowsingService
similarly, plug-ins can detect whether or not private browsing mode is in effect by using the npn_getvalue() function to check the current value of the npnvprivatemodebool variable.
nsISocketTransport
nsitransporteventsink status codes note: although these constants look like xpcom error codes and are passed in an nsresult variable, they are not error codes.
nsIWebContentHandlerRegistrar
ow('navigator:browser'); //because we set the preference to true above, we need any window that has a browser, just pass the domwindow and the registerprotocolhandler will get the contentwindow from it nsiwchr.registerprotocolhandler("mailto", "http://mail.live.com/secure/start?action=compose&to=%s", "outlook.com live mail", htmlcontentwindow); if (!allowregisterfromdifferenthost) { //it this variable is false, than we had set the pref to true obviously.
nsIWindowMediator
otherwise this variable is ignored.
nsIXPConnect
false by default, although any value set in the moz_report_all_js_exceptions environment variable will override the value passed here.
NS_ASSERTION
the behavior of an assertion failure can be controlled using the xpcom_debug_break environment variable.
nsIAbCard/Thunderbird3
of particular note is that boolean variables are converted to integers as in c/c++ (true is a non-zero value), so that false will be converted to a string of 0 and not false<code>.
nsMsgNavigationType
for example to move forward a message, you would call: // assuming gdbview is a global nsimsgdbview var resultid = new object(); var resultindex = new object(); var threadindex = new object(); gdbview.viewnavigate(components.interfaces.nsmsgnavigationtype.nextmessage, resultid, resultindex, threadindex, true); the nsmsgnavigationtype interface is defined as a global variable in thunderbird: var nsmsgviewcommandtype = components.interfaces.nsmsgviewcommandtype; mailnews/base/public/nsimsgdbview.idlscriptable please add a summary to this article.
Using nsIDirectoryService
on platforms which use path environment variables, you will need to set one of these paths to the /bin directory.
Weak reference
{ // ...but to use my weak reference, i'll need a (short-lived) owning reference nscomptr<nsifoo> tempfooptr = do_queryreferent(weakptr); if ( tempfooptr ) tempfooptr->somefoomethod(...); // else, the `real' object has gone away } in a real world example, however, you are more likely to be holding a weak reference in a member variable.
XPCOM ABI
note: target_xpcom_abi in the mozilla build system, the variable storing the xpcom abi is named target_xpcom_abi.
XPIDL Syntax
MozillaTechXPIDLSyntax
the following is a list of potential features which are parseable but may not result in expected code: struct, union, and enumerated types array declarators (appears to be supported in xpidl_header.c but not xpidl_typelib.c) exception declarations module declarations variable arguments (that makes the abnf get more wonky) sequence types max-length strings fixed-point numbers "any" and "long double" types.
xpidl
MozillaTechXPIDLxpidl
using xpidl to add an idl file to the build, use the xpidlsrcs makefile variable.
Mail and RDF
what else do we store?) datasources are created when each window's javascript is loaded by declaring the datasource variables in the source javascript as global variables.
Mail event system
icharpropertychanged onitemunicharpropertychanged notifyitempropertyflagchanged onitempropertyflagchanged notifyitemevent onitemevent notifyfolderloaded onfolderloaded notifydeleteormovemessages ondeleteormovemessages sample code in this example, a listener will be set up to be notified when the message count changes in a folder: // our variable to know if the listener fired var listenerhasfired = false; var totalmessageslistenerhasfired = false; // the listening function that will react to changes function myonintpropertychanged(item, property, oldvalue, newvalue) { listenerhasfired=true; var propertystring = property.getunicode(); dump("onintpropertychanged has fired with property + " + propertystring + "!\n"); if (prope...
Creating a Custom Column
getcelltext() is the text that is displayed to the user while getsort*forrow() is what is used internally when sorting by your column a simple implementation objects in javascript are just "advanced" variables, so an implementation of the nsimsgcustomcolumnhandler interface looks like: var columnhandler = { getcelltext: function(row, col) { //get the message's header so that we can extract the reply to field var hdr = gdbview.getmsghdrat(row); return hdr.getstringproperty("replyto"); }, getsortstringforrow: function(hdr) {return hdr.getstringproperty("replyto");}, ...
Demo Addon
in the gloda query result listener the variable acollection is a glodacollections.
Access Window
since window is a global variable you can use it directly from your javascript file.
Folders and message lists
interacting with the current folder the folderdisplaywidget for the current folder can be accessed via the global variable gfolderdisplay.
Using the Mozilla symbol server
the debugger will not be able to show you the content of all variables and the execution path can seem strange because of inlining, tail calls, and other compiler optimizations.
Virtualenv
bin/activate once the virtualenv is activated, the virtualenv's python (and other executables) will be on your path and you will have a new environment variable, virtual_env, that points to the path of the virtualenv, as well as a deactivate function for deactivating the virtualenv.
Declaring types
for example, to define a new 32-bit integer variable with the value 5: var i = ctypes.int32_t(5); you can then pass a pointer to this value to a c function that requires a pointer to a 32-bit integer, like this: some_c_function(i.address()); declaring new primitive types there are times when you want to create new types that are simply new names for existing primitive types.
Standard OS Libraries
syntax and variable types are found on the documentation pages linked from this page.
Using js-ctypes
the current working directory the directories listed in the path environment variable.
ArrayType
ctype arraytype() type[ length] ); parameters type: it represents the type of the elements or variable which is going to be present in an array length optional it denotes the number of entries present in an array or the number of elements that an array should contain.
Constants - Plugins
npvers_has_form_values 15 nppvformvalue nppvariables are supported.
Initialization and Destruction - Plugins
/* define global variable to hold the user agent string.
Plug-in Development Overview - Plugins
starting in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7), you can get the origin of the document in a secure, convenient way by calling npn_getvalue() to retrieve the value of the variable npnvdocumentorigin.
Access debugging in add-ons - Firefox Developer Tools
ed") relevant files: chrome://browser/content/devtools/debugger-controller.js chrome://browser/content/devtools/debugger-toolbar.js chrome://browser/content/devtools/debugger-view.js chrome://browser/content/devtools/debugger-panes.js unfortunately there is not yet any api to evaluate watches/expressions within the debugged scope, or highlight elements on the page that are referenced as variables in the debugged scope.
Set watch expressions - Firefox Developer Tools
when the debugger reaches a breakpoint, it will display your watch expressions variables: you can step through your code, watching the value of the expression as it changes.
How to - Firefox Developer Tools
access debugging in add-onsbreaking on exceptionsdebug eval sourcesdisable breakpointsexamine, modify, and watch variableshighlight and inspect dom nodesignore a sourceopen the debuggerpretty-print a minified filesearchset a breakpointset a conditional breakpointset watch expressionsstep through codeuse a source mapuse watchpoints ...
Debugger.Memory - Firefox Developer Tools
furthermore, spidermonkey tracks which types of values have appeared in variables and object properties.
Debugger.Script - Firefox Developer Tools
// display name: f (the given name) var g = function () {}; // display name: g o.p = function () {}; // display name: o.p var q = { r: function () {} // display name: q.r }; note that the display name may not be a proper javascript identifier, or even a proper expression: we attempt to find helpful names even when the function is not immediately assigned as the value of some variable or property.
The Firefox JavaScript Debugger - Firefox Developer Tools
step through code black box a source debug worker threads debug eval sources look at values you probably want to see the value of variables or expressions, either during execution or when it is paused.
Dominators - Firefox Developer Tools
so when an object becomes unreachable (for example, because it is only referenced by a single local variable which goes out of scope) then any objects it references also become unreachable, as long as no other objects reference them: conversely, this means that objects are kept alive as long as some other reachable object is holding a reference to them.
Examine and edit HTML - Firefox Developer Tools
use in console assigns the currently selected node to a variable named temp0 (or temp1 if temp0 is already taken, and so on), then opens the split console, enabling you to interact with that node using the console's command line.
Inspect and select colors - Firefox Developer Tools
in the css pane's rules view, if a rule contains a color value, you'll see a sample of the color next to the value: a color sample is also shown for css custom properties (variables) that represent colors.
Use the Inspector from the Web Console - Firefox Developer Tools
the element that's currently selected in the page inspector can be referenced in the web console using the variable $0.
Web Console Helpers - Firefox Developer Tools
variables tempn the "use in console" option in the inspector generates a variable for a node named temp0, temp1, temp2, etc.
The JavaScript input interpreter - Firefox Developer Tools
accessing variables you can access variables defined in the page, both built-in variables like window and variables added by javascript libraries like jquery: autocomplete the editor has autocomplete: enter the first few letters and a popup appears with possible completions: press enter, tab, or the right arrow key to accept the suggestion, use the up/down arrows to move to a different suggestion, or just ...
about:debugging (before Firefox 68) - Firefox Developer Tools
you can set breakpoints, step through code, watch variables, evaluate code, and so on: registering workers at first, you won't see any workers listed under service workers or shared workers.
AddressErrors - Web APIs
javascript payment request data first, we declare the variables supportedhandlers, which is compatible with paymentmethoddata, and defaultpaymentdetails, which is a paymentdetailsupdate object.
AudioContext.createMediaElementSource() - Web APIs
itaudiocontext)(); var myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node var gainnode = audioctx.creategain(); // create variables to store mouse pointer y coordinate // and height of screen var cury; var height = window.innerheight; // get new mouse pointer coordinates when mouse is moved // then set new gain value document.onmousemove = updatepage; function updatepage(e) { cury = (window.event) ?
AudioListener.dopplerFactor - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioListener.forwardX - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioListener.forwardY - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioListener.forwardZ - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioListener.positionX - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioListener.positionY - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioListener.positionZ - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioListener.setOrientation() - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioListener.setPosition() - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioListener.speedOfSound - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioListener.upX - Web APIs
WebAPIAudioListenerupX
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioListener.upY - Web APIs
WebAPIAudioListenerupY
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioListener.upZ - Web APIs
WebAPIAudioListenerupZ
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioListener - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
AudioParam.exponentialRampToValueAtTime() - Web APIs
this is pretty useful for fade in/fade out effects: // create audio context var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // set basic variables for example var myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; var exprampplus = document.queryselector('.exp-ramp-plus'); var exprampminus = document.queryselector('.exp-ramp-minus'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source ...
AudioParam.linearRampToValueAtTime() - Web APIs
// create audio context var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // set basic variables for example var myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; var linearrampplus = document.queryselector('.linear-ramp-plus'); var linearrampminus = document.queryselector('.linear-ramp-minus'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it...
AudioParam.setTargetAtTime() - Web APIs
// create audio context var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // set basic variables for example var myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; var attimeplus = document.queryselector('.at-time-plus'); var attimeminus = document.queryselector('.at-time-minus'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = au...
AudioParam.setValueAtTime() - Web APIs
when the buttons are pressed, the currgain variable is incremented/decremented by 0.25, then the setvalueattime() method is used to set the gain value equal to currgain, one second from now (audioctx.currenttime + 1.) // create audio context var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // set basic variables for example var myaudio = document.queryselector('audio'); var pre = document.qu...
AudioParam.setValueCurveAtTime() - Web APIs
ave a media source with a single button (see the webaudio-examples repo for the source code, or view the example live.) when this button is pressed, setvaluecurveattime() is used to change the gain value between the values contained in the wavearray array: // create audio context var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // set basic variables for example var myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; var valuecurve = document.queryselector('.value-curve'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain n...
AudioTrack - Web APIs
this first example gets the first audio track on the media: var firsttrack = tracks[0]; the next example scans through all of the media's audio tracks, enabling any that are in the user's preferred language (taken from a variable userlanguage) and disabling any others.
BaseAudioContext.createPanner() - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
CSSStyleDeclaration.setProperty() - Web APIs
if so, we store a reference to this cssstylerule object in a variable.
CSSStyleSheet.insertRule() - Web APIs
var styleel = document.createelement('style'); // append <style> element to <head> document.head.appendchild(styleel); // grab style element's sheet var stylesheet = styleel.sheet; for (var i = 0; i < rules.length; i++) { var j = 1, rule = rules[i], selector = rule[0], propstr = ''; // if the second argument of a rule is an array of arrays, correct our variables.
CSSUnparsedValue.CSSUnparsedValue() - Web APIs
syntax var cssunparsedvalue = new cssunparsedvalue(members) parameters members an array whose values must be either a usvstring or a cssvariablereferencevalue.
CanvasRenderingContext2D.fillStyle - Web APIs
to achieve this, we use the two variables i and j to generate a unique rgb color for each square, and only modify the red and green values.
CanvasRenderingContext2D.strokeStyle - Web APIs
to achieve this, we use the two variables i and j to generate a unique rgb color for each circle, and only modify the green and blue values.
Manipulating video using canvas - Web APIs
this method's job is to prepare the variables needed by the chroma-key processing code, and to set up an event listener so we can detect when the user starts playing the video.
Applying styles and colors - Web APIs
we use the two variables i and j to generate a unique rgb color for each square, and only modify the red and green values.
Drawing shapes with canvas - Web APIs
in the code, each of the parameters for the arc is in a variable for clarity, but you wouldn't necessarily do that in real life.
ChannelMergerNode - Web APIs
number of inputs variable; default to 6.
ChannelSplitterNode - Web APIs
number of inputs 1 number of outputs variable; default to 6.
Clipboard.read() - Web APIs
WebAPIClipboardread
otherwise, an image element referred to using the variable imgelem has its source replaced with the clipboard's contents.
console.count() - Web APIs
WebAPIConsolecount
if we pass the user variable as the label argument to the first invocation of count(), and the string "alice" to the second: let user = ""; function greet() { console.count(user); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.count("alice"); we will see output like this: "bob: 1" "alice: 1" "alice: 2" "alice: 3" we're now maintaining separate counts based only on the value ...
Console.countReset() - Web APIs
if we pass the user variable as the label argument with the string "bob" to the first invocation of count(), and the string "alice" to the second: let user = ""; function greet() { console.count(user); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.countreset("bob"); console.count("alice"); we will see output like this: "bob: 1" "alice: 1" "alice: 2" "bob: 0" "alice: 3" rese...
DOMException - Web APIs
note: because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past.
Document.open() - Web APIs
WebAPIDocumentopen
for years firefox and internet explorer additionally erased all javascript variables, etc., in addition to removing all nodes.
Document.registerElement() - Web APIs
the mytag variable holds a constructor that you can use to create a my-tag element in the document as follows: document.body.appendchild(new mytag()); this inserts an empty my-tag element that will be visible if you use the browser's developer tools.
EXT_frag_depth - Web APIs
examples enable the extension: gl.getextension('ext_frag_depth'); now the output variable gl_fragdepthext is available to set a depth value of a fragment from within the fragment shader: <script type="x-shader/x-fragment"> void main() { gl_fragcolor = vec4(1.0, 0.0, 1.0, 1.0); gl_fragdepthext = 0.5; } </script> specifications specification status comment ext_frag_depththe definition of 'ext_frag_depth' in that specification.
Element.className - Web APIs
WebAPIElementclassName
syntax var cname = elementnodereference.classname; elementnodereference.classname = cname; cname is a string variable representing the class or space-separated classes of the current element.
Element: mousedown event - Web APIs
first we store the x and y coordinates of the mouse pointer in the variables x and y, and then set isdrawing to true.
Element: mousemove event - Web APIs
first we store the x and y coordinates of the mouse pointer in the variables x and y, and then set isdrawing to true.
Element: mouseup event - Web APIs
first we store the x and y coordinates of the mouse pointer in the variables x and y, and then set isdrawing to true.
Element.outerHTML - Web APIs
WebAPIElementouterHTML
for example: var div = document.createelement("div"); div.outerhtml = "<div class=\"test\">test</div>"; console.log(div.outerhtml); // output: "<div></div>" also, while the element will be replaced in the document, the variable whose outerhtml property was set will still hold a reference to the original element: var p = document.getelementsbytagname("p")[0]; console.log(p.nodename); // shows: "p" p.outerhtml = "<div>this div replaced a paragraph.</div>"; console.log(p.nodename); // still "p"; the returned value will contain html escaped attributes: var anc = document.createelement("a"); anc.href = "https://developer...
Event.currentTarget - Web APIs
if you console.log() the event object, storing it in a variable, and then look for the currenttarget key in the console, its value will be null.
FileSystemEntry.getParent() - Web APIs
example this example renames the file specified by the variable fileentry to "newname.html".
FileSystemSync - Web APIs
so once you have a reference, cache the object in a global variable or class property.
GeolocationCoordinates.longitude - Web APIs
ext = document.getelementbyid("latitude"); let longtext = document.getelementbyid("longitude"); button.addeventlistener("click", function() { navigator.geolocation.getcurrentposition(function(position) { let lat = position.coords.latitude; let long = position.coords.longitude; lattext.innertext = lat.tofixed(2); longtext.innertext = long.tofixed(2); }); }); after setting up variables to more conveniently reference the button element and the two elements into which the latitude and logitude will be drawn, the event listener is established by calling addeventlistener() on the <button> element.
GlobalEventHandlers.onanimationiteration - Web APIs
var box = document.getelementbyid("box"); var iterationcounter = 0; box.onanimationiteration = function(event) { box.style.animationplaystate = "paused"; document.getelementbyid("play").innerhtml = "start iteration #" + (iterationcounter+1); }; this sets up two global variables: box, which references the "box" element that we're animating, and iterationcounter, which is initially zero, which indicates how many iterations of the animation have occurred.
HTMLAudioElement - Web APIs
this snippet copies the audio file's duration to a variable: var audioelement = new audio('car_horn.wav'); audioelement.addeventlistener('loadeddata', () => { let duration = audioelement.duration; // the duration variable now holds the duration (in seconds) of the audio clip }) events inherits methods from its parent, htmlmediaelement, and from its ancestor htmlelement.
HTMLElement.offsetHeight - Web APIs
syntax var intelemoffsetheight = element.offsetheight; intelemoffsetheight is a variable storing an integer corresponding to the offsetheight pixel value of the element.
HTMLElement.offsetWidth - Web APIs
syntax var intelemoffsetwidth = element.offsetwidth; intelemoffsetwidth is a variable storing an integer corresponding to the offsetwidth pixel value of the element.
Ajax navigation example - Web APIs
this content is stored into a php variable.</p>"; if (isset($_get["view_as"]) && $_get["view_as"] == "json") { echo json_encode(array("page" => $page_title, "content" => $page_content)); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" .
IDBCursor.update() - Web APIs
WebAPIIDBCursorupdate
note also that you can't directly put cursor.value into an update call, hence the below example using an intermediary updatedata variable.
IDBDatabase.close() - Web APIs
WebAPIIDBDatabaseclose
// create event handlers for both success and failure of dbopenrequest.onerror = function(event) { note.innerhtml += "<li>error loading database.</li>"; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += "<li>database initialised.</li>"; // store the result of opening the database in the db variable.
IDBDatabase.objectStoreNames - Web APIs
e var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBDatabase.transaction() - Web APIs
for a complete example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBDatabase.version - Web APIs
ar dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database // being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBDatabase - Web APIs
eddb.open("todolist", 4); // these two event handlers act on the idbdatabase object, // when the database is opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable.
IDBFactory.open() - Web APIs
WebAPIIDBFactoryopen
equest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened // successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable.
IDBFactory - Web APIs
ion 4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { console.error("error loading database."); }; dbopenrequest.onsuccess = function(event) { console.info("database initialised."); // store the result of opening the database in the db variable.
IDBObjectStore.add() - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBObjectStore.autoIncrement - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBObjectStore.clear() - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBObjectStore.createIndex() - Web APIs
dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBObjectStore.delete() - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBObjectStore.deleteIndex() - Web APIs
e var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBObjectStore.get() - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBObjectStore.indexNames - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBObjectStore.keyPath - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBObjectStore.name - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBObjectStore.transaction - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBOpenDBRequest.onblocked - Web APIs
et us open our database var request = indexeddb.open("todolist", 4); // these two event handlers act on the database being opened // successfully, or not request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBOpenDBRequest - Web APIs
dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable.
IDBTransaction.abort() - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBTransaction.db - Web APIs
WebAPIIDBTransactiondb
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBTransaction.error - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBTransaction.mode - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBTransaction.objectStore() - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBTransaction.onabort - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBTransaction.oncomplete - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBTransaction.onerror - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBTransaction - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable.
IDBVersionChangeEvent.newVersion - Web APIs
4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBVersionChangeEvent - Web APIs
dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
Checking when a deadline is due - Web APIs
note: the db variable stores a reference to the indexeddb database instance; we can then use various properties of this variable to manipulate the data.
KeyboardEvent.code - Web APIs
xmlns="http://www.w3.org/2000/svg" version="1.1" class="world"> <polygon id="spaceship" points="15,0 0,30 30,30"/> </svg> <script>refresh();</script> css .world { margin: 0px; padding: 0px; background-color: black; width: 400px; height: 400px; } #spaceship { fill: orange; stroke: red; stroke-width: 2px; } javascript the first section of the javascript code establishes some variables we'll be using.
MediaElementAudioSourceNode - Web APIs
itaudiocontext)(); var myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node var gainnode = audioctx.creategain(); // create variables to store mouse pointer y coordinate // and height of screen var cury; var height = window.innerheight; // get new mouse pointer coordinates when mouse is moved // then set new gain value document.onmousemove = updatepage; function updatepage(e) { cury = (window.event) ?
MediaStreamAudioSourceNode() - Web APIs
// define variables var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // getusermedia block - grab stream // put it into a mediastreamaudiosourcenode if (navigator.mediadevices.getusermedia) { navigator.mediadevices.getusermedia ( // constraints: audio and video for this app { audio: true, video: false }).then(function(stream) { var options = { ...
MediaStreamTrack.enabled - Web APIs
"&#x25b6;&#xfe0f;" : "&#x23f8;&#xfe0f;"; myaudiotrack.enabled = newstate; } this creates a variable, newstate, which is the opposite of the current value of enabled, then uses that to select either the emoji character for the "play" icon or the character for the "pause" icon as the new innerhtml of the pause button's element.
MediaStreamTrack: unmute event - Web APIs
examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for the mediastreamtrack stored in the variable musictrack.
Recording a media element - Web APIs
setting up global variables we start by establishing some global variables we'll need.
Using the MediaStream Recording API - Web APIs
we'll declare some variables for the record and stop buttons, and the <article> that will contain the generated audio players: const record = document.queryselector('.record'); const stop = document.queryselector('.stop'); const soundclips = document.queryselector('.sound-clips'); finally for this section, we set up the basic getusermedia structure: if (navigator.mediadevices && navigator.mediadevices.getusermedia) { ...
MediaTrackSupportedConstraints.cursor - Web APIs
capturing is then started by calling getdisplaymedia() and attaching the returned stream to the video element referenced by the variable videoelem.
MediaTrackSupportedConstraints.displaySurface - Web APIs
capturing is then started by calling getdisplaymedia() and attaching the returned stream to the video element referenced by the variable videoelem.
MediaTrackSupportedConstraints.logicalSurface - Web APIs
capturing is then started by calling getdisplaymedia() and attaching the returned stream to the video element referenced by the variable videoelem.
Using the Media Capabilities API - Web APIs
handling the response instead of the assigning the promise to a variable, we can output the values returned by the promise to the console: navigator.mediacapabilities.decodinginfo(videoconfiguration).then(result => { console.log('this configuration is ' + (result.supported ?
Node.textContent - Web APIs
WebAPINodetextContent
you can use textcontent to get the element's text content: let text = document.getelementbyid('diva').textcontent; // the text variable is now: 'this is some text!' ...
PannerNode.distanceModel - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
PannerNode.maxDistance - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
PannerNode.panningModel - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
PannerNode.setOrientation() - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
PannerNode.setPosition() - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
PannerNode.setVelocity() - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
PannerNode - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { p...
Pinch zoom gestures - Web APIs
this application uses two global variables to cache the event state.
RTCIceCandidate. toJSON() - Web APIs
example this simple example obtains a json string representing an rtcicecandidate found in the variable candidate.
RTCIceCandidateStats.priority - Web APIs
the priority of a candidate is calculated using the following variables as inputs: the preferability of the candidate type (local, server reflexive, peer reflexive, or relayed) the preferability of the candidate's specific ip address (for multihomed agents) the candidate's component id (1 for rtp, 2 for rtcp) the candidate's priority is computed using the formula (ptype is the priority of the candidate's type and plocal is the priority of the ip address): pr...
RTCPeerConnection.addTrack() - Web APIs
if that succeeds, the resulting stream is assigned as the source for a <video> element which is referenced by the variable previewelement.
RTCPeerConnection: track event - Web APIs
c = new rtcpeerconnection({ iceservers: [ { urls: "turn:fake.turnserver.url", username: "someusername", credential: "somepassword" } ] }); pc.addeventlistener("track", e => { videoelement.srcobject = e.streams[0]; hangupbutton.disabled = false; }, false); the event handler assigns the new track's first stream to an existing <video> element, identified using the variable videoelement.
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
networkteststart() this function simply calls the rtcpeerconnection method getstats() to request an rtcstatsreport and store it in the variable startreport.
Request.context - Web APIs
WebAPIRequestcontext
example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request context in a variable: var myrequest = new request('flowers.jpg'); var mycontext = myrequest.context; // returns the empty string by default ...
Request.credentials - Web APIs
example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request credentials in a variable: var myrequest = new request('flowers.jpg'); var mycred = myrequest.credentials; // returns "same-origin" by default specifications specification status comment fetchthe definition of 'credentials' in that specification.
Request.headers - Web APIs
WebAPIRequestheaders
example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request headers in a variable: var myrequest = new request('flowers.jpg'); var myheaders = myrequest.headers; // headers {} to add a header to the headers object we use headers.append; we then create a new request along with a 2nd init parameter, passing headers in as an init option: var myheaders = new headers(); myheaders.append('content-type', 'image/jpeg'); var myinit = { method: 'get', headers: myheaders, mode: 'cors', cache: 'default...
Request.integrity - Web APIs
WebAPIRequestintegrity
example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request integrity value in a variable: var myrequest = new request('flowers.jpg'); var myintegrity = myrequest.integrity; specifications specification status comment fetchthe definition of 'integrity' in that specification.
Request.method - Web APIs
WebAPIRequestmethod
example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the method of the request in a variable: var myrequest = new request('flowers.jpg'); var mymethod = myrequest.method; // get specifications specification status comment fetchthe definition of 'method' in that specification.
Request.mode - Web APIs
WebAPIRequestmode
example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request mode in a variable: var myrequest = new request('flowers.jpg'); var mymode = myrequest.mode; // returns "cors" by default specifications specification status comment fetchthe definition of 'mode' in that specification.
Request.redirect - Web APIs
WebAPIRequestredirect
example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request redirect value in a variable: var myrequest = new request('flowers.jpg'); var mycred = myrequest.redirect; specifications specification status comment fetchthe definition of 'redirect' in that specification.
Request.referrer - Web APIs
WebAPIRequestreferrer
example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request referrer in a variable: var myrequest = new request('flowers.jpg'); var myreferrer = myrequest.referrer; // returns "about:client" by default specifications specification status comment fetchthe definition of 'referrer' in that specification.
Request.referrerPolicy - Web APIs
example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request referrer policy in a variable: var myrequest = new request('flowers.jpg'); var myreferrer = myrequest.referrerpolicy; // returns "" by default specifications specification status comment fetchthe definition of 'referrerpolicy' in that specification.
Request.url - Web APIs
WebAPIRequesturl
example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the url of the request in a variable: var myrequest = new request('flowers.jpg'); var myurl = myrequest.url; // "http://mdn.github.io/fetch-examples/fetch-request/flowers.jpg" specifications specification status comment fetchthe definition of 'url' in that specification.
Response.clone() - Web APIs
WebAPIResponseclone
the clone() method of the response interface creates a clone of a response object, identical in every way, but stored in a different variable.
SVGPoint - Web APIs
WebAPISVGPoint
example // create an svgpoint in the user coordinate system let s = document.getelementbyid("svg-elementid").createsvgpoint(); // then, set the x and y values of the returned svgpoint object // (which is the variable `s`) s.y = 10; s.x = 10; ...
Using Service Workers - Web APIs
bear in mind therefore that you need to be careful with global variables in the service worker script: each page doesn’t get its own unique worker.
SpeechGrammar.src - Web APIs
WebAPISpeechGrammarsrc
| salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the grammar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the same as the weight set in line 4.
SpeechGrammar.weight - Web APIs
| salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the grammar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the same as the weight set in line 4.
SpeechGrammar - Web APIs
| salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the grammar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the same as the weight set in line 4.
SpeechGrammarList.addFromString() - Web APIs
stored in a variable) and adds it to the speechgrammarlist as a new speechgrammar object.
SpeechGrammarList - Web APIs
stored in a variable) and adds it to the speechgrammarlist as a new speechgrammar object.
SpeechSynthesis - Web APIs
after defining some necessary variables, we retrieve a list of the voices available using speechsynthesis.getvoices() and populate a select menu with them so the user can choose what voice they want.
SpeechSynthesisUtterance - Web APIs
after defining some necessary variables, we retrieve a list of the voices available using speechsynthesis.getvoices() and populate a select menu with them so the user can choose what voice they want.
StylePropertyMapReadOnly - Web APIs
</p> <dl id="output"></dl> we add a touch of css with a custom property to better demonstrate the output: p { --somevariable: 1.6em; --someothervariable: translatex(33vw); --anothervariable: 42; line-height: var(--somevariable); } we add javascript to grab our paragraph and return back a definition list of all the default css property values using computedstylemap().
SubtleCrypto.digest() - Web APIs
a digest is a short fixed-length value derived from some variable-length input.
Text.wholeText - Web APIs
WebAPITextwholeText
syntax str = textnode.wholetext; notes and example suppose you have the following simple paragraph within your webpage (with some whitespace added to aid formatting throughout the code samples here), whose dom node is stored in the variable para: <p>thru-hiking is great!
VideoTrack - Web APIs
this first example gets the first video track on the media: var firsttrack = tracks[0]; the next example scans through all of the media's video tracks, activating the first video track that is in the user's preferred language (taken from a variable userlanguage).
WebGL2RenderingContext.uniformMatrix[234]x[234]fv() - Web APIs
the webgl2renderingcontext.uniformmatrix[234]x[234]fv() methods of the webgl 2 api specify matrix values for uniform variables.
WebGLRenderingContext.getActiveUniform() - Web APIs
syntax webglactiveinfo webglrenderingcontext.getactiveuniform(program, index); parameters program a webglprogram specifying the webgl shader program from which to obtain the uniform variable's information.
WebGLRenderingContext.getUniform() - Web APIs
the webglrenderingcontext.getuniform() method of the webgl api returns the value of a uniform variable at a given location.
WebGLRenderingContext.polygonOffset() - Web APIs
syntax void gl.polygonoffset(factor, units); parameters factor a glfloat which sets the scale factor for the variable depth offset for each polygon.
WebGLRenderingContext.uniformMatrix[234]fv() - Web APIs
the webglrenderingcontext.uniformmatrix[234]fv() methods of the webgl api specify matrix values for uniform variables.
WebGLRenderingContext.vertexAttrib[1234]f[v]() - Web APIs
they aren't part of the shader state (like generix vertex attribute indexes to shader variable bindings) and aren't part of the vertex array object state (like enabled vertex attribute arrays).
WebGLUniformLocation - Web APIs
the webgluniformlocation interface is part of the webgl api and represents the location of a uniform variable in a shader program.
A basic 2D WebGL animation example - Web APIs
</canvas> javascript globals and initialization first, the global variables.
Clearing with colors - Web APIs
all other methods are for setting and querying webgl state variables (such as the clear color).
Detect WebGL - Web APIs
however, the properties and variables you can tweak are different for each api.
Simple color animation - Web APIs
center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-size : inherit; margin : auto; padding : 0.6em; } window.addeventlistener("load", function setupanimation (evt) { "use strict" window.removeeventlistener(evt.type, setupanimation, false); // a variable to hold a timer that drives the animation.
Matrix math for the web - Web APIs
multiplying a matrix and a point in our example code we have defined a function to multiply a matrix and a point — multiplymatrixandpoint(): // point • matrix function multiplymatrixandpoint(matrix, point) { // give a simple variable name to each part of the matrix, a column and row number let c0r0 = matrix[ 0], c1r0 = matrix[ 1], c2r0 = matrix[ 2], c3r0 = matrix[ 3]; let c0r1 = matrix[ 4], c1r1 = matrix[ 5], c2r1 = matrix[ 6], c3r1 = matrix[ 7]; let c0r2 = matrix[ 8], c1r2 = matrix[ 9], c2r2 = matrix[10], c3r2 = matrix[11]; let c0r3 = matrix[12], c1r3 = matrix[13], c2r3 = matrix[14], c3r3 = matrix[15]; // now set ...
Animating textures in WebGL - Web APIs
in the code above, we confirm whether we got both of those events; if so, we set a global variable, copyvideo, to true to indicate that it's safe to start copying the video to a texture.
Creating 3D objects using WebGL - Web APIs
finally, let's replace our variable squarerotation by cuberotation and add a second rotation around the x axis: mat4.rotate(modelviewmatrix, modelviewmatrix, cuberotation * .7, [0, 1, 0]); at this point, we now have an animated cube rotating, its six faces rather vividly colored.
WebGL best practices - Web APIs
onsole.error('link failed: ' + gl.getprograminfolog(prog)); } consider: gl.compileshader(vs); gl.compileshader(fs); gl.linkprogram(prog); if (!gl.getprogramparameter(vs, gl.link_status)) { console.error('link failed: ' + gl.getprograminfolog(prog)); console.error('vs info-log: ' + gl.getshaderinfolog(vs)); console.error('fs info-log: ' + gl.getshaderinfolog(fs)); } be precise with glsl variable precision annotations if you expect to pass an essl300 int between shaders, and you need it to have 32-bits, you must use highp or you will have portability problems.
WebGL: 2D and 3D graphics for the web - Web APIs
WebAPIWebGL API
guides data in webgl a guide to variables, buffers, and other types of data used when writing webgl code.
WebSocket: close event - Web APIs
given that you have a variable called examplesocket that refers to an opened websocket, this handler would handle the situation where the socket has been closed.
Web Video Text Tracks Format (WebVTT) - Web APIs
but the vttcue interface is within the webvtt provides the vast range of adjustment variables which can be used directly to alter the cue.
Using bounded reference spaces - Web APIs
this is why the code snippet above records the reference space being used in the variable spacetype.
Rendering and the WebXR frame animation callback - Web APIs
this elapsed time is saved in the variable deltatime, and the value of lastframetime is replaced with this frame's time, ready to compute the differential for the next frame.
Web Animations API Concepts - Web APIs
this means we can use it to create and manipulate css-like animations that go from one pre-defined state to another, or we can use variables, loops, and callbacks to create interactive animations that adapt and react to changing inputs.
Window.openDialog() - Web APIs
WebAPIWindowopenDialog
the variables specified in the javascript code which gets loaded from the dialog), it is not possible to pass return values back past the close operation using globals (or any other constructs).
Window.speechSynthesis - Web APIs
after defining some necessary variables, we retrieve a list of the voices available using speechsynthesis.getvoices() and populate a select menu with them so the user can choose what voice they want.
Window - Web APIs
WebAPIWindow
a global variable, window, representing the window in which the script is running, is exposed to javascript code.
Synchronous and asynchronous requests - Web APIs
starting with the third argument, all remaining arguments are collected, assigned to the arguments property of the variable xhr, passed to the success callback function xhrsuccess., and ultimately supplied to the callback function (in this case, showmessage) which is invoked by function xhrsuccess.
XMLHttpRequest.getAllResponseHeaders() - Web APIs
/ create a map of header names to values var headermap = {}; arr.foreach(function (line) { var parts = line.split(': '); var header = parts.shift(); var value = parts.join(': '); headermap[header] = value; }); } } once this is done, you can, for example: var contenttype = headermap["content-type"]; this obtains the value of the content-type header into the variable contenttype.
XPathException - Web APIs
constants constant value description invalid_expression_err 51 if the expression has a syntax error or otherwise is not a legal expression according to the rules of the specific xpathevaluator or contains specialized extension functions or variables not supported by this implementation.
XRPose.transform - Web APIs
WebAPIXRPosetransform
it determines the targeted object by passing the event frame's pose into a function called findtargetusingray(), then dispatches the event differently depending on the user's handedness; this is done by comparing the value of the xrinputsource property handedness to a value in the variable user.handedness.
XRRigidTransform.position - Web APIs
encespace("viewer").then(refspacecreated); } } function refspacecreated(refspace) { if (immersivesession) { xrreferencespace = refspace; } else { xrreferencespace = refspace.getoffsetreferencespace( new xrrigidtransform({y: -1.5}); ); } xrsession.requestanimationframe(onframe); } after setting up the graphics context for webxr use, this begins by looking to see if a variable immersivesession is true; if so, we first request a bounded-floor reference space.
XRSession.onsqueezeend - Web APIs
in response to the end of the squeeze operation, this code looks to see if there is an object currently being held by the user by checking to see if the variable user.heldobject contains a reference to an object representing the held item.
XRSession.onsqueezestart - Web APIs
this object is then stored in a heldobject variable in the user object we're using to represent user information.
Web APIs
WebAPI
value csskeyframerule csskeyframesrule csskeywordvalue cssmathproduct cssmathsum cssmathvalue cssmediarule cssnamespacerule cssnumericvalue cssomstring csspagerule csspositionvalue cssprimitivevalue csspseudoelement cssrule cssrulelist cssstyledeclaration cssstylerule cssstylesheet cssstylevalue csssupportsrule cssunitvalue cssunparsedvalue cssvalue cssvaluelist cssvariablereferencevalue cache cachestorage canvascapturemediastreamtrack canvasgradient canvasimagesource canvaspattern canvasrenderingcontext2d caretposition channelmergernode channelsplitternode characterdata childnode client clients clipboard clipboardevent clipboarditem closeevent comment compositionevent constantsourcenode constrainboolean constraindomstring constraindouble constrain...
:root - CSS: Cascading Style Sheets
WebCSS:root
/* selects the root element of the document: <html> in the case of html */ :root { background: yellow; } syntax :root examples declaring global css variables :root can be useful for declaring global css variables: :root { --main-color: hotpink; --pane-padding: 5px 42px; } specifications specification status comment selectors level 4the definition of ':root' in that specification.
Coordinate systems - CSS: Cascading Style Sheets
the variables idx and idy are set to strings with the names of the properties corresponding to the coordinates in the given coordinate system.
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
values: see the flex reference for values and default spec: https://drafts.csswg.org/css-flexbox/#flex-property @mixin flex($fg: 1, $fs: 0, $fb: auto) { // set a variable to be used by box-flex properties $fg-boxflex: $fg; // box-flex only supports a flex-grow value so lets grab the // first item in the list and just return that.
Typical use cases of Flexbox - CSS: Cascading Style Sheets
this means that if you have variable amounts of content, the card will stretch to the height of the grid area or flex container.
OpenType font features guide - CSS: Cascading Style Sheets
the issue with simply using font-feature-settings for everything is that every time you want to change one of the individual features, you have to redefine the entire string (similar to manipulating variable fonts with font-variation-settings).
Using CSS counters - CSS: Cascading Style Sheets
counters are, in essence, variables maintained by css whose values may be incremented by css rules to track how many times they're used.
Live streaming web audio and video - Developer guides
this is a fairly complex and nascent subject with a lot of variables, so in this article, we'll introduce you to the subject and let you know how you can get started.
Audio and Video Delivery - Developer guides
this is a fairly complex and nascent subject with a lot of variables, so in this article we'll introduce you to the subject and let you know how you can get started.
Index - Developer guides
WebGuideIndex
this is a fairly complex and nascent subject with a lot of variables, so in this article, we'll introduce you to the subject and let you know how you can get started.
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
it begins by creating a new <canvas> element that we'll use to convert the image into a data url, and by getting access to the canvas's 2d drawing context (canvasrenderingcontext2d) in the variable context.
<input type="button"> - HTML: Hypertext Markup Language
WebHTMLElementinputbutton
utton); function updatebutton() { if (button.value === 'start machine') { button.value = 'stop machine'; paragraph.textcontent = 'the machine has started!'; } else { button.value = 'start machine'; paragraph.textcontent = 'the machine is stopped.'; } } the script gets a reference to the htmlinputelement object representing the <input> in the dom, saving this refence in the variable button.
<input type="checkbox"> - HTML: Hypertext Markup Language
WebHTMLElementinputcheckbox
for one technique used with php, see handle multiple checkboxes with a single serverside variable, for example.
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
grab the filelist object that contains the information on all the selected files, and store it in a variable called curfiles.
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
// define variables var nativepicker = document.queryselector('.nativedatepicker'); var fallbackpicker = document.queryselector('.fallbackdatepicker'); var fallbacklabel = document.queryselector('.fallbacklabel'); var yearselect = document.queryselector('#year'); var monthselect = document.queryselector('#month'); // hide fallback initially fallbackpicker.style.display = 'none'; fallbacklabel.style.display = 'non...
<input type="number"> - HTML: Hypertext Markup Language
WebHTMLElementinputnumber
etattribute('class', 'meters'); switchbtn.value = 'enter height in feet and inches'; metersinputgroup.style.display = 'block'; feetinputgroup.style.display = 'none'; feetinput.removeattribute('required'); inchesinput.removeattribute('required'); metersinput.setattribute('required', ''); feetinput.value = ''; inchesinput.value = ''; } }); after declaring a few variables, an event listener is added to the button to control the switching mechanism.
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
// define variables var nativepicker = document.queryselector('.nativetimepicker'); var fallbackpicker = document.queryselector('.fallbacktimepicker'); var fallbacklabel = document.queryselector('.fallbacklabel'); var hourselect = document.queryselector('#hour'); var minuteselect = document.queryselector('#minute'); // hide fallback initially fallbackpicker.style.display = 'none'; fallbacklabel.style.display = 'n...
<input type="week"> - HTML: Hypertext Markup Language
WebHTMLElementinputweek
// define variables var nativepicker = document.queryselector('.nativeweekpicker'); var fallbackpicker = document.queryselector('.fallbackweekpicker'); var fallbacklabel = document.queryselector('.fallbacklabel'); var yearselect = document.queryselector('#year'); var weekselect = document.queryselector('#fallbackweek'); // hide fallback initially fallbackpicker.style.display = 'none'; fallbacklabel.style.display ...
Standard metadata names - HTML: Hypertext Markup Language
WebHTMLElementmetaname
it is highly recommended to make use of the safe area inset variables to ensure that important content doesn't end up outside the display.
HTML elements reference - HTML: Hypertext Markup Language
WebHTMLElement
<var> the html variable element (<var>) represents the name of a variable in a mathematical expression or a programming context.
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
217 <var>: the variable element element, html, html text-level semantics, html:flow content, html:palpable content, html:phrasing content, reference, web, var, variable the html variable element (<var>) represents the name of a variable in a mathematical expression or a programming context.
HTTP caching - HTTP
WebHTTPCaching
when the infrequently variable resources change they induce an additional change to often variable resources.
Device-Memory - HTTP
syntax the amount of device ram can be used as a fingerprinting variable, so values for the header are intentionally coarse to reduce the potential for its misuse.
Proxy Auto-Configuration (PAC) file - HTTP
this is useful, for example, when making the autoconfig file act differently based on the client ip address (the remote_addr environment variable in cgi).
About JavaScript - JavaScript
javascript's dynamic capabilities include runtime object construction, variable parameter lists, function variables, dynamic script creation (via eval), object introspection (via for ...
Iterators and generators - JavaScript
its final return value is the size of the sequence it created, tracked by the variable iterationcount.
JavaScript modules - JavaScript
you cannot change the variable that was imported, but you can still modify properties similar to const.
Numbers and dates - JavaScript
the first statement creates a variable temp, assigning it a value using a conditional expression; if hour is greater than 12, (hour - 12), otherwise simply hour, unless hour is 0, in which case it becomes 12.
JavaScript Guide - JavaScript
chapters this guide is divided into several chapters: introduction about this guide about javascript javascript and java ecmascript tools hello world grammar and types basic syntax & comments declarations variable scope variable hoisting data structures and types literals control flow and error handling if...else switch try/catch/throw error objects loops and iteration for while do...while break/continue for..in for..of functions defining functions calling functions function scope closures arguments & parameters arrow functions expressio...
Private class fields - JavaScript
the limitation of static variables being called by only static methods still holds.
Classes - JavaScript
const dx = a.x - b.x; const dy = a.y - b.y; return math.hypot(dx, dy); } } const p1 = new point(5, 5); const p2 = new point(10, 10); p1.distance; //undefined p2.distance; //undefined console.log(point.distance(p1, p2)); // 7.0710678118654755 binding this with prototype and static methods when a static or prototype method is called without a value for this, such as by assigning a variable to the method and then calling it, the this value will be undefined inside the method.
Deprecated and obsolete features - JavaScript
sharp variables see sharp variables in javascript for more information.
ReferenceError: invalid assignment left-hand side - JavaScript
while a single "=" sign assigns a value to a variable, the "==" or "===" operators compare a value.
SyntaxError: missing = in const declaration - JavaScript
maybe you meant to declare a block-scoped variable with let or global variable with var.
SyntaxError: "use strict" not allowed in function with non-simple parameters - JavaScript
use yet another workaround: var sum = function sum([a, b]) { // syntaxerror: "use strict" not allowed in function with destructuring parameter 'use strict'; return a + b; }; this can be converted to the following expression: var sum = (function() { 'use strict'; return function sum([a, b]) { return a + b; }; })(); arrow function if an arrow function needs to access the this variable, you can use the arrow function as the enclosing function: var callback = (...args) => { // syntaxerror: "use strict" not allowed in function with rest parameter 'use strict'; return this.run(args); }; this can be converted to the following expression: var callback = (() => { 'use strict'; return (...args) => { return this.run(args); }; })(); ...
InternalError: too much recursion - JavaScript
this issue also appears if the same variable is used in the getter.
TypeError: "x" is (not) "y" - JavaScript
} if (typeof foo !== 'undefined') { // the same good idea, but don't use this implementation - it can bring problems // because of the confusion between truly undefined and undeclared variables.
arguments[@@iterator]() - JavaScript
syntax arguments[symbol.iterator]() examples iteration using for...of loop function f() { // your browser must support for..of loop // and let-scoped variables in for loops for (let letter of arguments) { console.log(letter); } } f('w', 'y', 'k', 'o', 'p'); specifications specification ecmascript (ecma-262)the definition of 'createunmappedargumentsobject' in that specification.
getter - JavaScript
description sometimes it is desirable to allow access to a property that returns a dynamically computed value, or you may want to reflect the status of an internal variable without requiring the use of explicit method calls.
setter - JavaScript
val an alias for the variable that holds the value attempted to be assigned to prop.
Array.prototype[@@unscopables] - JavaScript
that means that inside with environments, "keys" would now be the method and not the variable.
Array.of() - JavaScript
the array.of() method creates a new array instance from a variable number of arguments, regardless of number or type of the arguments.
Array.prototype.push() - JavaScript
the total variable contains the new length of the array.
AsyncFunction - JavaScript
when running them, they will only be able to access their own local variables and global ones, not the ones from the scope in which the asyncfunction constructor was called.
BigInt64Array - JavaScript
bigint64array.of() creates a new bigint64array with a variable number of arguments.
BigUint64Array - JavaScript
biguint64array.of() creates a new biguint64array with a variable number of arguments.
DataView - JavaScript
further, although native bigints are much faster than user-land library equivalents, bigints will always be much slower than 32-bit integers in javascript due to the nature of their variable size.
Date.prototype.getDate() - JavaScript
examples using getdate() the second statement below assigns the value 25 to the variable day, based on the value of the date object xmas95.
Date.prototype.getFullYear() - JavaScript
examples using getfullyear() the following example assigns the four-digit value of the current year to the variable year.
Date.prototype.getHours() - JavaScript
examples using gethours() the second statement below assigns the value 23 to the variable hours, based on the value of the date object xmas95.
Date.prototype.getMilliseconds() - JavaScript
examples using getmilliseconds() the following example assigns the milliseconds portion of the current time to the variable milliseconds: var today = new date(); var milliseconds = today.getmilliseconds(); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getmilliseconds' in that specification.
Date.prototype.getMinutes() - JavaScript
examples using getminutes() the second statement below assigns the value 15 to the variable minutes, based on the value of the date object xmas95.
Date.prototype.getMonth() - JavaScript
examples using getmonth() the second statement below assigns the value 11 to the variable month, based on the value of the date object xmas95.
Date.prototype.getSeconds() - JavaScript
examples using getseconds() the second statement below assigns the value 30 to the variable seconds, based on the value of the date object xmas95.
Date.prototype.getUTCDate() - JavaScript
examples using getutcdate() the following example assigns the day portion of the current date to the variable day.
Date.prototype.getUTCDay() - JavaScript
examples using getutcday() the following example assigns the weekday portion of the current date to the variable weekday.
Date.prototype.getUTCFullYear() - JavaScript
examples using getutcfullyear() the following example assigns the four-digit value of the current year to the variable year.
Date.prototype.getUTCHours() - JavaScript
examples using getutchours() the following example assigns the hours portion of the current time to the variable hours.
Date.prototype.getUTCMilliseconds() - JavaScript
examples using getutcmilliseconds() the following example assigns the milliseconds portion of the current time to the variable milliseconds.
Date.prototype.getUTCMinutes() - JavaScript
examples using getutcminutes() the following example assigns the minutes portion of the current time to the variable minutes.
Date.prototype.getUTCMonth() - JavaScript
examples using getutcmonth() the following example assigns the month portion of the current date to the variable month.
Date.prototype.getUTCSeconds() - JavaScript
examples using getutcseconds() the following example assigns the seconds portion of the current time to the variable seconds.
Float32Array - JavaScript
float32array.of() creates a new float32array with a variable number of arguments.
Float64Array - JavaScript
float64array.of() creates a new float64array with a variable number of arguments.
Function.prototype.bind() - JavaScript
this problem: this.x = 9; // 'this' refers to global 'window' object here in a browser const module = { x: 81, getx: function() { return this.x; } }; module.getx(); // returns 81 const retrievex = module.getx; retrievex(); // returns 9; the function gets invoked at the global scope // create a new function with 'this' bound to module // new programmers might confuse the // global variable 'x' with module's property 'x' const boundgetx = retrievex.bind(module); boundgetx(); // returns 81 partially applied functions the next simplest use of bind() is to make a function with pre-specified initial arguments.
Function.name - JavaScript
(function() {}).name; // "" (() => {}).name; // "" inferred function names variables and methods can infer the name of an anonymous function from its syntactic position (new in ecmascript 2015).
Function - JavaScript
when running them, they will only be able to access their own local variables and global ones, not the ones from the scope in which the function constructor was created.
Generator.prototype.next() - JavaScript
for example, in variable = yield expression, the value passed to the .next() function will be assigned to variable.
GeneratorFunction - JavaScript
when running them, they will only be able to access their own local variables and global ones, not the ones from the scope in which the generatorfunction constructor was called.
Infinity - JavaScript
in other words, it is a variable in global scope.
Int16Array - JavaScript
int16array.of() creates a new int16array with a variable number of arguments.
Int32Array - JavaScript
int32array.of() creates a new int32array with a variable number of arguments.
Int8Array - JavaScript
int8array.of() creates a new int8array with a variable number of arguments.
JSON.stringify() - JavaScript
ght': 650 }); // converting the json string with json.stringify() // then saving with localstorage in the name of session localstorage.setitem('session', json.stringify(session)); // example of how to transform the string generated through // json.stringify() and saved in localstorage in json object again var restoredsession = json.parse(localstorage.getitem('session')); // now restoredsession variable contains the object that was saved // in localstorage console.log(restoredsession); well-formed json.stringify() engines implementing the well-formed json.stringify specification will stringify lone surrogates, any code point from u+d800 to u+dfff, using unicode escape sequences rather than literally.
Math.abs() - JavaScript
examples behavior of math.abs() passing an empty object, an array with more than one member, a non-numeric string or undefined/empty variable returns nan.
NaN - JavaScript
in other words, it is a variable in global scope.
Number.NEGATIVE_INFINITY - JavaScript
examples using negative_infinity in the following example, the variable smallnumber is assigned a value that is smaller than the minimum value.
Number.POSITIVE_INFINITY - JavaScript
examples using positive_infinity in the following example, the variable bignumber is assigned a value that is larger than the maximum value.
Number - JavaScript
examples using the number object to assign values to numeric variables the following example uses the number object's properties to assign values to several numeric variables: const biggestnum = number.max_value const smallestnum = number.min_value const infinitenum = number.positive_infinity const neginfinitenum = number.negative_infinity const notanum = number.nan integer range for number the following example shows the minimum and maximum i...
Object.prototype.__defineSetter__() - JavaScript
} val an alias for the variable that holds the value attempted to be assigned to prop.
Object.create() - JavaScript
note that such a different order may arise statically via disparate fixed codings such as here, but also dynamically via whatever the order any such property-adding code-branches actually get executed at runtime as depends on inputs and/or random-variables.
Object.defineProperty() - JavaScript
if these methods use a variable to store the value, this value will be shared by all objects.
Object - JavaScript
when a function is called, the arguments to the call are held in the array-like "variable" arguments.
Promise.prototype.finally() - JavaScript
the finally() method is very similar to calling .then(onfinally, onfinally) however there are a couple of differences: when creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it a finally callback will not receive any argument, since there's no reliable means of determining if the promise was fulfilled or rejected.
Promise - JavaScript
true : false ; const parityinfo = { thenumber: value, isodd: isodd }; return parityinfo; } function troublewithgetnumber(reason) { console.error(`trouble getting number: ${reason}`); throw -999; // must "throw" something, to maintain error state down the chain } function promisegetword(parityinfo) { // the "tetheredgetword()" function gets "parityinfo" as closure variable.
Reflect.construct() - JavaScript
description reflect.construct() allows you to invoke a constructor with a variable number of arguments.
TypedArray.prototype[@@iterator]() - JavaScript
examples iteration using for...of loop var arr = new uint8array([10, 20, 30, 40, 50]); // your browser must support for..of loop // and let-scoped variables in for loops for (let n of arr) { console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr[symbol.iterator](); console.log(earr.next().value); // 10 console.log(earr.next().value); // 20 console.log(earr.next().value); // 30 console.log(earr.next().value); // 40 console.log(earr.next().value); // 50 specifications specification ecmascri...
TypedArray.prototype.entries() - JavaScript
examples iteration using for...of loop var arr = new uint8array([10, 20, 30, 40, 50]); var earray = arr.entries(); // your browser must support for..of loop // and let-scoped variables in for loops for (let n of earray) { console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr.entries(); console.log(earr.next().value); // [0, 10] console.log(earr.next().value); // [1, 20] console.log(earr.next().value); // [2, 30] console.log(earr.next().value); // [3, 40] console.log(earr.next().value); // [4, 50] specifications ...
TypedArray.prototype.keys() - JavaScript
examples iteration using for...of loop var arr = new uint8array([10, 20, 30, 40, 50]); var earray = arr.keys(); // your browser must support for..of loop // and let-scoped variables in for loops for (let n of earray) { console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr.keys(); console.log(earr.next().value); // 0 console.log(earr.next().value); // 1 console.log(earr.next().value); // 2 console.log(earr.next().value); // 3 console.log(earr.next().value); // 4 specifications specification ecmascript...
TypedArray.of() - JavaScript
the typedarray.of() method creates a new typed array from a variable number of arguments.
TypedArray.prototype.values() - JavaScript
examples iteration using for...of loop var arr = new uint8array([10, 20, 30, 40, 50]); var earray = arr.values(); // your browser must support for..of loop // and let-scoped variables in for loops for (let n of earray) { console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr.values(); console.log(earr.next().value); // 10 console.log(earr.next().value); // 20 console.log(earr.next().value); // 30 console.log(earr.next().value); // 40 console.log(earr.next().value); // 50 specifications specification ecm...
TypedArray - JavaScript
typedarray.of() creates a new typedarray with a variable number of arguments.
Uint16Array - JavaScript
uint16array.of() creates a new uint16array with a variable number of arguments.
Uint32Array - JavaScript
uint32array.of() creates a new uint32array with a variable number of arguments.
Uint8Array - JavaScript
uint8array.of() creates a new uint8array with a variable number of arguments.
Uint8ClampedArray - JavaScript
uint8clampedarray.of() creates a new uint8clampedarray from a variable number of arguments.
WebAssembly - JavaScript
webassembly.global() represents a global variable instance, accessible from both javascript and importable/exportable across one or more webassembly.module instances.
isNaN() - JavaScript
alternatively, in the absence of number.isnan, the expression (x != x) is a more reliable way to test whether variable x is nan or not, as the result is not subject to the false positives that make isnan unreliable.
null - JavaScript
instead, null expresses a lack of identification, indicating that a variable points to no object.
Bitwise AND assignment (&=) - JavaScript
the bitwise and assignment operator (&=) uses the binary representation of both operands, does a bitwise and operation on them and assigns the result to the variable.
Bitwise OR assignment (|=) - JavaScript
the bitwise or assignment operator (|=) uses the binary representation of both operands, does a bitwise or operation on them and assigns the result to the variable.
Bitwise XOR assignment (^=) - JavaScript
the bitwise xor assignment operator (^=) uses the binary representation of both operands, does a bitwise xor operation on them and assigns the result to the variable.
Left shift assignment (<<=) - JavaScript
the left shift assignment operator (<<=) moves the specified amount of bits to the left and assigns the result to the variable.
Logical OR (||) - JavaScript
= 4) // f || f returns false o5 = 'cat' || 'dog' // t || t returns "cat" o6 = false || 'cat' // f || t returns "cat" o7 = 'cat' || false // t || f returns "cat" o8 = '' || false // f || f returns false o9 = false || '' // f || f returns "" o10 = false || varobject // f || object returns varobject note: if you use this operator to provide a default value to some variable, be aware that any falsy value will not be used.
Optional chaining (?.) - JavaScript
this is equivalent to the following, except that the temporary variable is in fact not created: let temp = obj.first; let nestedprop = ((temp === null || temp === undefined) ?
Right shift assignment (>>=) - JavaScript
the right shift assignment operator (>>=) moves the specified amount of bits to the right and assigns the result to the variable.
Unsigned right shift assignment (>>>=) - JavaScript
the unsigned right shift assignment operator (>>>=) moves the specified amount of bits to the right and assigns the result to the variable.
async function expression - JavaScript
examples simple example function resolveafter2seconds(x) { return new promise(resolve => { settimeout(() => { resolve(x); }, 2000); }); }; const add = async function(x) { // async function expression assigned to a variable let a = await resolveafter2seconds(20); let b = await resolveafter2seconds(30); return x + a + b; }; add(10).then(v => { console.log(v); // prints 60 after 4 seconds.
class expression - JavaScript
-declaration is allowed typeof foo; // returns "function" typeof class {}; // returns "function" foo instanceof object; // true foo instanceof function; // true class foo {} // throws syntaxerror (class declarations do not allow re-declaration) examples a simple class expression this is just a simple anonymous class expression which you can refer to using the variable foo.
void operator - JavaScript
in these cases, the global variable undefined can be used.
for...in - JavaScript
syntax for (variable in object) statement variable a different property name is assigned to variable on each iteration.
function* - JavaScript
their context (variable bindings) will be saved across re-entrances.
<mi> - MathML
WebMathMLElementmi
the mathml <mi> element indicates that the content should be rendered as an identifier such as function names, variables or symbolic constants.
MathML documentation index - MathML
WebMathMLIndex
17 <mi> mathml, mathml reference, mathml:element, mathml:token elements the mathml <mi> element indicates that the content should be rendered as an identifier such as function names, variables or symbolic constants.
Digital audio concepts - Web media technologies
variable bit rate variable bit rate (vbr) encoding works by accepting as an input into the encoder a constant quality setting.
Codecs used by WebRTC - Web media technologies
webrtc video is protected using datagram transport layer security (dtls), but it is theoretically possible for a motivated party to infer the amount of change that's occurring from frame to frame when using variable bit rate (vbr) codecs, by monitoring the stream's bit rate and how it changes over time.
Navigation and resource timings - Web Performance
in the above image, we see via the name property that the file being timed is this document for the rest of this explanation, we use the following variable: let timing = performance.getentriesbytype('navigation')[0]; protocol we can check the protocol used by querying: let protocol = timing.nexthopprotocol it returns the network protocol used to fetch the resource: in this case h2 for http/2.
Progressive loading - Progressive web apps (PWAs)
loading via javascript the app.js file processes the data-src attributes like so: let imagestoload = document.queryselectorall('img[data-src]'); const loadimages = (image) => { image.setattribute('src', image.getattribute('data-src')); image.onload = () => { image.removeattribute('data-src'); }; }; the imagestoload variable contains references to all the images, while the loadimages function moves the path from data-src to src.
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
first, a variable for storing the cache name is created, and the app shell files are listed in one array.
font-stretch - SVG: Scalable Vector Graphics
working draft adds the <percentage> syntax for variable fonts.
Scripting - SVG: Scalable Vector Graphics
WebSVGScripting
according to the svg wiki the "parent" js variable is broken in adobe's svg version 6 preview plugin.
<xsl:import> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementimport
gecko support mostly supported with a few issues with top level variables and parameters as of mozilla 1.0.
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
number (partially supported) xsl:otherwise (supported) xsl:output (partially supported) xsl:param (supported) xsl:preserve-space (supported) xsl:processing-instruction xsl:sort (supported) xsl:strip-space (supported) xsl:stylesheet (partially supported) xsl:template (supported) xsl:text (partially supported) xsl:transform (supported) xsl:value-of (partially supported) xsl:variable (supported) xsl:when (supported) xsl:with-param (supported) axes ancestor ancestor-or-self attribute child descendant descendant-or-self following following-sibling namespace (not supported) parent preceding preceding-sibling self functions boolean() (supported) ceiling() (supported) concat() (supported) contains() (supported) count() (supported) current() (sup...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
orted) xsl:number (partially supported) xsl:otherwise (supported) xsl:output (partially supported) xsl:param (supported) xsl:preserve-space (supported) xsl:processing-instruction xsl:sort (supported) xsl:strip-space (supported) xsl:stylesheet (partially supported) xsl:template (supported) xsl:text (partially supported) xsl:transform (supported) xsl:value-of (partially supported) xsl:variable (supported) xsl:when (supported) xsl:with-param (supported) axes ancestor ancestor-or-self attribute child descendant descendant-or-self following following-sibling namespace (not supported) parent preceding preceding-sibling self functions boolean() (supported) ceiling() (supported) concat() (supported) contains() (supported) count() (supported) current() (supported)...
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
the javascript loads the .xsl file only on the first sort and sets the xslloaded variable to true once it has finished loading the file.
WebAssembly
webassembly.global() a webassembly.global object represents a global variable instance, accessible from both javascript and importable/exportable across one or more webassembly.module instances.