client-side

Save JSON File Locally

允我心安 提交于 2019-12-04 14:06:30
I am designing an HTML5 website that allows you to create and position shapes with several attributes. The shapes are created as divs of class="shape" and the attributes are stored to each shape div using the data method. I'd like to be able to save the position and attributes of the shapes, in a JSON file, with a user defined name. Currently, I am using ajax and php to generate the JSON file and save it on the server. Any ideas or thoughts on how it should be done? Bonus points for libraries, APIs and examples! Clarification Edit: Saving to a discrete file in a user-defined location would be

Logic behind drag and drop

牧云@^-^@ 提交于 2019-12-04 13:25:47
问题 I am wondering the "how it works" and "how it should be designed and implemented" side of the basic drag & drop functionality. I have never yet implemented such a functionality. I am planning to do so for one of my projects and I do have some ideas on how to implement it. I wanted to make sure I am on the right path and that you people most probably has something to say about the matter too... Let's imagine I have 5 elements listed as following and grabbed from a database; <div id="1">this is

Why can't server side and client side scripts interact?

不羁的心 提交于 2019-12-04 12:23:00
I'm new to client and server side scripts, and I was wondering, how come they can't interact? The major difference Code Conquest stated here is that: ... is called a client side language is because it runs scripts on your computer after you’ve loaded a web page. And A server side or back-end language runs its scripts before the HTML is loaded, not after. Even if the server side script (e.g. PHP) has already been executed, how come it can't be changed (with JavaScript) after the page has loaded? I want to call PHP from JS. For example, is there a possible way to do this? setInterval(<?php

voting - stopping abuse from client side - ASP.NET MVC

做~自己de王妃 提交于 2019-12-04 12:06:51
so I have designed this voting thing which does not let somebody vote for the same article twice in 24 hours. However, suppose a person votes and after seeing the person was able to cast vote or that he is falling in that 24 hour window, I disable the vote-casting button (and this is all Ajax btw). But what to do when a person closes his/her browser and comes back up or even refreshes the page? Obviously, he would not be able to cast vote, because of my algorithm, but the person would still end up succeeding in making call to the server. So if he really wanted, he would keep refreshing the

is there a client side (javascript) graph library that doesn't require a server?

你说的曾经没有我的故事 提交于 2019-12-04 09:02:37
问题 I need to generate many internal client-side (within the company only) graphs from streams of data, and since the data itself is "secret", I can't use a service like Google-Graphs for generating the graphs. So I was wondering if anyone has some recomendations for a javascript graph library that doesn't require a server. Thanks 回答1: Have a look at flot a javascript plotting library. EDIT The official flot repo lives on github 回答2: Have a look at Raphael (github). 回答3: The data is likely going

How to set html input type text value using ASP.NET C#?

谁都会走 提交于 2019-12-04 07:31:22
I have an html control which I want to set its value .... here's the control: <input runat="server" id="first_name_txt" type="text" placeholder="First Name" /> in code behind, I use: first_name_txt.Value = String.empty; but the value of my input control still has the old value like "blah-blah" and not set to "". Its old question , but may help someone. You have to use Request.Form to get and call .Value to set the value. HTML <input runat="server" id="first_name_txt" type="text" placeholder="First Name" /> CODE BEHIND //To get value: string myname=Request.Form["first_name_txt"]; // To set

OpenId on Android

喜你入骨 提交于 2019-12-04 05:23:27
I'd like to give my users the ability to log-in my Android app using their OpenId (have a text field like StackOverflow's and ask the user to enter his OpenId there). I've looked around a lot but could not find any libraries that allow me to implement Client-Side OpenId authentication on Android. Should I rather go for server side authentication - ie. authenticate through my own website and pass the control to the application once the authentication is done? Thanks, Abhinav http://code.google.com/p/openid4java/ Check this link out, it is a library that allows OpenID authentication with Java

Check if a List Column Exists using SharePoint Client Object Model?

别来无恙 提交于 2019-12-04 04:45:11
Using the Client Object Model (C#) in SharePoint 2010, how can I determine if a specified column (field) name exists in a given List? Thanks, MagicAndi. Just found this while searching for the same thing, but it looks like Sharepoint 2010 has something built in for this, at least for the Server model: list.Fields.ContainsField("fieldName"); Not sure if it exists for Client side though. Figured it would be a good place to store this information however. Ashutosh Singh-MVP SharePoint Server Object Model string siteUrl = "http://mysite"; using (SPSite site = new SPSite(siteUrl)) { using (SPWeb

Upload and read file client side, with angular 2

你说的曾经没有我的故事 提交于 2019-12-04 04:02:19
I need log file(s) from user so I can read and analyze those. For example somekind of drop area, where user drops a file, then I can read it with javascript? I use Angular2 rc5. I have node.js running backside, but I don't need the data there. I need it only at client side. Is it possible to read and parse file content with just frontend tech, like angular2 and javascript? Or do I have to upload the file to server and analyze it there? Katu It is possible! I ended up doing it like this. This reads all the files that are selected with file dialog. I don't need to send these to node.js. I can

Business logic in JavaScript. Fat client vs thin client

扶醉桌前 提交于 2019-12-04 03:19:37
Is it a good idea to implement business logic on the client side with JavaScript? What kind of logic should be there? Validation Logic? Related to GUI? What would you do if the same logic want to be used in another application (exposed) implementing it in JavaScript would mean you can't reuse that logic. On the other hand having all logic on the server side would mean more requests to the server. What do you think? You can create reusable Javascript modules so there's no intrinsic barrier to resuing logic in several different rich uis. However, as has already been pointed out, you probably end