How do you safely encode a URL using JavaScript such that it can be put into a GET string?  var myUrl = "http://example.com/index.html?param=1&anotherParam=2"; var myOtherUrl = "http://example.com/index.html?url=" + myUrl;   I a...
When encoding a query string to be sent to a web server - when do you use escape() and when do you use encodeURI() or encodeURIComponent():  Use escape:  escape("% +&=");   OR  use encodeURI() / encodeURIComponent()  encodeURI("http...
I'm trying to download a binary file using XMLHttpRequest (using a recent Webkit) and base64-encode its contents using this simple function:  function getBinary(file){     var xhr = new XMLHttpRequest();       xhr.open("GET", file, fals...
In JavaScript:  encodeURIComponent("©?") == "%C2%A9%E2%88%9A"   Is there an equivalent for C# applications? For escaping HTML characters I used:  txtOut.Text = Regex.Replace(txtIn.Text, @"[\u0080-\uFFFF]",     m => @"...
I'm trying to upload a base64 image to a FaceBook page using Node.js. I have managed to get the upload working with all the multipart data etc should I read the file from the filesystem (ie. using fs.readFileSync('c:\a.jpg')  However, s...
What is the equivalent of JavaScript's encodeURIcomponent function in PHP?...
The JSON standard defines objects in one way and the ECMAScript (JavaScript) standard defines it in another.   It is often said that JSON objects are a subset of JavaScript objects, is this true?  Is every JSON object also a valid JavaScript object...
I'm trying to pass the output of a SQL Server exception to the client using the RegisterStartUpScript method of the MS ScriptManager in .NET 3.5. This works fine for some errors but when the exception contains single quotes the alert fails.  I...
I am trying to export an HTML table to Excel using javascript. This is the javascript code  <script type="text/javascript">     var tableToExcel = (function() {           var uri = 'data:application/vnd.ms-excel;base64,'...
I recently added a CSV-download button that takes data from database (Postgres) an array from server (Ruby on Rails), and turns it into a CSV file on the client side (Javascript, HTML5). I'm currently testing the CSV file and I am coming across s...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.