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
user name
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
hminskylaszlosystems.com">hminskylaszlosystems.com

Re: the 'escape()' function in javascript returns different values in swf and dhtml
country flaguser name
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
> hminskylaszlosystems.com


Re: the 'escape()' function in javascript returns different values in swf and dhtml
user name
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 < ptwopenlaszlo.org">ptwopenlaszlo.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. &nbsp;Looks like we
need to fix this up in the runtime.&nbsp; 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 "+&quot; character
> into a hex
> code.
>
> escape(&quot;2+2";)
> swf ==> '2%2B2'
>; dhtml ==> '2+2&#39;
>
&gt; 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?
&gt;
>
> --
> Henry Minsky
>; Software Architect
> hminskylaszlosystems.com">hminskylaszlosystems.com




--
Henry Minsky
Software Architect
hminskylaszlosystems.com">hminskylaszlosystems.com

Re: the 'escape()' function in javascript returns different values in swf and dhtml
user name
2007-04-16 12:44:38
BTW, Opera doesn't like the DHTML debugger&#39;s eval command for some reason. I just upgraded to Opera 9.2. Did something
change in the DHTML debugger&#39;s call to eval?

lzx> encodeURIComponent(&quot;2+2&quot;)
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

 &nbsp;  var $2_value = eval($1_expr);
  Line 1 of  script

 &nbsp;  $modules.lz.Debug.doEval((document.getElementById(&quot;LaszloDebuggerInput&quot;)).value);
return false;
&nbsp; At unknown location

  ;  [statement source code not available]


]



On 4/16/07, Henry Minsky < henry.minskygmail.com"> henry.minskygmail.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 < ptwopenlaszlo.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> ptwopenlaszlo.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. &nbsp;Looks like we
need to fix this up in the runtime.&nbsp; 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 "+&quot; character
> into a hex
> code.
>
> escape(&quot;2+2";)
> swf ==> '2%2B2'
>; dhtml ==> '2+2&#39;
>
&gt; 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?
&gt;
>;
> --
> Henry Minsky
>; Software Architect
> hminskylaszlosystems.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">hminskylaszlosystems.com




--
Henry Minsky
Software Architect
hminskylaszlosystems.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">hminskylaszlosystems.com




--
Henry Minsky
Software Architect
hminskylaszlosystems.com">hminskylaszlosystems.com

Re: the 'escape()' function in javascript returns different values in swf and dhtml
country flaguser name
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 <ptwopenlaszlo.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
>> > hminskylaszlosystems.com
>>
>>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminskylaszlosystems.com


Re: the 'escape()' function in javascript returns different values in swf and dhtml
country flaguser name
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.minskygmail.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 <ptwopenlaszlo.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
>> > > hminskylaszlosystems.com
>> >
>> >
>>
>>
>> --
>> Henry Minsky
>> Software Architect
>> hminskylaszlosystems.com
>>
>>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminskylaszlosystems.com


Re: the 'escape()' function in javascript returns different values in swf and dhtml
user name
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 < ptwopenlaszlo.org">ptwopenlaszlo.org> wrote:
Yup, just tested it.

I guess the solution is just:

if ($as2) {
 &nbsp; encodeURIComponent = escape;
}

On 2007-04-16, at 13:42 EDT, Henry Minsky wrote:

&gt; I'll file a bug. I think I will put something that calls
&gt; EncodeURIComponent
&gt; into the kernel ; in swf it can call escape() but
> in DHTML it will call the browser function. IE and Firefox seem to
> support
&gt; it, as does Opera. Safari??
&gt;
>
>
> On 4/16/07, P T Withington < ptwopenlaszlo.org">ptwopenlaszlo.org> wrote:
>;>
>&gt; 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. &nbsp;Looks like we
>>; need to fix this up in the runtime.&nbsp; File a bug?
>&gt;
>>; [The standard for `escape` says that none of the punctuation
>>; characters *_+-./ are escaped, so DHTML is operating correctly
>> here.]
>;>
>&gt; On 2007-04-16, at 13:19 EDT, Henry Minsky wrote:
>;>
>&gt; > I was tracking a bug in SOAP data down, and one of the things
&gt;> > happening is
>>; > that the data in an lzpostbody from
>&gt; > the client is not being URLencoded properly. We are using the
>&gt; > Javascript
>> > builtin 'escape', which returns what looks
&gt;> > like the wrong value in dhtml; it does not escape a "+&quot; character
>> > into a hex
>&gt; > code.
>> >
>&gt; > escape(&quot;2+2";)
>> > swf ==> '2%2B2'
>;> > dhtml ==> '2+2&#39;
>>; >
>&gt; > Does anyone know if escape() is supposed to work in DHTML, or if
>>; > there is a
>> > standard (cross browser?) other way to
>&gt; > url-encode strings?
&gt;> >
>&gt; >
>&gt; > --
>>; > Henry Minsky
>;> > Software Architect
>> > hminskylaszlosystems.com">hminskylaszlosystems.com
>>
&gt;>
>
>
> --
> Henry Minsky
>; Software Architect
> hminskylaszlosystems.com">hminskylaszlosystems.com




--
Henry Minsky
Software Architect
hminskylaszlosystems.com">hminskylaszlosystems.com

Re: the 'escape()' function in javascript returns different values in swf and dhtml
country flaguser name
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 <ptwopenlaszlo.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 <ptwopenlaszlo.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
>> >> > hminskylaszlosystems.com
>> >>
>> >>
>> >
>> >
>> > --
>> > Henry Minsky
>> > Software Architect
>> > hminskylaszlosystems.com
>>
>>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminskylaszlosystems.com


[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )