encodeURIComponent() is missing?

S

Serguei.Goumeniouk

Dear Experts,
I have a very simple javascript codes with a following lines inside:
............................
var str = "";
.. . . . . . . . . .
str = String(new Date()); // #1
str += fobj.elements.name + "=" + fobj.elements.value +
"&"; // #2
str += fobj.elements.name + "=" +
encodeURIComponent(fobj.elements.value) + "&"; // #3
str = 'Test'; // #4
............................

1) If I commented out the line #3 everything works OK.
2) If I leave this line in my script, lines #1 and #2 have no
problems, but the line #3 failed (without any trace) and I never reach
the line #4.

It seems the global function "encodeURIComponent()" is missing (by the
way, the global functions "String()" and "Date()" are not missing and
they returns a correct value).
How I can fix this problem?
Regards,
Serguei.
 
E

Evertjan.

wrote on 16 mrt 2007 in comp.lang.javascript:
Dear Experts,
I have a very simple javascript codes with a following lines inside:
...........................
var str = "";
. . . . . . . . . .
str = String(new Date()); // #1
str += fobj.elements.name + "=" + fobj.elements.value +
"&"; // #2
str += fobj.elements.name + "=" +
encodeURIComponent(fobj.elements.value) + "&"; // #3

str = 'Test'; // #4
...........................

1) If I commented out the line #3 everything works OK.
2) If I leave this line in my script, lines #1 and #2 have no
problems, but the line #3 failed (without any trace) and I never reach
the line #4.

It seems the global function "encodeURIComponent()" is missing (by the
way, the global functions "String()" and "Date()" are not missing and
they returns a correct value).
How I can fix this problem?

Test this:

<script type='text/javascript'>
alert('=' + encodeURIComponent('blah') + '&');
</script>

If that works it should work.
 
S

Serguei.Goumeniouk

Hi Evertjan,
I tried, but it does not help.
Serguei.

Evertjan. said:
wrote on 16 mrt 2007 in comp.lang.javascript:
Dear Experts,
I have a very simple javascript codes with a following lines inside:
...........................
var str = "";
. . . . . . . . . .
str = String(new Date()); // #1
str += fobj.elements.name + "=" + fobj.elements.value +
"&"; // #2
str += fobj.elements.name + "=" +
encodeURIComponent(fobj.elements.value) + "&"; // #3

str = 'Test'; // #4
...........................

1) If I commented out the line #3 everything works OK.
2) If I leave this line in my script, lines #1 and #2 have no
problems, but the line #3 failed (without any trace) and I never reach
the line #4.

It seems the global function "encodeURIComponent()" is missing (by the
way, the global functions "String()" and "Date()" are not missing and
they returns a correct value).
How I can fix this problem?

Test this:

<script type='text/javascript'>
alert('=' + encodeURIComponent('blah') + '&');
</script>

If that works it should work.


Regards,
Serguei.
 
E

Evertjan.

wrote on 16 mrt 2007 in comp.lang.javascript:
Evertjan. said:
wrote on 16 mrt 2007 in comp.lang.javascript:
Dear Experts,
I have a very simple javascript codes with a following lines
inside: ...........................
var str = "";
. . . . . . . . . .
str = String(new Date()); // #1
str += fobj.elements.name + "=" + fobj.elements.value +
"&"; // #2
str += fobj.elements.name + "=" +
encodeURIComponent(fobj.elements.value) + "&"; // #3

str = 'Test'; // #4
...........................

1) If I commented out the line #3 everything works OK.
2) If I leave this line in my script, lines #1 and #2 have no
problems, but the line #3 failed (without any trace) and I never
reach the line #4.

It seems the global function "encodeURIComponent()" is missing (by
the way, the global functions "String()" and "Date()" are not
missing and they returns a correct value).
How I can fix this problem?

Test this:

<script type='text/javascript'>
alert('=' + encodeURIComponent('blah') + '&');
</script>

If that works it should work.


[Please do not toppost on usenet]
I tried, but it does not help.

But did the above test work?
 
S

Serguei.Goumeniouk

Hi Gérard,
1) I removed all form-related stuff and just call this function like
following:
str = encodeURIComponent('Serg');
OR
str = alert(encodeURIComponent('Serg'));

In both cases my script does not work. It seems this function is
missing in some JavaScript library. By the way, my web application
works OK, if an IE browser is launched at my friend's computer.

2) I tried 2 browsers:
Internet Explorer version 6.0.2900.2180
Mozilla Firefox version 1.5.0.10

Regards,
Serguei.

Gérard Talbot said:
Dear Experts,
I have a very simple javascript codes with a following lines inside:
...........................
var str = "";
. . . . . . . . . .
str = String(new Date()); // #1
str += fobj.elements.name + "=" + fobj.elements.value +
"&"; // #2
str += fobj.elements.name + "=" +
encodeURIComponent(fobj.elements.value) + "&"; // #3
str = 'Test'; // #4
...........................

1) If I commented out the line #3 everything works OK.
2) If I leave this line in my script, lines #1 and #2 have no
problems, but the line #3 failed (without any trace) and I never reach
the line #4.

It seems the global function "encodeURIComponent()" is missing (by the
way, the global functions "String()" and "Date()" are not missing and
they returns a correct value).
How I can fix this problem?
Regards,
Serguei.


1-
Please explain precisely and exactly how you create that form reference
fobj
and how it is defined, accessed.

2-
Please define which browser and browser version you are testing here.

Gérard
 
S

Serguei.Goumeniouk

Hi Evertjan,
No, this test does not work. It seems the encodeURIComponent()
function is missing or it is not accessible. By the way, my web
application works, if an IE browser is launched from some another
computer. I compare settings of both browsers and they are identical.
Regards,
Serguei.

Evertjan. said:
wrote on 16 mrt 2007 in comp.lang.javascript:
Evertjan. said:
wrote on 16 mrt 2007 in comp.lang.javascript:

Dear Experts,
I have a very simple javascript codes with a following lines
inside: ...........................
var str = "";
. . . . . . . . . .
str = String(new Date()); // #1
str += fobj.elements.name + "=" + fobj.elements.value +
"&"; // #2
str += fobj.elements.name + "=" +
encodeURIComponent(fobj.elements.value) + "&"; // #3

str = 'Test'; // #4
...........................

1) If I commented out the line #3 everything works OK.
2) If I leave this line in my script, lines #1 and #2 have no
problems, but the line #3 failed (without any trace) and I never
reach the line #4.

It seems the global function "encodeURIComponent()" is missing (by
the way, the global functions "String()" and "Date()" are not
missing and they returns a correct value).
How I can fix this problem?

Test this:

<script type='text/javascript'>
alert('=' + encodeURIComponent('blah') + '&');
</script>

If that works it should work.


[Please do not toppost on usenet]
I tried, but it does not help.

But did the above test work?
 
E

Evertjan.

wrote on 19 mrt 2007 in comp.lang.javascript:
No, this test does not work.

I asked you before not to toppost on usenet.
I do not want to go on if you persist.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,068
Latest member
MakersCBDIngredients

Latest Threads

Top