|
List Info
Thread: the 'escape()' function in javascript returns different values in swf and dhtml
|
|
| the 'escape()' function in javascript
returns different values in swf and
dhtml |

|
2007-04-16 12:19:50 |
|
I was tracking a bug in SOAP data down, and one of the things happening is that the data in an lzpostbody from the client is not being URLencoded properly. We are using the Javascript builtin 'escape', which returns what looks
like the wrong value in dhtml; it does not escape a "+" character into a hex code.
escape("2+2") swf ==> '2%2B2'
dhtml ==>
'2+2'
Does anyone know if escape() is supposed to work in DHTML, or if there is a standard (cross browser?) other way to url-encode strings?
-- Henry Minsky Software Architect
hminsky laszlosystems.com">hminsky laszlosystems.com
|
| Re: the 'escape()' function in
javascript returns different values in
swf and dhtml |
  United States |
2007-04-16 12:39:00 |
My JavasScript book says that `escape` is deprecated in
ECMAScript v3
and that you should use `encodeURI` or `EncodeURIComponent`
instead.
Unfortunately, those don't seem to be in Actionscript.
Looks like we
need to fix this up in the runtime. File a bug?
[The standard for `escape` says that none of the punctuation
characters *_+-./ are escaped, so DHTML is operating correctly
here.]
On 2007-04-16, at 13:19 EDT, Henry Minsky wrote:
> I was tracking a bug in SOAP data down, and one of the
things
> happening is
> that the data in an lzpostbody from
> the client is not being URLencoded properly. We are
using the
> Javascript
> builtin 'escape', which returns what looks
> like the wrong value in dhtml; it does not escape a
"+" character
> into a hex
> code.
>
> escape("2+2")
> swf ==> '2%2B2'
> dhtml ==> '2+2'
>
> Does anyone know if escape() is supposed to work in
DHTML, or if
> there is a
> standard (cross browser?) other way to
> url-encode strings?
>
>
> --
> Henry Minsky
> Software Architect
> hminsky laszlosystems.com
|
|
| Re: the 'escape()' function in
javascript returns different values in
swf and dhtml |

|
2007-04-16 12:42:30 |
|
I'll file a bug. I think I will put something that calls EncodeURIComponent into the kernel ; in swf it can call escape() but in DHTML it will call the browser function. IE and Firefox seem to support it, as does Opera. Safari??
On 4/16/07, P T Withington < ptw openlaszlo.org">ptw openlaszlo.org> wrote:
My JavasScript book says that `escape` is deprecated in ECMAScript v3 and that you should use `encodeURI` or `EncodeURIComponent` instead. Unfortunately, those don't seem to be in Actionscript. Looks like we
need to fix this up in the runtime. File a bug?
[The standard for `escape` says that none of the punctuation characters *_+-./ are escaped, so DHTML is operating correctly here.]
On 2007-04-16, at 13:19 EDT, Henry Minsky wrote:
> I was tracking a bug in SOAP data down, and one of the things > happening is > that the data in an lzpostbody from > the client is not being URLencoded properly. We are using the > Javascript
> builtin 'escape', which returns what looks > like the wrong value in dhtml; it does not escape a "+" character > into a hex > code. > > escape("2+2") > swf ==> '2%2B2'
> dhtml ==> '2+239; > > Does anyone know if escape() is supposed to work in DHTML, or if > there is a > standard (cross browser?) other way to > url-encode strings? >
> > -- > Henry Minsky > Software Architect > hminsky laszlosystems.com">hminsky laszlosystems.com
-- Henry Minsky Software Architect
hminsky laszlosystems.com">hminsky laszlosystems.com
|
| Re: the 'escape()' function in
javascript returns different values in
swf and dhtml |

|
2007-04-16 12:44:38 |
|
BTW, Opera doesn't like the DHTML debugger39;s eval command for some reason. I just upgraded to Opera 9.2. Did something change in the DHTML debugger39;s call to eval?
lzx> encodeURIComponent("2+2")
ERROR: [Error:
name: EvalError
message: Statement on line 1087: Illegal use of eval Backtrace: Line 1087 of linked script
http://gigicorp:8080/legals3/lps/includes/lfc/LFCdhtml-debug.js
var $2_value = eval($1_expr); Line 1 of script
$modules.lz.Debug.doEval((document.getElementById("LaszloDebuggerInput")).value);
return false; At unknown location
[statement source code not available]
]
On 4/16/07, Henry Minsky < henry.minsky gmail.com">
henry.minsky gmail.com> wrote:I'll file a bug. I think I will put something that calls EncodeURIComponent into the kernel ; in swf it can call escape() but
in DHTML it will call the browser function. IE and Firefox seem to support it, as does Opera. Safari??
On 4/16/07, P T Withington < ptw openlaszlo.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
ptw openlaszlo.org> wrote:
My JavasScript book says that `escape` is deprecated in ECMAScript v3 and that you should use `encodeURI` or `EncodeURIComponent` instead. Unfortunately, those don't seem to be in Actionscript. Looks like we
need to fix this up in the runtime. File a bug?
[The standard for `escape` says that none of the punctuation characters *_+-./ are escaped, so DHTML is operating correctly here.]
On 2007-04-16, at 13:19 EDT, Henry Minsky wrote:
> I was tracking a bug in SOAP data down, and one of the things > happening is > that the data in an lzpostbody from > the client is not being URLencoded properly. We are using the > Javascript
> builtin 'escape', which returns what looks > like the wrong value in dhtml; it does not escape a "+" character > into a hex > code. > > escape("2+2")
> swf ==> '2%2B2'
> dhtml ==> '2+239; > > Does anyone know if escape() is supposed to work in DHTML, or if > there is a > standard (cross browser?) other way to > url-encode strings? >
> > -- > Henry Minsky > Software Architect > hminsky laszlosystems.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">hminsky laszlosystems.com
-- Henry Minsky Software Architect
hminsky laszlosystems.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">hminsky laszlosystems.com
-- Henry Minsky Software Architect hminsky laszlosystems.com">hminsky laszlosystems.com
|
| Re: the 'escape()' function in
javascript returns different values in
swf and dhtml |
  United States |
2007-04-16 12:45:23 |
Yup, just tested it.
I guess the solution is just:
if ($as2) {
encodeURIComponent = escape;
}
On 2007-04-16, at 13:42 EDT, Henry Minsky wrote:
> I'll file a bug. I think I will put something that
calls
> EncodeURIComponent
> into the kernel ; in swf it can call escape() but
> in DHTML it will call the browser function. IE and
Firefox seem to
> support
> it, as does Opera. Safari??
>
>
>
> On 4/16/07, P T Withington <ptw openlaszlo.org> wrote:
>>
>> My JavasScript book says that `escape` is
deprecated in ECMAScript v3
>> and that you should use `encodeURI` or
`EncodeURIComponent` instead.
>> Unfortunately, those don't seem to be in
Actionscript. Looks like we
>> need to fix this up in the runtime. File a bug?
>>
>> [The standard for `escape` says that none of the
punctuation
>> characters *_+-./ are escaped, so DHTML is operating
correctly
>> here.]
>>
>> On 2007-04-16, at 13:19 EDT, Henry Minsky wrote:
>>
>> > I was tracking a bug in SOAP data down, and
one of the things
>> > happening is
>> > that the data in an lzpostbody from
>> > the client is not being URLencoded properly.
We are using the
>> > Javascript
>> > builtin 'escape', which returns what looks
>> > like the wrong value in dhtml; it does not
escape a "+" character
>> > into a hex
>> > code.
>> >
>> > escape("2+2")
>> > swf ==> '2%2B2'
>> > dhtml ==> '2+2'
>> >
>> > Does anyone know if escape() is supposed to
work in DHTML, or if
>> > there is a
>> > standard (cross browser?) other way to
>> > url-encode strings?
>> >
>> >
>> > --
>> > Henry Minsky
>> > Software Architect
>> > hminsky laszlosystems.com
>>
>>
>
>
> --
> Henry Minsky
> Software Architect
> hminsky laszlosystems.com
|
|
| Re: the 'escape()' function in
javascript returns different values in
swf and dhtml |
  United States |
2007-04-16 12:47:11 |
I think it is being overly zealous about cross-site
scripting. It is
not letting me eval an expression in another frame. Maybe I
can ask
the Opera guys about it.
On 2007-04-16, at 13:44 EDT, Henry Minsky wrote:
> BTW, Opera doesn't like the DHTML debugger's eval
command for some
> reason. I
> just upgraded to Opera 9.2. Did something
> change in the DHTML debugger's call to eval?
>
> lzx> encodeURIComponent("2+2")
> ERROR: [Error:
>
> name: EvalError
>
> message: Statement on line 1087: Illegal use of eval
> Backtrace:
> Line 1087 of linked script
> http://gigicorp:8080/legals3/lps/includes/lfc/LFC
dhtml-debug.js
>
> var $2_value = eval($1_expr);
> Line 1 of script
>
> $modules.lz.Debug.doEval((document.getElementById
> ("LaszloDebuggerInput")).value);
> return false;
> At unknown location
>
> [statement source code not available]
>
>
> ]
>
>
>
> On 4/16/07, Henry Minsky <henry.minsky gmail.com> wrote:
>>
>> I'll file a bug. I think I will put something that
calls
>> EncodeURIComponent into the kernel ; in swf it can
call escape() but
>> in DHTML it will call the browser function. IE and
Firefox seem to
>> support
>> it, as does Opera. Safari??
>>
>>
>>
>> On 4/16/07, P T Withington <ptw openlaszlo.org> wrote:
>> >
>> > My JavasScript book says that `escape` is
deprecated in
>> ECMAScript v3
>> > and that you should use `encodeURI` or
`EncodeURIComponent`
>> instead.
>> > Unfortunately, those don't seem to be in
Actionscript. Looks
>> like we
>> > need to fix this up in the runtime. File a
bug?
>> >
>> > [The standard for `escape` says that none of
the punctuation
>> > characters *_+-./ are escaped, so
DHTML is operating correctly
>> here.]
>> >
>> > On 2007-04-16, at 13:19 EDT, Henry Minsky
wrote:
>> >
>> > > I was tracking a bug in SOAP data down,
and one of the things
>> > > happening is
>> > > that the data in an lzpostbody from
>> > > the client is not being URLencoded
properly. We are using the
>> > > Javascript
>> > > builtin 'escape', which returns what
looks
>> > > like the wrong value in dhtml; it does
not escape a "+" character
>> > > into a hex
>> > > code.
>> > >
>> > > escape("2+2")
>> > > swf ==> '2%2B2'
>> > > dhtml ==> '2+2'
>> > >
>> > > Does anyone know if escape() is supposed
to work in DHTML, or if
>> > > there is a
>> > > standard (cross browser?) other way to
>> > > url-encode strings?
>> > >
>> > >
>> > > --
>> > > Henry Minsky
>> > > Software Architect
>> > > hminsky laszlosystems.com
>> >
>> >
>>
>>
>> --
>> Henry Minsky
>> Software Architect
>> hminsky laszlosystems.com
>>
>>
>
>
> --
> Henry Minsky
> Software Architect
> hminsky laszlosystems.com
|
|
| Re: the 'escape()' function in
javascript returns different values in
swf and dhtml |

|
2007-04-16 13:15:30 |
|
Where would be the best place to put this compatibility declaration , in LzRuntime.lzs? Or in some swf kernel file?
On 4/16/07, P T Withington
< ptw openlaszlo.org">ptw openlaszlo.org> wrote:Yup, just tested it.
I guess the solution is just:
if ($as2) { encodeURIComponent = escape; }
On 2007-04-16, at 13:42 EDT, Henry Minsky wrote:
> I'll file a bug. I think I will put something that calls
> EncodeURIComponent > into the kernel ; in swf it can call escape() but > in DHTML it will call the browser function. IE and Firefox seem to > support > it, as does Opera. Safari?? >
> > > On 4/16/07, P T Withington < ptw openlaszlo.org">ptw openlaszlo.org> wrote: >> >> My JavasScript book says that `escape` is deprecated in ECMAScript v3 >> and that you should use `encodeURI` or `EncodeURIComponent` instead.
>> Unfortunately, those don't seem to be in Actionscript. Looks like we >> need to fix this up in the runtime. File a bug? >> >> [The standard for `escape` says that none of the punctuation
>> characters *_+-./ are escaped, so DHTML is operating correctly >> here.] >> >> On 2007-04-16, at 13:19 EDT, Henry Minsky wrote: >> >> > I was tracking a bug in SOAP data down, and one of the things
>> > happening is >> > that the data in an lzpostbody from >> > the client is not being URLencoded properly. We are using the >> > Javascript >> > builtin 'escape', which returns what looks
>> > like the wrong value in dhtml; it does not escape a "+" character >> > into a hex >> > code. >> > >> > escape("2+2") >> > swf ==> '2%2B2'
>> > dhtml ==> '2+239; >> > >> > Does anyone know if escape() is supposed to work in DHTML, or if >> > there is a >> > standard (cross browser?) other way to
>> > url-encode strings? >> > >> > >> > -- >> > Henry Minsky >> > Software Architect >> > hminsky laszlosystems.com">hminsky laszlosystems.com
>> >> > > > -- > Henry Minsky > Software Architect > hminsky laszlosystems.com">hminsky laszlosystems.com
-- Henry Minsky Software Architect hminsky laszlosystems.com">hminsky laszlosystems.com
|
| Re: the 'escape()' function in
javascript returns different values in
swf and dhtml |
  United States |
2007-04-16 13:30:49 |
I guess LzRuntime. If that starts getting to messy, we can
break it
out into platform pieces.
On 2007-04-16, at 14:15 EDT, Henry Minsky wrote:
> Where would be the best place to put this compatibility
> declaration , in
> LzRuntime.lzs? Or in some swf kernel file?
>
>
>
>
> On 4/16/07, P T Withington <ptw openlaszlo.org> wrote:
>>
>> Yup, just tested it.
>>
>> I guess the solution is just:
>>
>> if ($as2) {
>> encodeURIComponent = escape;
>> }
>>
>> On 2007-04-16, at 13:42 EDT, Henry Minsky wrote:
>>
>> > I'll file a bug. I think I will put something
that calls
>> > EncodeURIComponent
>> > into the kernel ; in swf it can call escape()
but
>> > in DHTML it will call the browser function. IE
and Firefox seem to
>> > support
>> > it, as does Opera. Safari??
>> >
>> >
>> >
>> > On 4/16/07, P T Withington <ptw openlaszlo.org> wrote:
>> >>
>> >> My JavasScript book says that `escape` is
deprecated in
>> ECMAScript v3
>> >> and that you should use `encodeURI` or
`EncodeURIComponent`
>> instead.
>> >> Unfortunately, those don't seem to be in
Actionscript. Looks
>> like we
>> >> need to fix this up in the runtime. File
a bug?
>> >>
>> >> [The standard for `escape` says that none
of the punctuation
>> >> characters *_+-./ are escaped, so
DHTML is operating correctly
>> >> here.]
>> >>
>> >> On 2007-04-16, at 13:19 EDT, Henry Minsky
wrote:
>> >>
>> >> > I was tracking a bug in SOAP data
down, and one of the things
>> >> > happening is
>> >> > that the data in an lzpostbody from
>> >> > the client is not being URLencoded
properly. We are using the
>> >> > Javascript
>> >> > builtin 'escape', which returns what
looks
>> >> > like the wrong value in dhtml; it
does not escape a "+"
>> character
>> >> > into a hex
>> >> > code.
>> >> >
>> >> > escape("2+2")
>> >> > swf ==> '2%2B2'
>> >> > dhtml ==> '2+2'
>> >> >
>> >> > Does anyone know if escape() is
supposed to work in DHTML, or if
>> >> > there is a
>> >> > standard (cross browser?) other way
to
>> >> > url-encode strings?
>> >> >
>> >> >
>> >> > --
>> >> > Henry Minsky
>> >> > Software Architect
>> >> > hminsky laszlosystems.com
>> >>
>> >>
>> >
>> >
>> > --
>> > Henry Minsky
>> > Software Architect
>> > hminsky laszlosystems.com
>>
>>
>
>
> --
> Henry Minsky
> Software Architect
> hminsky laszlosystems.com
|
|
[1-8]
|
|