Search completed in 0.98 seconds.
nsICurrentCharsetListener
intl/uconv/idl/nsicurrent
charsetlistener.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/intl/current
charsetlistener;1. ...
... intl/uconv/idl/nsicurrent
charsetlistener.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/intl/current
charsetlistener;1. ...
... intl/uconv/idl/nsicurrent
charsetlistener.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/intl/current
charsetlistener;1. ...
...And 8 more matches
@charset - CSS: Cascading Style Sheets
the @
charset css at-rule specifies the character encoding used in the style sheet. it must be the first element in the style sheet and not be preceded by any character; as it is not a nested statement, it cannot be used inside conditional group at-rules. if several @
charset at-rules are defined, only the first one is used, and it cannot be used inside a style attribute on an html element or inside the <style> element where the character set of the html page is relevant. @
charset "utf-8"; this at-rule is useful when using non-ascii characters in some css properties, like content. as there are several ways to define the character encoding of a style sheet, the browser will try the following methods in the following order (and stop as soon as one yields a result) : the value of the unicode by...
...utf-8"; this at-rule is useful when using non-ascii characters in some css properties, like content. as there are several ways to define the character encoding of a style sheet, the browser will try the following methods in the following order (and stop as soon as one yields a result) : the value of the unicode byte-order character placed at the beginning of the file. ...
...l ways to define the character encoding of a style sheet, the browser will try the following methods in the following order (and stop as soon as one yields a result) : the value of the unicode byte-order character placed at the beginning of the file. the value given by the
charset attribute of the content-type: http header or the equivalent in the protocol used to serve the style sheet. the @
charset css at-rule. use the character encoding defined by the referring document: the
charset attribute of the <link> element. this method is obsoleted in html5 and must not be used. assume that the document is utf-8 syntax @
charset "utf-8"; @
charset "iso-8859-15"; where:
charset is a <string> denoting the character encoding to be used. it must be the name of a web-safe character encoding def...
...And 7 more matches
Accept-Charset - HTTP
in early versions of http/1.1, a default character encoding was defined: iso-8859-1. ...
... in early versions of http/1.1, a default character encoding was defined: iso-8859-1. ...
...e header, usually in a
charset= parameter. browsers usually don't send this header, as the default value for each resource is usually correct and transmitting it would allow fingerprinting. if the server cannot serve any character encoding from this request header, it can theoretically send back a 406 not acceptable error code. but for a better user experience, this is rarely done and the accept-
charset header is ignored. in early versions of http/1.1, a default character encoding was defined: iso-8859-1. this is no longer recommended, and now each content-type may have its own default. utf-8 is now well-supported and the overwhelmingly preferred character encoding. ...
...And 6 more matches
nsICharsetResolver
intl/chardet/public/nsi
charsetresolver.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview void notifyresolved
charset(in acstring
charset, in nsisupports closure); acstring request
charset(in nsiwebnavigation awebnavigation, in nsichannel achannel, out boolean awant
charset, out nsisupports aclosure); methods notifyresolved
charset() some implementations may request that they be notified when the
charset is actually detected. void notifyresolved
charset( in acstring
charset, in nsisupports closure ); parameters
charset the detected
charset. closure the closure returned by request
charset(). ...
...navigation, in nsichannel achannel, out boolean awant
charset, out nsisupports aclosure); methods notifyresolved
charset() some implementations may request that they be notified when the
charset is actually detected. void notifyresolved
charset( in acstring
charset, in nsisupports closure ); parameters
charset the detected
charset. closure the closure returned by request
charset(). request
charset() called to resolve the
charset that should be used for parsing the document being loaded from achannel. if the
charset cannot be resolved, but the implementation of nsi
charsetresolver wants to be notified of the final resolved
charset when one is available, it can set awant
charset to true. ...
...et. closure the closure returned by request
charset(). request
charset() called to resolve the
charset that should be used for parsing the document being loaded from achannel. if the
charset cannot be resolved, but the implementation of nsi
charsetresolver wants to be notified of the final resolved
charset when one is available, it can set awant
charset to true. if this is done, the caller of request
charset is responsible for calling notifyresolved
charset() and passing it the final resolved
charset and the closure that request
charset set. acstring request
charset( in nsiwebnavigation awebnavigation, in nsichannel achannel, out boolean awant
charset, out nsisupports aclosure ); parameters awebnavigation the nsiwebnavigation the document is being loaded in. may be null. achannel the channel th...
...esolved
charset() and passing it the final resolved
charset and the closure that request
charset set. acstring request
charset( in nsiwebnavigation awebnavigation, in nsichannel achannel, out boolean awant
charset, out nsisupports aclosure ); parameters awebnavigation the nsiwebnavigation the document is being loaded in. may be null. achannel the channel the document is coming in from. awant
charset gets set to true if notifyresolved
charset() should be called with the given aclosure object. aclosure a resulting object which should be passed to notifyresolved
charset() if awant
charset is set to true. return value the resolved
charset, or an empty string if no
charset could be determined. ...
documentCharsetInfo - Archive of obsolete content
« xul reference document
charsetinfo obsolete since gecko 12.0 type: nsidocument
charsetinfo this read-only property contains the nsidocument
charsetinfo object for the document which is used to handle which character set should be used to display the document. the properties of the nsidocument
charsetinfo object were merged into the docshell in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9). ...
HTMLFormElement.acceptCharset - Web APIs
the htmlformelement.accept
charset property represents a list of the supported character encodings for the given <form> element. this list can be comma-separated or space-separated. syntax var string = form.accept
charset; form.accept
charset = string; example inputs = document.forms['myform'].accept
charset; specifications specification status comment html living standardthe definition of 'htmlformelement: accept
charset' in that specification. living standard ...
CSS Charsets - CSS: Cascading Style Sheets
css
charsets is a module of css that lets you specify the character set used in the style sheet. reference at-rules @
charset specifications specification status comment css level 2 (revision 1)the definition of '@
charset' in that specification. recommendation initial definition ...
nsIDocShell
ndowtarget, in string atypehint, in nsiinputstream apostdatastream, in nsiinputstream aheadersstream, in unsigned long aloadflags, in nsishentry ashentry, in boolean firstparty, out nsidocshell adocshell, out nsirequest arequest); native code only! boolean isbeingdestroyed(); void loadstream(in nsiinputstream astream, in nsiuri auri, in acstring acontenttype, in acstring acontent
charset, in nsidocshellloadinfo aloadinfo); native code only! void loaduri(in nsiuri uri, in nsidocshellloadinfo loadinfo, in unsigned long aloadflags, in boolean firstparty); native code only! void preparefornewcontentmodel(); void resumerefreshuris(); void setchildoffset(in unsigned long offset); native code only! void setcurrenturi(in nsiuri auri); ...
...boolean tells the docshell whether the canvas should have focus. called by the focus manager when the user tabs to the frame rather than an element. obsolete since gecko 1.9.2 channelisunsafe boolean find out if the currently loaded document came from a suspicious channel (such as a jar channel where the server-returned content type is not a known jar type). read only.
charset string the converter to use when reading the document's data. in mozilla code, all text is encoded as unicode. when reading a document, a converter is used to translate the text from its original format into unicode. this attribute lets you: see what converter was used when retrieving the document's data. override that character set for documents for which the specif...
...reading this value reports the encoding that was used when loading the data into the document. setting this attribute overrides the encoding; however, to update the dom or display of the content, you need have the data reparsed. overriding the character set also sets the fallback encoding for the container frame. note: prior to gecko 12.0, this attribute was part of a separate nsidoc
charset interface. chromeeventhandler nsidomeventtarget events generated in the frame bubble up to its chromeeventhandler. in the case of a content frame or subframe this is the containing chrome frame. in the case of a chrome frame this is the same as the frame element. this attribute allows chrome to tie in to handle dom events that may be of interest to chrome. content...
...And 14 more matches
Encodings for localization files
t to be aware of the encoding of the files that you generate. in general, files in the mozilla repositories are utf-8 encoded. there are a few exceptions, though. installer the windows installer can’t handle utf-8, but only the codepages provided by windows. ...
...s that you generate. in general, files in the mozilla repositories are utf-8 encoded. there are a few exceptions, though. installer the windows installer can’t handle utf-8, but only the codepages provided by windows. ...
...e a few exceptions, though. installer the windows installer can’t handle utf-8, but only the codepages provided by windows. 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. see the table below for appropriate values. toolkit/installer/windows/install.it a windows codepage. this must match the
charset= parameter in this file, and the win_installer_
charset parameter in
charset.mk the fontname/fontsize/
charset parameters in this file must be set to good values. for most western scripts, ‘ms sans serif’ and ‘8’ are good defaults for th...
...And 9 more matches
Examples - Archive of obsolete content
<!-- this file should have a .xhtml extension and will generate an error when parsed. --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>problem 1 - < in xhtml</title> <meta http-equiv="content-type" content="application/xhtml+xml;
charset=utf-8" /> <script type="text/javascript"> var i = 0; while (++i > 10) { // ... } </script> </head> <body> <h1>problem 1 - < in xhtml</h1> <p> this document is not well formed due to the use of a raw <. </p> </body> </html> back to the article problem 2 <!-- this file should have a .xhtml extension --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//e...
.../html> back to the article problem 2 <!-- this file should have a .xhtml extension --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>problem 2 - comments in xhtml</title> <meta http-equiv="content-type" content="application/xhtml+xml;
charset=utf-8" /> <style type="text/css"> <!-- body {background-color: blue; color: yellow; } --> </style> <script type="text/javascript"> <!-- var i = 0; var sum = 0; for (i = 0; i < 10; ++i) { sum += i; } alert('sum = ' + sum); // --> </script> </head> <body> <h1>problem 2 - comments in xhtml</h1> <p> this document is valid xhtml 1.0 strict served ...
...-- this file should have a .xhtml extension and will generate an error when parsed. --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>problem 3 - comments in xml</title> <meta http-equiv="content-type" content="application/xhtml+xml;
charset=utf-8" /> <script type="text/javascript"> var i; var sum = 0; for (i = 10; i > 0; --i) { sum += i; } </script> </head> <body> <h1>problem 3 - comments in xhtml</h1> <p> this document is not well formed xhtml due to the double dash contained in the comment. </p> </body> </html> back to the article examples for "using css rules in inline style within comments...
...And 6 more matches
nsINavHistoryService
this can be used in ui to determine whether the "clear history" button should be enabled or not. this is much better than using browserhistory.count since that can be very ...
...this can be used in ui to determine whether the "clear history" button should be enabled or not. this is much better than using browserhistory.count since that can be very slow if there is a lot of history (it must enumerat...
...this can be used in ui to determine whether the "clear history" button should be enabled or not. this is much better than using browserhistory.count since that can be very slow if there is a lot of history (it must enumerate each item). this is pretty fast. ...
...And 5 more matches
Reading textual data - Archive of obsolete content
ata, you need to know which character encoding the data is in. files and network sockets contain bytes, not characters - to give these bytes a meaning, you need to know the character encoding. xxx: document nsiunicharstreamlistener (gecko 1.8) xxx: also document nsistreamlistener here? determining the character encoding of data if you have a network channel (nsichannel), you can try the content
charset property of it. note that not all channels know the character encoding of the data. you can fallback to the default character encoding stored in preferences (intl.
charset.default, a localized pref value) when reading from a file, the question is harder to answer. using the system character encoding may work (xxx insert text how to get it), or again the default character encoding from preferences...
...sses["@mozilla.org/intl/utf8converterservice;1"]. getservice(components.interfaces.nsiutf8converterservice); var data = utf8converter.converturispectoutf8 (str, "utf-8"); gecko 1.8 and newer reading strings starting with gecko 1.8 (seamonkey 1.0, firefox 1.5), you can use nsiconverterinputstream to read strings from a stream (nsiinputstream). this work was done in bug 295047. ...
...bug 295047. usage: var
charset = /* need to find out what the character encoding is. using utf-8 for this example: */ "utf-8"; const replacementchar = components.interfaces.nsiconverterinputstream.default_replacement_character; var is = components.classes["@mozilla.org/intl/converter-input-stream;1"] .createinstance(components.interfaces.nsiconverterinputstream); is.init(fis,
charset, 1024, replacementchar); now you can read string from is: var str = {}; var numchars = is.readstring(4096, str); if (numchars != 0 /* eof */) var read_string = str.value; to read the entire stream and do something with the data: var str = {}; while (is.readstring(4096, str) != 0) { processdata(str.value); } don't forget to close the stream when you're done with it (is.close()). not do...
...And 4 more matches
tabbrowser - Archive of obsolete content
n other xul windows by third-party applications or extensions. ...
...ocument. contentwindow type: todo use the contentwindow.wrappedjsobject to obtain a dom(html) window object currenturi type: nsiuri this read-only property contains the currently loaded url. to change the url, use the loaduri method. docshell type: nsidocshell this read-only property contains the nsidocshell object for the document. document
charsetinfo obsolete since gecko 12.0 type: nsidocument
charsetinfo this read-only property contains the nsidocument
charsetinfo object for the document which is used to handle which character set should be used to display the document. the properties of the nsidocument
charsetinfo object were merged into the docshell in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9). ho...
...d(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata addprogresslistener( listener ) return type: no return value add a progress listener to the browser which will monitor loaded documents. the progress listener should implement the nsiwebprogresslistener interface. addtab( url, referreruri,
charset, postdata, owner, allowthirdpartyfixup ) addtab( url, {referreruri: ...,
charset: ..., postdata: ..., owner: ..., allowthirdpartyfixup: ..., relatedtocurrent: ... }) return type: tab element opens a new tab that loads a page with the specified url. the rest of the parameters are optional. the row of tabs will appear if needed. firefox 3.6 note the second form of this method was added...
...And 4 more matches
nsIIOService
.getservice(components.interfaces.nsiioservice); method overview boolean allowport(in long aport, in string ascheme); acstring extractscheme(in autf8string urlstring); unsigned long getprotocolflags(in string ascheme); nsiprotocolhandler getprotocolhandler(in string ascheme); nsichannel newchannel(in autf8string aspec, in string aorigin
charset, in nsiuri abaseuri); obsolete since gecko 48 nsichannel newchannel2(in autf8string aspec, in string aorigin
charset, in nsiuri abaseuri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in uint32_t asecurityflags, in uint32_t acontentpolicytype); nsichannel newchannelfromuri(in nsiuri auri); obsolete since gecko 48 ns...
...when in offline mode, attempts to access the network will fail (although this does not necessarily correlate with whether there is actually a network available -- that's hard to detect without causing the dialer to come up). observers w...
...a given uri scheme. nsiprotocolhandler getprotocolhandler( in string ascheme ); parameters ascheme the uri scheme for which to get a protocol handler. return value an nsiprotocolhandler for the scheme. newchannel() obsolete since gecko 48 a shortcut method to avoid repeated calls of newuri() and newchannelfromuri(). nsichannel newchannel( in autf8string aspec, in string aorigin
charset, in nsiuri abaseuri ); parameters aspec the spec for the desired uri. aorigin
charset the
charset for the uri. may be null. abaseuri the base uri for the spec. may be null. if aspec is an absolute url, this parameter is ignored. return value returns an nsichannel based on aspec and abaseuri. newchannel2() a shortcut method to avoid repeated calls of newuri() and newchannelfromuri(...
...And 4 more matches
nsIMsgSearchTerm
oda-id. * value.str will be compared with nsimsghdr::getproperty(hdrproperty). */ attribute acstring hdrproperty; customid /// identifier for a custom id used for this term, if any. ...
... will be compared with nsimsghdr::getproperty(hdrproperty). */ attribute acstring hdrproperty; customid /// identifier for a custom id used for this term, if any. ...
... customid /// identifier for a custom id used for this term, if any. ...
...And 4 more matches
nsIScriptableIO
nts.classes["@mozilla.org/io/scriptable-io;1"] .getservice(); scriptableio.getfile("profile", "cookies.txt"); method overview nsifile getfile(in astring alocation, in astring afilename); nsifile getfilewithpath(in astring afilepath); nsisupports newinputstream(in nsivariant abase, in astring amode, [optional] in astring a
charset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize); nsisupports newoutputstream(in nsivariant abase, in astring amode, [optional] in astring a
charset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize, [optional] in unsigned long apermissions); nsiuri newuri(in nsivariant auri); methods getfile() retriev...
...his parameter may be specified either as a url string or as an nsifile object. return value returns an nsiuri object corresponding to the specified string or file. exceptions thrown ns_error_invalid_arg auri was null. newinputstream() retrieves a stream from which data can be read. nsisupports newinputstream( in nsivariant abase, in astring amode, [optional] in astring a
charset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize ); parameters abase the base object from which to read. this should be one of the following types: nsifile: an object returned by getfile() or getfilewithpath(), or any object implementing the nsifile interface. nsitransport: a transport object such as a socket. nsiinputstream: a stream ret...
..., or any other object that implements nsiinputstream. string: a string from which to read data. amode a space-delineated string of mode terms controlling the manner in which the stream is accessed. if none of these modes are desired, specify an empty string. text: read unicode-converted text. the default character set is utf-8; to read text in another character set, set the a
charset argument to the desired character set. buffered: a stream that uses a buffer to hold a block of the next piece of the data to be read. this mode is generally used as a wrapper for other streams. by default, the buffer size is 1024 bytes; however, the size may be changed by specifying the abuffersize parameter. if the text mode is specified, a buffer is always used, regardless of whether or not ...
...And 4 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
ening a text file encoded as shift-jis (a double-byte character encoding for japanese). copy some japanese text into a text file, save it as shift-jis, and put in the path to that file. the text will be displayed as-is. the text that you've read in is actually being represented internally as unicode (utf-16). ...
...ponents.classes['@mozilla.org/network/file-input-stream;1'] .createinstance(components.interfaces.nsifileinputstream); filestream.init(file, 1, 0, false); var converterstream = components.classes['@mozilla.org/intl/converter-input-stream;1'] .createinstance(components.interfaces.nsiconverterinputstream); converterstream.init(filestream,
charset, filestream.available(), converterstream.default_replacement_character); var out = {}; converterstream.readstring(filestream.available(), out); var filecontents = out.value; converterstream.close(); filestream.close(); alert(filecontents); outputting text files fixme: not sure this example is relevant in an english context, maybe something from the snippets listing 16 sho...
...ly into the javascript source using escaped unicode entities. open the output file to check your results. note that if you set the character encoding to null it will default to utf-8 for both input and output. ...
...And 3 more matches
Client-Server Overview - Learn web development
the target ...
...naging sessions (cookie: sessionid=6ynxs23n521lu21b1t136rhbv7ezngie; ...). the remaining lines contain information about the browser used and the sort of responses it can handle. for example, you can see here that: my browser (user-agent) is mozilla firefox (mozilla/5.0). it can accept gzip compressed information (accept-encoding: gzip). it can accept the specified set of characters (accept-
charset: iso-8859-1,utf-8;q=0.7,*;q=0.7) and languages (accept-language: de,en;q=0.7,en-us;q=0.3). the referer line indicates the address of the web page that contained the link to this resource (i.e. the origin of the request, https://developer.mozilla.org/). http requests can also have a body, but it is empty in this case. the response the first part of the response for this request is shown below...
... is empty in this case. the response the first part of the response for this request is shown below. the header contains information like the following: the first line includes the response code 200 ok, which tells us that the request succeeded. we can see that the response is text/html formatted (content-type). ...
...And 3 more matches
nsIMimeConverter
the nsimimeconverter service allows you to convert headers into and out of mime format. inherits from: nsisupports implemented by: @mozilla.org/messenger/mimeconverter;1. ...
... convert headers into and out of mime format. inherits from: nsisupports implemented by: @mozilla.org/messenger/mimeconverter;1. ...
...hod overview string encodemimepartiistr(in string header, in boolean structured, in string mail
charset, in long fieldnamelen, in long encodedwordsize); string encodemimepartiistr_utf8(in autf8string header, in boolean structured, in string mail
charset, in long fieldnamelen, in long encodedwordsize); string decodemimeheadertocharptr(in string header, in string default_
charset, in boolean override_
charset, in boolean eatcontinuations); astring decodemimeheader(in string header, in string default_
charset, in boolean override_
charset, in boolean eatcontinuations); mimeencoderdata *b64encoderinit(in mimeconverteroutputcallback output_fn, in void *closure); mimeencoderdata *qpencoderinit(in mimeconverteroutputcallback output_fn, in void *closure)...
...And 3 more matches
nsIUTF8ConverterService
intl/uconv/idl/nsiutf8converterservice.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview autf8string convertstringtoutf8(in acstring astring, in string a
charset, in boolean askipcheck); autf8string converturispectoutf8(in acstring aspec, in string a
charset); methods convertstringtoutf8() ensure that astring is encoded in utf-8. if not, convert to utf-8 assuming it's encoded in a
charset and return the converted string in utf-8. ...
... askipcheck determines whether or not to skip 'asciiness' and 'utf8ness' check. ...
... askipcheck determines whether or not to skip 'asciiness' and 'utf8ness' check. set this to pr_true only if you suspect that astring can be mistaken for ascii / utf-8 but is actually not in ascii / utf-8 so that astring has to go through the conversion. skipping asciiness/utf8ness check. ...
...And 3 more matches
Localizations and character encodings - Developer guides
sers process text as unicode internally. however, a way of representing characters in terms of bytes (character encoding) is used for transferring text over the network to the browser. the html specification recommends the use of the utf-8 encoding (which can represent all of unicode) and regardless of the encoding used requires web content to declare what encoding was used. ...
...l of unicode) and regardless of the encoding used requires web content to declare what encoding was used. the <meta> element's
charset attribute is used to specify the page's character encoding. it must be used within a <head> block. to specify that a page is using, for example, the utf-8 character encoding (as per the recommendation), simply place the following line in the <head> block: <meta
charset="utf-8"> details and browser internals when the encoding is declared by web content like the html specification requires, firefox will use that encoding for turning the bytes into the internal representation. unfortunately, using utf-8 and declaring that utf-8 was used was not always the prevalent way of offering web content. in the 1990s, it was common to leave the encoding undeclared and to ...
...stic detection among multiple legacy encodings was introduced to web browsers. this has then had the effect that web authors have depended on heuristic detection being present, so firefox still has heuristic detection in these locales. finding canonical encoding names the text below refers to canonical names of encodings. the canonical names are the values to the right of the equals sign in unix
charset.properties. specifying the fallback encoding as of firefox 28, this section is obsolete, since the preference intl.
charset.default no longer exists. the mapping from locales onto fallback encodings is now built into gecko itself. the fallback encoding is specified by the preference intl.
charset.default in intl.properties. it should be set to the canonical name of the legacy encoding that users...
...And 3 more matches
Writing textual data - Archive of obsolete content
the full repertoire of unicode) while others can only represent a subset of the full repertoire. when the file is to be read only by the application/extension itself, using utf-8 is often the best choice — it can represent all characters, and ascii characters are represented efficiently. ...
... os.close(); you can also write character arrays using the write function, although using writestring is simpler from javascript code. ...
...t should happen with characters that are not supported by the selected character encoding. the last argument to init specifies that: 0x0000 means that writing unsupported characters throws an exception (with an error code of ns_error_loss_of_significant_data), and no data will be written. to instead write a replacement character in such cases, specify the character instead of 0x00: os.init(fos,
charset, 0, "?".charcodeat(0)); you can, of course, replace the "?" in that example with any other character. you can also specify any unicode character u+abcd directly as 0xabcd. note: if the replacement character is not a supported character in the chosen character encoding, attempts to write unsupported characters will fail with ns_error_loss_of_significant_data. versions before gecko 1.8 firefox...
...And 2 more matches
browser - Archive of obsolete content
cts to change the displayed document. ...
...ent. contentwindow type: todo use the contentwindow.wrappedjsobject to obtain a dom(html) window object currenturi type: nsiuri this read-only property contains the currently loaded url. to change the url, use the loaduri method. docshell type: nsidocshell this read-only property contains the nsidocshell object for the document. document
charsetinfo obsolete since gecko 12.0 type: nsidocument
charsetinfo this read-only property contains the nsidocument
charsetinfo object for the document which is used to handle which character set should be used to display the document. the properties of the nsidocument
charsetinfo object were merged into the docshell in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9). h...
...o the page in the history with the given index. use a positive number to go forward and a negative number to go back. note: this is the xul method on <browser> / <tabbrowser>, not the global function in chrome://browser/content/browser.js. ...
...And 2 more matches
NetUtil.jsm
e module into your javascript scope: components.utils.import("resource://gre/modules/netutil.jsm"); once you've imported the module, you can then use its methods. method overview nsiasyncstreamcopier asynccopy(nsiinputstream asource, nsioutputstream asink, [optional] acallback) void asyncfetch(asource, acallback) nsichannel newchannel(awhattoload, [optional] aorigin
charset, [optional] nsiuri abaseuri) nsiuri newuri(atarget, [optional] aorigin
charset, [optional] nsiuri abaseuri) string readinputstreamtostring(ainputstream, acount, aoptions) attributes attribute type description ioservice nsiioservice returns a reference to nsiioservice. methods asynccopy() the asynccopy() method performs a simple async...
... return; } // consume the input stream. }); remarks note: if you specify an nsichannel as the input source, and its notification callbacks have already been set, callers are responsible for implementing nsibadcertlistener and nsisslerrorlistener. newchannel() creates a new channel for the specified uri string, nsiuri, or nsifile. nsichannel newchannel( awhattoload, [optional] aorigin
charset, [optional] abaseuri ); parameters return value an nsichannel allowing access to the specified data source. awhattoload a string specifying a uri, or an nsiuri or nsifile object. the returned method will allow access to the specified data. aorigin
charset the optional character set to use when interpreting awhattoload as a string; this is ignored if awhattoload is not a string. default...
...e uri for the spec, specified as an nsiuri. only used if awhattoload is a string. newuri() the newuri() method creates a new nsiuri. this method wraps the nsiioservice.newuri(). note: starting in gecko 2, this method supports specifying an nsifile as the target of the uri. in previous versions of gecko, you must use a string to specify the uri. nsiuri newuri( atarget, [optional] aorigin
charset, [optional] abaseuri ); parameters atarget specifies the target of the uri as either a uri string or (starting in gecko 2) as an nsifile. aorigin
charset the optional character set for the uri. defaults to utf-8 if not provided. abaseuri the base uri for the spec, specified as an nsiuri. return value returns the nsiuri object representing the specified target. exceptions thrown th...
...And 2 more matches
nsIMessenger
inherits from: nsisupports implemented by: @mozilla.org/messenger;1. to create an instance, use: messenger = components.classes["@mozilla.org/messenger;1"] .createinstance(components.interfaces.nsimessenger); in thunderbird, a global nsimessenger object is defined as messenger via the createmessenger function in mailwindow.js. ...
...pports implemented by: @mozilla.org/messenger;1. to create an instance, use: messenger = components.classes["@mozilla.org/messenger;1"] .createinstance(components.interfaces.nsimessenger); in thunderbird, a global nsimessenger object is defined as messenger via the createmessenger function in mailwindow.js. ...
...aunchexternalurl(in acstring aurl); boolean canundo(); boolean canredo(); unsigned long getundotransactiontype(); unsigned long getredotransactiontype(); void undo(in nsimsgwindow msgwindow); void redo(in nsimsgwindow msgwindow); void sendunsentmessages(in nsimsgidentity aidentity, in nsimsgwindow amsgwindow); void setdocument
charset(in acstring characterset); void saveas(in acstring auri, in boolean aasfile, in nsimsgidentity aidentity, in astring amsgfilename); void openattachment(in acstring contenttpe, in acstring url, in acstring displayname, in acstring messageuri, in boolean isexternalattachment); void saveattachment(in acstring contenttpe, in acstring url, in acstring displayname, in acstrin...
...And 2 more matches
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
lated elements, like <base>, <link>, <script>, <style> or <title>. content categories metadata content. if the itemprop attribute is present: flow content, phrasing content. permitted content none, it is an empty element. tag omission as it is a void element, the start tag must be present and the end tag must not be present. permitted parents <meta
charset>, <meta http-equiv>: a <head> element. if the http-equiv is not an encoding declaration, it can also be inside a <noscript> element, itself inside a <head> element. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlmetaelement the type of metadata provided by the meta element can be one of the following: ...
...interface htmlmetaelement the type of metadata provided by the meta element can be one of the following: if the name attribute is set, the meta element provides document-level metadata, applying to the whole page. if the http-equiv attribute is set, the meta element is a pragma directive, providing information equivalent to what can be given by a similarly-named http header. if the
charset attribute is set, the meta element is a
charset declaration, giving the character encoding in which the document is encoded. if the itemprop attribute is set, the meta element provides user-defined metadata. attributes this element includes the global attributes. note: the attribute name has a specific meaning for the <meta> element, and the itemprop attribute must not be set on the same <m...
...ation, giving the character encoding in which the document is encoded. if the itemprop attribute is set, the meta element provides user-defined metadata. attributes this element includes the global attributes. note: the attribute name has a specific meaning for the <meta> element, and the itemprop attribute must not be set on the same <meta> element that has any existing name, http-equiv or
charset attributes.
charset this attribute declares the document's character encoding. if the attribute is present, its value must be an ascii case-insensitive match for the string "utf-8". content this attribute contains the value for the http-equiv or name attribute, depending on which is used. http-equiv defines a pragma directive. the attribute is named http-equiv(alent) because all the al...
...And 2 more matches
JavaScript Daemons Management - Archive of obsolete content
in function of a future date. the date argument can be a date object, a string expressing the date in gmtstring format, or a number expressing the number of milliseconds since january 1, 1970, 00:00:00 utc. only the length property will be modified. ...
...the @context object must contain *at least* |*| a "perf...
...ello" value="33" style="width: 40px;" onkeypress="return event.charcode===0||/\d/.test(string.fromcharcode(event.charcode));" onkeyup="if(isfinite(this.value)&&number(this.value)>0){ounhide.setrate(this.value);}" /></p> </body> </html> example #3: a safe (without setinterval) instantiation – new daemon.safe() <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html;
charset=utf-8" /> <title>new daemon.safe(…)</title> <script type="text/javascript" src="daemon.js"></script> <script type="text/javascript" src="daemon-safe.js"></script> <script type="text/javascript" src="daemon-methods.js"></script> <script type="text/javascript"> function perform (nindex, nlength, bbackw) { // http://tyleregeto.com/text-animation-in-javascript for (var oletter, nletter = ...
...idth: 40px;" onkeypress="return event.charcode===0||/\d/.test(string.fromcharcode(event.charcode));" onkeyup="if(isfinite(this.value)&&number(this.value)>0){orecompose.setrate(this.value);}" /></p> </body> </html> example #4: a practical and safe (without setinterval) instantiation – daemon.safe.buildaround() <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html;
charset=utf-8" /> <title>daemon.safe.buildaround(…)</title> <script type="text/javascript" src="daemon.js"></script> <script type="text/javascript" src="daemon-safe.js"></script> <script type="text/javascript" src="daemon-methods.js"></script> <script type="text/javascript"> /*\ |*| |*| :: daemon.safe.buildaround(@context[, @rate, @length]) :: |*| |*| returns a new daemon built around a @c...
Common Pitfalls - Archive of obsolete content
tt>chrome:</tt> uris when you shouldn't. ...
... .getservice(components.interfaces.nsiioservice); var uriobj = ioserv.newuri(uristring, uri
charset, baseuri); } catch (e) { // may want to catch ns_error_malformed_uri for some applications } c++: nsresult rv; nscomptr<nsiioservice> ioserv = do_getservice("@mozilla.org/network/io-service;1"); ns_ensure_success(rv, rv); nscomptr<nsiuri> uriobj; rv = ioserv->newuri(uristring, uri
charset, baseuri, getter_addrefs(uriobj)); if (ns_failed(rv)) { // may want to handle ns_error_malformed_uri for // some applications return rv; } or, if the code can include nsnetutil.h: nscomptr<nsiuri> uriobj; nsresult rv = ns_newuri(getter_addrefs(uriobj), uristring, uri
charset, baseuri); in all cases the baseuri can be null if the uristring should be treated as an abso...
...it's something the user typed in the url bar). ...
...it's something the user typed in the url bar). ...
How CSS is structured - Learn web development
le with a .css extension. this is the most common and useful method of bringing css to a document. you can link a single css file to multiple web pages, styling all of them with the same css stylesheet. in the getting started with css, we linked an external stylesheet to our web page. ...
...directory level, then inside a subdirectory called styles --> <link rel="stylesheet" href="../styles/style.css"> internal stylesheet an internal stylesheet resides within an html document. to create an internal stylesheet, you place css inside a <style> element contained inside the html <head>. the html for an internal stylesheet might look like this: <!doctype html> <html> <head> <meta
charset="utf-8"> <title>my css experiment</title> <style> h1 { color: blue; background-color: yellow; border: 1px solid black; } p { color: red; } </style> </head> <body> <h1>hello world!</h1> <p>this is my first css example</p> </body> </html> in some circumstances, internal stylesheets can be useful. for example, perhap...
... to site maintenance too. with css in internal stylesheets, there is the risk that even one simple styling change may require edits to multiple web pages. inline styles inline styles are css declarations that affect a single html element, contained within a style attribute. the implementation of an inline style in an html document might look like this: <!doctype html> <html> <head> <meta
charset="utf-8"> <title>my css experiment</title> </head> <body> <h1 style="color: blue;background-color: yellow;border: 1px solid black;">hello world!</h1> <p style="color:red;">this is my first css example</p> </body> </html> avoid using css in this way when possible. it is the opposite of a best practice. first, it is the least efficient implementation of css for maintenance. one st...
...l body. you may also see a lot of inline styles in html email to achieve compatibility with as many email clients as possible. playing with the css in this article for the exercise that follows, create a folder on your computer. you can name the folder whatever you want. inside the folder, copy the text below to create two files: index.html: <!doctype html> <html lang="en"> <head> <meta
charset="utf-8"> <title>my css experiments</title> <link rel="stylesheet" href="styles.css"> </head> <body> <p>create your test html here</p> </body> </html> styles.css: /* create your test css here */ p { color: red; } when you find css that you want to experiment with, replace the html <body> contents with some html to style, and then add your test css code to your css file. ...
What’s in the head? Metadata in HTML - Learn web development
prerequisites: basic html familiarity, as covered in getting started with html. objective: to learn about the html head, its purpose, the most important items it can contain, and what effect it can have on the html document. what is the html head? let's revisit the simple html document we covered in the previous article: <!doctype html> <html> <head> <meta
charset="utf-8"> <title>my test page</title> </head> <body> <p>this is my page</p> </body> </html> the html head is the contents of the <head> element — unlike the contents of the <body> element (which are displayed on the page when loaded in a browser), the head's content is not displayed on the page. instead, the head's job is to contain metadata about the document. in the above exampl...
...</head> <body> <p>this is my page</p> </body> </html> the html head is the contents of the <head> element — unlike the contents of the <body> element (which are displayed on the page when loaded in a browser), the head's content is not displayed on the page. instead, the head's job is to contain metadata about the document. in the above example, the head is quite small: <head> <meta
charset="utf-8"> <title>my test page</title> </head> in larger pages however, the head can get quite full. try going to some of your favorite websites and use the developer tools to check out their head contents. our aim here is not to show you how to use everything that can possibly be put in the head, but rather to teach you how to use the major elements that you'll want to include in the head, and ...
... metadata too. there are a lot of different types of <meta> elements that can be included in your page's <head>, but we won't try to explain them all at this stage, as it would just get too confusing. instead, we'll explain a few things that you might commonly see, just to give you an idea. specifying your document's character encoding in the example we saw above, this line was included: <meta
charset="utf-8"> this element simply specifies the document's character encoding — the character set that the document is permitted to use. utf-8 is a universal character set that includes pretty much any character from any human language. this means that your web page will be able to handle displaying any language; it's therefore a good idea to set this on every web page you create! for example, your...
...ngs, so depending on what browser you use, you may not see this problem anyway. you should still set an encoding of utf-8 on your page anyway, to avoid any potential problems in other browsers. active learning: experiment with character encoding to try this out, revisit the simple html template you obtained in the previous section on <title> (the title-example.html page), try changing the meta
charset value to iso-8859-1, and add the japanese to your page. this is the code we used: <p>japanese example: ご飯が熱い。</p> adding an author and description many <meta> elements include name and content attributes: name specifies the type of meta element it is; what type of information it contains. content specifies the actual meta content. two such meta elements that are useful to inc...
Looping code - Learn web development
ferent calculations to do, you want to do each different one, not the same one over and over again! let's look at an example to perfectly illustrate why loops are such a good thing. ...
... look at a real example so we can visualize what these do more clearly. ...
...'; input.focus(); for (let i = 0; i < contacts.length; i++) { let splitcontact = contacts[i].split(':'); if (splitcontact[0].tolowercase() === searchname) { para.textcontent = splitcontact[0] + '\'s number is ' + splitcontact[1] + '.'; break; } else { para.textcontent = 'contact not found.'; } } }); hidden code 3 <!doctype html> <html> <head> <meta
charset="utf-8"> <title>simple contact search example</title> <style> </style> </head> <body> <label for="search">search by contact name: </label> <input id="search" type="text"> <button>search</button> <p></p> <script> const contacts = ['chris:2232322', 'sarah:3453456', 'bill:7654322', 'mary:9998769', 'dianne:9384975']; const para = document.queryselector('p'); ...
...ample — a simple text input, and a paragraph for output. ...
XPCOM Stream Guide
on of nsichannel will have an input stream as well, but unless you own the channel, you shouldn't try to read from the input stream. there are two ways of getting the input stream: by calling the channel's .open() method for a synchronous read, or by calling the channel's .asyncopen() method with an nsistreamlistener object. you can get an nsichannel object from the io service's newchannel(spec,
charset, baseuri) method or its .newchannelfromuri(uri) method. the "safe file output stream" mozilla provides a "safe file output stream" implementation. this implementation actually writes the contents of the file you're trying to create to a temporary file. if everything goes well, calling the stream's .finish() method overwrites the original file with the new file. using streams in c++ using stre...
... contain 16-bit characters. this can mean if you have characters beyond ascii code 255, you risk losing data using nsstringstream, for example. to get an input stream for javascript strings safely, try this. var converter = components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createinstance(components.interfaces.nsiscriptableunicodeconverter); converter.
charset = "utf-8"; var stream = converter.converttoinputstream(string); javascript modules are your friends there are several useful javascript modules at your disposal. for streams, the most obvious are netutil.jsm and fileutils.jsm. netutil.jsm provides apis for copying an input stream to an output stream (the asynccopy() method), getting an input stream from another source (the asyncfetch() method)...
...eam(stream) object read a nsisupports object from the underlying stream. nsbinaryinputstream @mozilla.org/binaryinputstream;1 nsiobjectinputstream (inherits from nsibinaryinputstream) converter convert unicode characters from an underlying stream. nsconverterinputstream @mozilla.org/intl/converter-input-stream;1 nsiconverterinputstream .init(stream,
charset, buffersize, replacechar) mime separate headers from data. nsmimeinputstream @mozilla.org/network/mime-input-stream;1 nsimimeinputstream .setdata(stream) similarly, there are complex output streams which build from primitive output streams: complex output stream types type purpose native class contract id interface how to bind to a primitiv...
...rite an nsisupports object to the underlying stream. nsbinaryoutputstream @mozilla.org/binaryoutputstream;1 nsiobjectoutputstream (inherits from nsibinaryoutputstream) converter write to an underlying stream with automatic conversion of unicode characters. nsconverteroutputstream @mozilla.org/intl/converter-output-stream;1 nsiconverteroutputstream .init(stream,
charset, buffersize, replacechar) additional stream interfaces the nsilineinputstream interface supports a .readline() method for reading a single line from an input stream. the nsfileinputstream and nspartialfileinputstream classes implement this interface. (xxx nsiunicharinputstream interface) (xxx nsiunicharlineinputstream interface) (xxx nsisearchableinputstream interface) stream conve...
mozIJSSubScriptLoader
bscript-loader;1. to get this service, use: var mozijssubscriptloader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); note: see components.utils.import for another way to import javascript code. method overview jsval loadsubscript(in string url, in object targetobj optional, in string
charset optional); jsval loadsubscriptwithoptions(in string url, in object options); methods loadsubscript() synchronously loads and executes the script from the specified url. as of gecko 8.0, scripts are loaded from the startup cache where possible. the loaded script is executed with the principal associated with the target object. any top-level functions or variables created by th...
...es 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. if the script returns a value, it will be returned by this method. note: this method must only be called from javascript! jsval loadsubscript( in string url, in object targetobj optional, in string
charset optional, ); example let context = {}; services.scriptloader.loadsubscript("chrome://my-package/content/foo-script.js", context, "utf-8" /* the script's encoding */); parameters url the url pointing to the script to load. it must be a local chrome:, resource: or file: url (see bug 307686 and bug 418356). note: in versions of gecko prior to gecko 1...
...at let and const declarations in the script will be placed on a syntactic scope that is not an object at all, and will not be available to the caller of loadsubscript. note: undeclared variables in the loaded script will be created as global variables in the caller (ie.: in the caller's global object). this object will be searched for variables that cannot be resolved in the subscript scope.
charset an optional string to specify the character encoding of the file. if absent, the file is interpreted as ascii. loadsubscriptwithoptions() same as loadsubscript(), except that parameters after url are expressed as an object, and a new ignorecache option is available. note: this method must only be called from javascript! jsval loadsubscriptwithoptions( in string url, in object options )...
...scription target object the object to use as the scope object for the script being executed. it defaults to the global object of the caller. note: undeclared variables in the loaded script will be created as global variables in the caller (ie.: in the caller's global object). this object will be searched for variables that cannot be resolved in the subscript scope.
charset string an optional string to specify the character encoding of the file. if absent, the file is interpreted as ascii. ignorecache boolean if present and set to true, the cache will be bypassed when reading the file. see also appendix d: loading scripts ...
nsIContentSniffer
classes of nsirequest might offer. acstring getmimetypefromcontent( in nsirequest arequest, [const,array,size_is(alength)] in octet adata, in unsigned long alength ); parameters arequest the request where this data came from. may be null. adata data to check. alength length of the data. return value the content type. example how to read content from adata. ...
..., [const,array,size_is(alength)] in octet adata, in unsigned long alength ); parameters arequest the request where this data came from. may be null. adata data to check. alength length of the data. return value the content type. example how to read content from adata. ...
...ta, in unsigned long alength ); parameters arequest the request where this data came from. may be null. adata data to check. alength length of the data. return value the content type. example how to read content from adata. ...
...as been removed, see bug 910192
charset = services.prefs.getcomplexvalue("intl.
charset.default", ci.nsipreflocalizedstring).data; } catch (e) { } let conv = cc["@mozilla.org/intl/scriptableunicodeconverter"] .createinstance(ci.nsiscriptableunicodeconverter); conv.
charset =
charset; try { let str = conv.convertfrombytearray(adata, alength); if (str.substring(0, 5) == "%pdf-") return "application/pdf"; // we detected a pdf file } catch (e) { // try to get information from arequest } ...
nsIConverterOutputStream
.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/intl/converter-output-stream;1. ...
...abuffersize how many bytes to buffer. ...
...abuffersize how many bytes to buffer. ...
...abuffersize how many bytes to buffer. a value of 0 means that no bytes will be buffered. implementations not supporting buffering may ignore this parameter. ...
nsIDBFolderInfo
obsolete since gecko 1.8 void getmailboxname(in nsstring boxname); ...
...obsolete since gecko 1.8 void setmailbo...
... missing description getbooleanproperty() boolean getbooleanproperty( in string propertyname, in boolean defaultvalue ); parameters propertyname missing description defaultvalue missing description return value missing description exceptions thrown missing exception missing description getcharacterset() void getcharacterset( out acstring
charset, out boolean overriden ); parameters
charset missing description overriden missing description exceptions thrown missing exception missing description getcharactersetoverride() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void getcharactersetoverride( out boolean charactersetoverride ); param...
...s thrown missing exception missing description setbooleanproperty() void setbooleanproperty( in string propertyname, in boolean apropertyvalue ); parameters propertyname missing description apropertyvalue missing description exceptions thrown missing exception missing description setcharacterset() void setcharacterset( in string
charset ); parameters
charset missing description exceptions thrown missing exception missing description setcharactersetoverride() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void setcharactersetoverride( in boolean charactersetoverride ); parameters charactersetoverride missing description excepti...
nsIProtocolHandler
ement protocol handlers. if you wish to create a new protocol handler, you need to implement this interface. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean allowport(in long port, in string scheme); nsichannel newchannel(in nsiuri auri); nsiuri newuri(in autf8string aspec, in string aorigin
charset, in nsiuri abaseuri); attributes attribute type description defaultport long the default port is the port the protocol uses by default. if the protocol doesn't need a port (for example, the "about" protocol), this attribute is -1. read only. protocolflags unsigned long protocol-specific flags. read only. note: starting with firefox 3, one o...
...ewchannel() constructs a new channel from the given uri for this protocol handler. nsichannel newchannel( in nsiuri auri ); parameters auri the uri for which to construct a channel. return value return the newly constructed channel. newuri() makes a uri object that is suitable for loading by this protocol, where the uri string is given as an utf-8 string. ...
...hannel( in nsiuri auri ); parameters auri the uri for which to construct a channel. return value return the newly constructed channel. newuri() makes a uri object that is suitable for loading by this protocol, where the uri string is given as an utf-8 string. the caller may provide the
charset from which the uri string originated, so that the uri string can be translated back to that
charset (if necessary) before communicating with, for example, the origin server of the uri string. (many servers do not support utf-8 iris at the present time, so we must be careful about tracking the native
charset of the origin server.) nsiuri newuri( in autf8string aspec, in string aorigin
charset, in nsiuri abaseuri ); parameters aspec the uri string in utf-8 encoding. depending on the p...
...this corresponds to the character set that should be used when communicating this uri to an origin server. if this is null, then utf-8 encoding is assumed and no character transformation is not performed. ...
nsIScriptableUnicodeConverter
returns the converted string. after converting, finish should be called and its return value appended to this return value. acstring convertfromunicode( in astring asrc ); finish() returns the termina...
... octet adata, in unsigned long acount); void converttobytearray(in astring astring,[optional] out unsigned long alen,[array, size_is(alen),retval] out octet adata); nsiinputstream converttoinputstream(in astring astring); attributes attribute type description
charset string current character set. throws ns_error_uconv_noconv if the requested
charset is not supported. methods convertfromunicode() converts the data from unicode to one
charset. returns the converted string. after converting, finish should be called and its return value appended to this return value. acstring convertfromunicode( in astring asrc ); finish() returns the terminator string. should be called after convertfromunicode() and appended to that function's re...
... astring converttounicode( in acstring asrc ); convertfrombytearray() converts an array of bytes to a unicode string. astring convertfrombytearray( [const,array,size_is(acount)] in octet adata, in unsigned long acount ); converttobytearray() convert a unicode string to an array of bytes. finish does not need to be called. ...
...t adata, in unsigned long acount ); converttobytearray() convert a unicode string to an array of bytes. finish does not need to be called. void converttobytearray(in astring astring, out unsigned long alen, optional [array, size_is(alen),retval] out octet adata ); converttoinputstream() converts a unicode string to an input stream. the bytes in the stream are encoded according to the
charset attribute. the returned stream is non-blocking. nsiinputstream converttoinputstream( in astring astring ); parameters astring the text to encode to the stream. the text is encoded into the character set specified by the
charset attribute. return value an nsiinputstream that will present the text specified in astring as its data. examples see reading textual data and writing textual ...
nsIURI
see the following rfcs for details: rfc3490: internationalizing domain names in applications (idna) rfc3986: uniform resource identifier (uri): generic syntax rfc3987: internationalized resource identifiers subclasses of nsiuri, such as nsiurl, impose further structure on the uri. ...
... identifiers subclasses of nsiuri, such as nsiurl, impose further structure on the uri. ...
...nk) note: characters are not escaped. ipv6 addresses are not enclosed in square brackets. hostport autf8string the "host:port" part of the uri (or simply the host, if port is -1). exceptions thrown ns_error_failure if hostport is not applicable to the uri scheme (e.g. about:blank) note: characters are not escaped. origin
charset acstring the
charset of the document from which this uri originated. an empty value implies utf-8. if this value is something other than utf-8 then the uri components (for example spec, prepath, username, and so on) are all fully url-escaped. otherwise, the uri components may contain unescaped multibyte utf-8 characters. read only. password autf8string the optio...
...essage(). note: some characters may be escaped. read only. ref autf8string returns the reference portion (the part after the "#") of the uri. if there is not one, an empty string is returned. note: some characters may be escaped. scheme acstring (us-ascii) the scheme is the protocol to which this uri refers. the scheme is restricted to the us-ascii
charset per rfc3986. warning: setting this is highly discouraged outside of a protocol handler implementation, since doing so will generally lead to unpredictable results. spec autf8string returns a string representation of the uri. setting the spec causes the new spec to be parsed using the rules for the scheme the uri currently has. if the string cannot be parsed as a uri, ...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
with: <link rel="stylesheet" href="styles/main.css"> here however, we will use a rel value of preload, which turns <link> into a preloader for any resource we want. you will also need to specify: the path to the resource in the href attribute. the type of resource in the as attribute. ...
...attribute, which contains the mime type of the resource the element points to. this is especially useful when preloading resources — the browser will use the type attribute value to work out if it supports that resource, and will only download it if so, ignoring it if not. you can see an example of this in our video example (see the full source code, and also the live version): <head> <meta
charset="utf-8"> <title>video preload example</title> <link rel="preload" href="sintel-short.mp4" as="video" type="video/mp4"> <link rel="preload" href="sintel-short.webm" as="video" type="video/webm"> </head> <body> <video controls> <source src="sintel-short.mp4" type="video/mp4"> <source src="sintel-short.webm" type="video/webm"> <p>your browser doesn't support html5 video. here is...
... as long as you set a crossorigin attribute on your <link> element. one interesting case where this applies, even if the fetch is not cross-origin, is font files. because of various reasons, these have to be fetched using anonymous mode cors (see font fetching requirements). let's use this case as an example. ...
... hints in the type attributes, but we are also providing the crossorigin attribute to handle the cors issue. including media one nice feature of <link> elements is their ability to accept media attributes. ...
base64 - Archive of obsolete content
data encoding and decoding using base64 algorithms. var base64 = require("sdk/base64"); var encodeddata = base64.encode("hello, world"); var decodeddata = base64.decode(encodeddata); globals functions encode(data,
charset) creates a base-64 encoded ascii string from a string of binary data. parameters data : string the data to encode
charset : string the
charset of the string to encode (optional). the only accepted value is "utf-8". in order to encode and decode unicode strings, the
charset parameter needs to be set: var base64 = require("sdk/base64"); var encodeddata = base64.encode(unicodestring, "utf-8"); returns string : the encoded string decode(data,
charset) decodes a string of data which has been encoded using base-64 encoding. parameters data : string the encoded ...
.... the only accepted value is "utf-8". in order to encode and decode unicode strings, the
charset parameter needs to be set: var base64 = require("sdk/base64"); var encodeddata = base64.encode(unicodestring, "utf-8"); returns string : the encoded string decode(data,
charset) decodes a string of data which has been encoded using base-64 encoding. parameters data : string the encoded data
charset : string the
charset of the string to encode (optional). the only accepted value is "utf-8". ...
...se64"); var encodeddata = base64.encode(unicodestring, "utf-8"); returns string : the encoded string decode(data,
charset) decodes a string of data which has been encoded using base-64 encoding. parameters data : string the encoded data
charset : string the
charset of the string to encode (optional). the only accepted value is "utf-8". ...
io/text-streams - Archive of obsolete content
if not specified, "utf-8" is...
...closed) { textwriter.write(text); textwriter.close(); } } globals constructors textreader(inputstream,
charset) creates a buffered input stream that reads text from a backing stream using a given text encoding. you can also create textreader objects using io/file's open() function. parameters inputstream : stream the backing stream, an nsiinputstream. it must already be opened.
charset : string inputstream is expected to be in the character encoding named by this value. if not specified, "utf-8" is assumed. see nsi
charsetconvertermanager.idl for documentation on how to determine other valid values for this. textwriter(outputstream,
charset) creates a buffered output stream that writes text to a backing stream using a given text encoding. you can also create textwriter objec...
...convertermanager.idl for documentation on how to determine other valid values for this. textwriter(outputstream,
charset) creates a buffered output stream that writes text to a backing stream using a given text encoding. you can also create textwriter objects using io/file's open() function. parameters outputstream : stream the backing stream, an nsioutputstream. it must already be opened.
charset : string text will be written to outputstream using the character encoding named by this value. if not specified, "utf-8" is assumed. see nsi
charsetconvertermanager.idl for documentation on how to determine other valid values for this. textreader methods close() closes both the stream and its backing stream. read(numchars) reads and returns a string from the stream. if the stream is closed...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
// fix: we test for file extensions as well in case file:// doesn't return content type (as seems to be the case); can some other tool be uesd in ff (or ie) to detect encoding of local file? probably just need bom test since other encodings must be specified var patternxml = /\.(svg|xml|xul|rdf|xhtml)$/;...
... // let the request be processed below } else { if (encoding === '' || encoding === null) { // encoding has no effect on xml encoding = 'utf-8'; } request.overridemimetype('text/plain;
charset='+encoding); //'x-user-defined' } responsetype = 'responsetext'; break; case null: case 'xml': responsetype = 'responsexml'; break; default: alert('xinclude el...
... encodingtype = 'utf-8'; } // need to make a whole new request apparently since cannot convert the encoding after receiving it (to know what the encoding was) var request2 = new xmlhttprequest(); request2.overridemimetype('text/plain;
charset='+encodingtype); request2.open('get', href, false); request2.setrequestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt'); request2.setrequestheader('cache-control', 'no-cache'); request2.send(null); response = request2[...
Index
388 nsichannelpolicy interfaces, interfaces:scriptable, xpcom, xpcom interface reference this interface exists to allow the content policy mechanism to function properly during channel redirects. channels can be created with this interface placed in the property bag and upon redirect, the interface can be transferred from the old channel to the new channel. 389 nsi
charsetresolver interfaces, interfaces:scriptable, obsolete, xpcom, xpcom interface reference some implementations may request that they be notified when the
charset is actually detected. 390 nsichromeframemessagemanager interfaces, interfaces:scriptable, xpcom, xpcom interface reference loads a script into the remote frame. 391 nsichromeregistry interfaces, ...
...lib/softoken/pkcs11t.h and are switched to ckm_*_hmac constant. 460 nsicryptohash interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference these constants are used by the init() method to indicate which hashing function to use. the values map directly onto the values defined in mozilla/security/nss/lib/cryptohi/hasht.h. 461 nsicurrent
charsetlistener interfaces, interfaces:scriptable, needscontent, xpcom, xpcom interface reference implemented by: @mozilla.org/intl/current
charsetlistener;1. to create an instance, use: 462 nsicyclecollectorlistener interfaces, interfaces:scriptable, needscontent, xpcom interface reference the order of calls will be call to begin(); then for every node in the graph a call t...
...an contain 'a-z' letters and '_' characters. 1038 nsiurlparser interfaces, interfaces:scriptable, needscontent the string to parse in the methods may be given as a null terminated string, in which case the length argument should be -1. 1039 nsiutf8converterservice ensure that astring is encoded in utf-8. if not, convert to utf-8 assuming it's encoded in a
charset and return the converted string in utf-8. 1040 nsiutf8stringenumerator interfaces, interfaces:scriptable, xpcom interface reference, strings returns the next string in the enumerator. the "next" element is the first string upon the first call. must be preceded by a call to hasmore(), which returns pr_true. this method is generally called within a loop to iterate over the stri...
nsIConverterInputStream
n gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/intl/converter-input-stream;1. ...
...a value of null or "utf-8" equals utf-8 encoding. ...
...a value of null or "utf-8" equals utf-8 encoding. ...
nsIStandardURL
: nsimutable last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/standard-url;1. to create an instance, use: var standardurl = components.classes["@mozilla.org/network/standard-url;1"] .createinstance(components.interfaces.nsistandardurl); method overview void init(in unsigned long aurltype, in long adefaultport, in autf8string aspec, in string aorigin
charset, in nsiuri abaseuri); attributes attribute type description mutable boolean control whether or not this url can be modified. protocol handlers can set this flag before handing out an url to ensure that it is not inadvertently modified. obsolete since gecko 1.9 constants these constants describe how to normalize an url. constant value description urltype_standard 1 blah:foo/bar ...
...://foo/bar => blah://foo/bar blah:///foo/bar => blah://foo/bar urltype_no_authority 3 blah:foo/bar => blah:///foo/bar blah:/foo/bar => blah:///foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah:///foo/bar methods init() normalizes a given url to an standard url. ...
...rmalizes a given url to an standard url. void init( in unsigned long aurltype, in long adefaultport, in autf8string aspec, in string aorigin
charset, in nsiuri abaseuri ); parameters aurltype one of the constants listed above. adefaultport if the port parsed from the url string matches this port, then the port will be removed from the canonical form of the url. aspec url string. aorigin
charset the
charset from which this uri string originated. this corresponds to the
charset that should be used when communicating this uri to an origin server, for example. if null, then provide abaseuri implements this interface, the origin
charset of abaseuri will be assumed, otherwise defaulting to utf-8 (that is, no
charset transformation from aspec). abaseuri if null, aspec must specify an absolute ...
CSSRule - Web APIs
added value namespace_rule. css ...
...added value namespace_rule. css animationsthe definition...
...added value namespace_rule. css animationsthe definition of 'cssrule' in that specification. working draft added values keyframes_rule and keyframe_rule. css fonts module level 4the definition of 'cssrule' in that specification. working draft added value font_feature_values_rule. ...
Using files from web applications - Web APIs
ame as a read-only string. this is just the file name, and does not include any path information. size the size of the file in bytes as a read-only 64-bit integer. type the mime type of the file as a read-only string or "" if the type couldn't be determined. ...
... before actually transferring the data, several preparatory steps are taken: the xmlhttpre...
...ch uses php on the server side and javascript on the client side, demonstrates asynchronous uploading of a file. <?php if (isset($_files['myfile'])) { // example: move_uploaded_file($_files['myfile']['tmp_name'], "uploads/" . ...
HTMLFormElement - Web APIs
on html attribute, containing the uri of a program that processes the information submitted by the form. htmlformelement.encoding or htmlformelement.enctype a domstring reflecting the value of the form's enctype html attribute, indicating the type of content that is used to transmit the form to the server. only specified values can be set. the two properties are synonyms. htmlformelement.accept
charset a domstring reflecting the value of the form's accept-
charset html attribute, representing the character encoding that the server accepts. htmlformelement.autocomplete a domstring reflecting the value of the form's autocomplete html attribute, indicating whether the controls in this form can have their values automatically populated by the browser. htmlformelement.novalidate a boolean reflec...
...utton type="button" onclick="setforminfo(this.form);">set</button> <button type="reset">reset</button> </p> <textarea id="form-info" rows="15" cols="20"></textarea> </form> <script> function getforminfo(){ // get a reference to the form via its name var f = document.forms["forma"]; // the form properties we're interested in var properties = [ 'elements', 'length', 'name', '
charset', 'action', 'accept
charset', 'action', 'enctype', 'method', 'target' ]; // iterate over the properties, turning them into a string that we can display to the user var info = properties.map(function(property) { return property + ": " + f[property] }).join("\n"); // set the form's <textarea> to display the form's properties document.forms["forma"].elements['form-info'].value = info...
...to display the form's properties document.forms["forma"].elements['form-info'].value = info; // document.forms["forma"]['form-info'].value would also work } function setforminfo(f){ // argument should be a form element reference. ...
Using Web Workers - Web APIs
etc): calls a worker's queryable function * postmessage(string or json data): see worker.prototype.postmessage() * terminate(): terminates the wo...
...> elements do for normal scripts. but a <script> element that does not have a src attribute and has a type attribute that does not identify an executable mime type can be considered a data block element that javascript could use. "data blocks" is a more general feature of html5 that can carry almost any textual data. so, a worker could be embedded in this way: <!doctype html> <html> <head> <meta
charset="utf-8" /> <title>mdn example - embedded worker</title> <script type="text/js-worker"> // this script won't be parsed by js engines because its mime type is text/js-worker. var myvar = 'hello world!'; // rest of your worker code goes here. </script> <script type="text/javascript"> // this script will be parsed by js engines because its mime type is text/javascript. function pagelog(smsg...
...at name, or defining a function with that name. var onmessage and function onmessage will define global properties with those names, but they will not register the function to receive messages sent by the web page that created the worker). this starts the recursion, spawning new copies of itself to handle each iteration of the calculation. ...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
)'s basic syntax. var intervalid = window.setinterval(mycallback, 500, 'parameter 1', 'parameter 2'); function mycallback(a, b) { // your code here // parameters are purely optional. console.log(a); console.log(b); } example 2: alternating two colors the following example calls the flashtext() function once a second until the stop button is pressed. ...
... </script> </head> <body onload="changecolor();"> <div id="my_box"> <p>hello world</p> </div> <button onclick="stoptextcolor();">stop</button> </body> </html> example 3: typewriter simulation the following example simulates typewriter by first clearing and then slowly typing content into the nodelist that matches a specified group of selectors. ...
...ds (index decreasing). minidaemon global object methods minidaemon.forcecall(minidaemon) forces a single callback to the minidaemon.task function regardless of the fact that the end has been reached or not. in any case the internal index property is increased/decreased (depending on the actual direction of the process). ...
Using XMLHttpRequest - Web APIs
d to send and receive binary content. there are several well tested methods for coercing the response of an xmlhttprequest into sending binary data. these involve utilizing the overridemimetype() method on the xmlhttprequest object and is a workable solution. var oreq = new xmlhttprequest(); oreq.open("get", url); // retrieve data unprocessed as a binary string oreq.overridemimetype("text/plain;
charset=x-user-defined"); /* ... */ however, more modern techniques are available, since the responsetype attribute now supports a number of additional content types, which makes sending and receiving binary data much easier. for example, consider this snippet, which uses the responsetype of "arraybuffer" to fetch the remote content into a arraybuffer object, which stores the raw binary data. var ore...
... to perform the same effects using javascript you have to instruct the interpreter about everything. therefore, how to send forms in pure ajax is too complex to be explained here in detail. ...
.... formdata objects can be utilized in a number of ways with an xmlhttprequest. for examples, and explanations of how one can utilize formdata with xmlhttprequests, see the using formdata objects page. for didactic purposes here is a translation of the previous example transformed to use the formdata api. ...
animation - CSS: Cascading Style Sheets
></div> </div> </div> </div> </div> html,body { height: 100%; box-sizing: border-box; } pre { margin-bottom: 0; } svg { width: 1.5em; height: 1.5em; } button { width: 27px; height: 27px; background-size: 16px; background-position: center; background-repeat: no-repeat; border-radius: 3px; cursor: pointer; } button.play { background-image: url('data:image/svg+xml;
charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e...
...3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#play'); } button.pause { background-image: url('data:image/svg+xml;
charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e...
...ath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#pause'); } button.restart { background-image: url('data:image/svg+xml;
charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e...
<script>: The Script element - HTML: Hypertext Markup Language
he html5 specification urges authors to omit the attribute rather than provide a redundant mime type. in earlier browsers, this identified the scripting language of the embedded or imported (via the src attribute) code. javascript mime types are listed in the specification. module: causes the code to be treated as a javascript module. the processing of the script contents is not affected by the
charset and defer attributes. for information on using module, see our javascript modules guide. unlike classic scripts, module scripts require the use of the cors protocol for cross-origin fetching. any other value: the embedded content is treated as a data block which won't be processed by the browser. developers must use a valid mime type that is not a javascript mime type to denote data blocks. the...
... javascript modules guide. unlike classic scripts, module scripts require the use of the cors protocol for cross-origin fetching. any other value: the embedded content is treated as a data block which won't be processed by the browser. developers must use a valid mime type that is not a javascript mime type to denote data blocks. the src attribute will be ignored. deprecated attributes
charset if present, its value must be an ascii case-insensitive match for "utf-8". it’s unnecessary to specify the
charset attribute, because documents must use utf-8, and the script element inherits its character encoding from the document. language like the type attribute, this attribute identifies the scripting language in use. unlike the type attribute, however, this attribute’s possible v...
... recommendation html 4.01 specificationthe definition of '<script>' in that specification. recommendation ...
MIME types (IANA media types) - HTTP
ubtype might be plain (plain text), html (html source code), or calendar (for icalendar/.ics) files. each type has its own set of possible subtypes, and a mime type always has both a type and a subtype, never just one or the other. an optional parameter can be added to provide additional details: type/subtype;parameter=value for example, for any mime type whose main type is text, the optional
charset parameter can be used to specify the character set used for the characters in the data. if no
charset is specified, the default is ascii (us-ascii) unless overridden by the user agent's settings. to specify a utf-8 text file, the mime type text/plain;
charset=utf-8 is used. mime types are case-insensitive but are traditionally written in lowercase, with the exception of parameter values, whose ca...
...ext/javascript1.1 text/javascript1.2 text/javascript1.3 text/javascript1.4 text/javascript1.5 text/jscript text/livescript text/x-ecmascript text/x-javascript note: even though any given user agent may support any or all of these, you should only use text/javascript. it's the only mime type guaranteed to work now and into the future. some content you find may have a
charset parameter at the end of the text/javascript media type, to specify the character set used to represent the code's content. this is not valid, and in most cases will result in a script not being loaded. image types files whose mime type is image contain image data. the subtype specifies which specific image file format the data represents. only a few image types are used commonly enough to be co...
...es a boundary to separate the pieces. each piece has a content-type header with its actual type and a content-range of the range it represents. http/1.1 206 partial content accept-ranges: bytes content-type: multipart/byteranges; boundary=3d6b6a416f9b5 content-length: 385 --3d6b6a416f9b5 content-type: text/html content-range: bytes 100-200/1270 eta http-equiv="content-type" content="text/html;
charset=utf-8" /> <meta name="vieport" content --3d6b6a416f9b5 content-type: text/html content-range: bytes 300-400/1270 -color: #f0f0f2; margin: 0; padding: 0; font-family: "open sans", "helvetica --3d6b6a416f9b5-- importance of setting the correct mime type most web servers send unrecognized resources as the application/octet-stream mime type. for security reasons, most b...
Content negotiation - HTTP
url. these headers describe the preferred choice of the user. the server uses them as hints and an internal algorithm chooses the best content to serve to the client. the algorithm is server-specific and not defined in the standard. see, for example, the apache negotiation algorithm. the http/1.1 standard defines list of the standard headers that start server-driven negotiation (accept, accept-
charset, accept-encoding, accept-language). though strictly speaking user-agent is not in this list, it is sometimes also used to send a specific representation of the requested resource, though this is not considered as a good practice. the server uses the vary header to indicate which headers it actually used for content negotiation (or more precisely the associated response headers), so that caches ca...
...given by rounding to the nearest power of 2 and dividing that number by 1024. for example, 512 megabytes will be reported as 0.5. dpr indicates the client's device pixel ratio. viewport-width indicates the layout viewport width in css pixels. width indicates the resource width in physical pixels (in other words the intrinsic size of an image). the accept-
charset header the accept-
charset header indicates to the server what kinds of character encodings are understood by the user-agent. traditionally, it was set to a different value for each locale for the browser, like iso-8859-1,utf-8;q=0.7,*;q=0.7 for a western european locale. with utf-8 now being well-supported, being the preferred way of encoding characters, and to guarantee better privacy through ...
...what kinds of character encodings are understood by the user-agent. traditionally, it was set to a different value for each locale for the browser, like iso-8859-1,utf-8;q=0.7,*;q=0.7 for a western european locale. with utf-8 now being well-supported, being the preferred way of encoding characters, and to guarantee better privacy through less configuration-based entropy, browsers omit the accept-
charset header: internet explorer 8, safari 5, opera 11, firefox 10 and chrome 27 have abandoned this header. the accept-ch-lifetime header this is part of an experimental technology called client hints and is only available in chrome 61 or later. the accept-ch-lifetime header is used with the device-memory value of the accept-ch header and indicates the amount of time the device should opt-in to sh...
A typical HTTP session - HTTP
ng the client information about the data sent (e.g. type, data size, compression algorithm used, hints about caching). similarly to the block of http headers for a client request, these http headers form a block ending with an empty line. the final block is a data block, which contains the optional data. ...
...: keep-alive cache-control: s-maxage=300, public, max-age=0 content-language: en-us date: thu, 06 dec 2018 17:37:18 gmt etag: "2e77ad1dc6ab0b53a2996dfd4653c1c3" server: meinheld/0.6.1 strict-transport-security: max-age=63072000 x-content-type-options: nosniff x-frame-options: deny x-xss-protection: 1; mode=block vary: accept-encoding,cookie age: 7 <!doctype html> <html lang="en"> <head> <meta
charset="utf-8"> <title>a simple webpage</title> </head> <body> <h1>simple html5 webpage</h1> <p>hello, world!</p> </body> </html> notification that the requested resource has permanently moved: http/1.1 301 moved permanently server: apache/2.4.37 (red hat) content-type: text/html;
charset=utf-8 date: thu, 06 dec 2018 17:33:08 gmt location: https://developer.mozilla.org/ (this is the new link to...
...5, max=98 accept-ranges: bytes via: moz-cache-zlb05 connection: keep-alive content-length: 325 (the content contains a default page to display if the user-agent is not able to follow the link) <!doctype html... ...
dev/panel - Archive of obsolete content
however, it can receive messages from the add-on that created it, and the add-on can pass...
...o we've also provided a library called volcan.js which gives you a javascript api to the remote debugging protocol. note that at the moment volcan.js does not support the complete remote debugging protocol. we're still working on documenting exactly which messages are supported by volcan.js. ...
JXON - Archive of obsolete content
se;" /> </td> </tr> </table> <p> <input type="submit" value="purchase!" /> </p> </form> </div> other examples example #1: how to use jxon to create an html document instead of an xml document: /* the structure of my document */ var omyhtmlstruct = { "html": { "head": { "meta": { "@http-equiv": "content-type", "@content": "text/html;
charset=utf-8" }, "title": "my html document", "script": { "@type": "text/javascript", "keyvalue": "alert(\"welcome!\");" }, "style": "p:first-letter {\n font: italic bold 30px georgia, serif;\n}" }, "body": { "h1": "my html document", "p": "hello world!!" } } }; /* create the document */ var omyhtmldoc = jxon.unbuild(omyhtmlstruct...
...ont: italic bold 30px georgia, serif;\n}" }, "body": { "h1": "my html document", "p": "hello world!!" } } }; /* create the document */ var omyhtmldoc = jxon.unbuild(omyhtmlstruct, "http://www.w3.org/1999/xhtml"); …and here is the output of alert((new xmlserializer()).serializetostring(omyhtmldoc)): <html> <head> <meta http-equiv="content-type" content="text/html;
charset=utf-8" /> <title>my html document</title> <script type="text/javascript"> alert("welcome!"); </script> <style> p:first-letter { font: italic bold 30px georgia, serif; } </style> </head> <body> <h1>my html document</h1> <p>hello world!!</p> </body> </html> note: as we already said in the note within code considerations, despite the bidirectional conversion betwee...
Using SOAP in XULRunner 1.9 - Archive of obsolete content
ff between jqsoapclient.js and sasoapclient.js 42c42 < var jsout = $.xmltojson(xdata.responsexml); --- > var jsout = xmlobjectifier.xmltojson(xdata.responsexml); 46,60c46,62 < $.ajax({ < type: "post", < url: soapclient.proxy, < datatype: "xml", < processdata: false, < data: content, < complete: getresponse, < contenttype: soapclient.contenttype + ";
charset=\"" + soapclient.
charset + "\"", < beforesend: function(req) { < req.setrequestheader("method", "post"); < req.setrequestheader("content-length", soapclient.contentlength); < req.setrequestheader("soapserver", soapclient.soapserver); < req.setrequestheader("soapaction", soapreq.action); < } < }); --- > var xhr = new xmlhttprequest(); > xhr.mozbackgroun...
...questheader("soapaction", soapreq.action); < } < }); --- > var xhr = new xmlhttprequest(); > xhr.mozbackgroundrequest = true; > xhr.open('post', soapclient.proxy, true); > xhr.onreadystatechange = function() { > if (4 != xhr.readystate) { return; } > getresponse(xhr); > }; > var headers = { > 'method': 'post', > 'content-type': soapclient.contenttype + ';
charset="' + > soapclient.
charset + '"', > 'content-length': soapclient.contentlength, > 'soapserver': soapclient.soapserver, > 'soapaction': soapreq.action > }; > for (var h in headers) { xhr.setrequestheader(h, headers[h]); } > xhr.send(content); ...
Initialize the framework - Game development
phaser framework will generate the required <canvas> element. the game's html the html document structure is quite simple, as the game will be rendered entirely on the <canvas> element generated by the framework. ...
...choose an option that suits you best — i would recommend the min.js option as it keeps the source code smaller, and you are unlikely need to go through the source code anyway. save the phaser code inside a /js directory in the same location as your index.html file. update the src value of the first <script> element as shown above. walking through what we have so far at this point we have a
charset defined, <title> and some basic css in the header to reset the default margin and padding. we also have a <script> element to apply the phaser source code to the page. the body contains a second <script> element, where we will write the javascript code to render the game and control it. the <canvas> element is generated automatically by the framework. we are initializing it by creating a new pha...
2D maze game with device orientation - Game development
f the game defined inside. audio: the sound files used in the game. setting up the canvas we will be rendering our game on canvas, but we won't do it manually — this will be taken care of by the framework. let’s set it up: our starting point is the index.html file with the following content. ...
...the <body> contains initialization of the phaser framework and the definitions of the game states. var game = new phaser.game(320, 480, phaser.canvas, 'game'); the line above will initialize the phaser instance — the arguments are the width of the canvas, height of the canvas, rendering method (we're using canvas, but there are al...
How can we design for all types of users? - Learn web development
is proportional to the root element's font size and is expressed as portions of 1, like em. suppose we wanted a base font size of 16px and an h1 (main heading) at the equivalent of 32px, yet if within the h1 we find a span with the subheading class, it too must be rendered at the default font size (usually 16px). ...
...ines were too long. the solution? columns. of course the problem doesn't go away when we switch to the web. the reader's eyes act like a shuttle going from line to line. to make it easier on people's eyes, limit line width to around 60 or 70 characters. to achieve this, you can specify a size for your text's container. let's consider this html: <!doctype html> <html lang="en"> <head> <meta
charset="utf-8"> <title>font size experiment</title> </head> <body> <div class="container"> <h1>this is our main heading <span class="subheading">this is our subheading</span> </h1> <p>[lengthly text that spans many lines]</p> </div> </body> </html> we have a div with class container. we can style the div either to set its width (using the width property) or its maximum width ...
HTML basics - Learn web development
the html page in the place it appears. anatomy of an html document that wraps up the basics of individual html elements, but they aren't handy on their own. now we'll look at how individual elements are combined to form an entire html page. let's revisit the code we put into our index.html example (which we first met in the dealing with files article): <!doctype html> <html> <head> <meta
charset="utf-8"> <title>my test page</title> </head> <body> <img src="images/firefox-icon.png" alt="my test image"> </body> </html> here, we have the following: <!doctype html> — the doctype. it is required preamble. in the mists of time, when html was young (around 1991/92), doctypes were meant to act as links to a set of rules that the html page had to follow to be considered good h...
...s sometimes known as the root element. <head></head> — the <head> element. this element acts as a container for all the stuff you want to include on the html page that isn't the content you are showing to your page's viewers. this includes things like keywords and a page description that you want to appear in search results, css to style our content, character set declarations and more. <meta
charset="utf-8"> — this element sets the character set your document should use to utf-8 which includes most characters from the vast majority of written languages. essentially, it can now handle any textual content you might put on it. there is no reason not to set this and it can help avoid some problems later on. <title></title> — the <title> element. this sets the title of your page, which is th...
Getting started with HTML - Learn web development
/www.example.com' title='isn't this fun?'>a link to my example.</a> instead, you need to do this: <a href='http://www.example.com' title='isn't this fun?'>a link to my example.</a> anatomy of an html document individual html elements aren't very useful on their own. next, let's examine how individual elements combine to form an entire html page: <!doctype html> <html> <head> <meta
charset="utf-8"> <title>my test page</title> </head> <body> <p>this is my page</p> </body> </html> here we have: <!doctype html>: the doctype. when html was young (1991-1992), doctypes were meant to act as links to a set of rules that the html page had to follow to be considered good html. doctypes used to look something like this: <!doctype html public "-//w3c//dtd xhtml 1.0 transit...
... element. <head></head>: the <head> element. this element acts as a container for everything you want to include on the html page, that isn't the content the page will show to viewers. this includes keywords and a page description that would appear in search results, css to style content, character set declarations, and more. you'll learn more about this in the next article of the series. <meta
charset="utf-8">: this element specifies the character set for your document to utf-8, which includes most characters from the vast majority of human written languages. with this setting, the page can now handle any textual content it might contain. there is no reason not to set this, and it can help avoid some problems later. <title></title>: the <title> element. this sets the title of the page, which ...
nsICacheEntryDescriptor
pending requests will not get a cache descriptor. this is meant as a tool for clients that wish to instruct pending requests to skip the cache. void doomandfailpendingrequests( in nsresult status ); parameters status the access status. getmetadataelement() this method retrieves the meta data. meta data is a table of key/value string pairs. the strings do not have to conform to any particular
charset, but they must be null terminated. string getmetadataelement( in string key ); parameters key the key for retrieving the meta data. return value returns the string value containing the meta data for the provided key. markvalid() this method means that a writer must validate this cache object before any readers are given a descriptor to the object. void markvalid(); parameters none. openinpu...
... this method sets the time at which the cache entry should be considered invalid (in seconds since the epoch). void setexpirationtime( in pruint32 expirationtime ); parameters expirationtime the time for cache entry expiration (in seconds). setmetadataelement() this method sets the meta data. meta data is a table of key/value string pairs. the strings do not have to conform to any particular
charset, but they must be null terminated. void setmetadataelement( in string key, in string value ); parameters key the key for setting the meta data. value the value for setting the meta data. visitmetadata() this method means that the visitor will be called with key/value pair for each meta data element. void visitmetadata( in nsicachemetadatavisitor visitor ); parameters visitor the visito...
nsIChannel
responding http transaction. this interface must be used only from the xpcom main thread. implemented by netwerk/base/src/nsbasechannel.cpp and netwerk/protocol/http/src/nshttpchannel.cpp. method overview void asyncopen(in nsistreamlistener alistener, in nsisupports acontext); nsiinputstream open(); attributes attribute type description content
charset acstring the character set of the channel's content if available and if applicable. this attribute only applies to textual data. setting content
charset before the channel has been opened provides a hint to the channel on what the
charset should be. the behavior is similar to contenttype. the value of the content
charset attribute is a mixed case string. contentlength ...
...ype determined by the channel. setting contenttype between the time that asyncopen() is called and the time when onstartrequest is fired has undefined behavior at this time. the value of the contenttype attribute is a lowercase string. a value assigned to this attribute will be parsed and normalized as follows: any parameters (delimited with a ';') will be stripped. if a
charset parameter is given, then its value will replace the the content
charset attribute of the channel. the stripped contenttype will be lowercased. any implementation of nsichannel must follow these rules. notificationcallbacks nsiinterfacerequestor the notification callbacks for the channel. this is set by clients, who wish to provide a means to receive progress, stat...
nsIDOMSerializer
herits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/xmlextras/xmlserializer;1. to create an instance, use: var domserializer = components.classes["@mozilla.org/xmlextras/xmlserializer;1"] .createinstance(components.interfaces.nsidomserializer); method overview void serializetostream(in nsidomnode root, in nsioutputstream stream, in autf8string
charset); astring serializetostring(in nsidomnode root); methods serializetostream() the subtree rooted by the specified element is serialized to a byte stream using the character set specified. void serializetostream( in nsidomnode root, in nsioutputstream stream, in autf8string
charset ); parameters root the root of the subtree to be serialized. this could be any node, including a document...
...if this string is empty and root is a document, the document's character set will be used. ...
nsIJSON
ko 7.0 jsval decodetojsval(in astring str, in jscontext cx); native code only! jsobject decodefromstream(in nsiinputstream stream, in long contentlength); astring encode(in jsobject value); obsolete since gecko 7.0 astring encodefromjsval(in jsvaljsval value, in jscontext cx); native code only! void encodetostream(in nsioutputstream stream, in string
charset, in boolean writebom, in jsobject value); jsval legacydecode(in astring str); deprecated since gecko 2.0 jsval legacydecodefromstream(in astring str); deprecated since gecko 2.0 jsval legacydecodetojsval(in astring str, in jscontext cx); native code only! deprecated since gecko 2.0 methods decode() obsolete since gecko 7.0 (firefox 7.0 / thun...
... astring encodefromjsval( in jsval value, in jscontext cx ); parameters value a pointer to the jsval to encode. cx the javascript runtime context to use to encode the value. return value a json string representing the value. encodetostream() encodes a javascript object into json format, writing it to a stream. void encodetostream( in nsioutputstream stream, in string
charset, in boolean writebom in jsobject value ); parameters stream the nsioutputstream to which to write the json string.
charset the string encoding to use. only the five unicode encodings "utf-8", "utf-16le", "utf-16be", "utf-32le" and "utf-32be" are supported. writebom specify true if you wish to write a byte-order mark (bom) into the stream, otherwise specify false. value the java...
nsIMsgCompFields
c astring fcc2 astring followupto char * forcemsgencoding prbool forceplaintext prbool from astring hasrecipients prbool readonly new in thunderbird 23 indicates whether something is filled in in the to, cc, or bcc attribute. (bug 68784) messageid char * needtocheck
charset prbool indicates whether we need to check if the current document
charset can represent all the characters in the message body. it should be initialized to true and set to false when 'send anyway' is selected by a user. (bug 249530) newsgroups astring newshost char * newsposturl char * organization astring otherrand...
...astring securityinfo nsisupports subject astring templatename astring temporaryfiles char * obsolete temporaryfiles obsolete, do not use anymore to astring usemultipartalternative prbool uuencodeattachments prbool methods utility methods prbool check
charsetconversion ( out char * fallback
charset ); nsimsgrecipientarray splitrecipients ( in prunichar * recipients, in prbool emailaddressonly ); void convertbodytoplaintext ( ); attachment handling methods void addattachment ( in nsimsgattachment attachment ); void removeattachment ( in nsimsgattachment attachment ); void removeattachments ( ); ...
nsIMsgHeaderParser
ng which contains a list of header addresses, parses it into their component names and mailboxes. the returned value is the number of addresses, or a negative error code; the names and addresses are returned into the provided pointers as consecutive null-terminated strings. it is up to the caller to free them. note that some of the strings may be zero-length. the caller may pass nsnull for
charset and it will be interpreted as "us-ascii". either of the provided pointers may be null if the caller is not interested in those components. void parseheaderaddresses( in string line, out string names, out string addresses, out pruint32 numaddresses ); parameters line the header line to parse. names a string of the names in the header line. the names are separated by null-termin...
...s set to true, quote will not be removed in case the name part of the email contains a comma. wstring unquotephraseoraddrwstring( in wstring line, in boolean preserveintegrity ); parameters line the header line to parse. preserveintegrity missing description return value missing description exceptions thrown missing exception missing description remarks i think some of the
charset parameters might be obsolete... so this page is still w.i.p. see also ...
nsIMsgMessageService
nsiuri aurl); [noscript] void copymessages(in nsmsgkeyarrayptr keys, in nsimsgfolder srcfolder, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); void displaymessage(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, in string a
charsetoverride, out nsiuri aurl); void openattachment(in string acontenttype, in string afilename, in string aurl, in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener); void savemessagetodisk(in string amessageuri, in nsifilespec afile, in boolean ageneratedummyenvelope, in nsiurllistener aurllistener, out nsiuri aurl, in b...
...w nsimsgwindow for progress and status feedback return values aurl the new nsiuri of the message. (?) displaymessage() when you want a message displayed.... void displaymessage(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, in string a
charsetoverride, out nsiuri aurl); parameters amessageuri a uri representing the message to display. adisplayconsumer is (for now) an nsidocshell which the message is loaded into. amsgwindow nsimsgwindow for progress and status feedback aurllistener an nsiurllistener a
charsetoverride (optional) character set over ride to force the message to use. return values aurl...
XPCOM Interface Reference
amnsibinaryoutputstreamnsiblocklistpromptnsiblocklistservicensiboxobjectnsibrowserboxobjectnsibrowserhistorynsibrowsersearchservicensicrlinfonsicrlmanagernsicachensicachedeviceinfonsicacheentrydescriptornsicacheentryinfonsicachelistenernsicachemetadatavisitornsicacheservicensicachesessionnsicachevisitornsicachingchannelnsicancelablensicategorymanagernsichannelnsichanneleventsinknsichannelpolicynsi
charsetresolvernsichromeframemessagemanagernsichromeregistrynsiclassinfonsiclipboardnsiclipboardcommandsnsiclipboarddragdrophooklistnsiclipboarddragdrophooksnsiclipboardhelpernsiclipboardownernsicollectionnsicommandcontrollernsicommandlinensicommandlinehandlernsicommandlinerunnernsicomponentmanagernsicomponentregistrarnsicompositionstringsynthesizernsiconsolelistenernsiconsolemessagensiconsoleservicensic...
...icontentprefservice2nsicontentsecuritypolicynsicontentsniffernsicontentviewnsicontentviewmanagernsicontentviewernsicontrollernsicontrollersnsiconverterinputstreamnsiconverteroutputstreamnsicookiensicookie2nsicookieacceptdialognsicookieconsentnsicookiemanagernsicookiemanager2nsicookiepermissionnsicookiepromptservicensicookieservicensicookiestoragensicrashreporternsicryptohmacnsicryptohashnsicurrent
charsetlistenernsicyclecollectorlistenernsidbchangelistenernsidbfolderinfonsidnslistenernsidnsrecordnsidnsrequestnsidnsservicensidomcanvasrenderingcontext2dnsidomchromewindownsidomclientrectnsidomdesktopnotificationnsidomdesktopnotificationcenternsidomelementnsidomeventnsidomeventgroupnsidomeventlistenernsidomeventtargetnsidomfilensidomfileerrornsidomfileexceptionnsidomfilelistnsidomfilereadernsidomfontf...
Basic animations - Web APIs
e(img, x, y,imgw, imgh); // amount to move x += dx; } below is the <canvas> in which the image is scrolled. note that the width and height specified here must match the values of the canvasxzsize and canvasysize variables in the javascript code. ...
... position: fixed; z-index: -1; } body { margin: 0; padding: 0; background-color: rgba(0,0,0,0.05); } </style> </head> <body> <canvas id="cw"></canvas> </body> </html> output snake game <!doctype html> <html lang="en"> <head> <meta
charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>nokia 1100:snake..member berries</title> </head> <body> <div class="keypress hide"> <div class="up" onclick="emit(38)">↑</div> <div class="right" onclick="emit(39)">→</div> <div class="left" onclick="emit(37)...
Basic usage of canvas - Web APIs
if (canvas.getcontext) { var ctx = canvas.getcontext('2d'); // drawing code here } else { // canvas-unsupported code here } a skeleton template here is a minimalistic template, which we'll be using as a starting point for later examples. note: it is not good practice to embed a script inside html. we do it here to keep the example concise. ...
...ny other event handler, as long as the page has been loaded first. here is how a template would look in action. as shown here, it is initially blank. a simple example to begin, let's take a look at a simple example that draws two intersecting rectangles, one of which has alpha transparency. we'll explore how this works in more detail in later examples. ...
HTMLAnchorElement - Web APIs
isplay the linked resource. htmlanchorelement.text is a domstring being a synonym for the node.textcontent property. htmlanchorelement.type is a domstring that reflects the type html attribute, indicating the mime type of the linked resource. htmlhyperlinkelementutils.username is a usvstring containing the username specified before the domain name. obsolete properties htmlanchorelement.
charset is a domstring representing the character encoding of the linked resource. htmlanchorelement.coords is a domstring representing a comma-separated list of coordinates. htmlanchorelement.name is a domstring representing the anchor name. htmlanchorelement.rev is a domstring representing that the rev html attribute, specifying the relationship of the link object to the target object. ...
...thname, port, protocol, search, and hash, have been moved to the htmlhyperlinkelementutils mixin, and htmlanchorelement implements this mixin. html5the definition of 'htmlanchorelement' in that specification. recommendation the methods blur() and focus(), as well as the properties tabindex and accesskey, are now defined on htmlelement. the following properties are now obsolete:
charset, coords, name, rev, and shape. the following properties have been added: hash, host, hostname, media, pathname, port, protocol, rellist, search, and text. document object model (dom) level 2 html specificationthe definition of 'htmlanchorelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom...
HTMLLinkElement - Web APIs
ibute, as a list of tokens. htmllinkelement.sizes read only is a domsettabletokenlist that reflects the sizes html attribute, as a list of tokens. linkstyle.sheet read only returns the stylesheet object associated with the given element, or null if there is none. htmllinkelement.type is a domstring representing the mime type of the linked resource. obsolete properties htmllinkelement.
charset is a domstring representing the character encoding for the target resource. htmllinkelement.rev is a domstring representing the reverse relationship of the linked resource from the resource to the document. note: currently the w3c html 5.2 spec states that rev is no longer obsolete, whereas the whatwg living standard still has it labeled obsolete. until this discrepancy is resolved, you s...
... living standardthe definition of 'htmllinkelement' in that specification. living standard adds the following properties: crossorigin, referrerpolicy, and as. html 5.1the definition of 'htmllinkelement' in that specification. recommendation html5the definition of 'htmllinkelement' in that specification. recommendation the following properties are now obsolete:
charset, rev, and shape. the following properties have been added: rellist, and sizes. document object model (dom) level 2 html specificationthe definition of 'htmllinkelement' in that specification. obsolete added a second inheritence, the linkstyle interface. document object model (dom) level 1 specificationthe definition of 'htmllinkelement' in that specification. obsole...
Synchronous and asynchronous requests - Web APIs
ted. if the result is 200 -- http's "ok" result -- the document's text content is output to the console. example: synchronous http request from a worker one of the few cases in which a synchronous request does not usually block execution is the use of xmlhttprequest within a worker. ...
...mpts to submit data to a server by using a synchronous xmlhttprequest in an unload handler. this results in the unloading of the page to be delayed. window.addeventlistener('unload', logdata, false); function logdata() { var client = new xmlhttprequest(); client.open("post", "/log", false); // third parameter indicates sync xhr. :( client.setrequestheader("content-type", "text/plain;
charset=utf-8"); client.send(analyticsdata); } using the sendbeacon() method, the data will be transmitted asynchronously to the web server when the user agent has had an opportunity to do so, without delaying the unload or affecting the performance of the next navigation. the following example shows a theoretical analytics code pattern that submits data to a server by using the sendbeacon() metho...
Printing - Developer guides
eventlistener() is preferred. examples here are some common examples. ...
...int an external page without opening it if you want to be able to print an external page without opening it, you can utilize a hidden <iframe> (see: htmliframeelement), automatically removing it after the user prints its contents. ...
HTML attribute reference - HTML: Hypertext Markup Language
elements in html have attributes; these are additional values that configure the elements or adjust their behavior in various ways to meet the criteria the users want. attribute list attribute name elements description accept <form>, <input> list of types the server accepts, typically a file type. accept-
charset <form> list of supported
charsets. accesskey global attribute keyboard shortcut to activate or add focus to the element. action <form> the uri of a program that processes the information submitted via the form. align <applet>, <caption>, <col>, <colgroup>, <hr>, <iframe>, <img>, <table>, <tbody>, <td>, <tfoot> , <th>, <thead>, <tr> specifies the horizontal alignment of the element. al...
... the css border property instead. buffered <audio>, <video> contains the time range of already buffered media. capture <input> from the html media capturethe definition of 'media capture' in that specification.spec, specifies a new file can be captured. challenge <keygen> a challenge string that is submitted along with the public key.
charset <meta>, <script> declares the character encoding of the page or script. checked <command>, <input> indicates whether the element should be checked on page load. cite <blockquote>, <del>, <ins>, <q> contains a uri which points to the source of the quote or change. class global attribute often used with css to style elements with common properties.
<input type="hidden"> - HTML: Hypertext Markup Language
y browser's developer tools or "view source" functionality. do not rely on hidden inputs as a form of security. ...
... using hidden inputs as mentioned above, hidden inputs can be used anywhere that you want to include data the user can't see or edit along with the form when it's submitted to the server. let's look at some examples that illustrate its use. ...
Accept-Patch - HTTP
s. two others content encoding, bzip and bzip2, are sometimes used, though not standard. they implement the algorithm used by these two unix programs. note that the first one was discontinued due to patent licensing problems. ...
... the first one was discontinued due to patent licensing problems. ...
Content-Disposition - HTTP
sition: form-data; name="fieldname"; filename="filename.jpg" directives name is followed by a string containing the name of the html field in the form that the content of this subpart refers to. when dealing with multiple files in the same field (for example, the multiple attribute of an <input type="file"> element), there can be several subparts with the same name. a name with a value of '_
charset_' indicates that the part is not an html field, but the default
charset to use for parts without explicit
charset information. filename is followed by a string containing the original name of the file transmitted. the filename is always optional and must not be used blindly by the application: path information should be stripped, and conversion to the server file system rules should be done. th...
...ventual "save as" dialog presented to the user. filename* the parameters filename and filename* differ only in that filename* uses the encoding defined in rfc 5987. when both filename and filename* are present in a single header field value, filename* is preferred over filename when both are understood. examples a response triggering the "save as" dialog: 200 ok content-type: text/html;
charset=utf-8 content-disposition: attachment; filename="cool.html" content-length: 21 <html>save me!</html> this simple html file will be saved as a regular download rather than displayed in the browser. most browsers will propose to save it under the cool.html filename (by default). an example of an html form posted using the multipart/form-data format that makes use of the content-disposition hea...
Content-Location - HTTP
d) say you're creating a new blog post through a site's api: put /new/post host: example.com content-type: text/markdown # my first blog post! i made this through `example.com`'s api. i hope it worked. the site returns a generic success message confirming the post was published. the server specifies where the new post is with content-location: http/1.1 201 created content-type: text/plain;
charset=utf-8 content-location: /my-first-blog-post ✅ success! indicating the url of a transaction's result say you have a <form> for sending money to another user of a site. <form action="/send-payment" method="post"> <p> <label>who do you want to send the money to? <input type="text" name="recipient"> </label> </p> <p> <label>how much? <input type="number" name="am...
...e="text" name="recipient"> </label> </p> <p> <label>how much? <input type="number" name="amount"> </label> </p> <button type="submit">send money</button> </form> when the form is submitted, the site generates a receipt for the transaction. ...
WWW-Authenticate - HTTP
the http www-authenticate response header defines the authentication method that should be used to gain access to a resource. the www-authenticate header is sent along with a 401 unauthorized response. header type response header forbidden header name no syntax www-authenticate: <type> realm=<realm>[,
charset="utf-8"] directives <type> authentication type. a common type is "basic". iana maintains a list of authentication schemes. realm=<realm> a description of the protected area. if no realm is specified, clients often display a formatted hostname instead.
charset=<
charset> tells the client the server's prefered encoding scheme when submitting a username and password. the only allowed value is the case insensitive string "utf-8". this does not relate t...
...lls the client the server's prefered encoding scheme when submitting a username and password. the only allowed value is the case insensitive string "utf-8". this does not relate to the encoding of the realm string. examples typically, a server response contains a www-authenticate header that looks like these: www-authenticate: basic www-authenticate: basic realm="access to the staging site",
charset="utf-8" see also http authentication for examples on how to configure apache or nginx servers to password protect your site with http basic authentication. specifications specification title rfc 7235, section 4.1: www-authenticate http/1.1: authentication rfc 7617 the 'basic' http authentication scheme ...
Intl.Locale.prototype.collation - JavaScript
rom region to region and language to language. the collation property helps to make it easier for javascript programmers to access the collation type used by a particular locale. below is a table with the available collation types, taken from the unicode collation specification. valid collation types collation type description big5han pinyin ordering for latin, big5
charset ordering for cjk characters (used in chinese) compat a previous version of the ordering, for compatibility dict dictionary style ordering (such as in sinhala) the direct collation type has been deprected. do not use. direct binary code point order (used in hindi) ducet the default unicode collation element table order ...
...tyle ordering (such as in sinhala) the direct collation type has been deprected. do not use. ...
Communicating With Other Scripts - Archive of obsolete content
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 = mod.pagemod({ include: pageurl, contentscriptfile: self.data.url("content-script.js"), contentscriptwhen: "ready" }) tabs.open(pageurl); the target web page "page.html" includes a button and a page script: <html> <head> <meta
charset="utf-8"> </head> <body> <input id="message" type="button" value="send a message"/> <script type="text/javascript" src="page-script.js"></script> </body> </html> the content script "content-script.js" adds an event listener to the button, that sends a custom event containing a message: var messenger = document.getelementbyid("message"); messenger.addeventlistener("click", sendcusto...
Interacting with page scripts - Archive of obsolete content
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 = mod.pagemod({ include: pageurl, contentscriptfile: self.data.url("content-script.js"), contentscriptwhen: "ready" }) tabs.open(pageurl); the target web page "page.html" includes a button and a page script: <html> <head> <meta
charset="utf-8"> </head> <body> <input id="message" type="button" value="send a message"/> <script type="text/javascript" src="page-script.js"></script> </body> </html> the content script "content-script.js" adds an event listener to the button, that sends a custom event containing a message: var messenger = document.getelementbyid("message"); messenger.addeventlistener("click", sendcusto...
clipboard - Archive of obsolete content
r sit amet"); var contents = clipboard.get(); set the clipboard contents to some html. var clipboard = require("sdk/clipboard"); clipboard.set("<blink>lorem ipsum dolor sit amet</blink>", "html"); if the clipboard contains html content, open it in a new tab. var clipboard = require("sdk/clipboard"); if (clipboard.currentflavors.indexof("html") != -1) require("sdk/tabs").open("data:text/html;
charset=utf-8," + clipboard.get("html")); set the clipboard contents to an image. var clipboard = require("sdk/clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0qkaiawd0eyqe3q993aq3cbsukpygfsnty" + "n5ugbqpk0baadgp0brdwxwlweaaaaagpsa3rzdaaaaahgpcgrpganzq2fg" + "bwrr9aaaaabjru5erkjggg%3d%3d"); if...
request - Archive of obsolete content
you're retrieving text content which was encoded as iso-8859-1 (latin 1), it will be given a content type of "utf-8" and certain characters will not display correctly. to force the response to be interpreted as latin-1, use overridemimetype: var request = require("sdk/request").request; var quijote = request({ url: "http://www.latin1files.org/quijote.txt", overridemimetype: "text/plain;
charset=latin1", oncomplete: function (response) { console.log(response.text); } }); quijote.get(); anonymous boolean if true, the request will be sent without cookies or authentication headers. this option sets the mozanon property in the underlying xmlhttprequest object. defaults to false. request the request object is used to make get, head, post, put, or delete net...
net/url - Archive of obsolete content
to read content from a uri. globals functions readuri(uri, options) reads a uri and returns a promise. parameters uri : string the url, as a string, to load. options : object optional options: name type sync boolean if this option is set to true, the promise returned will be resolved synchronously. defaults to false if not provided.
charset string the character set to use when read the content of the uri given. defaults to utf-8 if not provided. returns promise : the promise that will be resolved with the content of the url given. ...
Storing annotations - Archive of obsolete content
e able to click links in the panel, but we want to open them in the main browser window rather than the panel. so the content script binds a click handler to the links which will send the url to the add-on. save this file in data/list as annotation-list.js. ...
File I/O - Archive of obsolete content
ata is a string // you can also optionally pass a flags parameter here. it defaults to // fileutils.mode_wronly | fileutils.mode_create | fileutils.mode_truncate; var ostream = fileutils.opensafefileoutputstream(file); var converter = components.classes["@mozilla.org/intl/scriptableunicodeconverter"]. createinstance(components.interfaces.nsiscriptableunicodeconverter); converter.
charset = "utf-8"; var istream = converter.converttoinputstream(data); // the last argument (the callback) is optional. netutil.asynccopy(istream, ostream, function(status) { if (!components.issuccesscode(status)) { // handle error! return; } // data has been written to the file. }); copy a stream to a file this function copies all of the data from an input stream to a file asyncronous...
Forms related code snippets - Archive of obsolete content
here are some <form> related code snippets. date picker (before implementing it in a working environment, please read the note about the const statement compatibility) <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html;
charset=utf-8" /> <title>datepicker example - mdn</title> <script type="text/javascript"> /*\ |*| |*| datepicker example mdndeveloper network |*| |*| https://developer.mozilla.org/docs/code_snippets/forms |*| https://developer.mozilla.org/user:fusionchess |*| |*| this snippet is released under the gnu public license, version 3 or later. |*| http://www.gnu.org/licenses/gpl-3.0-standalone.html |*| \*/ (function () { function datepicker (otarget) { const otable = document.createelement("table"), ohrow = document.createelement("...
CSS3 - Archive of obsolete content
k) with the css box-decoration-break property. css custom properties for cascading variables module level 1 candidate recommendation defines a mechanism allowing to define variables in css. compositing and blending level 1 candidate recommendation css syntax level 3 candidate recommendation clarifies how
charsets are determined; minor changes in parsing and tokenization algorithms. css grid layout candidate recommendation add a grid layout to the css display property and several new css properties to control it: grid, grid-area, grid-auto-columns, grid-auto-flow, grid-auto-position, grid-auto-rows, grid-column, grid-column-start, grid-column-end, grid-row, grid-row-start, grid...
Index - Archive of obsolete content
needshelp, xul properties, xul reference no summary! 1421 disableautoselect xul properties, xul reference no summary! 1422 disabled xul properties, xul reference no summary! 1423 dlgtype xul properties, xul reference no summary! 1424 docshell xul properties, xul reference no summary! 1425 document
charsetinfo xul properties, xul reference no summary! 1426 editable xul properties, xul reference no summary! 1427 editingcolumn xul properties, xul reference no summary! 1428 editingrow xul properties, xul reference no summary! 1429 editingsession xul properties, xul reference no summary! 1430 editor...
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
location: "js frame :: file:////usr/lib/thunderbird-3.0b2/defaults/autoconfig/prefcalls.js :: getldapattributes :: line 174" data: no] bug 295329 had been re-opened . autoconfig option and ldap support in thunderbird 1.5.x fortunately, autoconfig is now part of thunderbird default packages. moz_ldap_xpcom=1 and moz_extensions_default="wallet spellcheck xmlextras pref webservices universal
charset auth" are now present in the default configure script. see bug 295329 for details. add the autoconfig option for old thunderbird 1.0.x by default, autoconfig did not make part of the binaries distribution of thunderbird (1.0.x). it was apparently supposed to increase the load of the binary for a feature not used by lots of individuals. however for enterprise deployment, it is vital! so we neede...
Editor Embedding Guide - Archive of obsolete content
hould be considered examples of base functionality and in no way imply that this command won't handle other fonts. cmd_align sets the alignment for the lines contained in the current selection. getcommandstate "state_attribute" (cstring) docommand "state_attribute" (cstring) "left", "right", "center", "justify" cmd_inserthtml cmd_insertlinknoui cmd_insertimagenoui cmd_inserthr cmd_
charset sets the
charset for the document. getcommandstate "state_attribute" (cstring) docommand "state_attribute" (cstring) note there must be a clear undo stack or this will not work. cmd_copy copies current selection. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this...
jspage - Archive of obsolete content
rl),a=k.method.tolowercase(); switch($type(g)){case"element":g=document.id(g).toquerystring();break;case"object":case"hash":g=hash.toquerystring(g);}if(this.options.format){var j="format="+this.options.format; g=(g)?j+"&"+g:j;}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post";}if(this.options.urlencoded&&a=="post"){var c=(this.options.encoding)?";
charset="+this.options.encoding:""; this.headers.set("content-type","application/x-www-form-urlencoded"+c);}if(this.options.nocache){var f="nocache="+new date().gettime();g=(g)?f+"&"+g:f; }var e=b.lastindexof("/");if(e>-1&&(e=b.indexof("#"))>-1){b=b.substr(0,e);}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null;}this.xhr.open(a.touppercase(),b,this.options.async); this.xhr.onreadystatechange=this.on...
The new nsString class implementation (1999) - Archive of obsolete content
ort the nsstring idiom, and could be extended to serve as the general memory allocation idiom. here's it's api: class nsimemoryagent : nsisupports { void* new(nsint32 asize)=0; //used for both alloc and realloc void* delete(void* aptr)=0; }; internationalization the new nsstrimpl/nsstring implementation addresses at least two of the primary concerns of our i18n team. first, nsstrimpl offers
charset conversion hooks for use during construction, comparison and assignment. (these are stubbed out today awaiting their review and implementation). second, they are concerned that programmers be prevented from abusing the string classes in a number of ways. to wit: they want to ensure that the underlying buffers cannot be corrupted or altered erroneously they want to ensure that the appropriate s...
Elements - Archive of obsolete content
cripting. (see bug 83830 for <table> specifics). css: div { -moz-binding: url(mybinding.xml#default); } dom: elementreference.style.mozbinding = "url(mybinding.xml#default)"; in both cases above we are using binding with id="default" contained in file mybinding.xml starting with firefox 3, you can also use a data: url to embed the binding inline: div { -moz-binding: url(data:text/xml;
charset=utf-8,%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3cbindings%20id%3d%22xbltestbindings%22%20xmlns%3d%22http%3a//www.mozilla.org/xbl%22%3e%0a%20%20%3cbinding%20id%3d%22xbltest%22%3e%3ccontent%3epass%3c/content%3e%3c/binding%3e%0a%3c/bindings%3e%0a); } since data: urls don't support fragment identifiers, the first binding found in the embedded xml is used instead. keep in mind that the binding is st...
Example Sticky Notes - Archive of obsolete content
notes.html all parts are made and commented by vk [schools_ring@yahoo.com]. all rights are given to the world. view this example <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html401/strict.dtd"> <html> <head> <title>xbl demo : sticky notes</title> <meta http-equiv="content-type" content="text/html;
charset=iso-8859-1"> <style type="text/css"> body { background-color: #ffffff; color: #000000; font: 1em verdana, sans-serif; } h1 { font-size: 1.5em; } /* binding: */ .sticker { -moz-binding: url(notes.xml#default); } </style> </head> <body> <h1><a href="http://developer.mozilla.org/en/docs/xbl:xbl_1.0_reference">xbl</a> demo : sticky notes</h1> <div class="sticker"><p>acme, inc. fax - respond today.</p></div> <div class="sticker"><p>don't forget the...
Index - Archive of obsolete content
n needshelp, xul properties, xul reference no summary! 690 disableautoselect xul properties, xul reference no summary! 691 disabled xul properties, xul reference no summary! 692 dlgtype xul properties, xul reference no summary! 693 docshell xul properties, xul reference no summary! 694 document
charsetinfo xul properties, xul reference no summary! 695 editable xul properties, xul reference no summary! 696 editingcolumn xul properties, xul reference no summary! 697 editingrow xul properties, xul reference no summary! 698 editingsession xul properties, xul reference no summary! 699 editor ...
International characters in XUL JavaScript - Archive of obsolete content
ll be the same as the one used by the xul file (which can be specified using an encoding attribute in the <?xml?> tag). by default this will use utf-8, which can represent virtually all characters in the world. if the script file is loaded via http, the http header can contain a character encoding declaration as part of the content-type header, for example: content-type: application/javascript;
charset=utf-8 if no
charset parameter is specified, the same rules as above apply. cross-version compatibility if you want the same code to work in both gecko 1.8 and earlier versions, you must limit yourself to ascii. however, you can use unicode escapes – the earlier example rewritten using them would be: var text = "ein sch\u00f6nes beispiel eines mehrsprachigen textes: \u65e5\u672c\u8a9e"; a...
addTab - Archive of obsolete content
}) return type: tab element opens a new tab that loads a page with the specified url. the rest of the parameters are optional. the row of tabs will appear if needed. firefox 3.6 note the second form of this method was added in firefox 3.6; it allows you to specify the parameters by name, in any order. it also adds the relatedtocurrent parameter; firefox uses this to decide whether the new tab should be inserted next to the current tab. see code snippets: tabbed browser for examples. ...
loadOneTab - Archive of obsolete content
}) return type: tab element opens a new tab that loads a page with the specified url. the rest of the parameters are optional. this method works the same as addtab except for the loadinbackground parameter which allows you to choose whether to open the new tab in foreground or background. there's also no owner parameter as the owner tab is specified automatically. ...
loadURI - Archive of obsolete content
« xul reference home note: this is the xul method on <browser> / <tabbrowser>, not the global function in chrome://browser/content/browser.js. please check which one you're documenting! (this one has no post data parameter, see loaduriwithflags for a version that does) loaduri( uri, referrer,
charset ) return type: no return value load a url into the document, with the given referrer and character set. the first argument should be a string, not a nsiuri object. to get a string from an nsiuri, use nsiuri.spec or nsiuri.asciispec ...
loadURIWithFlags - Archive of obsolete content
in addition to the flags allowed for the reloadwithflags method, the following flags are also valid: load_flags_is_refresh: this flag is used when the url is loaded because of a meta tag refresh or redirect. load_flags_is_link: this flag is used when the url is loaded because a user clicked on a link. the http referer header is set accordingly. load_flags_bypass_history: do not add the url to the session history. ...
reloadWithFlags - Archive of obsolete content
navigation interface). you may combine flags using a or symbol ( | ). load_flags_none: no special flags. the document is loaded normally. load_flags_bypass_cache: reload the page, ignoring if it is already in the cache. this is the flag used when the reload button is pressed while the shift key is held down. load_flags_bypass_proxy: reload the page, ignoring the proxy server. load_flags_
charset_change: this flag is used if the document needs to be reloaded because the character set changed. ...
Property - Archive of obsolete content
currentindex currentitem currentnotification currentpage currentpane currentset currenturi customtoolbarcount database datasources date dateleadingzero datevalue decimalplaces decimalsymbol defaultbutton defaultvalue description dir disableautocomplete disableautocomplete disableautoselect disabled disablekeynavigation dlgtype docshell document
charsetinfo editable editingcolumn editingrow editingsession editor editortype emptytext deprecated since gecko 2 enablecolumndrag eventnode firstordinalcolumn firstpermanentchild flex focused focuseditem forcecomplete group handlectrlpageupdown handlectrltab hasuservalue height hidden hideseconds highlightnonmatches homepage hour hourleadingzero id...
Using XForms and PHP - Archive of obsolete content
introduction a few tips on using xforms and php together. returning xml data to either serve a page (with xforms in it) or to generate data used as instance data for xforms, the page needs to be served as xml, for example application/xhtml+xml. to do that, you need to use the header() php function: <?php header("content-type: application/xhtml+xml;
charset=utf-8"); ... ?> but remember this (quote from php documentation): remember that header() must be called before any actual output is sent, either by normal html tags, blank lines in a file, or from php. it is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. the same problem exists when using a single ph...
Building up a basic demo with A-Frame - Game development
a-frame javascript library file inside your directory (check the github repository for latest stable a dev builds). open the a-frame documentation in a separate tab — it is useful to refer to. html structure the first step is to create an html document — inside your project directory, create a new index.html file, and save the follow html inside it: <!doctype html> <html> <head> <meta
charset="utf-8"> <title>mdn games: a-frame demo</title> <script src="aframe.min.js"></script> </head> <body> <!-- html goes here --> </body> </html> this contains some basic information like the document
charset and <title>. the <script> element includes the a-frame framework in the page; we will write our example code inside the <body> element. initializing the scene a scene is the place where ...
Building up a basic demo with Babylon.js - Game development
ou are using a modern browser with good webgl support, such as the latest firefox or chrome. creating a directory to store your experiments in. saving a copy of the latest babylon.js engine inside your directory. opening the babylon.js documentation in a separate tab — it is useful to refer to. ...
Building up a basic demo with the PlayCanvas engine - Game development
you are using a modern browser with good webgl support, such as the latest firefox or chrome. creating a directory to store your experiments in. saving a copy of the latest playcanvas engine inside your directory. opening the playcanvas documentation in a separate tab — it is useful to refer to. html structure here's the html structure we will use. ...
Building up a basic demo with Three.js - Game development
re you are using a modern browser with good webgl support, such as the latest firefox or chrome. create a directory to store your experiments in. save a copy of the latest minimized three.js library inside your directory. open the three.js documentation in a separate tab — it is useful to refer to. ...
GLSL Shaders - Game development
etup to start with the webgl shaders you don't need much. you should: make sure you are using a modern browser with good webgl support, such as the latest firefox or chrome. create a directory to store your experiments in. save a copy of the latest minimized three.js library inside your directory. html structure here's the html structure we will use. ...
Create the Canvas and draw on it - Game development
tructure to render the game inside. this can be done using html and the <canvas> element. the game's html the html document structure is quite simple, as the game will be rendered entirely on the <canvas> element. using your favourite text editor, create a new html document, save it as index.html, in a sensible location, and add the following code to it: <!doctype html> <html> <head> <meta
charset="utf-8" /> <title>gamedev canvas workshop</title> <style> * { padding: 0; margin: 0; } canvas { background: #eee; display: block; margin: 0 auto; } </style> </head> <body> <canvas id="mycanvas" width="480" height="320"></canvas> <script> // javascript code goes here </script> </body> </html> we have a
charset defined, <title> and some basic css in the header. the body ...
Quality values - MDN Web Docs Glossary: Definitions of Web-related terms
al specifiers like text/html;level=1. these increase the specificity of the value. their use is extremely rare. browser-specific information firefox starting with firefox 18, the quality factor values are clamped to 2 decimal places. they used to be clamped to only 1 decimal place in earlier versions (bug 672448). more information http headers using q-values in their syntax: accept, accept-
charset, accept-language, accept-encoding, te. ...
Character encoding - MDN Web Docs Glossary: Definitions of Web-related terms
an encoding defines a mapping between bytes and text. a sequence of bytes allows for different textual interpretations. by specifying a particular encoding (such as utf-8), we specify how the sequence of bytes is to be interpreted. for example, in html we normally declare a character encoding of utf-8, using the following line: <meta
charset="utf-8"> this ensures that you can use characters from just about any human language in your html document, and they will display reliably. learn more general knowledge character encoding on w3c character encoding on wikipedia ...
Getting started with CSS - Learn web development
objective: to understand the basics of linking a css document to an html file, and be able to do simple text formatting with css. starting with some html our starting point is an html document. you can copy the code from below if you want to work on your own computer. save the code below as index.html in a folder on your machine. <!doctype html> <html lang="en"> <head> <meta
charset="utf-8"> <title>getting started with css</title> </head> <body> <h1>i am a level one heading</h1> <p>this is a paragraph of text. in the text is a <span>span element</span> and also a <a href="http://example.com">link</a>.</p> <p>this is the second paragraph. it contains an <em>emphasized</em> element.</p> <ul> <li>item one</li> <li>item two</li> <...
How to build custom form controls - Learn web development
width : 100%; overflow : hidden; white-space : nowrap; text-overflow: ellipsis; vertical-align: top; } we don't need an extra element to design the down arrow; instead, we're using the :after pseudo-element. it could also be implemented using a simple background image on the select class. ...
Dealing with files - Learn web development
d make it display the image you chose in the article "what will your website look like?" copy the image you chose earlier into your images folder. open up your index.html file, and insert the following code into the file exactly as shown. don't worry about what it all means for now — we'll look at the structures in more detail later in the series. <!doctype html> <html> <head> <meta
charset="utf-8"> <title>my test page</title> </head> <body> <img src="" alt="my test image"> </body> </html> the line <img src="" alt="my test image"> is the html code that inserts an image into the page. we need to tell the html where the image is. the image is inside the images directory, which is in the same directory as index.html. to walk down the file structure from index.html to ...
Document and website structure - Learn web development
; often placed inside <main>. footer: <footer>. active learning: exploring the code for our example our example seen above is represented by the following code (you can also find the example in our github repository). we'd like you to look at the example above, and then look over the listing below to see what parts make up what section of the visual. ...
Manipulating documents - Learn web development
an manipulate the dom with javascript after the page has been rendered. we have created a simple example page at dom-example.html (see it live also). try opening this up in your browser — it is a very simple page containing a <section> element inside which you can find an image, and a paragraph with a link inside. ...
A first splash into JavaScript - Learn web development
tunity to practice thinking like a programmer throughout the course. with that in mind, let's look at the example we'll be building up in this article, and review the general process of dissecting it into tangible tasks. ...
Getting started with Svelte - Learn web development
nt and compiles them into the public/build/bundle.css file. it also compiles the markup and <script> section of every component and stores the result in public/build/bundle.js. it also adds the code in src/main.js to reference the features of each component. ...
Package management basics - Learn web development
x.js file to work with, but otherwise it is very unopinionated about how you structure your project. other tools can be very different, but at least parcel makes it easy for our initial experiment. so now we need to add an index.html file to our working directory. create index.html in your test directory, and give it the following contents: <!doctype html> <html lang="en-us"> <head> <meta
charset="utf-8"> <title>my test page</title> </head> <body> <script src="./index.js"></script> </body> </html> next, we need to add an index.js file in the same directory as index.html. for now index.js can be empty; it just needs to exist. create this now. having fun with parcel now we’ll run our newly installed parcel tool. in your terminal, run the following command: parcel index.
Embedding API for Accessibility
oolpref("network.cookie.warnaboutcookies", boolwarn); moz 0.8 fonts setcharpref("font.name.monospace.x-western", newfontname); setcharpref("font.name.serif.x-western", newfontname); 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 fo...
Mozilla’s UAAG evaluation report
look - all font sizes are increased the same percentage. zooming can be controlled via hotkeys ctrl+plus and ctrl+minus the prefs are at preferences, appearances, fonts there is also a hidden pref line that can be added to prefs.js, if you just want to change the minimum font size for a certain font: user_pref("font.minimum-size.x-western", newfontsizeinpoints); 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 4.2 configure font family. (p1) c can be changed through preferences or user style sheet the prefs are at preferences, appearances, fonts 4.3 configure text colors. (p1) vg can be changed through preferences or by editing the prefs.js file ...
Debugging Frame Reflow
/nightlydebug.app/contents/macos" \ ./obj-ff-dbg/dist/nightlydebug.app/contents/macos/firefox-bin > logfile.txt after loading your testcase, the log file will contain the promised information. ...
How Mozilla determines MIME Types
mozilla 1.6alpha. http for http uris mozilla usually gets a mime type sent from the server, and uses it. contrary to internet explorer's mime type guessing, mozilla will generally not sniff the type of the document. however, starting in mozilla 1.7alpha, mozilla does do content sniffing, like this: when the content-type sent by the server is one of (case-sensitively) text/plain text/plain;
charset=iso-8859-1 text/plain;
charset=iso-8859-1 and the server did not send a content-encoding header, mozilla will sniff the first block of data it gets and check for non-text bytes. text bytes are 9-13, 27, and 31-255. when encountering a non-text byte, the helper app dialog will be shown, showing the mime type corresponding to the extension of the file. also, for images loaded via <img src>, moz...
CustomizableUI.jsm
and_dom[cui-areatype="menu-panel"],'; css += ' toolbarpaletteitem[place="palette"] > #id_of_my_widget_within_customizableui_and_dom {'; css += ' list-style-image: url("chrome://branding/content/icon32.png");'; //a 32px x 32px icon for when in toolbar css += ' }'; css += '}'; var cssenc = encodeuricomponent(css); var newuriparam = { aurl: 'data:text/css,' + cssenc, aorigin
charset: null, abaseuri: null } var cssuri = services.io.newuri(newuriparam.aurl, newuriparam.aorigin
charset, newuriparam.abaseuri); //store this in a global var so you can call it when removing the widget sss.loadandregistersheet(cssuri, sss.author_sheet); /**************/ // when you want to remove this widget run this code: // sss.unregistersheet(cssuri, sss.author_sheet); //remove the style shee...
Http.jsm
postdata option. postdata can be of 2 different types: a string or an array of parameters. when null/undefined is given, no post data will be attached. if a string is given the data will be appended to the request as is. in case an array of parameters is given, it will be treated as an array of key-value pairs. the elements of the array will be url-encoded and "application/x-www-form-urlencoded;
charset=utf-8" will be enforced as the content type. http.jsm only forces the content type if the post data is an array, and it serializes it automatically. if the provided postdata is a string, the content type isn't touched. in this case, the content type may be set through the headers parameter. additional xhr configuration it is possible to modify things manually on the xhr object after calling htt...
gettext
he same license as the package package. # first author <email@address>, year. # #, fuzzy msgid "" msgstr "" "project-id-version: package version\n" "report-msgid-bugs-to: \n" "pot-creation-date: 2009-09-28 16:18+0200\n" "po-revision-date: year-mo-da ho:mi+zone\n" "last-translator: full name <email@address>\n" "language-team: language <ll@li.org>\n" "mime-version: 1.0\n" "content-type: text/plain;
charset=
charset\n" "content-transfer-encoding: 8bit\n" "plural-forms: nplurals=integer; plural=expression;\n" #. l10n: this is a block comment one line directly above the gettext function call. it will be extracted by xgettext. #: file.php:12 msgid "a simple string." msgstr "" #. l10n: this is an inline comment. it will be extracted by xgettext. #: file.php:14 msgctxt "unique context string" msgid "a s...
Mork
s (changesets). dictionaries, tables, and rows all have corresponding metastructures. meta-dictionaries are in practice only used to change the scope of alias definitions (the '(a=c)' that you can see in files). meta-tables are used to establish some facts about the table as well as the default row scope. meta-rows do not appear to be used at all, although the parser seems to consider setting the
charset, row scope, and atom scope. some notes on further terminology: when referring to cells or aliases, the first component is the key and the second component is the value. expanding refers to taking a '^' hex buffer and replacing it with the alias value for the hex key (explained below). a mid has two components: the id itself, to the left of the colon, and the scope, to the right of the colon. th...
History Service Design
management: provides basic and advanced apis to store and modify visits and page details. relevance calculation: maintain and expire frecency values for pages. history expiration: expire old visits and invalid informations from the database. queries creation: allows the creation for complex queries. queries results maintenance: allows easy access to queries results.
charset for pages: allows setting and reading
charset for each page. database maintenance at startup the service creates an exclusive storage connection to places.sqlite, the exclusive locking is needed for both a perf gain and data-safety. in case the database is missing a new one is created, if instead the database exists but the connection to it fails due to database corruption, the corrupt datab...
Finishing the Component
you'll recall is a string class that many of the gecko apis require. see string classes in xpcom for more information about strings. once the url string is wrapped in a nsembedcstring, it can be passed to the method newuri. this method expects to parse the incoming string and create an object which implements an nsiuri interface. the two nsnull parameters passed to newuri are used to specify the
charset of the string and any base uri to use, respectively. we are assuming here that the
charset of the url string is utf-8, and also assuming that every url string is absolute. see the intro to the html 4 specification for more information about relative urls. here is the complete implementation of the shouldload() method: ns_imethodimp weblock::shouldload(print32 contenttype, ns...
Mozilla internal string guide
iciently maps to utf-32. (win32 w apis and mac os x natively use utf-16.) latin1 - 8-bit encoding for the first 256 unicode code points. used for http headers and for size-optimized storage in text node and spidermonkey strings. latin1 converts to utf-16 by zero-extending each byte to a 16-bit code unit. note that this kind of "latin1" is not available for encoding html, css, js, etc. specifying
charset=latin1 means the same as
charset=windows-1252. windows-1252 is a similar but different encoding used for interchange. in addition, there exist multiple other (legacy) encodings. the web-relevant ones are defined in the encoding standard. conversions from these encodings to utf-8 and utf-16 are provided by mozilla::encoding. additonally, on windows the are some rare cases (e.g. drag&drop) where ...
nsCStringEncoding
scii and can be inflated to utf-16 by inserting null bytes. reverse conversion is done by truncating every other byte. the conversion may result in loss and/or corruption of information if the strings do not strictly contain ascii data. ns_cstring_encoding_utf8 conversion between utf-8 and utf-16 is non-lossy. ns_cstring_encoding_native_filesystem conversion from utf-16 to the native filesystem
charset may result in a loss of information. no attempt is made to protect against data loss in this case. the native filesystem
charset applies to strings passed to the "native" method variants on nsifile and nsilocalfile. history this enumeration was frozen for mozilla 1.7. see bug 239123 for details. see also ns_cstringtoutf16, ns_utf16tocstring ...
nsICryptoHash
example, we use the update() method to pass an array of bytes to be hashed. as in the previous example, we convert the binary result to a hex string. var str = "hello world"; var converter = components.classes["@mozilla.org/intl/scriptableunicodeconverter"]. createinstance(components.interfaces.nsiscriptableunicodeconverter); // we use utf-8 here, you can choose other encodings. ...
nsIDOMWindowUtils
idomfile wrapdomfile(nsifile afile); attributes attribute type description currentinnerwindowid unsigned long long the id of the window's current inner window. read only. exceptions thrown ns_error_not_available there is no current inner window displaydpi float the dpi of the display. read only. doc
charsetisforced boolean whether the
charset of the window's current document has been forced by the user. cannot be accessed from unprivileged context (not content-accessible) read only. elementsrestyled read only unsigned long long the number of elements which have been restyled for the current document. keep in mind that during a restyle operation, an element may be restyled mult...
nsIEditor
// tag name are in lower case with <br>. ...
nsIFile
y items in the filesystem. an nsifile can be retrieved by either instantiating an nsilocalfile using a platform specific path string or by using cross-platform locations retrieved from the directory service. all methods with string parameters have two forms. the preferred form operates on utf-16 encoded characters strings. an alternate form operates on characters strings encoded in the "native"
charset. a string containing characters encoded in the native
charset cannot be safely passed to javascript via xpconnect. therefore, the utf-16 forms are scriptable, but the "native methods" are not. in addition, the native form cannot deal with files whose name contains characters outside the default system code page on windows. using the native form limits the ability of your code to deal with the ful...
nsIHttpChannel
e code (for example 200). read only. exceptions thrown ns_error_not_available if called before the response has been received (before onstartrequest()). responsestatustext acstring get the http response status text (for example "ok"). note: this returns the raw (possibly 8-bit) text from the server. there are no assumptions made about the
charset of the returned text. you have been warned! read only. exceptions thrown ns_error_not_available if called before the response has been received (before onstartrequest()). referrerpolicy read only unsigned long the referrer policy in use for this channel, indicated by one of the constants listed above methods getoriginalresponseheade...
nsIMarkupDocumentViewer
individual bidi options. the default direction for the layout of bidirectional text. 1 - left to right 2 - right to left. biditexttype octet the ordering of bidirectional text. this may be either "logical" or "visual". logical text will be reordered for presentation using the unicode bidi algorithm. visual text will be displayed without reordering. 1 - the default order for the
charset 2 - logical order 3 - visual order. defaultcharacterset acstring forcecharacterset acstring fullzoom float the amount by which to scale all lengths. default is 1.0. hintcharacterset acstring hintcharactersetsource print32 minfontsize long the minimum font size to allow. note: this attribut...
nsIMsgDBHdr
lue here will have been decoded by the mime converter service. mime2decodedsubject astring readonly: indicates the subject of this message. the value here will have been decoded by the mime converter service. mime2decodedrecipients astring readonly: indicates the recipients of this message. the value here will have been decoded by the mime converter service.
charset string indicates the character set of this message. this value is extracted from the content-type header. label nsmsglabelvalue indicates one of the old 5 label values used by old versions. new code should use keywords instead. accountkey string indicates the account that was originally used to fetch the message. may be blank if the message has not been moved o...
nsIMsgFolder
you might want to associate an identity with a particular newsgroup, or for imap shared folders in the other users namespace, you might want to create a delegated identity. gettingnewmessages boolean are we running a url as a result of the user clicking get msg. filepath nsilocalfile local path of this folder. basemessageuri acstring readonly
charset acstring the
charset of this folder.
charsetoverride boolean biffstate unsigned long locked boolean readonly flags unsigned long direct access to the set/get all the flags at once. knowssearchnntpextension boolean readonly allowsposting boolean readonly relativepathname acstring readon...
nsIMsgWindow
rotocol channels to handle things like bad cert exceptions. promptdialog nsiprompt readonly: this is the equivalent of calling getinterface on the rootdocshell object. mailcharacterset acstring this is used to track the character set of the currently displayed message. if set to an alias, the actual character set is returned.
charsetoverride boolean remember the message's
charset was overridden, so it can be inherited (e.g for quoting). stopped boolean check if a running url been stopped. if you are checking this flag, you need to clear it before you start your operation since there's no convenient place to clear it. domwindow nsidomwindow the message window'...
nsIWebNavigation
to loaduri. load_flags_bypass_cache 256 this flag specifies that the local web cache should be bypassed, but an intermediate proxy cache could still be used to satisfy the load. load_flags_bypass_proxy 512 this flag specifies that any intermediate proxy caches should be bypassed (that is, that the content should be loaded from the origin server). load_flags_
charset_change 1024 this flag specifies that a reload was triggered as a result of detecting an incorrect character encoding while parsing a previously loaded document. load_flags_stop_content 2048 if this flag is set, stop() will be called before the load starts and will stop both content and network activity (the default is to only stop network activity). effectively, this...
nsIWebProgressListener
g) { let win = awebprogress.domwindow; let outerwindowid = win.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindowutils) .outerwindowid; sendasyncmessage("myaddonmessage", { name: "onlocationchange", outerwindowid: outerwindowid, uri: auri.spec,
charset: auri.
charset, flag: aflag, }); }, // for definitions of the remaining functions see related documentation onprogresschange: function(awebprogress, arequest, curself, maxself, curtot, maxtot) {}, onstatuschange: function(awebprogress, arequest, astatus, amessage) {}, onsecuritychange: function(awebprogress, arequest, astate) {} } let filter = cc["@mozill...
nsIWindowWatcher
rn nsisupports objects which can be nsisupports.queryinterface() (queryinterfaced) to an nsidomwindow. openwindow() creates a new window. it will automatically be added to our list. note: this method may examine the javascript context stack for purposes of determining the security context to use for the search for a given window named aname. note: this method will try to set the default
charset for the new window to the default
charset of aparent. this is not guaranteed, however. note: this method may dispatch a "toplevel-window-ready" notification via nsiobserverservice if the window did not already exist. note: supported nsisupportsprimitive objects will be reflected into window.arguments as the base type, however id, void and 64-bit primitive types are not currently support...
nsIXmlRpcClient
tion ( in string username, in string password ) ; parameters username username to be used if asked to authenticate password password to be used if asked to authenticate clearauthentication() clear authentication info void setauthentication ( in string username, in string password ) ; parameters username password setencoding() set character encoding. the default
charset if this function is not called is "utf-8" void setauthentication ( in string encoding ) ; parameters encoding encoding
charset to be used asynccall() call remote method methodname asynchronously with given arguments. supported arguments are: nsisupportspruint8, nsisupportspruint16, nsisupportsprint16, nsisupportsprint32: i4, nsisupportsprbool: boolean, nsisupportschar, nsisupportscstri...
Autoconfiguration in Thunderbird
this ip! documentroot /var/www/autoconfig/ servername autoconfig.hoster.com <directory /var/www/autoconfig> order allow,deny allow from all </directory> </virtualhost> place the configuration file at the url /mail/config-v1.1.xml on that host. all config files must be served as content-type: text/xml (or application/xml), otherwise the file will be ignored. also, they must use
charset utf-8 (esp. if there are any non-ascii-characters). if you like to use name-based virtual hosts you probably don't want to setup the autoconfig subdomain for every domain of your customers. you can add a rewriterule in the default virtual host (on debian /etc/apache2/sites-enabled/000-default) to match all autoconfig.* subdomains: <virtualhost *:80> #must be the first virtual host serveradmi...
The JavaScript input interpreter - Firefox Developer Tools
cd(frame); you can pass a css selector that matches the iframe: cd("#frame1"); you can pass the iframe's global window object: var frame = document.getelementbyid("frame1"); cd(frame.contentwindow); to switch the context back to the top-level window, call cd() with no arguments: cd(); for example, suppose we have a document that embeds an iframe: <!doctype html> <html> <head> <meta
charset="utf-8"> </head> <body> <iframe id="frame1" src="static/frame/my-frame1.html"></iframe> </body> </html> the iframe defines a new function: <!doctype html> <html> <head> <meta
charset="utf-8"> <script> function whoareyou() { return "i'm frame1"; } </script> </head> <body> </body> </html> you can switch context to the iframe like this: cd("#frame...
CSS Object Model (CSSOM) - Web APIs
the css object model is a set of apis allowing the manipulation of css from javascript. it is much like the dom, but for the css rather than the html. it allows users to read and modify css style dynamically. ...
Document.anchors - Web APIs
hors read-only property of the document interface returns a list of all of the anchors in the document. syntax nodelist = document.anchors; value an htmlcollection. ...
Document.characterSet - Web APIs
ing of the document that it's currently rendered with. (a character encoding is a set of characters and how to interpret bytes into those characters.) a “character set” and a “character encoding” are related, but different. despite the name of this property, it returns the encoding. users can override the developer-specified encoding inside the content-type header or inline like <meta
charset="utf-8">, such as with firefox's view → text encoding menu. this override is provided to fix incorrect developer-specified encodings that result in garbled text. the properties document.
charset and document.inputencoding are legacy aliases for document.characterset. do not use them any more. syntax var string = document.characterset; examples <button onclick="console.log(document.charact...
Document.getElementById() - Web APIs
ement-lookup methods such as document.queryselector() and document.queryselectorall(), getelementbyid() is only available as a method of the global document object, and not available as a method on all element objects in the dom. because id values must be unique throughout the entire document, there is no need for "local" versions of the function. ...
Document.getElementsByTagName() - Web APIs
s both document.getelementsbytagname() and the functionally identical element.getelementsbytagname(), which starts the search at a specific element within the dom tree. clicking the buttons uses getelementsbytagname() to count the descendant paragraph elements of a particular parent (either the document itself or one of two nested <div> elements). ...
Document - Web APIs
links in the document body. document.all provides access to all elements in the document — it returns an htmlallcollection rooted at the document node. this is a legacy, non-standard property and should not be used. document.applets read only returns an ordered list of the applets within a document. document.bgcolor gets/sets the background color of the current document. document.
charset read only alias of document.characterset. use this property instead. document.domconfig should return a domconfiguration object. document.fgcolor gets/sets the foreground color, or text color, of the current document. document.fullscreen true when the document is in full-screen mode. document.height gets/sets the height of the current document. document.inputencoding read o...
Examples of web and XML development using the DOM - Web APIs
tandard lists the standard properties, however many browsers have extended these greatly. put the following code into a blank text file and load it into a variety of browsers, you'll be surprised at the different number and names of properties. you might also like to add some elements in the page and call this function from different event handlers. ...
Comparison of Event Targets - Web APIs
see anonymous content#event_flow_and_targeting for details. event.composedtarget event.webidl the original non-native target of the event before composition from shadow dom. ...
HTMLScriptElement - Web APIs
its parent, htmlelement. htmlscriptelement.type is a domstring representing the mime type of the script. it reflects the type attribute. htmlscriptelement.src is a domstring representing the url of an external script. it reflects the src attribute. htmlscriptelement.event is a domstring; an obsolete way of registering event handlers on elements in an html document. htmlscriptelement.
charset is a domstring representing the character encoding of an external script. it reflects the
charset attribute. htmlscriptelement.async htmlscriptelement.defer the async and defer attributes are boolean attributes that control how the script should be executed. the defer and async attributes must not be specified if the src attribute is absent. there are three possible execution modes: ...
Headers() - Web APIs
o this using headers.append: myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns 'image/jpeg' or you can add the headers you want as the headers object is created. ...
Ajax navigation example - Web APIs
d between all ajax pages.</p> include/before_content.php: <p> [ <a class="ajax-nav" href="first_page.php">first example</a> | <a class="ajax-nav" href="second_page.php">second example</a> | <a class="ajax-nav" href="third_page.php">third example</a> | <a class="ajax-nav" href="unexisting.php">unexisting page</a> ] </p> include/header.php: <meta http-equiv="content-type" content="text/html;
charset=utf-8" /> <script type="text/javascript" src="js/ajax_nav.js"></script> <link rel="stylesheet" href="css/style.css" /> js/ajax_nav.js: "use strict"; const ajaxrequest = new (function () { function closereq () { oloadingbox.parentnode && document.body.removechild(oloadingbox); bisloading = false; } function abortreq () { if (!bisloading) { return; } ...
Index - Web APIs
node matches. 1668 htmlformelement api, dom, form element, forms, html, html dom, html form element, html forms, htmlformelement, interface, reference the htmlformelement interface represents a <form> element in the dom; it allows access to and in some cases modification of aspects of the form, as well as access to its component elements. 1669 htmlformelement.accept
charset api, html dom, htmlformelement, needsmarkupwork, needsspectable, property, reference the htmlformelement.accept
charset property represents a list of the supported character encodings for the given form element. this list can be comma- or space-separated. 1670 htmlformelement.action api, forms, html dom, htmlformelement, needsspectable, needsupdate, property, reference ...
Key Values - Web APIs
tch (204) "groupprevious" switches to the previous character group on an iso/iec 9995 keyboard. gdk_key_iso_prev_group (0xfe0a) "modechange" [5] the mode change key. toggles or cycles among input modes of imes. vk_modechange (0x1f) gdk_key_mode_switch (0xff7e) gdk_key_script_switch (0xff7e) qt::key_mode_switch (0x0100117e) keycode_switch_
charset (95) "nextcandidate" the next candidate function key. selects the next possible match for the ongoing input. "nonconvert" [2] the nonconvert ("don't convert") key. this accepts the current input method sequence without running conversion when using an ime. vk_nonconvert (0x1d) gdk_key_muhenkan (0xff22) qt::key_muhenkan (0x01001122) ke...
window.location - Web APIs
on senddata (sdata) { location.search = sdata; } // in html: <button onclick="senddata('some data');">send data</button> the current url with "?some%20data" appended is sent to the server (if no action is taken by the server, the current document is reloaded with the modified search string). ...
Window.locationbar - Web APIs
returns the locationbar object, whose visibility can be checked. syntax objref = window.locationbar example the following complete html example shows how the visible property of the locationbar object is used. <!doctype html> <html lang="en"> <head> <meta
charset="utf-8" /> <title>various dom tests</title> <script> var visible = window.locationbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> specifications specification status comment html living standardthe definition of 'window.locationbar' in that specification. living standard html5the definition of 'window.locationbar' in that specification. recommendation ...
Window.statusbar - Web APIs
ns the statusbar object, whose visibility can be toggled in the window. syntax objref = window.statusbar example the following complete html example shows a way that the visible property of the various "bar" objects is used, and also the change to the privileges necessary to write to the visible property of any of the bars on an existing window. ...
Sending and Receiving Binary Data - Web APIs
rue); oreq.responsetype = "blob"; oreq.onload = function(oevent) { var blob = oreq.response; // ... }; oreq.send(); receiving binary data in older browsers the load_binary_resource() function shown below loads binary data from the specified url, returning it to the caller. function load_binary_resource(url) { var req = new xmlhttprequest(); req.open('get', url, false); //xhr binary
charset opt by marcus granado 2006 [http://mgran.blogspot.com] req.overridemimetype('text\/plain;
charset=x-user-defined'); req.send(null); if (req.status != 200) return ''; return req.responsetext; } the magic happens in line 5, which overrides the mime type, forcing the browser to treat it as plain text, using a user-defined character set. this tells the browser not to parse it, and to let th...
XMLHttpRequest.getAllResponseHeaders() - Web APIs
whose field name is set-cookie or set-cookie2) separated by crlf, or null if no response has been received. if a network error happened, an empty string is returned. an example of what a raw header string looks like: date: fri, 08 dec 2017 21:04:30 gmt\r\n content-encoding: gzip\r\n x-content-type-options: nosniff\r\n server: meinheld/0.6.1\r\n x-frame-options: deny\r\n content-type: text/html;
charset=utf-8\r\n connection: keep-alive\r\n strict-transport-security: max-age=63072000\r\n vary: cookie, accept-encoding\r\n content-length: 6502\r\n x-xss-protection: 1; mode=block\r\n each line is terminated by both carriage return and line feed characters (\r\n). these are essentially delimiters separating each of the headers. note: in modern browsers, the header names are returned in all lower c...
@import - CSS: Cascading Style Sheets
e for more information. list-of-media-queries is a comma-separated list of media queries conditioning the application of the css rules defined in the linked url. if the browser does not support any these queries, it does not load the linked resource. supports-query is either a <supports-condition> or a <declaration>. description imported rules must precede all other types of rules, except @
charset rules; as it is not a nested statement, @import cannot be used inside conditional group at-rules. so that user agents can avoid retrieving resources for unsupported media types, authors may specify media-dependent @import rules. these conditional imports specify comma-separated media queries after the url. in the absence of any media query, the import is unconditional. specifying all for the med...
@namespace - CSS: Cascading Style Sheets
xml-namespace-url"; description the defined namespaces can be used to restrict the universal, type, and attribute selectors to only select elements within that namespace. the @namespace rule is generally only useful when dealing with documents containing multiple namespaces—such as html5 with inline svg or mathml, or xml that mixes multiple vocabularies. any @namespace rules must follow all @
charset and @import rules, and precede all other at-rules and style declarations in a style sheet. @namespace can be used to define the default namespace for the style sheet. when a default namespace is defined, all universal and type selectors (but not attribute selectors, see note below) apply only to elements in that namespace. the @namespace rule can also be used to define a namespace prefix. when ...
At-rules - CSS: Cascading Style Sheets
at-rules are css statements that instructs css how to behave. they begin with an at sign, '@' (u+0040 commercial at), followed by an identifier and includes everything up to the next semicolon, ';' (u+003b semicolon), or the next css block, whichever comes first. /* general structure */ @identifier (rule); /* example: tells browser to use utf-8 character set */ @
charset "utf-8"; there are several at-rules, designated by their identifiers, each with a different syntax: @
charset — defines the character set used by the style sheet. @import — tells the css engine to include an external style sheet. @namespace — tells the css engine that all its content must be considered prefixed with an xml namespace. nested at-rules — a subset of nested statements, which can be used as a statement...
Introducing the CSS Cascade - CSS: Cascading Style Sheets
h the same descriptor are defined, only the most appropriate @font-face, as a whole, is considered. while the declarations contained in most at-rules — such as those in @media, @document, or @supports — participate in the cascade, declarations contained in @keyframes don't. as with @font-face, only the at-rule as a whole is selected via the cascade algorithm. finally, note that @import and @
charset obey specific algorithms and aren't affected by the cascade algorithm. origin of css declarations the css cascade algorithm's job is to select css declarations in order to determine the correct values for css properties. css declarations originate from different origins: the user-agent stylesheets, the author stylesheets, and the user stylesheets. though style sheets come from these different ...
CSS reference - CSS: Cascading Style Sheets
rder-right-styleborder-right-widthborder-spacingborder-start-end-radiusborder-start-start-radiusborder-styleborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-widthborder-widthbottom@bottom-centerbox-decoration-breakbox-shadowbox-sizingbreak-afterbreak-beforebreak-insidebrightness()ccalc()caption-sidecaret-colorch@character-variantcharacter-variant()@
charset:checkedcircle()clamp()clearclipclip-pathcm<color>colorcolor-adjustcolumn-countcolumn-fillcolumn-gapcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-incrementcounter-resetcounter-set@counter-stylecounters()cross-fade()cubic-bezier()::cue::cue-regioncursor<custom-ident>d:defaultdeg<dimension>:dirdire...
Syntax - CSS: Cascading Style Sheets
ctor. at-rules that start with an at sign, '@' (u+0040 commercial at), followed by an identifier and then continuing up to the end of the statement, that is up to the next semi-colon (;) outside of a block, or the end of the next block. each type of at-rules, defined by the identifier, may have its own internal syntax, and semantics of course. they are used to convey meta-data information (like @
charset or @import), conditional information (like @media or @document), or descriptive information (like @font-face). any statement which isn't a ruleset or an at-rule is invalid and ignored. there is another group of statements – the nested statements. these are statements that can be used in a specific subset of at-rules – the conditional group rules. these statements only apply if a specific c...
WebKit CSS extensions - CSS: Cascading Style Sheets
* use flex-box properties instead. deprecated -webkit- properties the following properties were once supported with the -webkit- prefix but are no longer supported in evergreen browsers, with or without the -webkit- prefix. ...
Getting Started - Developer guides
file), and then print the complete list of timestamps, and the last timestamp, onto the page. this is repeated every 5 seconds, using a setinterval() call. the idea would be that a server-side script of some kind would continually update the text file with new timestamps, and our xhr code would be used to report the latest timestamp on the client-side. ...
Introduction to HTML5 - Developer guides
sently support html5 to enter into standards mode, which means that they'll interpret the long-established parts of html in an html5-compliant way while ignoring the new features of html5 they don't support. this is much simpler than the former doctypes, and shorter, making it easier to remember and reducing the amount of bytes that must be downloaded. declaring the character set with the <meta
charset> the first thing done on a page is usually indicating the character set that is used. in previous versions of html, it was done using a very complex <meta> element. now, it is very simple: <meta
charset="utf-8"> place this right after your <head>, as some browsers restart the parsing of an html document if the declared character set is different from what they had anticipated. also, if you are...
XHTML - Developer guides
xhtml is a term that was historically used to describe html documents written to conform with xml syntax rules. the following example shows an html document and corresponding "xhtml" document, and the accompanying http content-type headers they should be served with. ...
<a>: The Anchor element - HTML: Hypertext Markup Language
s _self. note: when using target, add rel="noreferrer noopener" to avoid exploitation of the window.opener api; note: in newer browser versions (e.g. firefox 79+) setting target="_blank" on <a> elements implicitly provides the same rel behavior as setting rel="noopener". type hints at the linked url’s format with a mime type. no built-in functionality. obsolete attributes
charsetobsolete since html5 hinted at the character encoding of the linked url. note: this attribute is obsolete and should not be used by authors. use the http content-type header on the linked url. coordsobsolete since html5 used with the shape attribute. a comma-separated list of coordinates. nameobsolete since html5 was required to define a possible target location in a page. in html 4.01...
<form> - HTML: Hypertext Markup Language
otherwise no corresponding role permitted aria roles search, none or presentation dom interface htmlformelement attributes this element includes the global attributes. accept comma-separated content types the server accepts. this attribute was removed in html5 and should not be used. instead, use the accept attribute on <input type=file> elements. accept-
charset space-separated character encodings the server accepts. the browser uses them in the order in which they are listed. the default value means the same encoding as the page. (in previous versions of html, character encodings could also be delimited by commas.) autocapitalize a nonstandard attribute used by ios safari that controls how textual form elements should be automatically capitalized.
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
mitted along with the control's value when the form data is submitted. what's in a name consider the name a required attribute (even though it's not). if an input has no name specified, or name is empty, the input's value is not submitted with the form! (disabled controls, unchecked radio buttons, unchecked checkboxes, and reset buttons are also not sent.) there are two special cases: _
charset_ : if used as the name of an <input> element of type hidden, the input's value is automatically set by the user agent to the character encoding being used to submit the form. isindex: for historical reasons, the name isindex is not allowed. name and radio buttons the name attribute creates a unique behavior for radio buttons. only one radio button in a same-named group of radio buttons ...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
ecure context this attribute identifies a resource that might be required by the next navigation and that the user agent should retrieve it. this allows the user agent to respond faster when the resource is requested in the future. target defines the frame or window name that has the defined linking relationship or that will show the rendering of any linked resource. obsolete attributes
charset this attribute defines the character encoding of the linked resource. the value is a space- and/or comma-delimited list of character sets as defined in rfc 2045. the default value is iso-8859-1. usage note: to produce the same effect as this obsolete attribute, use the content-type http header on the linked resource. rev the value of this attribute shows the relationship of the current ...
<style>: The Style Information element - HTML: Hypertext Markup Language
o avoid unexpected cascade issues. in the same manner as <link> elements, <style> elements can include media attributes that contain media queries, allowing you to selectively apply internal stylesheets to your document depending on media features such as viewport width. attributes this element includes the global attributes. type this attribute defines the styling language as a mime type (
charset should not be specified). this attribute is optional and defaults to text/css if it is not specified; values other than the empty string or text/css are not used. note: there is very little reason to include this attribute in modern web documents. media this attribute defines which media the style should be applied to. its value is a media query, which defaults to all if the attribute is missin...
HTML documentation index - HTML: Hypertext Markup Language
nt, html, html5, navigation, navigation menus, reference, ui, ux, user interface, user experience, web, menuitem the html <menuitem> element represents a command that a user is able to invoke through a popup menu. this includes context menus, as well as menus that might be attached to a menu button. 157 <meta>: the document-level metadata element document, element, html, html
charset, html document metadata, reference, web,
charset, http-equiv, metadata the html <meta> element represents metadata that cannot be represented by other html meta-related elements, like <base>, <link>, <script>, <style> or <title>. 158 standard metadata names attribute, html, html document metadata, reference, metadata the <meta> element can be used to provide document me...
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
nly a very small number of quirks implemented. how do browsers determine which mode to use? for html documents, browsers use a doctype in the beginning of the document to decide whether to handle it in quirks mode or standards mode. to ensure that your page uses full standards mode, make sure that your page has a doctype like in this example: <!doctype html> <html lang="en"> <head> <meta
charset=utf-8> <title>hello world!</title> </head> <body> </body> </html> the doctype shown in the example, <!doctype html>, is the simplest possible, and the one recommended by html5. earlier versions of the html standard recommended other variants, but all existing browsers today will use full standards mode for this doctype, even the dated internet explorer 6. there are no valid reasons to ...
Data URLs - HTTP
inheriting the origin of the settings object responsible for the navigation. syntax data urls are composed of four parts: a prefix (data:), a mime type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:[<mediatype>][;base64],<data> the mediatype is a mime type string, such as 'image/jpeg' for a jpeg image file. if omitted, defaults to text/plain;
charset=us-ascii if the data is textual, you can simply embed the text (using the appropriate entities or escapes based on the enclosing document's type). otherwise, you can specify base64 to embed base64-encoded binary data. you can find more info on mime types here and here. a few examples: data:,hello%2c%20world! simple text/plain data. note the use of percent-encoding (url-encoding) for the quo...
Evolution of HTTP - HTTP
eveloper.mozilla.org user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate, br referer: https://developer.mozilla.org/docs/glossary/simple_header 200 ok connection: keep-alive content-encoding: gzip content-type: text/html;
charset=utf-8 date: wed, 20 jul 2016 10:55:30 gmt etag: "547fa7e369ef56031dd3bff2ace9fc0832eb251a" keep-alive: timeout=5, max=1000 last-modified: tue, 19 jul 2016 00:59:33 gmt server: apache transfer-encoding: chunked vary: cookie, accept-encoding (content) get /static/img/header-background.png http/1.1 host: developer.cdn.mozilla.net user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) g...
Cross-Origin Resource Sharing (CORS) - HTTP
once the preflight request is complete, the real request is sent: post /doc http/1.1 host: bar.other user-agent: mozilla/5.0 (macintosh; intel mac os x 10.14; rv:71.0) gecko/20100101 firefox/71.0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip,deflate connection: keep-alive x-pingother: pingpong content-type: text/xml;
charset=utf-8 referer: https://foo.example/examples/preflightinvocation.html content-length: 55 origin: https://foo.example pragma: no-cache cache-control: no-cache <person><name>arun</name></person> http/1.1 200 ok date: mon, 01 dec 2008 01:15:40 gmt server: apache/2 access-control-allow-origin: https://foo.example vary: accept-encoding, origin content-encoding: gzip content-length: 235 keep-alive: t...
CSP: report-uri - HTTP
$message = "the following content-security-policy violation occurred on " . $current_domain . ":\n\n" . $json_data . "\n\nfurther cps violations will be logged to the following log file, but no further email notifications will be sent until this log file is deleted:\n\n" . $log_file; mail($email_address, $email_subject, $message, 'content-type: text/plain;
charset=utf-8'); } else if (filesize($log_file) > $log_file_size_limit) { exit(0); } file_put_contents($log_file, $json_data, file_append | lock_ex); } specifications specification status comment content security policy level 3the definition of 'report-uri' in that specification. working draft no changes. content security policy level 2the definition ...
Content-Type - HTTP
cors-safelisted request header yes, with the additional restriction that values can't contain a cors-unsafe request header byte: 0x00-0x1f (except 0x08 (tab)), "():<>?@[\]{}, and 0x7f (delete). it also needs to have a mime type of its parsed value (ignoring parameters) of either application/x-www-form-urlencoded, multipart/form-data, or text/plain. syntax content-type: text/html;
charset=utf-8 content-type: multipart/form-data; boundary=something directives media-type the mime type of the resource or the data.
charset the character encoding standard. boundary for multipart entities the boundary directive is required, which consists of 1 to 70 characters from a set of characters known to be very robust through email gateways, and not ending with white space. it is used t...
Index - HTTP
tand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-type response header. browsers set adequate values for this header depending on the context where the request is done: when fetching a css stylesheet a different value is set for the request than when fetching an image, video or a script. 3 accept-
charset content negotiation, http, http header, reference, request header the accept-
charset request http header advertises which character set the client is able to understand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice within the content-type response header. browsers usually don't set this header as the default value ...
Keep-Alive - HTTP
e maximum number of requests that can be sent on this connection before closing it. unless 0, this value is ignored for non-pipelined connections as another request will be sent in the next response. an http pipeline can use it to limit the pipelining. ...
HTTP headers - HTTP
a cached response can be used rather than requesting a fresh one from the origin server. connection management connection controls whether the network connection stays open after the current transaction finishes. keep-alive controls how long a persistent connection should stay open. content negotiation accept informs the server about the types of data that can be sent back. accept-
charset which character encodings the client understands. accept-encoding the encoding algorithm, usually a compression algorithm, that can be used on the resource sent back. accept-language informs the server about the human language the server is expected to send back. this is a hint and is not necessarily under the full control of the user: the server should always pay attention not to override a...
HTTP Index - HTTP
header is set by the server to specify which client hints headers client should include in subsequent requests. 49 accept-ch-lifetime client hints, http, header the accept-ch-lifetime header is set by the server to specify the persistence of accept-ch header value that specifies for which client hints headers client should include in subsequent requests. 50 accept-
charset content negotiation, http, http header, reference, request header the accept-
charset request http header advertises which character encodings the client understands. 51 accept-encoding content negotiation, http, http header, reference, request header the accept-encoding request http header advertises which content encoding, usually a compression algorithm, the clien...
406 Not Acceptable - HTTP
the hypertext transfer protocol (http) 406 not acceptable client error response code indicates that the server cannot produce a response matching the list of acceptable values defined in the request's proactive content negotiation headers, and that the server is unwilling to supply a default representation. proactive content negotiation headers include: accept accept-
charset accept-encoding accept-language in practice, this error is very rarely used. instead of responding using this error code, which would be cryptic for the end user and difficult to fix, servers ignore the relevant header and serve an actual page to the user. it is assumed that even if the user won't be completely happy, they will prefer this to an error code. if a server returns such an error status, the body of the ...
Error.prototype.stack - JavaScript
later this is less of an issue. different browsers set this value at different times. for example, firefox sets it when creating an error object, while phantomjs sets it only when throwing the error, and archived msdn docs also seem to match the phantomjs implementation. examples using the stack property the following html markup demonstrates the use of stack property. ...
Populating the page: how browsers work - Web Performance
8 round trips, the browser is finally able to make the request. response once we have an established connection to a web server, the browser sends an initial http get request on behalf of the user, which for websites is most often an html file. once the server receives the request, it will reply with relevant response headers and the contents of the html. ...