473,394 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

encodeURIComponent() is missing?

Dear Experts,
I have a very simple javascript codes with a following lines inside:
............................
var str = "";
.. . . . . . . . . .
str = String(new Date()); // #1
str += fobj.elements[i].name + "=" + fobj.elements[i].value +
"&"; // #2
str += fobj.elements[i].name + "=" +
encodeURIComponent(fobj.elements[i].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.

Mar 16 '07 #1
9 9511
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[i].name + "=" + fobj.elements[i].value +
"&"; // #2
str += fobj.elements[i].name + "=" +
encodeURIComponent(fobj.elements[i].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.



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 16 '07 #2
Hi Evertjan,
I tried, but it does not help.
Serguei.

Evertjan. wrote:
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[i].name + "=" + fobj.elements[i].value +
"&"; // #2
str += fobj.elements[i].name + "=" +
encodeURIComponent(fobj.elements[i].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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 16 '07 #3
wrote on 16 mrt 2007 in comp.lang.javascript:
Evertjan. wrote:
>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[i].name + "=" + fobj.elements[i].value +
"&"; // #2
str += fobj.elements[i].name + "=" +
encodeURIComponent(fobj.elements[i].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?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 16 '07 #4
Se****************@cibc.ca wrote :
Dear Experts,
I have a very simple javascript codes with a following lines inside:
...........................
var str = "";
. . . . . . . . . .
str = String(new Date()); // #1
str += fobj.elements[i].name + "=" + fobj.elements[i].value +
"&"; // #2
str += fobj.elements[i].name + "=" +
encodeURIComponent(fobj.elements[i].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
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Mar 17 '07 #5
Gérard Talbot wrote :
Se****************@cibc.ca wrote :
> Dear Experts,
I have a very simple javascript codes with a following lines inside:
...........................
var str = "";
. . . . . . . . . .
str = String(new Date()); // #1
str += fobj.elements[i].name + "=" + fobj.elements[i].value +
"&"; // #2
str += fobj.elements[i].name + "=" +
encodeURIComponent(fobj.elements[i].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
The following works as expected in Firefox 2.0.0.2 and in Seamonkey 1.5a
rv:1.9a3pre build 2007031608 under XP Pro SP2.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Testing encodeURIComponent(str)</title>

<script type="text/javascript">
function encode()
{
alert("= " +
encodeURIComponent(document.forms["FormName"].elements["NotEncodedYet"].value));
}
</script>

<form name="FormName" action="">
<p><input name="NotEncodedYet" type="text"><br>
<input type="button" value="Encode" onclick="encode();"></p>
</form>

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Mar 17 '07 #6
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 wrote:
Se****************@cibc.ca wrote :
Dear Experts,
I have a very simple javascript codes with a following lines inside:
...........................
var str = "";
. . . . . . . . . .
str = String(new Date()); // #1
str += fobj.elements[i].name + "=" + fobj.elements[i].value +
"&"; // #2
str += fobj.elements[i].name + "=" +
encodeURIComponent(fobj.elements[i].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
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Mar 19 '07 #7
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. wrote:
wrote on 16 mrt 2007 in comp.lang.javascript:
Evertjan. wrote:
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[i].name + "=" + fobj.elements[i].value +
"&"; // #2
str += fobj.elements[i].name + "=" +
encodeURIComponent(fobj.elements[i].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?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 19 '07 #8
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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 19 '07 #9
Serguei

Reading is easier, intuitive, natural because the chronological order of
messages (messages, replies, replies to replies, etc.) is easy to do, is
done from top to bottom (we all read from top to bottom) and contextual
reading, contextual comprehensiveness of the last message are preserved,
guaranteed. The readers do not have to scroll up and down all the time
to figure out what was said or replied, to understand the contextual
logic of a long discussion spread on several messages, within a thread,
among several posters. When bottom-posting is respected, the last
message of a thread keeps all the important issues of a long thread of
messages.
Bottom-posting serves the purpose of archiving and of searching among
posted messages.
In what way or why (avantages, inconvénients) bottom-posting would be
better?
>To reply after quoted material (bottom-posting) or, even better, to
reply inside the quoted message, at the spot where you want to reply
>>What do you propose then?
When you reply before quoted text, people end up reading in the
reverse order of exchanges of posted messages. We all read from top to
bottom, not from bottom to top.
>>>>What?? What are you talking about??
>It's when you reply after quoted replies
>>What's top-posting anyway?
>>>Please stop top-posting!
------------------
>>>>>>>Please stop top-posting!
>>What's top-posting anyway?
>It's when you reply after quoted replies
What?? What are you talking about??
When you reply before quoted text, people end up reading in the
reverse order of exchanges of posted messages. We all read from top to
bottom, not from bottom to top.
>>What do you propose then?
To reply after quoted material (bottom-posting) or, even better, to
reply inside the quoted message, at the spot where you want to reply
In what way or why (avantages, inconvénients) bottom-posting would be
better?
Reading is easier, intuitive, natural because the chronological order of
messages (messages, replies, replies to replies, etc.) is easy to do, is
done from top to bottom (we all read from top to bottom) and contextual
reading, contextual comprehensiveness of the last message are preserved,
guaranteed. The readers do not have to scroll up and down all the time
to figure out what was said or replied, to understand the contextual
logic of a long discussion spread on several messages, within a thread,
among several posters. When bottom-posting is respected, the last
message of a thread keeps all the important issues of a long thread of
messages.
Bottom-posting serves the purpose of archiving and of searching among
posted messages.
Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Mar 20 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steven T. Hatton | last post by:
If you happen to have Accelerated C++ by Koenig and Moo, and haven't gotten around to reading it, I suggest you count the pages between page 18 and page 51. I came up with zero. This is very...
5
by: fochie | last post by:
Greetings, I'm trying to send data to my server using xmlhttp POST. The data being sent is actually an HTML page that is built with javascript in the browser. The HTML code contains a small...
102
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
0
by: kris | last post by:
hi can any one help me out, i have written a code for Word Indexing using Dll's i think this is an incomplete code for WORD INDEX. I had encountered this error "Error! No index entries found"...
17
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). ...
3
by: Fred Chateau | last post by:
Still working on my XML DataSet... Having moved on past difficult and complex problems, resolved with the assistance of everyone here, I find myself facing yet another problem. My XML document...
10
by: Peter Michaux | last post by:
Hi, All Ajax libraries I've read use encodeURIComponent() on the name- value pairs extracted from forms before POST ing the result to the server with and xmlhttprequest. I can understand why...
2
by: =?Utf-8?B?RGFubnkgVnVjaW5lYw==?= | last post by:
Hi, I've a problem reading querystring parameters that are 'uri encoded'. Anyone has a solution for this? To reproduce the problem, create a classic ASP containing the following code: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.