client-side

Sending emails with Javascript

青春壹個敷衍的年華 提交于 2019-11-26 01:35:27
问题 This is a little confusing to explain, so bear with me here... I want to set up a system where a user can send templated emails via my website, except it\'s not actually sent using my server - it instead just opens up their own local mail client with an email ready to go. The application would fill out the body of the email with predefined variables, to save the user having to type it themselves. They can then edit the message as desired, should it not exactly suit their purposes. There\'s a

Pass request headers in a jQuery AJAX GET call

一个人想着一个人 提交于 2019-11-26 00:36:51
问题 I am trying to pass request headers in an AJAX GET using jQuery. In the following block, \"data\" automatically passes the values in the querystring. Is there a way to pass that data in the request header instead ? $.ajax({ url: \"http://localhost/PlatformPortal/Buyers/Account/SignIn\", data: { signature: authHeader }, type: \"GET\", success: function() { alert(\'Success!\' + authHeader); } }); The following didn\'t work either $.ajax({ url: \"http://localhost/PlatformPortal/Buyers/Account

Image resizing client-side with JavaScript before upload to the server

萝らか妹 提交于 2019-11-25 23:51:10
问题 I am looking for a way to resize an image client-side with JavaScript (really resize, not just change width and height). I know it\'s possible to do it in Flash but I would like to avoid it if possible. Is there any open source algorithm somewhere on the web? 回答1: Here's a gist which does this: https://gist.github.com/dcollien/312bce1270a5f511bf4a (an es6 version, and a .js version which can be included in a script tag) You can use it as follows: <input type="file" id="select"> <img id=

How to export JavaScript array info to csv (on client side)?

独自空忆成欢 提交于 2019-11-25 21:56:25
问题 I know there are lot of questions of this nature but I need to do this using JavaScript. I am using Dojo 1.8 and have all the attribute info in array, which looks like this: [[\"name1\", \"city_name1\", ...][\"name2\", \"city_name2\", ...]] Any idea how I can export this to CSV on the client side? 回答1: You can do this in native JavaScript. You'll have to parse your data into correct CSV format as so (assuming you are using an array of arrays for your data as you have described in the question

What is the difference between client-side and server-side programming?

吃可爱长大的小学妹 提交于 2019-11-25 21:29:29
问题 I have this code: <script type=\"text/javascript\"> var foo = \'bar\'; <?php file_put_contents(\'foo.txt\', \' + foo + \'); ?> var baz = <?php echo 42; ?>; alert(baz); </script> Why does this not write \"bar\" into my text file, but alerts \"42\"? NB: Earlier revisions of this question were explicitly about PHP on the server and JavaScript on the client. The essential nature of the problem and solutions is the same for any pair of languages when one is running on the client and the other on