473,761 Members | 2,410 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Plus sign not shown

Hi All

I am using ajax as follows:

var parameters = "groups=" + escape(my****** ***@gmail.com);
var url="/mydomain/ajaxCall";

if (req != null) {

req.open("POST" , url, true);
req.setRequestH eader("Content-type", "applicatio n/x-www-form-
urlencoded");
req.send(parame ters);
req.onreadystat echange=process Resp2;
}

I noticed that inside the ajaxCall the plus (+) sign is replaced with
a space in the string escaped (myemail 10*@gmal.com)

Could someone tell me how to do this correctly?

Thanks
Oct 16 '08 #1
5 9089
souporpo...@gma il.com wrote:
I am using ajax as follows:

var parameters = "groups=" + escape(myemail+ ...@gmail.com);
var url="/mydomain/ajaxCall";

* * * * if (req != null) {

* * * * * * * req.open("POST" , url, true);
* * * * * * * req.setRequestH eader("Content-type", "applicatio n/x-www-form-
urlencoded");
* * * * * * * req.send(parame ters);
* * * * * * * req.onreadystat echange=process Resp2;
* * * * }

I noticed that inside the ajaxCall the plus (+) sign is replaced with
a space in the string escaped (myemail 1...@gmal.com)

Could someone tell me how to do this correctly?
'+' is a reserved character; it is one of the 2 possible ways to
percent-encode a space (the other one is '%20'). You should send '%2B'
if you want to send the plus-sign.

See section 2.2.in RFC 3986:
http://www.ietf.org/rfc/rfc3986.txt

In your code:

parameters = parameters.repl ace(/\+/g,'%2B');

More info:
http://en.wikipedia.org/wiki/Percent-encoding

Hope this helps,

--
Bart
Oct 16 '08 #2
On Oct 16, 10:07*am, Bart Van der Donck <b...@nijlen.co mwrote:
souporpo...@gma il.com wrote:
I am using ajax as follows:
var parameters = "groups=" + escape(myemail+ ...@gmail.com);
var url="/mydomain/ajaxCall";
* * * * if (req != null) {
* * * * * * * req.open("POST" , url, true);
* * * * * * * req.setRequestH eader("Content-type", "applicatio n/x-www-form-
urlencoded");
* * * * * * * req.send(parame ters);
* * * * * * * req.onreadystat echange=process Resp2;
* * * * }
I noticed that inside the ajaxCall the plus (+) sign is replaced with
a space in the string escaped (myemail 1...@gmal.com)
Could someone tell me how to do this correctly?

'+' is a reserved character; it is one of the 2 possible ways to
percent-encode a space (the other one is '%20'). You should send '%2B'
if you want to send the plus-sign.

See section 2.2.in RFC 3986:http://www.ietf.org/rfc/rfc3986.txt

In your code:

* parameters = parameters.repl ace(/\+/g,'%2B');

More info:http://en.wikipedia.org/wiki/Percent-encoding

Hope this helps,

--
*Bart
Thanks for the clarification. I tried replace as suggested above
and also encodeURI. The plus sign still gets dropped.

I don't know what else to try. Your kind help is appreciated.
Oct 16 '08 #3
so*********@gma il.com wrote:
Bart Van der Donck wrote:
>souporpo...@gm ail.com wrote:
>>I am using ajax as follows:
var parameters = "groups=" + escape(myemail+ ...@gmail.com);
var url="/mydomain/ajaxCall";
if (req != null) {
req.open("POST" , url, true);
req.setRequestH eader("Content-type", "applicatio n/x-www-form-
urlencoded" );
req.send(parame ters);
req.onreadystat echange=process Resp2;
}
I noticed that inside the ajaxCall the plus (+) sign is replaced with
a space in the string escaped (myemail 1...@gmal.com)
Could someone tell me how to do this correctly?
'+' is a reserved character; [...]
In your code:

parameters = parameters.repl ace(/\+/g,'%2B');
[...]

I tried replace as suggested above and also encodeURI. The plus sign
still gets dropped.

I don't know what else to try. Your kind help is appreciated.
You could post the code that you are using. The code that you have posted
so far does not run because it is syntactically invalid (you did not quote
the argument of escape); who knows what other typos/omissions are there.

Please trim your quotes to the relevant parts.
PointedEars
--
var bugRiddenCrashP ronePieceOfJunk = (
navigator.userA gent.indexOf('M SIE 5') != -1
&& navigator.userA gent.indexOf('M ac') != -1
) // Plone, register_functi on.js:16
Oct 16 '08 #4
On Oct 17, 12:20*am, "souporpo...@gm ail.com" <soup_or_po...@ yahoo.com>
wrote:
Thanks for the clarification. I tried replace as suggested above
and also encodeURI. The plus sign still gets dropped.

I don't know what else to try. Your kind help is appreciated.
Use encodeURICompon ent() instead of escape() for encoding your POST
data.

/sasuke
Oct 17 '08 #5
On Oct 16, 10:50*pm, sasuke <database...@gm ail.comwrote:
On Oct 17, 12:20*am, "souporpo...@gm ail.com" <soup_or_po...@ yahoo.com>
wrote:
Thanks for the clarification. I tried replace as suggested above
and also encodeURI. The plus sign still gets dropped.
I don't know what else to try. Your kind help is appreciated.

Use encodeURICompon ent() instead of escape() for encoding your POST
data.

/sasuke
thank you; the encodeURICompon ent worked like a charm

regards
Oct 17 '08 #6

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

Similar topics

4
4121
by: r0adh0g | last post by:
I am attempting to build a primitive search form on my site. It is searching an Access Database Table and comparing on field in the database to a field passed from the form. Works great if only one word is keyed in. If two words are keyed in, it separates them with a plus sign. I have tried using the split command to parse out the data but that function does not recognize the plus sign. Any help here? I know some of you folks have...
1
2109
by: lbbs | last post by:
Newbie, so please don't flame me. I am just starting to learn access. I seem a feature in access a while ago, but don't remember what it was called. I seen project lab example that had, a plus sign besides the inventory (key)number. When you click on the plus sign it show sub items under each inventory number. I am trying to start a small data base that has no duplicate key inventory numbers (with this feature it will make that...
2
1780
by: Tim Wallace | last post by:
Perhaps my original post wasn't clear enough, so I'll try to reword. I only want to retrieve a node at a time for my treeview control. As the user clickes the plus sign, I will populate child nodes. In pre-.NET, it was easy to do. In .NET, using Visual C# 2005 EE Beta, if I don't insert a child, the plus sign will not show. Is there a way to make this happen? Tim
0
1519
by: Emil Georgiev | last post by:
Hell I have a Web Custom Control project in ASP.NET. I'm using a subclassing technique to add functionality in HyperLink web server control. I want to create a property "BrowserWindow" of my class "NewWinHyperLink" which will contain child properties. When I use this custom control in testing web application these child properties don't appear with 'plus sign' in visual studio designer. I want to make my parent property to have plus...
2
2685
by: B-Dog | last post by:
I was trying to use the treeview and was wondering if there was a way to make the treeview select the node when you click the plus sign next to it. The only way I've found to do it is to actually click on the node name and then it will show it selected. I'd like to change to selected when you click the plus sign. Is this possible. Thanks
2
4034
by: Dave Bazell | last post by:
I was using Math::BigInt and found that postive integers have a leading plus sign: +12345678900000 Is there a way to supress this? Thanks, Dave
2
1124
by: Robert Bravery | last post by:
Hi all I have a dataset with three tables. On my form I have two grids. Both grids have the default plus sign on the side of the grid. I have set up my tables and columns collection the way I want, but I don't need the plus sign to open any child records. How can i get rid of this. As I am ne to VB and .net, I tried every thing I can think of in the VS IDE Thanks Robert
2
1499
by: blue_nirvana | last post by:
Is there an event that fires when a user clicks the plus sign in a Master/Detail datagrid? It would be even better if I could catch when the user clicks the link to see the detail records. What I'm wanting to do is not load the detail data until the user clicks the link. Any ideas or links would be appreciated. Thanks
1
3789
by: =?Utf-8?B?Sm9zdWZm?= | last post by:
Hi: I've been using MSN Bill Pay for years to pay my bills. I recently decided to look into Microsoft Money as I wanted a desktop application to manage and pay my bills. I downloaded the trial and set things up. Everything worked fine until I got to the point of adding MSN Bill Pay as an account. I was able to add it but when it came time to access it, I couldn't figure out where to go within MSN Bill Pay to have it give me a PIN or...
0
9522
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9336
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9948
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9902
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9765
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8770
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.