Above function return a string like “failed”. However, when I try to run then function on it, it will return error of and the cursor is indicate right after connected and before .then. Below is the full function: UPDATE Here is the islogged() function I am certain that the $checkSessionServer will…
Author: admin@master
Update Knockout `attr` binding from DOM instead of from ViewModel
I am using Knockout.js to populate a set of HTML5 <details> elements. Here is the structure: The data in the ViewModel looks something like this: I have added the ability to remember the open or closed state of the details view using the isOpen property of the ViewModel and an attr binding (As originall…
binding viewmodel to existence of a property in knockout
I am using Knockout.js to populate a set of HTML5 <details> elements. Here is the structure: The data in the ViewModel looks something like this: I want to add the ability to remember the open or closed state of the details view. I have implemented this behavior previously using jQuery and localStorage1…
Wrapping Text in D3
I would like to get the text to wrap on the following D3 tree so that instead of each line is wrapped to I have tried making the text a ‘foreignObject’ rather than a text object and the text does indeed wrap, but it doesn’t move on the tree animation and is all grouped in the upper left hand…
Loop through childNodes
I’m trying to loop through childNodes like this: However, it output Uncaught TypeError: undefined is not a function due to forEach function. I also try to use children instead of childNodes but nothing changed. Does anybody know what’s going on? Answer The variable children is a NodeList instance …
Reload Express.js routes changes without manually restarting server
I tried express-livereload, but it just reloaded view files. Should I use another tool, or this one can be configured to watch for my index.js file which runs the server? I read that options are the same as node-livereload, and default for watched files include .js files. Any URL you know with a simple config…
Bootstrap addon create options button with arbitrary js
I figured out from Bugzilla that you can set your options url in install.rdf to arbitrary js and it will run perfectly fine. The only issue is that the window deactivates, its as if an invisible dialog has opened over it, and no matter what you can’t close it. For example: In my addon here: simple test …
CSRF protection with CORS Origin header vs. CSRF token
This question is about protecting against Cross Site Request Forgery attacks only. It is specifically about: Is protection via the Origin header (CORS) as good as the protection via a CSRF token? Example: Alice is logged in (using a cookie) with her browser to https://example.com. I assume, that she uses a mo…
scrollIntoView Scrolls just too far
I have a page where a scroll bar containing table rows with divs in them is dynamically generated from the database. Each table row acts like a link, sort of like you’d see on a YouTube playlist next to the video player. When a user visits the page, the option they are on is supposed to go to the top
Uploading a file via Yammer API
I’m able to post a message but when I add either the attachment or pending_attachment, I get an error saying: TypeError: ‘stepUp’ called on an object that does not implement interface HTMLInputElement. Answer yammer’s javascript SDK doesn’t work with attachment. (at least no work…