client-side

Serverside and clientside javascript

前提是你 提交于 2019-12-18 09:24:33
问题 Does serverside javascript exist, if yes, is it possible to clientside javascript to interact with serverside javascript? For example, is it possible for clientside javascript to request from the serverside javascript to return part of a json file which is stored on the server without downloading the whole json file? I understand that I can do this with other serverside languages like aspx, php etc etc, but wanted to know if serverside javascript exists and if it can do something similar with

How can I save div as image at client side where div contains one or more than one HTML5 canvas elements?

我是研究僧i 提交于 2019-12-18 07:14:30
问题 Div 'canvasesdiv' element contains three HTML5 canvases. <div style="position: relative; width: 400px; height: 300px;" id="canvasesdiv"> <canvas width="400" height="300px" style="z-index: 1; position: absolute; left: 0px; top: 0px;" id="layer1" /> <canvas width="400" height="300px" style="z-index: 2; position: absolute; left: 0px; top: 0px;" id="layer2"/> <canvas width="400" height="300px" style="z-index: 3; position: absolute; left: 0px; top: 0px;" id="layer3"/> </div> How can I save an

Set ClientID in asp.net

情到浓时终转凉″ 提交于 2019-12-18 05:47:18
问题 Is it possible to set the ClientID of any asp.net server control? How can I do this? 回答1: The good news is that in VS 2010 .Net 4, you'll have complete control over Client IDs! Still for the current versions of .Net, you can make due. I assume you need the ID for JavaScript. If so, just get the ID like so: <script type="text/javascript"> var myTextBox = $('#<%=TextBox1.ClientID%>'); </script> 回答2: I would advice against doing this unless you are sure you want to do it, but there is a way. You

What is server side rendering of javascript?

心不动则不痛 提交于 2019-12-18 01:44:09
问题 Some javascript frameworks like Dust.js claim that they ALSO support server-side rendering (in addition to client side rendering) as well. Can someone explain how does this work? My understanding is that the JS is always executed in the browser runtime. 回答1: JavaScript can be run on servers using systems like Node.js. With regard to Dust.js, a templating engine, it can generate hypertext and HTML on the server and send that content directly to the client's browser. This is typically used to

How can I rewrite the ErrorMessage for a CustomValidator control on the client?

柔情痞子 提交于 2019-12-17 20:10:08
问题 I have a CustomValidator that is validating a telephone number for several different telephone numbering schemes. The client-side javascript looks like this: validatePhoneNumber(sender, args) { cleanNumber = args.Value.replace(/\D/, ""); country = $("#" + CountryID).get(0).value; switch (country) { case "North America": args.IsValid = validateNAPhoneNumber(cleanNumber); if (!args.IsValid) sender.errormessage = "* Not a NA Phone #"; break; case "UK": args.IsValid = validateUKPhoneNumber

Is it possible to change a $_SESSION variable client-side? [duplicate]

一个人想着一个人 提交于 2019-12-17 16:51:41
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: PHP Can a client ever set $_SESSION variables? What I'd like to know, is whether a PHP $_SESSION variable can be changed on the client-side. If, for example, I do $_SESSION['username'] = $username; Can someone somehow change the value of my $_SESSION['username'] variable? 回答1: PHP is a server-side programming language and the $_SESSION superglobal is only directly accessible on the server. With 'normal' php

How to get UTC offset in javascript (analog of TimeZoneInfo.GetUtcOffset in C#)

守給你的承諾、 提交于 2019-12-17 16:04:01
问题 In C# you can use System.TimeZone.CurrentTimeZone.GetUtcOffset(someDate).Hours But how can I get UTC offset in hours for a certain date (Date object) in javascript? 回答1: Vadim's answer might get you some decimal points after the division by 60; not all offsets are perfect multiples of 60 minutes. Here's what I'm using to format values for ISO 8601 strings: function pad(value) { return value < 10 ? '0' + value : value; } function createOffset(date) { var sign = (date.getTimezoneOffset() > 0) ?

Can Python be used for client side web development? [closed]

百般思念 提交于 2019-12-17 10:16:49
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . If yes are there any frameworks/Tutorials/tips/etc recommended? N00b at Python but I have tons of PHP experience and wanted to expand

Is there any drawback to set ClientIDMode = Static on every object ( set on maincontent of master page)

◇◆丶佛笑我妖孽 提交于 2019-12-17 09:45:13
问题 I am working on asp.net project and each time i need to use jquery identifier $(#"objectID"). I have to change the ClientIDMode on each object to be static. Since I have noticed that the default client ID mode is Inherit so i set the MainContent Client ID mode to be static and i have found that all the object became static. This will sure save a lot of time when working with jquery, but i just want to know is there any drawback from this and is there any reason why shouldn't ClientIDMode set

generate a key for SJCL that expires automatically after a period of time?

浪子不回头ぞ 提交于 2019-12-14 04:03:20
问题 I want to encrypt and decrypt the data on client-side for that i am using SJCL library, but i want my key to be expired after a scheduled time , so my question here is - is it possible to generate such a key while using SJCL(or any other library may be) , if yes how? provided that the key must be demolished on the client side only without any server interaction? any help is greatly appreciated. thanks 回答1: No, outside help of a third party (keeping the key) or normal programming techniques (i