client-side

adding image namespace in svg through JS still doesn't show me the picture

旧时模样 提交于 2019-11-28 04:35:19
问题 after working out getting the parameter through a scaled version of a picture, I am trying through Javascript adding the picture with the original size parameter in SVG. Firebug shows me the element, and all the necessary parameter, but with best wishes I am not getting through. this.svg = document.getElementsByTagNameNS('http://www.w3.org/2000/svg','svg'); var bild = document.createElementNS('http://www.w3.org/2000/svg','image'); var BildURL = this.image[0][0].getAttribute('xlink:href'); var

What's a good bit of JS or JQuery for horizontally scrolling news ticker

亡梦爱人 提交于 2019-11-28 04:26:12
问题 I am looking for a little bit of JQuery or JS that allows me to produce a horizontally scrolling "news ticker" list. The produced HTML needs to be standards compliant as well. I have tried liScroll but this has a habit of breaking (some content ends up on a second line at the start of the scroll), especially with longer lists. I have also tried this News Ticker but when a DOCTYPE is included the scrolling will jolt rather than cycle smoothly at the end of each cycle. Any suggestions are

Reading line-by-line file in JavaScript on client side

◇◆丶佛笑我妖孽 提交于 2019-11-28 03:51:38
Could you please help me with following issue. Goal Read file on client side (in browser via JS and HTML5 classes) line by line, without loading whole file to memory. Scenario I'm working on web page which should parse files on client side. Currently, I'm reading file as it described in this article . HTML: <input type="file" id="files" name="files[]" /> JavaScript: $("#files").on('change', function(evt){ // creating FileReader var reader = new FileReader(); // assigning handler reader.onloadend = function(evt) { lines = evt.target.result.split(/\r?\n/); lines.forEach(function (line) {

Getting query parameters from react-router hash fragment

淺唱寂寞╮ 提交于 2019-11-28 03:44:09
I'm using react and react-router for my application on the client side. I can't seem to figure out how to get the following query parameters from a url like: http://xmen.database/search#/?status=APPROVED&page=1&limit=20 My routes look like this (the path is totally wrong I know): var routes = ( <Route> <DefaultRoute handler={SearchDisplay}/> <Route name="search" path="?status=:status&page=:page&limit=:limit" handler={SearchDisplay}/> <Route name="xmen" path="candidate/:accountId" handler={XmenDisplay}/> </Route> ); My route is working fine but I'm just not sure how to format the path to get

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

自闭症网瘾萝莉.ら 提交于 2019-11-28 01:28:20
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? Casey Flynn PHP is a server-side programming language and the $_SESSION superglobal is only directly accessible on the server. With 'normal' php sessions, the data contained in the SESSON superglobal is passed back and forth between the browser and the server in a cookie. So technically, it is possible to

Save to Local File from Blob

微笑、不失礼 提交于 2019-11-28 00:59:17
I have a difficult question to you, which i'm struggeling on for some time now. I'm looking for a solution, where i can save a file to the users computer, without the local storage, because local storage has 5MB limit. I want the "Save to file"-dialog, but the data i want to save is only available in javascript and i would like to prevent sending the data back to the server and then send it again. The use-case is, that the service im working on is saving compressed and encrypted chunks of the users data, so the server has no knowledge whats in those chunks and by sending the data back to the

AngularJS - Getting data inserted in dom

心不动则不痛 提交于 2019-11-27 21:36:15
I'm looking for a way to get initial data from a DOM after the application is loaded. Data has been inserted in a view by a server. Is Module 's value method is a good way? As well i want to know how to get data from a views when i'm working with routes , can i use script tags for injecting a data in specific scopes? I saw this and this questions but it didn't help a lot. Cherniv 1) First solution inspired by this question and it is Module 's value method : <script> var users_json = '[{"name":"Piotr"},{"name":"Natasha"}]'; // created by xsl myApp.value("PrimaryData" , users_json ); </script>

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

时光总嘲笑我的痴心妄想 提交于 2019-11-27 21:15:42
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? 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) ? "-" : "+"; var offset = Math.abs(date.getTimezoneOffset()); var hours = pad(Math.floor(offset / 60)); var

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

人盡茶涼 提交于 2019-11-27 21:06:38
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 to be static at the first place ? You want to be careful about setting the ClientIDMode to Static for

Check filesize before upload

余生长醉 提交于 2019-11-27 19:33:00
问题 I have a website that allows users to upload video files but I want to limit the filesize to 2MB , this is pretty straightforward after uploading the file but does anyone knows if I can check the file-size before uploading it so I don't overload the server unnecessarily ? I might be looking for a javascript/ajax solution but I don't have a clue on how to achieve this. Any help will be very welcome. Thanks guys! UPDATE: I need to check the file size on client-side and NOT on server-side , is