1

誰もこれを使用して動作させたことがありますか? JScript エラーがあり、それを修正する方法がわからないため、実際に問題が発生しています。

これに関するリンクは、製品の背景を理解するためにここにありますが、これは従来の ASP 用の JSON パーサーです。 ASP Xtreme Evolution を使用して JSON リターンを反復処理する

先日、これが機能していたと確信していますが、今戻ってきました.JScriptエラーがスローされており、今は機能していないようです.

したがって、JSON を従来の ASP ページに投稿しています。これは、すべてのチュートリアルで指示されているように、json2.asp ページを含めるために使用しているコードです。

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="json2.asp"-->"%>
<% 'json processing details here..

スローされるエラーは json2.asp の行にあり、これは JScript エラーです。正確なエラーは次のとおりです。

Microsoft JScript compilation error '800a03ea' 
Line 765 json2.asp

これはCrockfords json2.jsのバージョンだと思います.aspページにあるのは、JScriptを使用できるようにするためだと思いますが、私にとっては進歩していません. 私が髪を全部引きちぎる前に、私が何について話しているのか知っている人はいますか?!

さらに情報が必要な場合はお知らせください - どうもありがとう

アップデート

これが765行目です(コメントの真ん中)

if (/^[\],:{}\s]*$/.
test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {

// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.

        j = eval('(' + text + ')');

// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.

        return typeof reviver === 'function' ?
             walk({'': j}, '') : j;
}
4

1 に答える 1

0

正しいものを含めていません。ライブラリ全体を利用可能にし、次のファイルを含める必要があります (パスを適切に変更してください)。

<!-- #include file="includes/extlib/axe/base.asp" -->
<!-- #include file="includes/extlib/axe/classes/Parsers/json.class.asp" -->

次に、実際に使用するには、次のようにします。

set oJson = new Json
oJson.loadJson(strJSON)

strSomething = oJson.getElement("theElement")

set oJson = nothing

これはすべて、作業コードから取得したものです。

于 2013-06-07T15:39:54.277 に答える