You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
JSON for Humans View the Project on GitHub json5/json5 JSON5 – JSON for Humans JSON5 is an extension to the popular JSON file format that aims to be easier to write and maintain by hand (e.g. for config files). It is not intended to be used for machine-to-machine communication. (Keep using JSON or other file formats for that. 🙂) JSON5 was started in 2012, and as of 2022, now gets >65M downloads/w
Ajaxなアプリケーションにおいて、サーバからJSONを返す場合に、JSON自体はvalidであるにも関わらず、(IEの都合で)エスケープが不足していて脆弱性につながってる場合があるので、書いておきます。 発生するかもしれない脆弱性 JSONのエスケープが不足している場合に発生する可能性のある脆弱性は以下の通りです。 JSON内に含まれる機密情報の漏えい XSS それぞれの詳細については後述します。 開発側でやるべきこと 文字列中のUnicode文字は "\uXXXX" な形式にエスケープするとともに、ASCIIな範囲であっても「/」「<」「>」「+」も同様にエスケープすることにより、前述の脆弱性を防ぐことができます。 Perlであれば、以下のような感じになります。JSON->ascii(1) に続けて、JSON文字列を正規表現で置換しているあたりがキモになります。 use utf8; u
Health These insects carry enough bacteria to the cause Ezio Palermo June 30, 2019 5246 Struggling to sell one multi-million dollar home currently on the market won’t stop actress and singer Jennifer Lopez from expanding her property collection. Lopez has reportedly added to her real Health Morning people may have the lower breast cancer risk Ezio Palermo June 30, 2019 5478 Struggling to sell one
Today I attended Wakate IT Benkyou-kai (in English, "Young IT Study Meetup"?). We read Secrets of the JavaScript Ninja and today's chapter is "Code Evaluation". This book contains many real-world examples. We saw Caja, Prototype, json2.js, base2, Packer, Screw.Unit, Processing.js and Objective-J. For me, today's most striking code is json2.js. It has eval-based JSON parser and prevent unsafe code
■19.0 Introduction 従来のAjaxで受け取った文字列などのデータはホント挿入するまで安全なのかははかり知ることができないというセキュリティ的な弱点があった。 そこでJSONが登場。ECMA5ではJSON.parseはネイティブ実装されているので高速に動作し、evalと違って安全にJSONオブジェクトを解釈できる。 ■19.1 Process an XML Document Returned from an Ajax Call Ajaxの返り値としてXMLを扱うには、MIME typeにxmlを設定してresponseXMLで取得する。 if (window.XMLHttpRequest) { xmlHttpObj = new XMLHttpRequest(); if (xmlHttpObj.overrideMimeType) { xmlHttpObj.overri
こんにちは、太田です。今回はGoogle Chrome拡張に使えるHTML5関連技術の2回目をお送りします。 前回はcanvas、ドラッグ・アンド・ドロップを取り上げましたが、今回はHTML5周辺の技術として、ECMAScript 5やCSS3の先行実装を取り上げます。ECMAScript 5は昨年末(2009年12月)にリリースされたばかりですが、WebKit・Chromiumでは早速(実際にはかなり先行して)その実装が進められています。またCSS3についても、多くのモジュールがWorking Draft(草案)の段階ですが、WebKitでは先行実装がされており、Chrome拡張ではその機能を存分に試すことができます。前回も書きましたが、Chrome拡張はそういった最新技術を試すのに格好のプラットフォームです。 Chrome拡張で使えるECMAScript 5 Google Chrome
"あa".toJSON() JSON.stringify("あa") JSON.stringify({"あa": null}) Google Chrome6(dev) "あa" ""\u3042a"" "{"\u3042a":null}" Safari5 not impl ""あa"" "{"あa":null}" Opera10.60β not impl '"あa"' '{"あa":null}' Firefox3.6.3 "あa" ""あa"" "{"あa":null}" IE8 "あa" ""\u3042a"" "{"\u3042a":null}" IE6, IE7 not impl not impl not impl JSON.parse('"あa"') JSON.parse('"\u3042a"') Google Chrome6(dev) "あa" "あa" Safari5 "あa"
Paste some JSON in each of the text fields. Click "Compare" to see the diff. Changed portions are displayed in yellow. Additions are displayed in green. Deletions are displayed in red. It also works as a JSON viewer. Click the disclosure triangles to display/hide portions of the JSON. Invalid JSON is indicated by the text fields turning red. Swap the contents of the text areas by clicking "Swap".
Today, we released jQuery 1.4, a mostly backward compatible release with a few minor quirks. One of these quirks is that jQuery now uses the native JSON parser where available, rejecting malformed JSON. This probably sounds fine, except that by malformed JSON, we mostly mean: {foo: "bar"} Because this is valid JavaScript, people have long assumed it was valid JSON, and a lot of hand-coded JSON is
最近のChromeやFirefoxはJSONオブジェクトが標準付属してるっぽいのですが、それとprototype.jsが干渉してJSON.stringifyの挙動がおかしくなるようです。 prototype.js 1.6.1をロードした状態で JSON.stringify({"a": ["b", "c"]}) とすると '{"a":"[\"b\", \"c\"]"}' が返ってきます。配列の部分が二重にJSON化されています。 このへんによるとprototype.jsとJSONオブジェクトが同じObject#toJSON()という名前を違う用途で使っているのが問題らしいです。 まあ今時prototype.jsなんて使うなよ、っていう話なのかもしれませんが。いい加減jQueryでも覚えようかな…。 ちなみにjson2.jsは組み込みのJSON実装があればそちらを使うようになっています。なので
JavaScriptのオブジェクトをJSONに変換する際、必ずと言っていいほど使われるのがjson2.js。 ECMAScript5(JavaScript2)では、json2.jsの実装をほぼ忠実に仕様として再現しており、Firefox3.5やSafari4ではネイティブの実装が利用できます。 例えば、JSオブジェクトをJSON文字列にしたい場合は、JSON.stringify(value, replacer, space)を利用できます。 valueはJSオブジェクト。 replacerは省略可能で、function(key, value)と言うシグネチャの関数オブジェクトを渡します。JS→文字列の変換ルーチンを独自に提供できます。 spaceは、結果の文字列を人間が読みやすくするための、インデントの数を指定します。 その逆に、JSON文字列をJSオブジェクトに復元したい場合は、JSON
Blogs from the JScript team in Microsoft Steps Toward Creating Compatible ECMAScript 5 Implementations As we’ve discussed in the past, Microsoft has been actively involved in the developing the... Date: 06/29/2009 Native JSON Support in IE8 and Tracking the ECMAScript Fifth Edition Draft Specification UPDATEMicrosoft has released an update that addresses most of the issues discussed below. Refer..
JavaScript tests & Compatibility tables In this web site I have collected various JavaScript tests, to display code samples, have them run and check web browser compatibility. Test pages Compatibility tables JavaScript 1.6 Method/feature Web browser support Array extras: The indexOf method
the vision Imagine freedom of notations. the solution Custom notations are a novel, open source, technology providing programmers in Java and JavaScript with powerful pattern matching support, offering the following main features: Generalized pattern matching: Every programmer knows regular expressions, and how useful they are for matching simple or complex patterns within text (that is, within st
JSON(http://www.json.org/)データはけっこうよく使うので、何度か話題にしたことがあります(例えば「もう一度、ちゃんとJSON入門」)。でも、JSONには型情報/メタ情報が付けられないのがとても不満で、JSON改なんてもんを考えたこともありました。(後でXIONに改名) JSONデータに対するスキーマ定義の仕様がかたまりつつあることを、ごく最近になって知りました。 http://json-schema.org/ JSON本体はRFC 4627になっていますが、JSONスキーマの標準化のステータスは、あまりハッキリとは分かりません(僕には)。http://groups.google.com/group/json-schema?pli=1 を覗き見した感じでは、現状ワーキングドラフトという位置付けらしいです。 なかなか面白いし役に立ちそうなので紹介します。ただし、僕にとっ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く