4
votes
7answers
625 views

URL encoding a string from JS to Drupal

I have a Drupal web app that uses Ajax; the Ajax function, sometimes, needs to pass string as parameters to a Drupal function as $.ajax({url: "index.php?q=get_value/"+encodeURIComponent(value), ...
4
votes
1answer
73 views

Can I urlencode null when sending request?

I'm trying to send a request that origins from an object that contains null values: ajax_post("path", {name: "Name", status: null}, callback); I have my own method that URL encodes the objects. ...
3
votes
2answers
561 views

how do I properly encode a URL in JavaScript?

I am working on a browser plugin that takes the URL of the current page or any selected link as a parameter and send it to our server. When characters of the basic latin alphabet are present in the ...
3
votes
1answer
414 views

Proper way to encode a (relative) URL using PHP

I'm trying to encode the following relative URL using PHP: /tracks/add/5449326 I've tried using rawurlencode and urlencode. Which made it look something like: %2Ftracks%2Fadd%2F5449326 I'm going ...
2
votes
2answers
469 views

Is `document.referrer` url-encoded or not?

I wrote a small test page to grab document.referrer of users with javascript and send it to a simple log server (like sendReferrer(document.referrer)). The referrer Firefox sends is always ...
2
votes
1answer
1k views

Firefox strange single quotes conversion in urls

Does anybody know why FF encodes single quote ' into %27 ? Single quote is supposed to be a valid char in URLs. In-fact all other browser IE7/IE8/Chrome5/Safari4 work well by NOT encoding single ...
2
votes
1answer
224 views

Url encoding for query params in Ember.js

I am using Ember.js, version 1.7.0-beta.1, in my latest project. I use the query params feature to make a list survive a hard refresh (e.g. after a reload, the selected items in the list are still ...
2
votes
3answers
4k views

when assigning location.href, please explain url encoding (in asp.net and firefox)

In some javascript, I have: var url = "find.aspx?" + "location=" + encodeURIComponent( address ); alert( url ); location.href = url; where the value of address is the string "Seattle, WA". In the ...
2
votes
1answer
192 views

Force unescapeing of ajax query parameters

What I am doing I am building a query to a service. I query the service using ajax and get a response in JSON. I am querying the Google map API service. Reverse Geocoding Here is a sample query: ...
2
votes
2answers
417 views

Spaces in URIs in Firefox 7

In Firefox version 7.0.1, URIs with encoded spaces in them are automatically converted to a space in the Location Bar. This does not happen in Internet Explorer. For example, I have a textbox on ...
1
vote
1answer
4k views

URL component encoding in Node.js

I want to send http request using node.js. I do: http = require('http'); var options = { host: 'www.mainsms.ru', path: ...
1
vote
2answers
2k views

url encoding with javascript window open

ASP.NET 4.0, webform site There is a link in my site is to call another page and pass url parameters, it looks like below. http://www.foo.com/foo.aspx?anotherURI?param1=aaa&26param2=bbb ...
1
vote
1answer
944 views

Strange javascript decoding behavior in IE

I run the following html snippet in IE8 and IE7 with non-English characters (we tried both Hebrew and Chinese), and the second link never works properly. The displayed text in the alert box is ...
1
vote
3answers
2k views

How to append encoded parameters to the url using javascript?

I have a search input box and I am appending its data to an URL after the "#", e.g http://test.cl.com/#pqr xyz (using hash to avoid reloading of page). It is working fine but my data is not encoded as ...
1
vote
1answer
139 views

Strange Javascript URL encoding result for multiple spaces

I have some javascript that reads the user input from an HTML field (using .text() ). I am then sending that text via URL (FMP protocol, not HTTP, but does the same encoding). When I enter in ...
1
vote
1answer
316 views

How to send data from browser to server and reply back

On my webpage I have a textarea where the user inputs all kind of characters. When he saves it I want to send the data using AJAX to the server for storing in the database. After this, the server will ...
1
vote
1answer
188 views

How to implement angular js website with question mark in url

I am new to angularJs. I have a issue when I am working on an app with angularjs and ruby on rails at the backend. Whenever i have a '?' in the url it gets converted into %3f in the url and hence ...
1
vote
1answer
121 views

Most efficient way to send ascii characters to mailto without reaching URL limit

I have a form which is submitted via mailto to a email server. As you most know, there is a limitation to the mailto content over which it won't work because it exceeds URL characters limit. I ...
1
vote
0answers
150 views

Are Browser URL encoded XSS Attacks vulnerable?

I am using Burp Tool and Firefox . This is the attack . http://localhost/xssWebsite/?aParameter=<script>alert('XSS');</script> I perform this attack in two ways. Using Burp Suite ...
1
vote
1answer
607 views

XSS vulnerability when <c:url> and <c:param> value is injected into a JavaScript string literal

My static analyzer has flagged the following XSS error. I would like to understand if it is possible to inject malicious code into this parameter, to cause the injected value to be interpreted as ...
1
vote
2answers
212 views

PHP + AJAX send data (link) trouble

I use my own AJAX code to send data, it worked, AJAX sent & PHP code gets a variable, but: When I try send a link ( ex: http://abc.com/abc+/ ) or var like folder name has + it return string ...
1
vote
4answers
1k views

Cyrillic URLs in Google Chrome?

I'm having troubles with cyrillic URLs in my site. Well, I change my URLs with Javascript (jQuery) and cyrillic characters work fine in every browser instead Google Chrome, where it's shown thir ...
0
votes
1answer
8k views

How to decode url-encoded string in javascript

I use javascript / jquery to fill dom elements that contain umlauts: var text1 = "Unser platonisches Internetreich droht in die H%E4nde einer bewaffneten Miliz zu fallen." $("#quote1 ...
0
votes
2answers
3k views

Javascript: regex to replace some characters with their hexadecimal code

I haven't been able to find an example that does something similar to what I want, that is, replace: % with %25 & with %26 / with %2F # with %23 " with space \ with space For the reference ...
0
votes
3answers
438 views

How to POST back a textarea with enters?

I have a HTML / Javascript page with some textarea. The user are typing their text with enter to create new lines. The problem lies when the form is submitted via ajax (with the functionnality of ...
0
votes
2answers
4k views

JS encodeURIComponent result different from the one created by FORM

I thought values entered in forms are properly encoded by browsers. But this simple test file "test_get_vs_encodeuri.html" shows it's not true: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 ...
0
votes
1answer
205 views

Convert string to array JavaScript

I have urlencoded JSON data: %5B%5B"Task"%2C"Hours%20per%20Day"%5D%2C%5B"Work"%2C11%5D%2C%5B"Eat"%2C2%5D%2C%5B"Commute"%2C2%5D%2C%5B"Watch%20TV"%2C2%5D%2C%5B"Sleep"%2C7%5D%5D I have already ...
0
votes
3answers
221 views

Problems with passing Euro Sign as URL parameter

I am trying to pass the Euro ( € ) sign as url parameter in my spring jsp. What is the right way to do so ? I tried the following with no avail. Problem is the character is getting encoded properly ...
0
votes
1answer
125 views

What are the equivalents of encodeURL and decodeURL in NodeJS

What functions/modules should I use in order to have the same functionality like the client JavaScript functions: encodeURL/Component and decodeURL/Component? Is there a core module to do this?
0
votes
3answers
649 views

Pound (£) and euro (€) signs encoded wrong in external JavaScript file

I'm trying to encode the £ sign in an external JS file but I keep getting '%EF%BF%BD'. Here's the code in its simplicity: alert(encodeURIComponent("£")); The same alert gives me '%C2%A3' on the ...
0
votes
2answers
1k views

the case of url percent encoding

In this page, it is possible to decode Some+website+you+got%21%0AGood+luck+%28you%27ll+need+it%29%0A%7E%7E+The+Slug+%7E%7E into Some website you got! Good luck (you'll need it) ~~ The Slug ~~ ...
0
votes
1answer
28 views

Google App Script make get request to another script with parameters

I have two google scripts: 1) Script A with url say sa/exec which accepts parameters a,b,c 2) Script B with url say sb/exec I have to call doGet(e) of script A from script B. Manually I can do it ...
0
votes
1answer
122 views

Is JavaScript Injection possible if the URL is inserted into a JavaScript string?

Is it possible to inject and execute javascript in the following context? Or terminate the JavaScript string? The URL is inserted into a JavaScript string (double-quote delimited) The URL is URL ...
0
votes
1answer
123 views

Russian URI using JavaScript

I have a link with half part in English and other half in Russian character. ex: http://www.xxx.xx/?card=1234&/русский/как-это-сделать/ When I do a encodeURIComponent(document.URL) inside java ...
0
votes
1answer
243 views

Does it matter the different behavior between PHP `rawurlencode` and JS `encodeURIComponent`?

According to http://stackoverflow.com/a/1734255/1529630, encodeURIComponent is the same as rawurlencode, but !*'() aren't escaped, e.g., function encodeURIComponent($str) { $revert = ...
0
votes
1answer
237 views

JS url encoding

when trying to encode the URL http://www.example.com/events/tours/example-tour/?utm_source=example&utm_medium=banner it gives me back the following: ...
0
votes
1answer
64 views

Should I worry that using GET in a form element doesn't automatically URL-encode angle brackets?

So I decided to use GET in my form element, point it to my cshtml page, and found (as expected) that it automatically URL encodes any passed form values. I then, however, decided to test if it ...
0
votes
1answer
130 views

URL encoding in javascript

I have this parameter [email protected] in my url. I want to encode it using javascript, I dont want . in my url.
0
votes
0answers
36 views

mysql_real_escape_string leaves slashes

I am using post method to send data. And the data is an array so I just use encodeURIComponent before it is send. POST data: data = "data="+encodeURIComponent(JSON.stringify(data)); And in the ...
0
votes
0answers
11 views

How to encode a url as a query parameter when using Xmlhttprequest?

I will be using Xmlhttprequest to make an api call using javascript. One of the query parameters of the url to which I will be making a call will be also url - one that may have a variety of symbols ...
0
votes
0answers
34 views

Tomcat Bad Request on page reload - encoding issue - Backbone webapp with Spring MVC

Recently I updated my web app to encode certain URI components as they contain slashes and I should be encoding slashes in my URI components. I'm using the JavaScript encodeURIComponent() call to do ...
0
votes
0answers
60 views

URL encoding ampersand in href attribute

I'm having some difficulty narrowing down the problem, I am wondering if anyone can help. We are storing a URI in a element href attribute. This URI is dynamically created. One of the URI path ...
0
votes
1answer
611 views

Javascript: SyntaxError: identifier starts immediately after numeric literal

I need to fix that (not mine) code: var addr = escape('<a ...
0
votes
0answers
24 views

How to Obtain Image Bytes as String in JavaScript?

All I have is <input type="file" name="myFileUpload" />. After the user chooses a file (most likely an image), how do I obtain the actual contents of the file as a string? (If possible, please ...
0
votes
2answers
75 views

passing @ symbol to mailto field, or how to bypass URL encoding in google-app-script

I'm trying to specify a mailto link in an Html template, for a google app script. Unfortunately, the link <a href="mailto:[email protected]"> is converted to <a href="mailto:foo%40bar.com"> ...
0
votes
1answer
88 views

URI Escape for strings [duplicate]

I am referencing an API for developing an application for a social platform called Mixi. I am stuck at a point where it says the following: For a parameter to be passed correctly to payment API, the ...
0
votes
2answers
230 views

encodeURIComponent is failing

So I am trying to create a search in my website and I need to encode some text so it is URL friendly. However, if I search anything with a "<" symbol I get HTTP error 403 (access forbidden) because ...
0
votes
1answer
451 views

URL encoding in Javascript and Java servlet

I have a Java script that should call and pass parameters servlet using url encoding. The java script gets the parameters from the html form. I have done this and validated the input. I'm not sure how ...
0
votes
2answers
1k views

How to prevent JavaScript encoding the query string in a location.replace()? [duplicate]

Possible Duplicate: JavaScript URL Decode function I have an already encoded URL string printed in my HTML template via Django. When I place this in a call to location.replace() it gets ...
0
votes
1answer
264 views

url encoding javascript of $0 value

I want to encode the value being pass by $0 in jsp, how can I do that? Below is the snippet of the code: ..href='"url+"$0'>$0"