client-side

Can I execute js files via php?

谁都会走 提交于 2019-12-22 00:38:46
问题 The situation is next: I have php file, which parses a web-page. on that web-page is a phone number and it's digits are mixed with each other. The only way to put each digit on the correct place is to use some JS functions (on the client side). So, when I execute that php file in linux console, it gives me all that I need, except js function's result (no wonder - JavaScript is not a server-side language). So all I see from JS - only a code, that I have written. The question: can I execute js

How to detect inactive tab and fill it with color

心已入冬 提交于 2019-12-21 21:25:47
问题 How can I fill my website with color if tab is inactive? I would like to give screensaver like effect to my site if user move to another window. Can I do that with jQuery? 回答1: Here is some basic code to get you going: <script type="text/javascript"> document.onmousemove = resetTimer; window.onload = function() { screenTimer = setTimeout(inactive, 2000); } function inactive(){ // screen saver goes here document.body.style.backgroundColor = "black"; } function resetTimer(e) { // undo screen

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

强颜欢笑 提交于 2019-12-21 12:14:41
问题 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. 回答1: 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. 回答2: Server Object Model string

Upload and read file client side, with angular 2

ⅰ亾dé卋堺 提交于 2019-12-21 04:32:06
问题 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? 回答1: It is possible! I ended up doing it like this. This

401 error when consuming a Web service with HTTP Basic authentication using CXF

自作多情 提交于 2019-12-20 18:34:30
问题 I'm trying to consume a remote Web service that uses HTTP basic authentication, using Apache CXF, within a JUnit test. The error I am getting is: javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://localhost:8080/services/MyService?wsdl. It failed with: Server returned HTTP response code: 401 for URL: http://localhost:8080/services/MyService?wsdl. at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:151) at com.sun.xml.internal.ws.wsdl

Is it possible to do a traceroute in the browser?

时间秒杀一切 提交于 2019-12-20 09:55:41
问题 I'm looking for a way to do a traceroute client-side, i.e. in a browser. As far as I know, it's not possible to send ICMP, UDP or TCP packets with arbitrary TTL values via Javascript or Flash. I know Flash allows TCP connections via the Socket class in Actionscript but it doesn't seem useful for a traceroute implementation. Is the only solution to develop a browser plug-in ? EDIT : I just found out that it has been done with a Java applet: http://www.codefromthe70s.org/traceroute.aspx The bad

Best Practices for Self Updating Desktop Application in a network environment

自作多情 提交于 2019-12-20 08:50:06
问题 I have searched through google and SO for possible answers to this question, but can only find small bits of information scattered around the place, most of which appear to be personal opinion. I'm aware that this question could be considered subjective, but I'm not looking for personal opinion, rather facts with reasons (e.g. past experience) or even a single link to a blog/wiki which describes best practices for this (this is what I'd prefer to be honest). What I'm not looking for is how to

GWT/Javascript client side password encryption

廉价感情. 提交于 2019-12-20 08:49:29
问题 I'm implementing authorization in my gwt app, and at the moment it's done in the following fashion: The user signs up by putting his credentials in a form, and I send them in clear text to the server. The server code hashes the received password using BCrypt and puts the hash in a database. When the user logs in, his password is sent in the clear to the server, that checks it against the stored hash. Now. The thing that's bothering me about this is the fact that I'm sending the password to

Client side validation is not working while applying conditional validation in rails 4

笑着哭i 提交于 2019-12-20 05:41:50
问题 I am using client side validation gem. Client side validation is not working while applying conditions. Here is my Model Class. validates_uniqueness_of :project_code **validates :price, numericality: true, :if => :project_type_fixed?** def project_type_fixed? project_type == 'Fixed' end In this code validation for project_code is working fine, but for price it is not working. Thanks in advance. 回答1: Client_side_validations does not validate conditionals out-of-the-box. What you are observing

Parse LESS client side

梦想与她 提交于 2019-12-19 07:35:13
问题 Can I parse LESS client side, and return the results? I am currently using as recommended in documentation, which is to include less file, and minified less parser afterwards. I want to be able to return the raw css so I can save it as a css file. I do not want to install node.js and the likes, I want a client side solution. 回答1: A look at the less.js source brings up the Parser object. Assuming that less.js is included in the page: var data = "@colour: red; #example { background-color: