client-side

Are there any APIs for programmatically translating text on the server-side?

a 夏天 提交于 2020-01-02 04:49:29
问题 I've looked at Google Translate but from what I can tell it only offers a client-side JavaScript API for freely translating text between languages. What I need to do is translate text on the server side in Java. Is there a library that makes it possible to do this for free with Google Translate? 回答1: Here is a Java API... http://code.google.com/p/google-api-translate-java/ and just for reference, a PHP implementation - http://code.google.com/p/gtranslate-api-php/ 回答2: There is nothing

Implementing Backbone.Subset.js in Backbone.js to filter Models from a parent Collection

空扰寡人 提交于 2020-01-01 08:36:17
问题 In this stackoverflow post i read about filtering backbone collections and using subsets. One answer (by sled) recommends using backbone.subset.js (usage example). I could not find any further resources on backbone.subset.js and I failed implementing it into my project. It seems like backbone.subset.js is the perfect solution for what i'm trying to achieve. (Having one "parent" collection that holds all models at all times, and depending on user input filtering the relevant models from the

Removing cookies with the same name but different paths

…衆ロ難τιáo~ 提交于 2020-01-01 02:11:33
问题 I need to delete clientside cookies with the same name but with different paths. What is the best way to do this in javascript. 回答1: Just specify the same path of the cookie you want to remove, giving it a past expiration. document.cookie = 'name=value1; path=/'; document.cookie = 'name=value2; path=/path/'; alert(document.cookie); // name=value1; name=value2 document.cookie = 'name=; path=/path/; expires=' + new Date(0).toUTCString(); alert(document.cookie); // name=value1 Changing it to

Removing cookies with the same name but different paths

↘锁芯ラ 提交于 2020-01-01 02:11:07
问题 I need to delete clientside cookies with the same name but with different paths. What is the best way to do this in javascript. 回答1: Just specify the same path of the cookie you want to remove, giving it a past expiration. document.cookie = 'name=value1; path=/'; document.cookie = 'name=value2; path=/path/'; alert(document.cookie); // name=value1; name=value2 document.cookie = 'name=; path=/path/; expires=' + new Date(0).toUTCString(); alert(document.cookie); // name=value1 Changing it to

Does it make security sense to hash password on client end

孤人 提交于 2019-12-29 11:36:02
问题 If you were to hash a user's password prior to sending it across the line and leaving it in plain-text in memory, would this improve the security of the application? I would assume this mitigates a small fraction of vulnerabilities by protecting the data stored in the clients memory. But really if we're worried about someone reading the client's memory there are probably bigger problems that we can't address. There's something that doesn't feel right about hashing on the client's end. Is

Does it make security sense to hash password on client end

帅比萌擦擦* 提交于 2019-12-29 11:35:36
问题 If you were to hash a user's password prior to sending it across the line and leaving it in plain-text in memory, would this improve the security of the application? I would assume this mitigates a small fraction of vulnerabilities by protecting the data stored in the clients memory. But really if we're worried about someone reading the client's memory there are probably bigger problems that we can't address. There's something that doesn't feel right about hashing on the client's end. Is

Help refactor a small piece of Javascript code which identifies user's referrer source

笑着哭i 提交于 2019-12-25 16:03:19
问题 I've written the following small piece of javascript (Based on the excellent parseURI function) to identify where the user originated from. I am new to Javascript, and although the code below works, was wondering if there is a more efficient method of achieving this same result? try { var path = parseUri(window.location).path; var host = parseUri(document.referrer).host; if (host == '') { alert('no referrer'); } else if (host.search(/google/) != -1 || host.search(/bing/) != -1 || host.search(

Help refactor a small piece of Javascript code which identifies user's referrer source

限于喜欢 提交于 2019-12-25 16:02:59
问题 I've written the following small piece of javascript (Based on the excellent parseURI function) to identify where the user originated from. I am new to Javascript, and although the code below works, was wondering if there is a more efficient method of achieving this same result? try { var path = parseUri(window.location).path; var host = parseUri(document.referrer).host; if (host == '') { alert('no referrer'); } else if (host.search(/google/) != -1 || host.search(/bing/) != -1 || host.search(

ASP.NET/MVC: Knockout-binding preventing client-side validation from being performed?

梦想的初衷 提交于 2019-12-25 09:26:53
问题 This is a follow-up to, or rather replacement for, this question: MVC/ASP.NET: Client side validation not working The issue was, and is, that my ASP.NET/MVC client-side validation isn't being performed, even though it should. Now that I've done more testing, it seems I have identified the core of the problem, so here goes. I have a ViewModel as follows: public class RegisterViewModel { [Required] [EmailAddress] [Display(Name = "Email")] public string Email { get; set; } // some other

Return default value to predefined javascript objects in concrete circumstances

时光怂恿深爱的人放手 提交于 2019-12-25 06:35:20
问题 Some days ago, I asked a question , that was: How could anyone return the default value to a predefined JavaScript object or function (like the object window.console, or the object-function document.getElementById) once it has been changed? Posted here: Return the default value to a predefined javascript object The solution wasn't enough, because the possibility to return the default value was based on creating an iframe object and insert it to the current DOM. But, we also have the