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...
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 have a javascript function which passes as a query string value another query string.  In other words, I want the query string to be:   http://www.somesite.com/?somequery=%3fkey%3dvalue1%2520%26%2520key2%3value3   However, if I redirect like this:...
I'm using Node.js:  var s = 'Who\'s that girl?'; var url = 'http://graph.facebook.com/?text=' + encodeURIComponent(s);  request(url, POST, ...)   This does not work! And Facebook cuts off my text...  Full code:  function postT...
I want to load some text from other site wich the content is GBK encoded, but my site is UTF8.  Is there anyway by which I can convert these GBK text into UTF8 for display ?  For some reasons I can only use Javascript for this....
My site works fine on localhost, my javascript is loading and working fine. But when I deploy the site the script is not working. When I right click the page and say view source and then view the linked script file, it has some strange characters at...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.