http://stackoverflow.com/a/27704718
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27704634
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27704634
type: Answer
has body: I think you meant 11 not 80, or maybe you're not explaining it correctly. Here s is global var, you can modify its value in data function. When you use var s in data function it creates a new variable names s whose scope is limited to that function only. That's why you get 9 outside its scope. $(function(){ var s = 9; function data() { s = 11; //removed var from here, if you use var here it will... //create new variable whose scope will end outside this function. } data(); alert(s); }); Recommend reading: Values, variables, and literals var in JavaScript and its scope

http://stackoverflow.com/q/27766405
accepted answer: http://stackoverflow.com/a/27768610
has answer: http://stackoverflow.com/a/38510126
has comment: http://stackoverflow.com/comment/43946516
has comment: http://stackoverflow.com/comment/43945337
has comment: http://stackoverflow.com/comment/43947831
has comment: http://stackoverflow.com/comment/43946602
has comment: http://stackoverflow.com/comment/43946314
has comment: http://stackoverflow.com/comment/43945307
type: AnsweredQuestion
has body: I'm just trying to do something very simple to start off with. I'm using the jQuery FullCalendar found here: http://fullcalendar.io/ When I add the event data as an array (as the documentation example provides), the calendar populates. However, when I try to do it via jQuery I get a valid JSON response, but the event doesn't populate. $(document).ready(function () { // page is now ready, initialize the calendar... $('#calendar').fullCalendar({ events: { url: '../calendar/GetCalendarData', type: 'GET', data: {}, success: function (doc) { //alert(doc.title + ' ' + doc.start); var events = []; events.push(doc); alert(events[0].title + ' ' + events[0].start); }, error: function() { alert('there was an error while fetching events!'); }, color: 'yellow', // a non-ajax option textColor: 'black' // a non-ajax option } }); // Code and Documents: http://fullcalendar.io/ }); [HttpPost] public ActionResult PostCalendarData() { return Json(new { title = "Free Pizza", allday = "false", borderColor = "#5173DA", color = "#99ABEA", textColor = "#000000", description = " This is just a fake description for the Free Pizza. Nothing to see! ", start = "2015-01-04T22:00:49", end = "2015-01-01", url = "http=//www.mikesmithdev.com/blog/worst-job-titles-in-internet-and-info-tech/" }); } [HttpGet] public ActionResult GetCalendarData() { return Json(new { title = "Free Pizza", allday = "false", borderColor = "#5173DA", color = "#99ABEA", textColor = "#000000", description = " This is just a fake description for the Free Pizza. Nothing to see! ", start = "2015-01-04T22:00:49", end = "2015-01-01", url = "http=//www.mikesmithdev.com/blog/worst-job-titles-in-internet-and-info-tech/" }, JsonRequestBehavior.AllowGet); } The response I get from my GetCalendarData call is the following: {"title":"Free Pizza","allday":"false","borderColor":"#5173DA","color":"#99ABEA","textColor":"#000000","description":" This is just a fake description for the Free Pizza. Nothing to see! ","start":"2015-01-04T22:00:49…
tagged with: asp.net-mvc
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43946377
tagged with: fullcalendar
has title: jquery FullCalendar using MVC and JSON
has comment: http://stackoverflow.com/comment/43946864
has comment: http://stackoverflow.com/comment/43946976
type: Question
has comment: http://stackoverflow.com/comment/43945132
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27768610
score: 0
has comment: http://stackoverflow.com/comment/43946636
has comment: http://stackoverflow.com/comment/43946736
has comment: http://stackoverflow.com/comment/43944910
has comment: http://stackoverflow.com/comment/43945142
possible better answer: http://stackoverflow.com/a/38510126
has comment: http://stackoverflow.com/comment/43946715

http://stackoverflow.com/comment/43723167
score: 0
comment on: http://stackoverflow.com/q/27653100
type: QuestionComment
type: Comment
has text: What error are you getting ?

http://stackoverflow.com/comment/43946575
score: 0
type: Comment
has text: It is a typo and so marking for closure. PostsCtrl != PostCtrl
type: QuestionComment
comment on: http://stackoverflow.com/q/27766622

http://stackoverflow.com/comment/43852331
type: Comment
comment on: http://stackoverflow.com/a/27720368
has text: The socket are defined on the app.js, and the function onSave & onRemove work to. I just want the way to call a socket in my controller.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43759244
type: AnswerComment
score: 0
type: Comment
has text: @giraffeslacks: For starters: `{"attributes": {"color": "blue", "size": "large"}}`.
comment on: http://stackoverflow.com/a/27672159

http://stackoverflow.com/comment/43897786
has text: Please Keep your post as **One question** there is too much here ... also include the code here since a site as Jsfiddle can goes down and then the question will be useless for future users
comment on: http://stackoverflow.com/q/27743499
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/41746194
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27673074
score: 4
has body: A little more comprehensive (for me) with this : 'change #box, paste #box, keyup #box, mouseup #box': function (e) { Meteor.call('click', $("#box").val()); }
upvote count: 4

http://stackoverflow.com/comment/43900242
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27744506
has text: I have edited question, sorry for confusing. Ajax.php returns json object and in index.php I need to manipulate that object in success part of ajax call. Yes, I have script tags in index.php.

http://stackoverflow.com/comment/43786310
comment on: http://stackoverflow.com/a/27685892
has text: I think you incorrectly used AppContextSite. If you are using this in AppWeb and trying to read the list form the host web, you can try using the SP.RequestExecutor.js. Please read the details from MSDN here : http://msdn.microsoft.com/en-us/library/office/fp179927(v=office.15).aspx
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/27673293
answers question: http://stackoverflow.com/q/27672073
has comment: http://stackoverflow.com/comment/44205422
type: Answer
has comment: http://stackoverflow.com/comment/43786704
accepted answer of: http://stackoverflow.com/q/27672073
has body: I think you can add a javascript function as a option in the widget's options by prefixing it with 'js:', for example: $this-&gt;widget( 'booster.widgets.TbSelect2', array( 'asDropDownList' =&gt; false, 'name' =&gt; 'clevertech', 'options' =&gt; array( 'tags' =&gt; array('clever', 'is', 'better', 'clevertech'), 'placeholder' =&gt; 'type clever, or is, or just type!', 'width' =&gt; '40%', 'tokenSeparators' =&gt; array(',', ' ') 'createSearchChoice' =&gt; 'js:function(term, data) { if ( $(data).filter( function() { return this.text.localeCompare(term)===0; }).length===0) { return {id:term, text:term}; }', } ) ) ); For further debugging, if you open TbSelect2.php you can see what it does with the options: $options = !empty($this-&gt;options) ? CJavaScript::encode($this-&gt;options) : ''; And if you go to CJavaScript::encode function you can see it does: if(is_string($value)) { if(strpos($value,'js:')===0 &amp;&amp; $safe===false) return substr($value,3); else return "'".self::quote($value)."'"; } Note: I've opened CJavaScript::encode of Yii 1 not 2 but might be the same.
has comment: http://stackoverflow.com/comment/43821332
has comment: http://stackoverflow.com/comment/44184837
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43786579

http://stackoverflow.com/q/27659852
has answer: http://stackoverflow.com/a/27659918
score: 1
has comment: http://stackoverflow.com/comment/43735508
possible better answer: http://stackoverflow.com/a/27659918
answer count: 3
upvote count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27660052
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27660052
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27659930
type: Question
has title: Calling a method in a script from HTML. The script is indirectly referred to in the HTML
has comment: http://stackoverflow.com/comment/43735545
has body: I have an html which has this: The script1.js has code that internally refers to script2.js like this : var js = document.createElement(""script""); js.type = ""text/javascript""; js.src = ""script2.js""; script2.js contains this : function myFunc() { alert "Hi!"; } I need to now refer to this method in script2.js directly from the html. But I am not able to achieve the same. I get an error saying myFunc is not defined. (Debugged in Mozilla) Can someone help me out?

wordpress
tags question: http://stackoverflow.com/q/27723846
tags question: http://stackoverflow.com/q/27712423
tags question: http://stackoverflow.com/q/27796947
tags question: http://stackoverflow.com/q/27657936
tags question: http://stackoverflow.com/q/27773024
tags question: http://stackoverflow.com/q/27748559
tags question: http://stackoverflow.com/q/27696804
tags question: http://stackoverflow.com/q/27745853
tags question: http://stackoverflow.com/q/27758699
tags question: http://stackoverflow.com/q/27760517
tags question: http://stackoverflow.com/q/27726999
tags question: http://stackoverflow.com/q/27728667
tags question: http://stackoverflow.com/q/27786716
tags question: http://stackoverflow.com/q/27697270
tags question: http://stackoverflow.com/q/27680301
tags question: http://stackoverflow.com/q/27750393
tags question: http://stackoverflow.com/q/27671083
tags question: http://stackoverflow.com/q/27789948
tags question: http://stackoverflow.com/q/27698532
tags question: http://stackoverflow.com/q/27693055
tags question: http://stackoverflow.com/q/27677601
tag name: wordpress
tags question: http://stackoverflow.com/q/27759278
tags question: http://stackoverflow.com/q/27741484
tags question: http://stackoverflow.com/q/27661261
tags question: http://stackoverflow.com/q/27798264
tags question: http://stackoverflow.com/q/27680895
tags question: http://stackoverflow.com/q/27726702
tags question: http://stackoverflow.com/q/27687797
tags question: http://stackoverflow.com/q/27739642
tags question: http://stackoverflow.com/q/27682320
tags question: http://stackoverflow.com/q/27751275
tags question: http://stackoverflow.com/q/27711182
tags question: http://stackoverflow.com/q/27747348
tags question: http://stackoverflow.com/q/27760778
tags question: http://stackoverflow.com/q/27767766
type: Tag
tags question: http://stackoverflow.com/q/27699425

http://stackoverflow.com/q/27736241
tagged with: method-chaining
possible better answer: http://stackoverflow.com/a/27736422
type: Question
has comment: http://stackoverflow.com/comment/43883988
has comment: http://stackoverflow.com/comment/43884060
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27736294
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/43883982
has body: After reading up online I wrote this simple code that does addition and multiplication via chaining. But reading the code, it looks like to me, that the method "Result" makes the code less readable and kind of seems redundant. Can someone help me get rid of the Result function? var Calculator = function () { var result = 0; this.Add = function (x) { result = result + x; return this; }; this.Multiply = function (x) { result = result * x; return this; }; this.Result = function () { return result; } }; var total = new Calculator().Add(2).Add(3).Multiply(5); alert(total.Result()); What I am trying to achieve is var total = new Calculator().Add(2).Add(3).Multiply(5); alert(total);
has answer: http://stackoverflow.com/a/27736294
has answer: http://stackoverflow.com/a/27736422
favorite count: 0
has title: Is this the right way to implement chaining in javascript?
linked to: http://stackoverflow.com/q/26656718
score: 2
type: AnsweredQuestion
downvote count: 0

flask
tags question: http://stackoverflow.com/q/27669224
tags question: http://stackoverflow.com/q/27736805
type: Tag
tag name: flask
tags question: http://stackoverflow.com/q/27748633

http://stackoverflow.com/comment/43702841
has text: Please migrate to code review rather than downvote... We all were beginners once ;)>
comment on: http://stackoverflow.com/q/27641882
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/27652320
type: Answer
score: 1
upvote count: 1
has body: You need to use img tag, instead of image. You cannot use the element id directly like this. Use getElementById("Elem ID Here"). Also innerHTML in your case is with a capitalised i. Use innerHTML not InnerHTML.
answers question: http://stackoverflow.com/q/27652297
downvote count: 0

http://stackoverflow.com/comment/43947403
score: 3
comment on: http://stackoverflow.com/q/27768355
has text: `$('#seo-content').each(...)` IDs ***must*** be unique on document context. Are you using duplicate IDs?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27732187
upvote count: 4
has body: Usually I develop on Java, and now I am studying JavaScript/HTML5 Canvas things. And I get a strange situation from Java developer's point of view. There's a html5 canvas object on the html page, and I want to track the mouse click events on this canvas. I declared class GameBoard and initialized its properties: function GameBoard() { // defining a property for GameBoard class instance this.myProperty = 'some text here'; // getting canvas element this.boardCanvas = document.getElementById("myCanvas"); // setting the mouse click event listener this.boardCanvas.addEventListener("mousedown", this.handleMouseClick, false); } and there's a class method to handle mouse click events: GameBoard.prototype.handleMouseClick = function(event) { alert(this.myProperty); } handleMouseClick() will display undefined because this in handleMouseClick() method refers to the HTML5 Canvas instance (boardCanvas). My question: how can I refer the current GameBoard class instance inside of handleMouseClick method to get myProperty field value defined in the class constructor? What I am doing wrong here? Thank you.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27732203
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
score: 4
has title: How to get the current object reference in a class method?
has answer: http://stackoverflow.com/a/27732288
accepted answer: http://stackoverflow.com/a/27732288
has answer: http://stackoverflow.com/a/27732203
favorite count: 0

http://stackoverflow.com/comment/43822766
has text: Can you explain your code to me? Especially this line `$('.slides').each(function(index,value)` , I don't quite understand what index and value are used for in your function. Thank you a lot.
comment on: http://stackoverflow.com/a/27705110
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27659217
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43734244
accepted answer of: http://stackoverflow.com/q/27659073
type: Answer
has body: load() is a shortcut convenience method for $.ajax(). AJAX is asynchronous so the http request won't have completed at the time when you are trying to get the returned html from inside $tmp You need to use the complete callback of load() to do anything within the returned result To continue using load() method Try: $("[data-load]").each(function (index) { var $tmp = $('&lt;div&gt;'), $el = $(this); var valueData = $(this).data("load") $tmp.load(valueData, function () { /* the ajax has completed here */ $el.append($tmp.html()); }); }); Another shortcut method of $.ajax is $.get which I think would make this code more readable and a little shorter by not needing to create a temporary storage element $("[data-load]").each(function (index) { var $el = $(this); $.get($el.data("load"), function(response){ $el.append(response); }); }); Both solutions assume that data-load attribute is a valid url that returns the html expected.
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27659073

http://stackoverflow.com/comment/43970528
type: Comment
comment on: http://stackoverflow.com/a/27780189
score: 1
type: AnswerComment
has text: ng-if="myDropDown == 'one' || !myDropDown"

http://stackoverflow.com/comment/43885215
score: 0
has text: Why not use a single ` ` with an ID or CLASS, then CSS @media queries (which allow you to specify size to change the CSS for the associated ID or CLASS
comment on: http://stackoverflow.com/q/27736853
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43700819
has text: I would just use `dateFormat: 'yy-mm-dd'` in the datepicker. Then the form field will contain the date in the proper format for sending to MySQL.
comment on: http://stackoverflow.com/q/27640753
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27652929
has comment: http://stackoverflow.com/comment/43723503
answer count: 4
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43722780
has comment: http://stackoverflow.com/comment/43723475
has comment: http://stackoverflow.com/comment/43731668
has answer: http://stackoverflow.com/a/27653137
score: 2
has body: I'm facing problem using setInterval function in my website. I've a small section of my code below. I'm basically trying to increase the count by 1 and print it on screen. &lt;div id="test"&gt;&lt;/div&gt; &lt;script&gt; var count = 0; setInterval(function() { document.getElementById('test').innerHTML=count; count++; }, 1000); &lt;/script&gt; Edit: I'm not using jquery in the code as it should be quite clear from above. However the problem I'm facing here is when I open the html in opera mini in mobile device, the count it shows is either 1 to 3 or 1 to 4. It does not continue. I've an external url. Please open the url in a mobile device and see the problem. http://fundoophoto.com/raman/Test/
has title: JavaScript setInterval for opera mini and other mobile browsers
has answer: http://stackoverflow.com/a/27754536
type: Question
has answer: http://stackoverflow.com/a/27660687
has comment: http://stackoverflow.com/comment/43723484
tagged with: mobile
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43722773
has comment: http://stackoverflow.com/comment/43722846
has answer: http://stackoverflow.com/a/27665401
tagged with: opera-mini

http://stackoverflow.com/q/27774433
type: Question
has comment: http://stackoverflow.com/comment/43959735
score: 0
has title: Unable to match input string with ')' before the end
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: regex
has comment: http://stackoverflow.com/comment/43959783
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43959813
has comment: http://stackoverflow.com/comment/43959621
has answer: http://stackoverflow.com/a/27774864
has comment: http://stackoverflow.com/comment/43963667
has body: I am having problems in writing a regular expression to match strings like following: var p1=@VAL([Test1Q1].[Bandwidth]) var p2=@VAL([Test1Q1].[Usages (KB)]) The pattern should match inputs that start with @VAL( and end with a first bracket ) and capture the following (from the above inputs): [Test1Q1].[Bandwidth] [Test1Q1].[Usages (KB)] I have tried with the following expression: var fieldPattern = /@VAL\((.*)\)/; var P1_Pattern = p1.match(fieldPattern ); var P2_Pattern = p2.match(fieldPattern ); I got the correct match for p1 but the wrong result for p2. For p2 I got [Test1Q1].[Usages (KB but need the following result instead: [Test1Q1].[Usages (KB)] I know it happens because ) occurs before the end of p2; but I am unable to sort it out. How can I modify my regex to match p1 and p2 and capture the values I want within them?
has comment: http://stackoverflow.com/comment/43959876

http://stackoverflow.com/comment/43769238
has text: by opening up my console and typing: `$("body").scrollLeft()` while I'm at your portfolio section I can see that JS doesn't think there's anything to scroll. I would suggest creating a ` ` inside the body with a fixed width and placing all your content in that container... then your body will be able to scroll. Maybe even `nowrap` will work instead of fixed-width, but im dubious.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27677052

http://stackoverflow.com/comment/43908223
comment on: http://stackoverflow.com/a/27748142
type: Comment
score: 0
type: AnswerComment
has text: also i tried other variations of JSON.stringify(changing whats in here) and it always ends up passing a null value to the controller.

http://stackoverflow.com/q/27799671
score: 0
linked to: http://stackoverflow.com/q/2846283
answer count: 1
duplicate of: http://stackoverflow.com/q/2846283
tagged with: javascript
type: UnansweredQuestion
has body: function foo() { return { foo: 'bar' } } function bar() { return { foo: 'bar' } } typeof foo() === typeof bar(); //why this is false I didnt get why typeof foo() === typeof bar() returing false
has title: Why the code is comparison statement giving false;
has answer: http://stackoverflow.com/a/27799702
type: Question

compression
tags question: http://stackoverflow.com/q/27701779
tag name: compression
type: Tag

http://stackoverflow.com/comment/43983257
score: 0
has text: That did not work in debug mode. I am thinking it is the regex.
type: QuestionComment
comment on: http://stackoverflow.com/q/27783626
type: Comment

http://stackoverflow.com/a/27691087
type: Answer
accepted answer of: http://stackoverflow.com/q/27657661
score: 1
has body: Instead of putting the image src as the filename, put a base64 string instead. This will embed the image to the html and give you what you're after. E.g. &lt;img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO 9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" /&gt; You can convert an image to a base64 string using various websites such as http://www.base64-image.de/ See http://en.wikipedia.org/wiki/Data_URI_scheme for more information. FYI: Just remembered that IE8 only supports base64 strings as data URI's where the image is less than 32kb, it's the only browser with that issue that i've seen though.
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27657661

http://stackoverflow.com/a/27787039
accepted answer of: http://stackoverflow.com/q/27786188
has comment: http://stackoverflow.com/comment/43986010
has comment: http://stackoverflow.com/comment/43986500
has comment: http://stackoverflow.com/comment/43985283
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43985246
answers question: http://stackoverflow.com/q/27786188
has comment: http://stackoverflow.com/comment/43985876
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43985066
downvote count: 0
has comment: http://stackoverflow.com/comment/43985332
has body: Directives have isolated scopes. Since you added: scope: { topic: '=topic', label: '=label' }, it created an isolated scope. But, angular documentation says: = or =attr - set up bi-directional binding between a local scope property and the parent scope property of name defined via the value of the attr attribute. If no attr name is specified then the attribute name is assumed to be the same as the local name. Given &lt;widget my-attr="parentModel"&gt; and widget definition of scope: { localModel:'=myAttr' }, then widget scope property localModel will reflect the value of parentModel on the parent scope. Any changes to parentModel will be reflected in localModel and any changes in localModel will reflect in parentModel. Link here
has comment: http://stackoverflow.com/comment/44013600
type: Answer

http://stackoverflow.com/comment/43764060
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27674578
has text: You can pass the array through
type: Comment

http://stackoverflow.com/q/27661781
has answer: http://stackoverflow.com/a/27662057
type: AnsweredQuestion
score: 1
has body: I have a submenu that appears when you put the mouse over the menu, is properly working in Chrome and in IE but is not working on Firefox. Here's where the function to show the sub menu is called. {code to show the list of options } and here's the function that shows and hide the sub menu function showSubMenu(pCell, pSubMenu){ var subMenu = document.getElementById(pSubMenu); var unionCell = document.getElementById("unionCell"); var offsetElem = pCell; var offsetTop = null; var offsetLeft = null; while (offsetElem.parentNode){ if (offsetElem.tagName != "DIV"){ offsetTop += offsetElem.offsetTop; offsetLeft += offsetElem.offsetLeft; } offsetElem = offsetElem.parentNode; } pCell.className = "hover" subMenu.style.left = (offsetLeft) + "px"; subMenu.style.top = (offsetTop + pCell.offsetHeight - 1) + "px"; subMenu.style.display = "block"; activeMenu = pCell; activeSubMenu = subMenu; cancelBubble(); document.getElementById("document").onmouseover = hideSubMenu; } function hideSubMenu(){ var subMenu = activeSubMenu; subMenu.style.display = "none"; activeMenu.className = "navItem"; cancelBubble(); document.getElementById("document").onmouseover = hideSubMenu; } function cancelBubble(){ if (window.event){ window.event.cancelBubble=true; } The submenu appears and hides correctly in IE and Chrome, but is not showing in Firefox here's the complete html
linked to: http://stackoverflow.com/q/2029654
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43745260
has comment: http://stackoverflow.com/comment/43739529
accepted answer: http://stackoverflow.com/a/27662057
has comment: http://stackoverflow.com/comment/43741750
has comment: http://stackoverflow.com/comment/43739382
tagged with: javascript
has comment: http://stackoverflow.com/comment/43739495
has comment: http://stackoverflow.com/comment/43742053
has title: OnMouseOver SubMenu not showing in Firefox
tagged with: firefox
answer count: 1
downvote count: 0
tagged with: jsp
favorite count: 0

http://stackoverflow.com/comment/43717316
has text: You're probably passing a reference, not a new array, use `.slice()` to create a copy.
score: 0
comment on: http://stackoverflow.com/q/27650041
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27735205
score: 0
has body: You might be interested in https://www.npmjs.com/package/web-audio-api It's the web audio API for node.js, which sounds like what you're looking for. I haven't used it though, so I can't vouch for how good it is. The web audio API changes periodically, so I don't know how well that library stays in sync with the current spec.
type: Answer
answers question: http://stackoverflow.com/q/27724790
has comment: http://stackoverflow.com/comment/43889954

http://stackoverflow.com/q/27762891
tagged with: image
type: Question
has comment: http://stackoverflow.com/comment/43936975
accepted answer: http://stackoverflow.com/a/27766189
has comment: http://stackoverflow.com/comment/43937209
has comment: http://stackoverflow.com/comment/43944800
tagged with: javascript
linked to: http://stackoverflow.com/q/17090571
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has title: Setting background image in javascript with base64 data
has body: I'm having trouble setting the background image of a div using a data url. Here's my code, which doesn't throw an error but also doesn't work: profilePhotoData= shout.get("authorProfPic"); src = 'data:image/png;base64, ' + profilePhotoData.base64 outerDiv.style.backgroundImage="url("+src+")";
has answer: http://stackoverflow.com/a/27766117
has comment: http://stackoverflow.com/comment/74375822
possible better answer: http://stackoverflow.com/a/27766117
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27766167
tagged with: background-image
has answer: http://stackoverflow.com/a/27766189

http://stackoverflow.com/comment/43787038
score: 0
comment on: http://stackoverflow.com/a/27686265
has text: Thanks for your reply. I'm really new to JS. Where do I place `document.getElementById("video_div").addEventListener("click", playVideo);` ?
type: Comment
type: AnswerComment

http://stackoverflow.com/a/27794016
answers question: http://stackoverflow.com/q/27793115
downvote count: 0
type: Answer
has body: This should work too, but most restrictive and shorter: var url = "http://www.blog.domain.com/page/category" var result = url.replace(/^(https?:\/\/)?(.+\.)*(([a-z0-9-]*)\.[a-z]{2,6})(\/.+)$/i,"$4") If you want "domain.com" and not only "domain", use $3 instead of $4. Explaination step by step: A correct domain syntax: letters,numbers and "-" /([a-z0-9-]*)/i Domain extension (2-6 chars): /(([a-z0-9-]*)\.[a-z]{2,6})/i Subdomains: /(.+\.)*(([a-z0-9-]*)\.[a-z]{2,6})/i An url start with http and maybe https: /^https?:\/\/(.+\.)*(([a-z0-9-]*)\.[a-z]{2,6})/i You can put or not http when you type an url: /^(https?:\/\/)?(.+\.)*(([a-z0-9-]*)\.[a-z]{2,6})/i Then what is after /: /^(https?:\/\/)?(.+\.)*(([a-z0-9-]*)\.[a-z]{2,6})(\/.+)$/i
upvote count: 1
score: 1

http://stackoverflow.com/q/27693573
answer count: 5
has answer: http://stackoverflow.com/a/27693638
type: AnsweredQuestion
has title: $ is not defined in my javascript console
has answer: http://stackoverflow.com/a/27693658
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27693667
has answer: http://stackoverflow.com/a/27693777
tagged with: javascript
has comment: http://stackoverflow.com/comment/43800309
has comment: http://stackoverflow.com/comment/43800336
score: 0
accepted answer: http://stackoverflow.com/a/27693658
tagged with: http://stackoverflow.com/tag/html
has body: i am learning programming and trying my hand at the first website. Every time i run my code i get the error $ is not defined on the line $(document).ready(function(){ I have added some of my code below, thanx in advance. $(document).ready(function(){ var mechanical = { program: "Engineering", course: "Mechanical Engineering", tuition: 1000000 } var electrical = { program: "Engineering", course: "Electrical Engineering", tuition: 1000000 } var telecom = { program: "Engineering", course: "Telecom Engineering", tuition: 1000000 } var civil = { program: "Engineering", course: "Civil Engineering", tuition: 1000000 } var courses = [mechanical, electrical, telecom, civil]; if ($('#program_selector').text() == "Engineering"){ //then load engineering courses var selectedCourses = []; for (var i = 0; courses[i]; i++){ if (courses[i].program == "Engineering") { //find courses where program is engineering and add name to selected courses array //selectedCourses.push(courses[i].program); //add to options to select var x = document.getElementById("#course_selector"); var option = document.createElement("option"); option.text = courses[i].program; x.add(option); } } } else if ($('#program_selector').text() == "Agriculture") { //then load the agriculture courses var selectedCourses = []; for (var i = 0; courses[i]; i++){ if (courses[i].program == "Agriculture") { //find courses where program is engineering and add name to selected courses array //selectedCourses.push(courses[i].program); //add to options to select var x = document.getElementById("#course_selector"); var option = document.createElement("option"); option.text = courses[i].program; x.add(option); } } } else if ($('#program_selector').text() == "Ict") { //then load ICT courses var selectedCourses = []; for (var i = 0; courses[i]; i++){ if (courses[i].program == "Ict") { //find courses where program is engineering and add name to selected courses array //selectedCourses.push(courses[i].program); //add to options to sele…
has comment: http://stackoverflow.com/comment/43800240
possible better answer: http://stackoverflow.com/a/27693598
has comment: http://stackoverflow.com/comment/43800243
favorite count: 0
has comment: http://stackoverflow.com/comment/43800278
has answer: http://stackoverflow.com/a/27693598

http://stackoverflow.com/q/27769113
answer count: 1
has comment: http://stackoverflow.com/comment/43949010
has body: I wanted to push data in JavaScript object literal. But, not able to find anyway. I am trying the following code. var wd = { item: [] } wd.item = { country: weatherData.query.results.weather.rss.channel.location.country, state: weatherData.query.results.weather.rss.channel.location.city, displayState: weatherData.query.results.weather.rss.channel.location.city + ', ' + weatherData.query.results.weather.rss.channel.location.country, data: [ { date: weatherData.query.results.weather.rss.channel.item.forecast[0].date, day: weatherData.query.results.weather.rss.channel.item.forecast[0].day, high: weatherData.query.results.weather.rss.channel.item.forecast[0].high, low: weatherData.query.results.weather.rss.channel.item.forecast[0].low, text: weatherData.query.results.weather.rss.channel.item.forecast[0].text } ] }; I am trying to use push() function, but I am getting error. After adding one item, following is the result. Object {item: Object}item: Objectcountry: "India"data: Array[1]0: Object$$hashKey: "object:254"date: "4 Jan 2015"day: "Sun"high: "84"low: "66"text: "Partly Cloudy"__proto__: Objectlength: 1__proto__: Array[0]displayState: "Bangalore, India"state: "Bangalore"__proto__: Object__proto__: Object But, I am not able to add new data after this. Can somebody help? Following code is working now. var wd = { item: [] }; var location = weatherData.query.results.weather.rss.channel.location, forecast = weatherData.query.results.weather.rss.channel.item.forecast[0]; wd.item.push({ country: location.country, state: location.city, displayState: location.city + ', ' + location.country, data: { date: forecast.date, day: forecast.day, high: forecast.high, low: forecast.low, text: forecast.text } }); console.log(wd); Thanks all for the help.
has title: How to push data to JavaScript Object Literal
tagged with: angularjs
tagged with: javascript-objects
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/27769129
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27769129
score: 0
has comment: http://stackoverflow.com/comment/43948990

http://stackoverflow.com/a/27656221
answers question: http://stackoverflow.com/q/27656134
has body: use HTML5 placeholders. &lt;asp:RegularExpressionValidator placeholder="__\/__\/___" ID="RegularExpressionValidator1" runat="server" ErrorMessage="Enter valid Date" ControlToValidate="TextBox3" ValidationExpression="^(((0[1-9]|[12]\d|3[01])(/)(0[13578]|1[02])(/) ((19|20)\d\d))| ((0[1-9]|[12]\d|30)(/)(0[13456789]|1[012])(/)((19|20)\d\d))| ((0[1-9]|1[0-9]|2[0-8])(/)02(/)((19|20)\d)\d))| (29(/)02(/)((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))$"&gt; &lt;/asp:RegularExpressionValidator&gt; You can use placeholder. It's a HTML5 attribute that displays a placeholder value when the input is empty.
score: 0
has comment: http://stackoverflow.com/comment/44433701
type: Answer
has comment: http://stackoverflow.com/comment/43729875

http://stackoverflow.com/comment/43720692
type: AnswerComment
has text: It works, thanks. But if I edit my grids then update, it just exports old data not new.
type: Comment
comment on: http://stackoverflow.com/a/27645255
score: 0

http://stackoverflow.com/q/27746904
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27747042
score: 1
has answer: http://stackoverflow.com/a/27747042
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27747006
answer count: 2
has title: Add Active Class for any URL match to first segment?
downvote count: 0
tagged with: jquery
favorite count: 0
has body: My Javascript is adding the active class to all links with one segment that match my path variable, but not ones with two on my nav. I want it regardless to check the first segment of any URL that is currently in the window.location.pathname and if the first segment matches then add the active class to the nav item. It works for home, products and gallery. But when I console.log(linkPath) it's showing for the url products/samples the text sample and not products. Thus there is no math and it will not add the active class to the current item. How Can I get it to add the active class no matter what based off the first segment matching within any url with more than one segment? HTML Main Navigation Home Products Gallery Promotions Samples Javascript var url = window.location.pathname.split( '/' ), path = url[1]; /* Get URL For Setting Active Nav List Item */ $(".navbar-nav").children("li").each(function() { var link = $(this).children("a").attr("href"), linkPathIndex = link.lastIndexOf("/")+1, linkPath = link.substring(linkPathIndex); if (linkPath == path) { $(this).addClass("active"); } });
accepted answer: http://stackoverflow.com/a/27747006

http://stackoverflow.com/q/27797994
tagged with: git
has title: Invalid IDP response from Google Identity Toolkit
score: 0
type: Question
linked to: http://stackoverflow.com/q/31714765
tagged with: javascript
has answer: http://stackoverflow.com/a/31714924
has body: I'm followin the tutorial to get a simple app with Google Identity Toolkit and PHP https://developers.google.com/identity-toolkit/quickstart/php The login button appears, I can select my Google account, I can grant my app permission to access and read my profile etc. The callback url on my site then says 'INVALID_IDP_RESPONSE' and in Firebug I see https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyAssertion?key=mykeyremoved Failed to load resource: the server responded with a status of 400 (Bad Request) I have tried rerunning the tutorial without success, any help on how to take this debugging forward would be greatly appreciated! Best regards Johan Login script button code: www.exanple.com/index.php Return/redirect url at www.exanple.com/gitkit/index.php (which is the one producing the error code) <?php set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ .'\quickapp\vendor\google\apiclient\src'); require_once 'quickapp/vendor/autoload.php'; $gitkitClient=Gitkit_Client::createFromFile('http://www.exanple.com/quickapp/gitkit-server-config.json'); $gitkitUser = $gitkitClient->getUserInRequest(); ?> <?php if ($gitkitUser) { ?> Welcome back! Email: <?= $gitkitUser->getEmail() ?> Id: <?= $gitkitUser->getUserId() ?> Name: <?= $gitkitUser->getDisplayName() ?> Identity provider: <?= $gitkitUser->getProviderId() ?> <?php } else { ?> You are not logged in yet. <?php } ?>
answer count: 1
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/comment/43893170
type: Comment
comment on: http://stackoverflow.com/q/27741102
type: QuestionComment
has text: Dear MLeFevre, Thanks but where should i add that code?? And I need not create any model for it?
score: 0

http://stackoverflow.com/comment/43877881
type: QuestionComment
comment on: http://stackoverflow.com/q/27733192
has text: What has a call of `.toUpperCase()` to do with filtering? O.o
score: 0
type: Comment

http://stackoverflow.com/q/27766679
tagged with: java
tagged with: javascript
score: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/43943980
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43944021
favorite count: 0
has answer: http://stackoverflow.com/a/27766812
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43943915
has body: Hi i have written my javascript code in my jsp page and i am calling my jsp through java connection url,it is executing properly but skipping my javascript function which i have called at the time of page load. I am not able to understand why it is not executing my javascript. try { URL myURL = new URL("http:localhost:8080/Approval.jsp?empCode=123&amp;compCode=A"); URLConnection myURLConnection = myURL.openConnection(); myURLConnection.connect(); } catch (IOException e) { } Is there any of calling JavaScript directly through connection url.Please suggest?
has title: How can i execute javascript of jsp throught java connection url?
type: Question
has comment: http://stackoverflow.com/comment/43943893
has comment: http://stackoverflow.com/comment/43944022

google-apps-script
tags question: http://stackoverflow.com/q/27751128
tags question: http://stackoverflow.com/q/27701079
tags question: http://stackoverflow.com/q/27745604
tags question: http://stackoverflow.com/q/27803444
tags question: http://stackoverflow.com/q/27664342
tags question: http://stackoverflow.com/q/27752213
tags question: http://stackoverflow.com/q/27785480
tags question: http://stackoverflow.com/q/27648365
tags question: http://stackoverflow.com/q/27643515
tags question: http://stackoverflow.com/q/27740544
tags question: http://stackoverflow.com/q/27727325
tags question: http://stackoverflow.com/q/27747477
tags question: http://stackoverflow.com/q/27715376
tags question: http://stackoverflow.com/q/27768417
type: Tag
tag name: google-apps-script
tags question: http://stackoverflow.com/q/27725424
tags question: http://stackoverflow.com/q/27726914
tags question: http://stackoverflow.com/q/27683587
tags question: http://stackoverflow.com/q/27679908
tags question: http://stackoverflow.com/q/27781625
tags question: http://stackoverflow.com/q/27664518
tags question: http://stackoverflow.com/q/27788367
tags question: http://stackoverflow.com/q/27684512
tags question: http://stackoverflow.com/q/27650123
tags question: http://stackoverflow.com/q/27668519
tags question: http://stackoverflow.com/q/27750628
tags question: http://stackoverflow.com/q/27683564
tags question: http://stackoverflow.com/q/27725367
tags question: http://stackoverflow.com/q/27650356
tags question: http://stackoverflow.com/q/27689179
tags question: http://stackoverflow.com/q/27701671
tags question: http://stackoverflow.com/q/27672004

http://stackoverflow.com/a/27721506
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27715090
answers question: http://stackoverflow.com/q/27715090
type: Answer
has body: i worked around with this for a min and i am not sure exactly why i couldn't get things to work as i thought they should. i copied your code and made a plunker. i was able to get your code to work basically as you have it now. but if i moved the submit paper-button inside the dialog it changed all return data to null. if i wrap it in a custom element i could get everything to work with a submit button inside the dialog or from outside. i am not sure the reason for this as i haven't had any issue like this as of yet. but i would say the best bet for functionality is to wrap this into a custom element. this plunker is where i was working on this without a custom element. the button that is showing when dialog is closed will get the value of the paper-input value without issue. but the submit button inside the dialog that is calling the same function returns null still. http://plnkr.co/edit/X8SHCCBW3usZ5c6BrSmQ?p=preview here is the plunker i worked up with a working custom element and both buttons returning the value of the input. Upload File Submit Submit Show Dialog http://plnkr.co/edit/yr1pLc05VYZ6c9OwsvOH?p=preview
has comment: http://stackoverflow.com/comment/43864373

http://stackoverflow.com/comment/43756148
comment on: http://stackoverflow.com/q/27670526
has text: Oow, no.. That's not really an option. I think i'd go with the answer below then from just instantiating the class from another file.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43799382
has text: i tried your edited version and the page won't even load now. I'm at a lost, still not giving up though.
comment on: http://stackoverflow.com/a/27660920
score: 0
type: AnswerComment
type: Comment

javascript
tags question: http://stackoverflow.com/q/27783626
tags question: http://stackoverflow.com/q/27751795
tags question: http://stackoverflow.com/q/27673034
tags question: http://stackoverflow.com/q/27650638
tags question: http://stackoverflow.com/q/27794439
tags question: http://stackoverflow.com/q/27736431
tags question: http://stackoverflow.com/q/27676850
tags question: http://stackoverflow.com/q/27714498
tags question: http://stackoverflow.com/q/27705910
tags question: http://stackoverflow.com/q/27786482
tags question: http://stackoverflow.com/q/27657233
tags question: http://stackoverflow.com/q/27751120
tags question: http://stackoverflow.com/q/27763228
tags question: http://stackoverflow.com/q/27798994
tags question: http://stackoverflow.com/q/27758841
tags question: http://stackoverflow.com/q/27747319
tags question: http://stackoverflow.com/q/27738912
tags question: http://stackoverflow.com/q/27786939
tags question: http://stackoverflow.com/q/27763086
tags question: http://stackoverflow.com/q/27663993
tags question: http://stackoverflow.com/q/27779009
tags question: http://stackoverflow.com/q/27735360
tags question: http://stackoverflow.com/q/27686394
tags question: http://stackoverflow.com/q/27747631
tags question: http://stackoverflow.com/q/27676475
tags question: http://stackoverflow.com/q/27674850
tags question: http://stackoverflow.com/q/27677771
tags question: http://stackoverflow.com/q/27721743
tags question: http://stackoverflow.com/q/27720432
tags question: http://stackoverflow.com/q/27778608
tags question: http://stackoverflow.com/q/27668486
tags question: http://stackoverflow.com/q/27658906
tags question: http://stackoverflow.com/q/27703371
tags question: http://stackoverflow.com/q/27666142
tags question: http://stackoverflow.com/q/27670017
tags question: http://stackoverflow.com/q/27691620
tags question: http://stackoverflow.com/q/27716673
tags question: http://stackoverflow.com/q/27684340
tags question: http://stackoverflow.com/q/27737209
tags question: http://stackoverflow.com/q/27706955
tags question: http://stackoverflow.com/q/27761978
tags question: http://stackoverflow.com/q/27793777
tags question: http://stackoverflow.com/q/27750600
tags question: http://stackoverflow.com/q/27784437
tags question: http://stackoverflow.com/q/27726147
tags question: http://stackoverflow.com/q/27747244
tags question: http://stackoverflow.com/q/27792725
tags question: http://stackoverflow.com/q/27668722
tags question: http://stackoverflow.com/q/27643719
tags question: http://stackoverflow.com/q/27782431
tags question: http://stackoverflow.com/q/27797530
tags question: http://stackoverflow.com/q/27766679
tags question: http://stackoverflow.com/q/27702353
tags question: http://stackoverflow.com/q/27750537
tags question: http://stackoverflow.com/q/27758364
tags question: http://stackoverflow.com/q/27660158
tags question: http://stackoverflow.com/q/27739787
tags question: http://stackoverflow.com/q/27736747
tags question: http://stackoverflow.com/q/27712450
tags question: http://stackoverflow.com/q/27640982
tags question: http://stackoverflow.com/q/27660117
tags question: http://stackoverflow.com/q/27755212
tags question: http://stackoverflow.com/q/27660478
tags question: http://stackoverflow.com/q/27653465
tags question: http://stackoverflow.com/q/27700061
tags question: http://stackoverflow.com/q/27701121
tags question: http://stackoverflow.com/q/27694223
tags question: http://stackoverflow.com/q/27660002
tags question: http://stackoverflow.com/q/27695585
tags question: http://stackoverflow.com/q/27791230
tags question: http://stackoverflow.com/q/27670288
tags question: http://stackoverflow.com/q/27734777
tags question: http://stackoverflow.com/q/27785262
tags question: http://stackoverflow.com/q/27796832
tags question: http://stackoverflow.com/q/27749336
tags question: http://stackoverflow.com/q/27760346
tags question: http://stackoverflow.com/q/27731137
tags question: http://stackoverflow.com/q/27707111
tags question: http://stackoverflow.com/q/27692093
tags question: http://stackoverflow.com/q/27697103

http://stackoverflow.com/q/27726902
has answer: http://stackoverflow.com/a/27727283
tagged with: javascript
tagged with: jquery
has body: As someone who will be working extensively with JavaScript and JQuery, I hear the community is strong so I figured I would ask what a beginner should been keen in understanding when developing mobile applications. Like any other language, I wish someone would have walked in the first day of class when programming with C and said to me, "if you don't learn everything about malloc() and free() today, you will fail!" Or when I was writing with Java and heard that private and static are essential for every function and variable too late. See what I mean about learning the most important so I don't get frustrated with the details later. My current attempt at figuring this question out is reading a book, but like most books, they don't expect you to ask what is the high-level re-occurring concepts. I have used CSS and HTML and have not used scripts or Jquery as much when developing websites.
answer count: 2
accepted answer: http://stackoverflow.com/a/27727283
downvote count: 0
favorite count: 0
tagged with: database-connection
possible better answer: http://stackoverflow.com/a/27727357
has answer: http://stackoverflow.com/a/27727357
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has title: Javascript and Jquery essential knowledge for beginner?
tagged with: mobile
tagged with: ios

record
type: Tag
tag name: record
tags question: http://stackoverflow.com/q/27672761

http://stackoverflow.com/a/27787025
type: Answer
has comment: http://stackoverflow.com/comment/43984391
has body: According to man scanf The value EOF is returned if the end of input is reached before either the first successful conversion or a matching failure occurs. EOF is also returned if a read error occurs, in which case the error indicator for the stream (see ferror(3)) is set, and errno is set indicate the error. I feel that you should use something like that: r = scanf("%d",&amp;a); if (r != EOF) { ... Logically, simple wait for data could look like this: while(r = scanf("%d",&amp;a)) { if (r == EOF) continue; printf("%d",a); } EDIT As i understand, you should use unbuffered IO operations, like read/write syscals. Try this: int main(){ int n; char buf[255]; while(1) { while((n = read(0,buf,sizeof(buf))) != 0){ write(1,buf,n); } } } Get the info from: write() to stdout and printf output not interleaved?, good answer, check it out. Your C program reads value from buffer. In my first example it awaits data to fill the output buffer, so i had no output. EDIT 2: How to turn the buffer off With small modifications of code, you can use fflush(stdout) after each printf call. If you can't edit the code, take a look at this answer from unix.stackexchange: https://unix.stackexchange.com/questions/25372/turn-off-buffering-in-pipe, there are two good solutions. (i'd prefer the second, because it is from coreutils).
score: 0
answers question: http://stackoverflow.com/q/27785087

http://stackoverflow.com/a/27677143
answers question: http://stackoverflow.com/q/27675370
has comment: http://stackoverflow.com/comment/43785462
has comment: http://stackoverflow.com/comment/43782760
upvote count: 6
has comment: http://stackoverflow.com/comment/70019929
has body: I think this plugin will full fill your needs (https://github.com/vliesaputra/DeviceInformationPlugin). It will give the following data 1.Your unique Device ID 2.Phone Number (if it is stored in your SIM card) 3.Country ISO of your phone network provider 4.Name of your network provider 5.Your SIM Card Serial number 6.Country ISO of your SIM card 7.Name of your SIM card mobile operator 8.E-mail/Phone number used by apps listed in your Settings > Accounts &amp; Sync list Here is sample code var deviceInfo = cordova.require("cordova/plugin/DeviceInformation"); deviceInfo.get(function(result) { //fetch the device data console.log("result = " + result); }, function() { console.log("error"); });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43782539
score: 6
type: Answer
accepted answer of: http://stackoverflow.com/q/27675370
downvote count: 0
has comment: http://stackoverflow.com/comment/43782343

http://stackoverflow.com/q/27727036
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Window Redirect Confusion
accepted answer: http://stackoverflow.com/a/27727120
type: AnsweredQuestion
has body: I am using a JavaScript function to redirect the window to different webpage with this command: window.location.replace("/EluLander/doctor/doctordash.html"); This is the url of the webpage when I open it manually: file:///C:/Users/Elijah%20Spiegel/Desktop/EluLander/doctor/doctordash.html And the url of the page I am redirecting FROM is this: file:///C:/Users/Elijah%20Spiegel/Desktop/EluLander/Landingpage.html When I run the function, it leads me to file:///C:/EluLander/doctor/doctordash.html What am I goofing?
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27727120

node.js
tags question: http://stackoverflow.com/q/27733221
tags question: http://stackoverflow.com/q/27683290
tags question: http://stackoverflow.com/q/27649157
tags question: http://stackoverflow.com/q/27757040
tags question: http://stackoverflow.com/q/27757238
tags question: http://stackoverflow.com/q/27662729
tags question: http://stackoverflow.com/q/27724323
tags question: http://stackoverflow.com/q/27769638
tags question: http://stackoverflow.com/q/27764788
tags question: http://stackoverflow.com/q/27794073
tags question: http://stackoverflow.com/q/27743312
tags question: http://stackoverflow.com/q/27802901
tags question: http://stackoverflow.com/q/27656391
tags question: http://stackoverflow.com/q/27758432
tags question: http://stackoverflow.com/q/27769697
tags question: http://stackoverflow.com/q/27796362
tags question: http://stackoverflow.com/q/27702096
tags question: http://stackoverflow.com/q/27763228
tags question: http://stackoverflow.com/q/27747631
tags question: http://stackoverflow.com/q/27759880
tags question: http://stackoverflow.com/q/27750537
tags question: http://stackoverflow.com/q/27702664
tags question: http://stackoverflow.com/q/27732753
tags question: http://stackoverflow.com/q/27694711
tags question: http://stackoverflow.com/q/27678491
tags question: http://stackoverflow.com/q/27691684
tags question: http://stackoverflow.com/q/27715631
tags question: http://stackoverflow.com/q/27679287
tags question: http://stackoverflow.com/q/27720887
tags question: http://stackoverflow.com/q/27661570
tags question: http://stackoverflow.com/q/27789535
tags question: http://stackoverflow.com/q/27782774
tags question: http://stackoverflow.com/q/27664624
tags question: http://stackoverflow.com/q/27692546
tags question: http://stackoverflow.com/q/27799780
tags question: http://stackoverflow.com/q/27671346
tags question: http://stackoverflow.com/q/27786463
tags question: http://stackoverflow.com/q/27714694
tags question: http://stackoverflow.com/q/27650526
tags question: http://stackoverflow.com/q/27703659
tags question: http://stackoverflow.com/q/27775323
tags question: http://stackoverflow.com/q/27670051
tags question: http://stackoverflow.com/q/27712941
tags question: http://stackoverflow.com/q/27767822
tags question: http://stackoverflow.com/q/27646397
tags question: http://stackoverflow.com/q/27770161
tags question: http://stackoverflow.com/q/27768724
tags question: http://stackoverflow.com/q/27715581
tags question: http://stackoverflow.com/q/27745357
tags question: http://stackoverflow.com/q/27714060
tags question: http://stackoverflow.com/q/27676936
tags question: http://stackoverflow.com/q/27654784
tags question: http://stackoverflow.com/q/27715197
tags question: http://stackoverflow.com/q/27681354
tags question: http://stackoverflow.com/q/27770898
tags question: http://stackoverflow.com/q/27732155
tags question: http://stackoverflow.com/q/27724790
tags question: http://stackoverflow.com/q/27722370
tags question: http://stackoverflow.com/q/27712703
tags question: http://stackoverflow.com/q/27789905
tags question: http://stackoverflow.com/q/27699179
tags question: http://stackoverflow.com/q/27773521
tags question: http://stackoverflow.com/q/27742064
tags question: http://stackoverflow.com/q/27767030
tags question: http://stackoverflow.com/q/27647742
tags question: http://stackoverflow.com/q/27645529
tags question: http://stackoverflow.com/q/27649435
tags question: http://stackoverflow.com/q/27732623
tags question: http://stackoverflow.com/q/27743649
tags question: http://stackoverflow.com/q/27771633
tags question: http://stackoverflow.com/q/27727993
tags question: http://stackoverflow.com/q/27712381
tags question: http://stackoverflow.com/q/27749596
tags question: http://stackoverflow.com/q/27682389
tags question: http://stackoverflow.com/q/27643329
tags question: http://stackoverflow.com/q/27799496
tags question: http://stackoverflow.com/q/27742790
tags question: http://stackoverflow.com/q/27793564
tags question: http://stackoverflow.com/q/27662263
tags question: http://stackoverflow.com/q/27693898

http://stackoverflow.com/comment/43915410
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27750900
type: Comment
has text: Ok, can you share your setup in a jsfiddle or jsbin or email it to me to check it for you.

http://stackoverflow.com/comment/43714770
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27648703
has text: Likely a document.write after page load or a parent selector
type: QuestionComment

http://stackoverflow.com/q/27651340
tagged with: jquery
has comment: http://stackoverflow.com/comment/43719882
has answer: http://stackoverflow.com/a/27651388
has comment: http://stackoverflow.com/comment/43719730
score: 3
answer count: 1
downvote count: 0
favorite count: 0
has title: CSS "!important" rule disables animate()
has body: I'm trying to change an image element's height and width using jquery's animate() function. The image's height and width attributes are followed by "!important" in the CSS. CSS: #my_image { height: 50px !important; width: 50px !important; } The following jquery code will have no effect because of the "!important" rules: $('#my_image').animate({ height: "100px;", width: "100px"}, 1000 ); Is there a way to animate the image using jquery (as would happen if the "!important" rule were not there)? Thanks.
tagged with: css
accepted answer: http://stackoverflow.com/a/27651388
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/43719756
linked to: http://stackoverflow.com/q/2655925
has comment: http://stackoverflow.com/comment/43719724
has comment: http://stackoverflow.com/comment/43719953
type: Question
tagged with: javascript

http://stackoverflow.com/comment/43880359
comment on: http://stackoverflow.com/a/27721842
type: AnswerComment
score: 0
type: Comment
has text: the controller that manages the view where you want to display your information

http://stackoverflow.com/q/27727748
has answer: http://stackoverflow.com/a/27727768
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27727973
type: Question
accepted answer: http://stackoverflow.com/a/27727768
has title: Reverse DOM node order with Javascript
has answer: http://stackoverflow.com/a/27728086
has comment: http://stackoverflow.com/comment/43867639
score: 0
possible better answer: http://stackoverflow.com/a/27728086
answer count: 3
tagged with: language-features
tagged with: dom
tagged with: javascript
has comment: http://stackoverflow.com/comment/43867642
has body: I'm curious if there is an easy way to make this transition with JavaScript. TEXT To this: TEXT Now I know that this is possible in longer ways, like creating a new and , placing all of old inside of new , and then new inside of the new , and then replace the child, or similar method. But I'm curious if there's something like node.swapTypeWithParent or swapNodeTypes(b, i).

http://stackoverflow.com/comment/43952943
comment on: http://stackoverflow.com/a/27770749
type: AnswerComment
has text: Interesting, let me see if I understand. So even though I only want the time, I should save it as a date (with day probably hardcoded to 1/1/1970?) & then use the date API to extract the time?
score: 0
type: Comment

http://stackoverflow.com/comment/44037501
type: Comment
comment on: http://stackoverflow.com/a/27794224
has text: `delete values.Menu` - This is just a plain javascript object we are working with :) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete
type: AnswerComment
score: 1

http://stackoverflow.com/q/27777564
has comment: http://stackoverflow.com/comment/43966762
has comment: http://stackoverflow.com/comment/43966596
has answer: http://stackoverflow.com/a/27778869
has comment: http://stackoverflow.com/comment/43966978
has answer: http://stackoverflow.com/a/27779261
linked to: http://stackoverflow.com/q/7040078
has comment: http://stackoverflow.com/comment/43965962
accepted answer: http://stackoverflow.com/a/27778869
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43966508
has body: Ive made a Websocket server in C# and a HTML UI together with JS. I can get the server to communicate and do the handshake properly, but the information being sent is absolute gibberish and looks something like this: ???=u??X?G? I have tried encoding it, but the result is not very different. My JS looks like this: // the user clicked the big red button $('#bigredbutton_send').click(function () { ws_send($('#console_input').val()); }); $('#console_input').keyup(function (e) { if(e.keyCode == 13) // enter is pressed ws_send($('#console_input').val()); }); CSS: &lt;input type="image" src="button.png" name="bigredbutton_send" id="bigredbutton_send" value="VALUE" /&gt; &lt;input type="text" name="console_input" id="console_input" value="Hello123" /&gt; and c# module that recieves the information looks like this: private void Read(IAsyncResult ar) { int sizeOfReceivedData = ConnectionSocket.EndReceive(ar); if (sizeOfReceivedData &gt; 0) { int start = 0, end = dataBuffer.Length - 1; // if we are not already reading something, look for the start byte as specified in the protocol if (!readingData) { for (start = 0; start &lt; dataBuffer.Length - 1; start++) { if (dataBuffer[start] == (byte)WrapperBytes.Start) { readingData = true; // we found the begining and can now start reading start++; // we dont need the start byte. Incrementing the start counter will walk us past it break; } } } // no else here, the value of readingData might have changed // if a begining was found in the buffer, or if we are continuing from another buffer if (readingData) { bool endIsInThisBuffer = false; // look for the end byte in the received data for (end = start; end &lt; sizeOfReceivedData; end++) { byte currentByte = dataBuffer[end]; if (dataBuffer[end] == (byte)WrapperBytes.End) { endIsInThisBuffer = true; // we found the ending byte break; } } // the end is in this buffer, which means that we are done reading if (endIsInThisBuffer == true) { // we are no longer reading data readingData = fals…
possible better answer: http://stackoverflow.com/a/27779261
has title: WebSocketServers in C# and JS - Gibberish in return
type: Question
has comment: http://stackoverflow.com/comment/43965935
has answer: http://stackoverflow.com/a/30211709
tagged with: c#
has comment: http://stackoverflow.com/comment/43967817
tagged with: .net
tagged with: javascript
has comment: http://stackoverflow.com/comment/43967121
score: 0
has comment: http://stackoverflow.com/comment/43967230
answer count: 3
tagged with: websocket
tagged with: jquery

http://stackoverflow.com/q/27797931
has answer: http://stackoverflow.com/a/27806537
answer count: 1
tagged with: javascript
has body: I use pouchDB in my tests, and recently upgraded the version from 3.1.0 to 3.2.0. Since then my tests timeout Error: timeout of 2000ms exceeded Debugging hints at the pouch.bulidDocs call never returning (it is trying to insert an array of 20 docs). I was using the memory adapter, but turned that off to tests and still the tests fail. An upgrade to 3.2.1 didn't fix it, but when I downgrading again to 3.1.0 it all works well. Is anyone else experiencing similar problems?
tagged with: pouchdb
score: 0
has title: PouchDB's bulkDocs times out after upgrading to 3.2.0 (from 3.1.0)
tagged with: upgrade
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44012874

http://stackoverflow.com/q/27742495
has title: Ajax promise not working
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43897665
score: 2
type: AnsweredQuestion
upvote count: 3
has answer: http://stackoverflow.com/a/27742578
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27743506
tagged with: sharepoint
has comment: http://stackoverflow.com/comment/43897548
possible better answer: http://stackoverflow.com/a/27743506
has comment: http://stackoverflow.com/comment/43895949
answer count: 2
accepted answer: http://stackoverflow.com/a/27742578
has body: I'm trying to use promise to return a comparison of current logged in user and a field from a list in SharePoint. function compareCurrentUserWithListObject() { var userProp = this._userProfileProperties; var userName = userProp.get_userProfileProperties()['UserName']; return this._list.filter(function (element, index, array) { var promise = jQuery.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/GetUserById(" + element.user.get_lookupId() + ")", type: "GET", headers: { "Accept": "application/json;odata=verbose" } }); promise.done(function(data) { return (data.d.Email.indexOf(userName) &gt; -1); }); }); } function init() { var userArray = this.compareCurrentUserWithListObject(); userArray.done(function(res) { if (res.length &gt; 0) { //Do some stuff after compare... } }); } I'm not sure I'm using the .done correct here. Can someone help me? EDIT: Working code: function compareCurrentUserWithListObject() { var userProp = this._userProfileProperties; var userName = userProp.get_userProfileProperties()['UserName']; return this._list.filter(function (element, index, array) { var promise = jQuery.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/GetUserById(" + element.user.get_lookupId() + ")", type: "GET", headers: { "Accept": "application/json;odata=verbose" } }); promise.done(function(data) { return (data.d.Email.indexOf(userName) &gt; -1); }); return promise; }); } function init() { var userArray = this.compareCurrentUserWithListObject(); if (userArray.length &gt; 0) { //Do some stuff after compare... } }
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27736680
has comment: http://stackoverflow.com/comment/43884977
tagged with: string
favorite count: 0
score: -1
has body: How can I transform the string "Test(5)" into "Test\(5\)" dynamically? (JQuery or Javascript) I have tried this but with no success var string = "Test(5)"; string = string.replace("(","\("); string = string.replace(")","\)"); console.log(string); http://jsfiddle.net/mvehkkfe/
has comment: http://stackoverflow.com/comment/43884870
has answer: http://stackoverflow.com/a/27736688
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27736704
accepted answer: http://stackoverflow.com/a/27736688
has comment: http://stackoverflow.com/comment/43884863
possible better answer: http://stackoverflow.com/a/27736704
downvote count: 1
has title: javascript string replace ( with \(
upvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43885056
tagged with: replace
type: AnsweredQuestion

http://stackoverflow.com/a/27671170
type: Answer
has body: You'll need to loop through the items. Jeremy Millers had a good plan $("input[type='number']").removeAttr("disable"); jQuery This selects all your number inputs. Of course you can use other selectors like [input:disabled]
score: 0
answers question: http://stackoverflow.com/q/27671117

http://stackoverflow.com/a/27722889
has comment: http://stackoverflow.com/comment/43861338
has body: Compiling these points to an SVG file seems like the most efficient option. If I understand your question correctly, you already have a database of points you'd like to draw. This means that there is no need to generate this image on the fly. I would guess a precompiled SVG image would load a lot faster than lines drawn on a canvas. Canvas may be faster at generating images on the fly, but if you can generate your image before hand, this will save you a lot of time in the browser. SVG would also be zoomable so I think this best fits your criteria. Here's an example of a library you could use to zoom and pan your SVG EDIT: I created a large SVG image with 100000 lines (similar to dwana's canvas one here: jsfiddle.net/dqkksbz6/2) and found that my guess was wrong. As MarkE points out, a huge amount of DOM nodes does have a significant impact on browser performance. SVG is actually slower. Using a canvas is a lot faster and doesn't break the browser the way a huge SVG does. Still, my original point still stands about generating the image before it's requested. MarkE's comment is very helpful and maybe there's something in that. You could generate a PNG which then switches out to a small SVG of the relevant area once a certain zoom level is reached. This would be quite a lot of work to put together, but I can't think of a better way to optimise for both speed and quality.
downvote count: 0
answers question: http://stackoverflow.com/q/27720559
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/q/27663986
answer count: 1
downvote count: 1
has body: I have an AngularJS directive which calls $compile inside a callback click() function. However, the contents do not seem to be getting compiled. var testApp = angular.module('testApp', []); testApp.controller('TestController', function($scope) { $scope.user_name = 'George'; }); testApp.directive('testDirective', function($compile) { return { template: 'Click Here', link: function(scope, element, attrs) { $(element).click(function() { $('#externalDiv2').html('{{user_name}}, you clicked the button.'); $compile($('#externalDiv2')[0])(scope); }); } }; }); In the example above, #externalDiv2 still displays '{{user_name}}' instead of interpolating it with the username from the scope object. What am I doing wrong? http://jsfiddle.net/gcmLndzm/3/
has comment: http://stackoverflow.com/comment/43743815
favorite count: 0
accepted answer: http://stackoverflow.com/a/27664027
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43743812
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27664027
upvote count: 0
has comment: http://stackoverflow.com/comment/43743754
score: -1
type: Question
tagged with: angularjs-directive
tagged with: javascript
has title: $compile not working inside callback

jquery
tags question: http://stackoverflow.com/q/27678012
tags question: http://stackoverflow.com/q/27676825
tags question: http://stackoverflow.com/q/27710999
tags question: http://stackoverflow.com/q/27795102
tags question: http://stackoverflow.com/q/27672328
tags question: http://stackoverflow.com/q/27703460
tags question: http://stackoverflow.com/q/27751275
tags question: http://stackoverflow.com/q/27708007
tags question: http://stackoverflow.com/q/27760718
tags question: http://stackoverflow.com/q/27794565
tags question: http://stackoverflow.com/q/27719656
tags question: http://stackoverflow.com/q/27702280
tags question: http://stackoverflow.com/q/27681615
tags question: http://stackoverflow.com/q/27659580
tags question: http://stackoverflow.com/q/27721945
tags question: http://stackoverflow.com/q/27792965
tags question: http://stackoverflow.com/q/27653725
tags question: http://stackoverflow.com/q/27742615
tags question: http://stackoverflow.com/q/27641726
tags question: http://stackoverflow.com/q/27709746
tags question: http://stackoverflow.com/q/27750631
tags question: http://stackoverflow.com/q/27752951
tags question: http://stackoverflow.com/q/27792711
tags question: http://stackoverflow.com/q/27714042
tags question: http://stackoverflow.com/q/27741771
tags question: http://stackoverflow.com/q/27738306
tags question: http://stackoverflow.com/q/27657592
tags question: http://stackoverflow.com/q/27741293
tags question: http://stackoverflow.com/q/27784547
tags question: http://stackoverflow.com/q/27798024
tags question: http://stackoverflow.com/q/27647613
tags question: http://stackoverflow.com/q/27704862
tags question: http://stackoverflow.com/q/27798530
tags question: http://stackoverflow.com/q/27692049
tags question: http://stackoverflow.com/q/27686279
tags question: http://stackoverflow.com/q/27660886
tags question: http://stackoverflow.com/q/27776743
tags question: http://stackoverflow.com/q/27641188
tags question: http://stackoverflow.com/q/27764047
tags question: http://stackoverflow.com/q/27797492
tags question: http://stackoverflow.com/q/27786486
tags question: http://stackoverflow.com/q/27739835
tags question: http://stackoverflow.com/q/27697457
tags question: http://stackoverflow.com/q/27759415
tags question: http://stackoverflow.com/q/27794100
tags question: http://stackoverflow.com/q/27648587
tags question: http://stackoverflow.com/q/27774950
tags question: http://stackoverflow.com/q/27667253
tags question: http://stackoverflow.com/q/27702418
tags question: http://stackoverflow.com/q/27699519
tags question: http://stackoverflow.com/q/27751010
tags question: http://stackoverflow.com/q/27801055
tags question: http://stackoverflow.com/q/27767564
tags question: http://stackoverflow.com/q/27771707
tags question: http://stackoverflow.com/q/27789029
tags question: http://stackoverflow.com/q/27724304
tags question: http://stackoverflow.com/q/27715409
tags question: http://stackoverflow.com/q/27786879
tags question: http://stackoverflow.com/q/27787425
tags question: http://stackoverflow.com/q/27680665
tags question: http://stackoverflow.com/q/27743140
tags question: http://stackoverflow.com/q/27710040
tags question: http://stackoverflow.com/q/27747348
tags question: http://stackoverflow.com/q/27745060
tags question: http://stackoverflow.com/q/27696406
tags question: http://stackoverflow.com/q/27760096
tags question: http://stackoverflow.com/q/27682028
tags question: http://stackoverflow.com/q/27794960
tags question: http://stackoverflow.com/q/27797294
tags question: http://stackoverflow.com/q/27645455
tags question: http://stackoverflow.com/q/27753589
tags question: http://stackoverflow.com/q/27710273
tags question: http://stackoverflow.com/q/27777291
tags question: http://stackoverflow.com/q/27751988
tags question: http://stackoverflow.com/q/27678746
tags question: http://stackoverflow.com/q/27695820
tags question: http://stackoverflow.com/q/27798114
tags question: http://stackoverflow.com/q/27706961
tags question: http://stackoverflow.com/q/27711906
tags question: http://stackoverflow.com/q/27678328

http://stackoverflow.com/q/27723113
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44479397
score: 4
tagged with: angularjs
tagged with: asynchronous
favorite count: 0
has comment: http://stackoverflow.com/comment/43858711
type: UnansweredQuestion
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/47322412
type: Question
upvote count: 4
has body: I am currently working with angular and rails on a new blog for myself and I am stuck. I used ng-bind-html for injecting the code from my backend. Now I fixed it using my own directive. I am currently getting the following error when I am trying to import a code example from Github's Gist service: Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened. What is the reason and how to fix this? Thanks in advance!
has title: How to load Gist code without getting async error
answer count: 1

http://stackoverflow.com/a/27783618
accepted answer of: http://stackoverflow.com/q/27782659
type: Answer
has comment: http://stackoverflow.com/comment/44037651
answers question: http://stackoverflow.com/q/27782659
has body: .leaflet-map-pane is positioned using transform: translate3d(x,y,z). Since translate3d is now controlling the z-axis the z-index is ignored. (You'll see it work if you remove/toggle the translate3d property of .leaflet-map-pane in the inspector/dev tools.) I can't see where in the code this translate3d style is set (presumably leaflet.js) but you could replace it with absolute positioning instead. Update: Here's a couple of screenshots showing the element I'm referring to. Screenshot 1: leaflet-map-pane has translate3d applied. Screenshot 2: translate3d style disabled in inspector.
has comment: http://stackoverflow.com/comment/44041644
downvote count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43988234
type: AcceptedAnswer

internet-explorer-9
tag name: internet-explorer-9
tags question: http://stackoverflow.com/q/27642627
type: Tag

http://stackoverflow.com/comment/55966104
score: 3
type: AnswerComment
has text: I used a search engine and posted one more Explanation for you
comment on: http://stackoverflow.com/a/34108006
type: Comment

http://stackoverflow.com/q/27799015
has answer: http://stackoverflow.com/a/27799562
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44009189
upvote count: 1
type: Question
has title: Uploading multiple files using Javascript
tagged with: cakephp
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27799562
answer count: 1
downvote count: 0
favorite count: 0
tagged with: php
has body: Is there any way to do this ? I mean to upload multiple files in to files folder ? At the moment I have this, But here I can upload only one File, : But what I want to do is this (If u click this little +, then coming new input, where u can choose another file.) : Uploadfile VIEW Code &lt;div class="users view"&gt; &lt;h2&gt;&lt;?php echo __('Lisa Fail'); ?&gt;&lt;/h2&gt; &lt;?php echo $this-&gt;Form-&gt;create('uploadFile', array( 'type' =&gt; 'file')); echo $this-&gt;Form-&gt;input('pdf_path', array('type' =&gt; 'file','label' =&gt; '')); //echo $this-&gt;Form-&gt;input('files.', array('type' =&gt; 'file', 'multiple')); echo $this-&gt;Form-&gt;end('Upload file'); $image_src = $this-&gt;webroot.'files/'.$image; Uploadfile CONTROLLER Code public function uploadFile() { $filename = ''; if ($this-&gt;request-&gt;is('post')) { // checks for the post values $uploadData = $this-&gt;data['uploadFile']['pdf_path']; if ( $uploadData['size'] == 0 || $uploadData['error'] !== 0) { // checks for the errors and size of the uploaded file return false; } $filename = basename($uploadData['name']); // gets the base name of the uploaded file $uploadFolder = WWW_ROOT. 'files'; // path where the uploaded file has to be saved $filename = time() .'_'. $filename; // adding time stamp for the uploaded image for uniqueness $uploadPath = $uploadFolder . DS . $filename; if( !file_exists($uploadFolder) ){ mkdir($uploadFolder); // creates folder if not found } if (!move_uploaded_file($uploadData['tmp_name'], $uploadPath)) { return false; } } $this-&gt;set('image',$filename); } I have one Javascript, maybe I can use this , or not (What this is doing?: Its doing same thing, but its doing number input, where u can type a number) ? var lastRow=0; function addNumber() { $("#mytable tbody&gt;tr#number0").clone(true).attr('id','lisanumbrid'+lastRow).removeAttr('style').insertBefore("#mytable tbody&gt;tr#trAdd"); $("#lisanumbrid"+lastRow+" button").attr('onclick','removeNumber('+lastRow+')'); $("#lisan…

http://stackoverflow.com/q/27791230
score: -1
type: Question
has answer: http://stackoverflow.com/a/27791268
has comment: http://stackoverflow.com/comment/43992288
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27791288
favorite count: 0
has body: My page is receiving JSON encoded data from a php script. Using my browsers dev network tool I can see the data is as follows: {"state":200,"message":null,"result":"..\/0images\/listimg\/orig\/54ab4719bf848.jpeg","id":"957"} I have an input tag on the page called &lt;input class="avatar-src" name="avatar_src" type="hidden" value=""&gt; Using jquery, I would like to store the value for "id" from the json string in the value attribute of my input tag. There is a JS script that is already processing the "state", "message" and "result" objects from the json string. If possible I would like to leave that script alone and use a separate one to extract the JSON object "id". How would I do this? Here is part of the first ajax response that manages "state" "message" and "result" ajaxUpload: function () { var url = this.$avatarForm.attr("action"), data = new FormData(this.$avatarForm[0]), _this = this; $.ajax(url, { type: "post", data: data, processData: false, contentType: false, beforeSend: function () { _this.submitStart(); }, success: function (data) { _this.submitDone(data); }, error: function (XMLHttpRequest, textStatus, errorThrown) { _this.submitFail(textStatus || errorThrown); }, complete: function () { _this.submitEnd(); } }); }, syncUpload: function () { this.$avatarSave.click(); }, submitStart: function () { }, submitDone: function (data) { console.log(data); try { data = $.parseJSON(data); } catch (e) {}; if (data &amp;&amp; data.state === 200) { if (data.result) { this.url = data.result; if (this.support.datauri || this.uploaded) { this.uploaded = false; this.cropDone(); } else { this.uploaded = true; this.$avatarSrc.val(this.url); this.startCropper(); } this.$avatarInput.val(""); } else if (data.message) { this.alert(data.message); } } else { this.alert("Failed to response"); } },
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43992251
downvote count: 1
has title: How to store JSON data in an element using jquery
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/27651069
possible better answer: http://stackoverflow.com/a/27660954
tagged with: mongodb
has answer: http://stackoverflow.com/a/27660954
answer count: 2
upvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27662650
has comment: http://stackoverflow.com/comment/43720362
tagged with: node.js
downvote count: 1
type: Question
type: AnsweredQuestion
has title: Can't list documents in mongodb collection using MongoClient in node.js
accepted answer: http://stackoverflow.com/a/27662650
has body: I can connect to my database from node.js using the MongoClient. I amb able to write, update and remove docs from a collection. But I am not able to retrieve data from it. This is my code: var mongoClient=require('mongodb').MongoClient; var mongoDbObj; mongoClient.connect('mongodb://127.0.0.1:27017/trendoa', function(err, db){ if(err){ console.log(err); }else{ global.db = db; }; var col = global.db.collection('twitter_accounts_mon'); // create var doc1 = {'hola':'sushi'}; col.insert(doc1, function(err, result) { callback(err); }); // update col.update({hola:'jordi'}, {$set:{hola:'joan'}}, {w:1}, function(err, result) {}); // delete col.remove({hola:'jordi'}, function(err, result) { callback(err); }); // read col.find().toArray(function(err, docs) { console.log(docs); }); What I'm trying to do in the last lines of code is to get all the documents using find() but it doesn't return any results. Through the mongo shell, using this command I get data on screen: db.twitter_accounts_mon.find() I don't know what I'm doing wrong. Thanks!
score: -1

http://stackoverflow.com/q/27714549
score: 1
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27714610
accepted answer: http://stackoverflow.com/a/27714583
tagged with: javascript
has body: Saw this example as a mental exercise. I don't understand why it returns true. Surely the inner this should be scoped to the anonymous function and the outer this is not related to that function at all. var result = (function() { return this; }()) === this; var el = document.createElement("div") el.innerHTML = result; document.body.appendChild(el)
type: Question
possible better answer: http://stackoverflow.com/a/27714610
answer count: 2
downvote count: 0
favorite count: 0
has title: Why does this JavaScript snippet return true?
has comment: http://stackoverflow.com/comment/43841241
has answer: http://stackoverflow.com/a/27714583
has comment: http://stackoverflow.com/comment/43841226
has comment: http://stackoverflow.com/comment/43841239

http://stackoverflow.com/comment/43744193
comment on: http://stackoverflow.com/a/27655911
type: Comment
has text: Thank you. Still does not find anything. What is the best way to debugging the map functions?
type: AnswerComment
score: 0

http://stackoverflow.com/a/27693722
score: 2
answers question: http://stackoverflow.com/q/27693686
upvote count: 2
has body: Cookies are commonly used for this. If you only need to access this data client-side, consider using localstorage. Remember that with either method, you're only identifying a browser that has been to your site before. Anyone can use that computer, and you wouldn't know it was a new user. It's also important to be careful with those tokens so that someone else has a hard time impersonating that user. Rotating a session ID regularly is a good idea, so that if someone does get your session ID it has a limited shelf life for re-use. Do not use IP addresses, as there are entire buildings that can share a single public IP address thanks to NAT.
accepted answer of: http://stackoverflow.com/q/27693686
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43886189
has text: @AlexanderO'Mara - I guess I can see your line of thinking, but the issue is that the variable is not redefined in each iteration of the loop and thus retains its value from one iteration of the loop to the next. Hoisting has to do with "where" the variable is first defined when the code runs. That isn't the exact issue here. The issue here is that the variable is only defined once within its scope and thus retains its value from one iteration of the `for` loop to the next.
type: Comment
comment on: http://stackoverflow.com/a/27737345
score: 1
type: AnswerComment

http://stackoverflow.com/comment/43707913
has text: Can you show how these lines are called?
type: Comment
comment on: http://stackoverflow.com/q/27644683
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43874085
has text: You're right, composition would be more cool in my case, since I'm using only on() and emit(). But imagine having a huge superclass with dozens of methods which you have to rebind in your child class.
type: AnswerComment
comment on: http://stackoverflow.com/a/27731284
score: 0
type: Comment

http://stackoverflow.com/a/27689607
has comment: http://stackoverflow.com/comment/43792710
has comment: http://stackoverflow.com/comment/43792955
has comment: http://stackoverflow.com/comment/43792860
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43792924
has comment: http://stackoverflow.com/comment/43793025
answers question: http://stackoverflow.com/q/27689501
has body: json is a string. The argument to $.each() must be an array or object. There's no need for you to create a JSON string, you should just loop over obj directly: $.each(obj, function(k, v) { ... }); Actually, there's no reason to create obj, either, just loop over data: $.each(data, function(i, el) var k = el.name; var v = el.value; ... }); Finally, this will not be JSON. $.ajax uses x-www-form-urlencoded format, which PHP decodes automatically. So you should not use json_decode() in the PHP.

http://stackoverflow.com/q/27656515
has comment: http://stackoverflow.com/comment/43744398
score: -1
tagged with: google-maps-api-3
upvote count: 0
has body: I am working on a project where i need to track the salesperson's route of movement for a certain period (may span n days). I get locations stored from mobile device which i save in database using web service. Now i have a multi-select drop-down for selecting salesperson(s). i pass the salesperson ids as comma separated values and get the latitude and longitude for selected salesperson(s) from database. Code is below. IList&lt;RadComboBoxItem&gt; Values = rcbSalesPersons.CheckedItems; string Ids = String.Join(",", rcbSalesPersons.Items.Where(i =&gt; i.Checked).Select(i =&gt; i.Value).ToList()); List&lt;SalespersonSpatialInfo&gt; lstSpatialInfo = SalespersonSpatialInfo.getSpatialInfo(Ids, Session["StoreID"].ToString(),RadDatePickerFrom.SelectedDate.Value, RadDatePickerTo.SelectedDate.Value); string jsonString; if (lstSpatialInfo.Count &gt; 0) { jsonString = JsonSerializer&lt;List&lt;SalespersonSpatialInfo&gt;&gt;(lstSpatialInfo); ScriptManager.RegisterArrayDeclaration(Page, "markers", jsonString); ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), "GoogleMap();", true); } As i registered the javascript Markers array in source of the page, now i use following javascript function to plot the points on map and join them function GoogleMap() { var mapOptions = { center: new google.maps.LatLng(markers[0][0].Latitude, markers[0][0].Longitude), zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); var infoWindow = new google.maps.InfoWindow(); var lat_lng = new Array(); var latlngbounds = new google.maps.LatLngBounds(); for (i = 0; i &lt; markers[0].length; i++) { var data = markers[0][i]; var myLatlng = new google.maps.LatLng(data.Latitude, data.Longitude); lat_lng.push(myLatlng); var marker = new google.maps.Marker({ position: myLatlng, map: map }); latlngbounds.extend(marker.position); (function (marker, data) { google.maps.event.addListener(marker, "click"…
answer count: 1
accepted answer: http://stackoverflow.com/a/27717165
tagged with: javascript
favorite count: 0
tagged with: polyline
has comment: http://stackoverflow.com/comment/43729568
has comment: http://stackoverflow.com/comment/43729833
tagged with: c#-4.0
tagged with: maproute
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43729787
has title: how to show different route on google map for each salesperson
has answer: http://stackoverflow.com/a/27717165
downvote count: 1
has comment: http://stackoverflow.com/comment/43729481
type: Question
has comment: http://stackoverflow.com/comment/43730640

http://stackoverflow.com/q/27686756
score: -2
has comment: http://stackoverflow.com/comment/43787258
tagged with: javascript
has body: I've created a multiple layered array with objects in JSON format in order to have to user change background images to custom create a character. Here's the main script: var newHead; var newBody; var newArm; var masterList = [ { {"creatureName":"Snowman"}, {"part": [ {"partName":"head", "urlLocation": "'snowman/head.png'"}, {"partName":"body", "urlLocation": "'snowman/body.png'"}, {"partName":"arms", "urlLocation": "'snowman/arm.png'"} ] } }, { {"creatureName":"Robot"}, {"part": [ {"partName":"head", "urlLocation": "'robot/head.png'"}, {"partName":"body", "urlLocation": "'robot/body.png'"}, {"partName":"arms", "urlLocation": "'robot/arm.png'"} ] } }, { {"creatureName":"Alien"}, {"part": [ {"partName":"head", "urlLocation": "'alien/head.png'"}, {"partName":"body", "urlLocation": "'alien/body.png'"}, {"partName":"arms", "urlLocation": "'alien/arm.png'"} ] } } ]; $(window).ready(matchHeight); $(window).resize(matchHeight); function matchHeight() { var div = $('#charImg'); var width = div.width(); div.css('height', width); } function createOptions(x) { } function changeHead(x) { newHead = masterList[x].part[0].urlLocation; $('#charImg').css("background","url('')"); $('#charImg').css("background","url("+newHead+"),url("+newBody+"),url("+newArm+")"); $('#charImg').css("background-position","center center"); $('#charImg').css("background-repeat","no-repeat"); $('#charImg').css("background-size","100%","100%"); } function changeBody(x) { newBody = masterList[x].part[1].urlLocation; $('#charImg').css("background","url('')"); $('#charImg').css("background","url("+newHead+"),url("+newBody+"),url("+newArm+")"); $('#charImg').css("background-position","center center"); $('#charImg').css("background-repeat","no-repeat"); $('#charImg').css("background-size","100%","100%"); } function changeArm(x) { newArm = masterList[x].part[2].urlLocation; $('#charImg').css("background","url('')"); $('#charImg').css("background","url("+newHead+"),url("+newBody+"),url("+newArm+")"); $('#charImg')…
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27686824
type: UnansweredQuestion
downvote count: 2
has title: Issue with multiple layer array with objects in JSON
tagged with: http://stackoverflow.com/tag/json
type: Question
upvote count: 0

http://stackoverflow.com/comment/43898868
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27743965
score: 1
has text: That's kind of exactly what my answer says... ;)

php
tags question: http://stackoverflow.com/q/27685369
tags question: http://stackoverflow.com/q/27728667
tags question: http://stackoverflow.com/q/27667818
tags question: http://stackoverflow.com/q/27743558
tags question: http://stackoverflow.com/q/27717025
tags question: http://stackoverflow.com/q/27699425
tags question: http://stackoverflow.com/q/27800446
tags question: http://stackoverflow.com/q/27785172
tags question: http://stackoverflow.com/q/27739776
tags question: http://stackoverflow.com/q/27736183
tags question: http://stackoverflow.com/q/27756850
tags question: http://stackoverflow.com/q/27729859
tags question: http://stackoverflow.com/q/27746142
tags question: http://stackoverflow.com/q/27793855
tags question: http://stackoverflow.com/q/27748296
tags question: http://stackoverflow.com/q/27782388
tags question: http://stackoverflow.com/q/27718030
tags question: http://stackoverflow.com/q/27713834
tags question: http://stackoverflow.com/q/27655492
tags question: http://stackoverflow.com/q/27670526
tags question: http://stackoverflow.com/q/27741903
tags question: http://stackoverflow.com/q/27739256
tags question: http://stackoverflow.com/q/27712423
tags question: http://stackoverflow.com/q/27662402
tags question: http://stackoverflow.com/q/27667046
tags question: http://stackoverflow.com/q/27781344
tags question: http://stackoverflow.com/q/27759958
tags question: http://stackoverflow.com/q/27727560
tags question: http://stackoverflow.com/q/27642588
tags question: http://stackoverflow.com/q/27674593
tags question: http://stackoverflow.com/q/27661755
tags question: http://stackoverflow.com/q/27746716
tags question: http://stackoverflow.com/q/27685953
tags question: http://stackoverflow.com/q/27676255
tags question: http://stackoverflow.com/q/27647783
tags question: http://stackoverflow.com/q/27671117
tags question: http://stackoverflow.com/q/27745645
tags question: http://stackoverflow.com/q/27786103
tags question: http://stackoverflow.com/q/27752427
tags question: http://stackoverflow.com/q/27704446
tags question: http://stackoverflow.com/q/27724483
tags question: http://stackoverflow.com/q/27776559
tags question: http://stackoverflow.com/q/27798899
tags question: http://stackoverflow.com/q/27768315
tags question: http://stackoverflow.com/q/27652591
tags question: http://stackoverflow.com/q/27711933
tags question: http://stackoverflow.com/q/27801873
tags question: http://stackoverflow.com/q/27642691
tags question: http://stackoverflow.com/q/27790387
tags question: http://stackoverflow.com/q/27640753
tags question: http://stackoverflow.com/q/27697037
tags question: http://stackoverflow.com/q/27717029
tags question: http://stackoverflow.com/q/27709784
tags question: http://stackoverflow.com/q/27657936
tags question: http://stackoverflow.com/q/27683177
tags question: http://stackoverflow.com/q/27771190
tags question: http://stackoverflow.com/q/27706596
tags question: http://stackoverflow.com/q/27800376
tags question: http://stackoverflow.com/q/27730277
tags question: http://stackoverflow.com/q/27666984
tags question: http://stackoverflow.com/q/27656410
tags question: http://stackoverflow.com/q/27782811
tags question: http://stackoverflow.com/q/27675420
tags question: http://stackoverflow.com/q/27697270
tags question: http://stackoverflow.com/q/27765326
tags question: http://stackoverflow.com/q/27677911
tags question: http://stackoverflow.com/q/27689964
tags question: http://stackoverflow.com/q/27773024
tags question: http://stackoverflow.com/q/27711023
tags question: http://stackoverflow.com/q/27744506
tags question: http://stackoverflow.com/q/27797994
tags question: http://stackoverflow.com/q/27708738
tags question: http://stackoverflow.com/q/27667928
tags question: http://stackoverflow.com/q/27717852
tags question: http://stackoverflow.com/q/27714432
tags question: http://stackoverflow.com/q/27665028
tags question: http://stackoverflow.com/q/27795167
tags question: http://stackoverflow.com/q/27731330
tags question: http://stackoverflow.com/q/27684857
tags question: http://stackoverflow.com/q/27645009

http://stackoverflow.com/a/27646048
downvote count: 0
type: Answer
has body: The way to harmonise the view of the number on client and server is to do your processing on the server and have the client display what the server sends it. Use the Java version on the server, convert to a String, and send that to the client. Then you'll just be doing the conversion once, and won't have the possibility of a conflict. After all, the client is just supposed to be giving a nice view of what the server has done. Repeating the calculations on the client is not the right way to think about it.
upvote count: 1
answers question: http://stackoverflow.com/q/27645876
score: 1

http://stackoverflow.com/a/27700517
answers question: http://stackoverflow.com/q/27700128
upvote count: 0
score: -2
downvote count: 2
type: Answer
has body: give socket.io a try.. I love it.. /// Server socket.send("myMSG", {key1:"HelloWorld"}); /// Client socket.on("myMSG", function(data){ console.log(data.key1); }); // stringify JSON.stringify({key1: "HelloWorld"}) Best Regards

http://stackoverflow.com/q/27747963
answer count: 0
downvote count: 0
has body: As you can see in this javascript equality table, javascript equality transitivity is weird. I understand most of the results of the table, but I have a question regarding the following comparison: [] == true // false [] == false // true !![] == true // true !![] == false // false But also: if ([]) { // this code will run } if (!![]) { // and of course this too } Why? Is this another extremly bad part? Have this a reasonable explanation?
has comment: http://stackoverflow.com/comment/43907271
type: Question
has comment: http://stackoverflow.com/comment/43907187
has comment: http://stackoverflow.com/comment/43907394
tagged with: javascript
duplicate of: http://stackoverflow.com/q/4226101
has comment: http://stackoverflow.com/comment/43907247
score: 5
duplicate of: http://stackoverflow.com/q/5491605
has title: Javascript comparison with an empty array and booleans
favorite count: 0
upvote count: 5
has comment: http://stackoverflow.com/comment/43907308
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43907304
has comment: http://stackoverflow.com/comment/43907245
has comment: http://stackoverflow.com/comment/43907280

http://stackoverflow.com/a/27778114
type: Answer
has comment: http://stackoverflow.com/comment/43966819
answers question: http://stackoverflow.com/q/27777984
upvote count: 2
score: 2
has comment: http://stackoverflow.com/comment/43966734
has body: You need to use document.getElementsByClassName and also fix the typo for .length you also need to call the nodes .innerHTML... var result = document.getElementById('result'), aalist = document.getElementsByClassName('aaposition'), bblist = document.getElementsByClassName('bbposition'), sumlist = 0; for(var i=0; i&lt;aalist.length; i++) { sumlist += aalist[i].innerHTML * bblist[i].innerHTML; } result.innerHTML = sumlist; Working jsfiddle
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27777984

http://stackoverflow.com/q/27716028
accepted answer: http://stackoverflow.com/a/27716071
has comment: http://stackoverflow.com/comment/43844099
tagged with: javascript
tagged with: variables
answer count: 3
has comment: http://stackoverflow.com/comment/43844201
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has body: Lets say I am asking users (on my local machine) to input their email address to sign up for a raffle. Raffle Fiddle When the user hits submit, the email address pops up in front of them. Is there any way to simultaneously store the variable email in an external file (.php, .txt etc.)
has comment: http://stackoverflow.com/comment/43844246
has answer: http://stackoverflow.com/a/27716071
has comment: http://stackoverflow.com/comment/43844143
tagged with: php
tagged with: css
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27716805
score: 1
has comment: http://stackoverflow.com/comment/43844095
has answer: http://stackoverflow.com/a/27716174
has answer: http://stackoverflow.com/a/27716805
upvote count: 1
has title: How do I store the value of a javascript variable (without a server) externally?
type: Question
has comment: http://stackoverflow.com/comment/43844123

http://stackoverflow.com/a/27947180
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27794821
has body: Thanks to Emmanuel I was able to find the spherical functions which helped me a lot by making the function. I like his answer too but what I finally made was a lot less code. this.makeRightAngle = function(polygon, e, A, B, C){ var heading_AB = google.maps.geometry.spherical.computeHeading( new google.maps.LatLng(A.lat, A.lng), new google.maps.LatLng(B.lat, B.lng) ); var heading_AC = google.maps.geometry.spherical.computeHeading( new google.maps.LatLng(A.lat, A.lng), new google.maps.LatLng(C.lat, C.lng) ); var heading_BC = google.maps.geometry.spherical.computeHeading( new google.maps.LatLng(A.lat, A.lng), new google.maps.LatLng(C.lat, C.lng) ); var distanceBC = google.maps.geometry.spherical.computeDistanceBetween( new google.maps.LatLng(B.lat, B.lng), new google.maps.LatLng(C.lat, C.lng) ); var heading_C_AB = heading_AC - heading_AB; if((heading_C_AB &lt; 0 &amp;&amp; heading_C_AB &gt; -200) || (heading_C_AB &gt; 200)){ var new_heading = heading_AB - 90; } else{ var new_heading = heading_AB + 90; } var D = google.maps.geometry.spherical.computeOffset( new google.maps.LatLng(B.lat, B.lng), //From LatLng distanceBC, //Get distance BC new_heading //Heading of AB + or - 90 degrees ); var p = {x: D.lat(), y: D.lng()}; var latlng = new google.maps.LatLng(p.x, p.y); return latlng; } Still many thanks for both answers!
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/27794821
type: AcceptedAnswer

http://stackoverflow.com/q/27699822
type: Question
tagged with: javascript
tagged with: inheritance
upvote count: 3
has title: Inheritance using Object.create
favorite count: 0
answer count: 0
type: UnansweredQuestion
score: 3
linked to: http://stackoverflow.com/q/8453887
downvote count: 0
has body: I was going through some links to find out what Object.create functionality has and how does it differs when it comes to create using new as constructor. So I came across this link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create This link has a basic example which explains inheritance using Object.create(). Here is the code // Shape - superclass function Shape() { this.x = 0; this.y = 0; } // superclass method Shape.prototype.move = function(x, y) { this.x += x; this.y += y; console.info('Shape moved.'); }; // Rectangle - subclass function Rectangle() { Shape.call(this); // call super constructor. } // subclass extends superclass Rectangle.prototype = Object.create(Shape.prototype); Rectangle.prototype.constructor = Rectangle; var rect = new Rectangle(); console.log("Is rect an instance of Rectangle? " + (rect instanceof Rectangle)); // true console.log("Is rect an instance of Shape? " + (rect instanceof Shape)); // true rect.move(1, 1); // Outputs, 'Shape moved.' Now it explained very nicely how inheritance can be done. But I wanted to know what exactly is the need of this line of code Rectangle.prototype.constructor = Rectangle; Does it really required. Eliminating that does not create any issue while running. Am i missing something important here or Does it means optional?
duplicate of: http://stackoverflow.com/q/8453887

http://stackoverflow.com/comment/43851032
has text: maxlength is working fine for textarea but, when you add directive , It is not working..
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27719498
score: 1

http://stackoverflow.com/a/76173803
type: Answer
downvote count: 0
score: 1
has body: There is Window: sessionStorage property. https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage It also cleans data when page is closed,compatible with all browsers // Save data to sessionStorage sessionStorage.setItem("key", "value"); // Get saved data from sessionStorage let data = sessionStorage.getItem("key");
answers question: http://stackoverflow.com/q/27765666
upvote count: 1

http://stackoverflow.com/comment/43913609
has text: @meagar: yes, the property list is completely unpredictable.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27751121
score: 0

http://stackoverflow.com/comment/43852820
has text: fair enough :) , I think I will go with answer provided by transformer .
comment on: http://stackoverflow.com/a/27720521
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27681939
tagged with: javascript
tagged with: dom
score: 0
answer count: 1
tagged with: event-handling
has title: Event Handler function in prototype's method, why does it think .keyCode is a property of undefined in JavaScript?
has body: I am experimenting with DOM event handlers, and I put in my Constructor's prototype a function that works on the DOM div element, which is a property created by the constructor in my object. It displays the object correctly, but the only thing that does not work is that it thinks that in my method, .keyCode, is a property of undefined and gives me an error message: TypeError: Cannot read property 'keyCode' of undefined (line 16 in function KeyBlock.move) This is my method, along with my calling of it: KeyBlock.prototype.move = function(event) { if(event.keyCode == 37) this.x -= 1; if(event.keyCode == 38) this.y -= 1; if(event.keyCode == 39) this.x += 1; if(event.keyCode == 40) this.y += 1; if (this.y &lt; 0) this.y = 0; if (this.x &lt; 0) this.x = 0; console.log(this.y); } me = new KeyBlock("me"); addEventListener("keyup", me.move(event)); It might have to do with the argument, event, in the method? To answer this question, my constructor itself will not be needed, but I will also place it (below this text), to make clear what I am doing. var KeyBlock = function(name) { this.character = document.createElement("div"); document.body.appendChild(this.character); this.character.style.width = "20px"; this.character.style.height = "20px"; this.name = name; this.x = 0; this.y = 0; this.character.style.background = "indigo"; this.character.id = this.name; this.character.style.left = String(this.x) + "px"; this.character.style.top = String(this.y) + "px"; }
type: AnsweredQuestion
tagged with: constructor
has answer: http://stackoverflow.com/a/27682080
tagged with: methods
accepted answer: http://stackoverflow.com/a/27682080
type: Question

http://stackoverflow.com/q/27722216
has title: How to get value of Paragraph element contained in in HTML using JavaScript
tagged with: dom
type: Question
accepted answer: http://stackoverflow.com/a/27722267
has answer: http://stackoverflow.com/a/27722240
downvote count: 0
tagged with: javascript
favorite count: 0
answer count: 3
has body: I know this can be very basic but I'm very poor in using JavaScript. Following is my HTML Code : Request a Free Consultation XXX-XXX-XXXX Using JavaScript, I want to get text contained in element. I am trying in the following way, but it's giving me undefined error. var x = document.getElementsByClassName("request"); var pText = x.getElementsByTagName("P").innerHTML; alert(pText); Can anyone lead me in the right direction? EDIT : Here is the fiddle link to try above code : http://jsfiddle.net/Scoobler/ua9zN/
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27722239
has answer: http://stackoverflow.com/a/27722267
possible better answer: http://stackoverflow.com/a/27722239
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43856215
has comment: http://stackoverflow.com/comment/43856407
score: 1

http://stackoverflow.com/q/27695191
has answer: http://stackoverflow.com/a/27695346
has body: I was thinking of adding an invisible button on top of a datalist option, so I could click on the datalist to trigger events. Why doesn't this work? var button=document.createElement("button") button.style.width=option.style.width; button.style.height=option.style.height; button.style.background="#EEEEEE" option.appendChild(button); button.onclick="clickedfriendsOption()";
has comment: http://stackoverflow.com/comment/43807140
has comment: http://stackoverflow.com/comment/43804619
has comment: http://stackoverflow.com/comment/43827469
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43807368
has comment: http://stackoverflow.com/comment/43803733
downvote count: 2
has comment: http://stackoverflow.com/comment/43810975
has comment: http://stackoverflow.com/comment/43844182
has title: Button datalist hack
has comment: http://stackoverflow.com/comment/43803833
has comment: http://stackoverflow.com/comment/43804185
has comment: http://stackoverflow.com/comment/43803875
has comment: http://stackoverflow.com/comment/43857017
has comment: http://stackoverflow.com/comment/43803748
has answer: http://stackoverflow.com/a/27697091
score: -1
upvote count: 1
type: Question
answer count: 2

http://stackoverflow.com/q/27695820
has title: Jquery inputmask Dynamic masks specific email domain
has comment: http://stackoverflow.com/comment/43805180
has answer: http://stackoverflow.com/a/27695902
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
type: Question
tagged with: php
has comment: http://stackoverflow.com/comment/43805538
upvote count: 1
answer count: 1
has body: I have a text field that requires a mask, I am using this jQuery plugin to do this: http://robinherbots.github.io/jquery.inputmask. and with dynamic I mean that you see ______@___ and the part after the @ sign I wanted to restricted to specific domain (dynamic set it from php) meanwhile the user can type the email name. What do i want: i want a way to make the mask be dynamic so when the user finish to type the input, see appended the domain address. What i've tried: I tried with several masks. http://jsfiddle.net/8Jpdd/262/ `$("#u_email").inputmask({ mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}[.*{2,6}][.*{1,2}]", greedy: false, onBeforePaste: function (pastedValue, opts) { pastedValue = pastedValue.toLowerCase(); return pastedValue.replace("mailto:", ""); }, definitions: { '*': { validator: "[0-9A-Za-z!#$%&amp;'*+/=?^_`{|}~\-]", cardinality: 1, casing: "lower" } } });` Also I was using jquery-ghostinput-plugin but due styling and others issue didn't stay with it. mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}[.*{2,6}][.*{1,2}]", any help on inputmask mask domain mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@ 'anydomainfromphpvalue' ",
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43805665

http://stackoverflow.com/q/27783574
has comment: http://stackoverflow.com/comment/43977197
tagged with: random
has comment: http://stackoverflow.com/comment/43977179
has comment: http://stackoverflow.com/comment/43977249
tagged with: javascript
has comment: http://stackoverflow.com/comment/43977248
score: 0
has comment: http://stackoverflow.com/comment/43977293
has title: Weird behaviour: JS for loop i<=20 sometimes outputs 15 as the final entry, with 0-20 displaying correctly
answer count: 0
type: UnansweredQuestion
has body: I've set up a simple for loop, outputting random numbers. For some reason, this code sometimes outputs 15 as the final value of "i", with the previous ones 0-20 displaying correctly. Here's a screenshot of the output: https://i.sstatic.net/wUjZO.png var picks = 20; var numberRange = 1000; for(var i = 0; i&lt;=picks; ++i) { var rnd = ~~(Math.random()*numberRange)+1; console.log(i + ":\t" + rnd); }
type: Question
has comment: http://stackoverflow.com/comment/43977394
tagged with: iterator

http://stackoverflow.com/q/27655473
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27655546
upvote count: 2
tagged with: codeigniter
type: Question
possible better answer: http://stackoverflow.com/a/27655544
has answer: http://stackoverflow.com/a/27655544
tagged with: javascript
has body: im new to codeginiter and its developing. i used dropbox (html select box) when i pressed option there. i need to trigger a alert box.in oder to do that i used following code. But it didnt work on me. and i could find the mistake i've done please help me. Ask Questions <link href="<?php echo base_url(); ?>css/bootstrap.min.css" rel="stylesheet"> <link href="<?php echo base_url(); ?>css/style.css" rel="stylesheet"> <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.min.js"> // untill select catogory tags are disabled function activate_match() { // var tnmt_id = "hip hure"; alert("tested"); //Get the id of the tournament selected in the list } How to Ask Is your question about DIY ? We prefer questions that can be answered, not just discussed. Provide details. Share your experience. <?php echo form_open('homepage/askquestionview'); echo validation_errors(); ?> <?php foreach($catogories as $cat) { echo' ' . $cat . ' '; } ?> Description: Declare new Tags: <?php echo form_close(); ?>
accepted answer: http://stackoverflow.com/a/27655546
answer count: 3
score: 2
downvote count: 0
tagged with: jquery
favorite count: 0
has title: JS simple function call is not working
has answer: http://stackoverflow.com/a/27655644
tagged with: http://stackoverflow.com/tag/html
tagged with: php

dom
tags question: http://stackoverflow.com/q/27749169
type: Tag
tags question: http://stackoverflow.com/q/27664219
tags question: http://stackoverflow.com/q/27742873
tags question: http://stackoverflow.com/q/27796965
tags question: http://stackoverflow.com/q/27688311
tags question: http://stackoverflow.com/q/27791007
tags question: http://stackoverflow.com/q/27701347
tags question: http://stackoverflow.com/q/27762978
tags question: http://stackoverflow.com/q/27643294
tags question: http://stackoverflow.com/q/27682793
tags question: http://stackoverflow.com/q/27749218
tags question: http://stackoverflow.com/q/27702624
tags question: http://stackoverflow.com/q/27660031
tags question: http://stackoverflow.com/q/27756497
tags question: http://stackoverflow.com/q/27772404
tags question: http://stackoverflow.com/q/27722216
tags question: http://stackoverflow.com/q/27732995
tags question: http://stackoverflow.com/q/27643719
tags question: http://stackoverflow.com/q/27755266
tags question: http://stackoverflow.com/q/27727748
tags question: http://stackoverflow.com/q/27781735
tags question: http://stackoverflow.com/q/27729083
tags question: http://stackoverflow.com/q/27704828
tags question: http://stackoverflow.com/q/27796544
tags question: http://stackoverflow.com/q/27704965
tags question: http://stackoverflow.com/q/27798126
tags question: http://stackoverflow.com/q/27750185
tags question: http://stackoverflow.com/q/27690827
tags question: http://stackoverflow.com/q/27673447
tags question: http://stackoverflow.com/q/27749460
tags question: http://stackoverflow.com/q/27675561
tags question: http://stackoverflow.com/q/27771666
tags question: http://stackoverflow.com/q/27697313
tags question: http://stackoverflow.com/q/27685115
tags question: http://stackoverflow.com/q/27736997
tags question: http://stackoverflow.com/q/27681592
tags question: http://stackoverflow.com/q/27734252
tags question: http://stackoverflow.com/q/27720489
tags question: http://stackoverflow.com/q/27697457
tags question: http://stackoverflow.com/q/27751434
tags question: http://stackoverflow.com/q/27767782
tags question: http://stackoverflow.com/q/27789086
tag name: dom
tags question: http://stackoverflow.com/q/27692259
tags question: http://stackoverflow.com/q/27775162
tags question: http://stackoverflow.com/q/27794015
tags question: http://stackoverflow.com/q/27660781
tags question: http://stackoverflow.com/q/27681939
tags question: http://stackoverflow.com/q/27689207
tags question: http://stackoverflow.com/q/27682749
tags question: http://stackoverflow.com/q/27773150
tags question: http://stackoverflow.com/q/27723498
tags question: http://stackoverflow.com/q/27678813
tags question: http://stackoverflow.com/q/27689454
tags question: http://stackoverflow.com/q/27794960
tags question: http://stackoverflow.com/q/27699887
tags question: http://stackoverflow.com/q/27799755

http://stackoverflow.com/q/27725424
tagged with: javascript
score: 0
has body: Trying out the Content Service API and the example is returning HTML when it should be returning JSON, what am I doing wrong? https://developers.google.com/apps-script/guides/content function doGet(request) { var events = CalendarApp.getEvents( new Date(Number(request.parameters.start) * 1000), new Date(Number(request.parameters.end) * 1000)); var result = { available: events.length == 0 }; return ContentService.createTextOutput(JSON.stringify(result)) .setMimeType(ContentService.MimeType.JSON); } GAS from another file trying to make the request: function myFunction() { var url = "published URL"; url+="?start=1325437200&amp;end=1325439000"; var options = { method:"get" } var response = UrlFetchApp.fetch(url,options).getContentText(); response = JSON.parse(response); //error, unexpected token &lt; }
answer count: 1
has comment: http://stackoverflow.com/comment/43864186
has title: Content Service for Google Apps Script returning HTML instead of JSON
has answer: http://stackoverflow.com/a/27726073
type: AnsweredQuestion
tagged with: urlfetch
accepted answer: http://stackoverflow.com/a/27726073
type: Question
tagged with: google-apps-script

http://stackoverflow.com/q/27710273
tagged with: forms
has answer: http://stackoverflow.com/a/27710359
type: AnsweredQuestion
tagged with: jquery
tagged with: ajax
type: Question
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27710359
possible better answer: http://stackoverflow.com/a/27710436
has answer: http://stackoverflow.com/a/27710436
score: 0
answer count: 2
has body: What I am trying to do is on a submit click event, I want to geocode and address and set the values of a form and send those values via post. In the following code, the alerts are to test the order in which the code is run. I need the alert("2") and alert("3") to be processed before alert("4") so that there the variable result1 can have a value that will be used by the code after alert (4). As it stands now, the code fires in this order (the alerts pop up in this order): 1,4,2,3. There is an error on the line here: var testvar = result1.lat(); The error is: Uncaught TypeError: Cannot read property 'lat' of undefined which makes sense since #4 is looking for the result1 variable before it can be set by the geocoder1 (point 2). It also does not populate the form fields. $(document).ready(function() { $("#myForm").submit(function() { var address = $("#id_user_entered_address").val(); var geocoder = new google.maps.Geocoder(); var result; alert("point 1"); geocoder.geocode({'address': address1}, function(results, status) { if(status == google.maps.GeocoderStatus.OK){ result = results[0].geometry.location; alert("point 2"); } alert("point 3"); } ); alert("point 4"); var testvar = result.lat(); var testlong = result.lng(); $("#id_latitude").val(testvar); $("#id_longitude").val(testlong); alert("point 5"); }); }); That said, I can actually make this work properly (but it is a big hack since I do not want people needing to click on two buttons) when I do the following: Create a separate function for the geocoding portion that is fired by a button click. This leaves only the setting of the form variables in the submit function (on a the submit button of the form). I also have to change the result variable to global (by not using the var). Then I click on the submit to fire the geocoding function, when that is complete, then I click on the submit button for the form, and all works as it should (i.e. post data is sent with the form). see following: function firstgeocode() { va…
has title: Javascript: need code to be processed in order
tagged with: javascript

http://stackoverflow.com/comment/44040179
score: 0
type: AnswerComment
has text: If possible create a jsfiddle for your grid. And share here.
type: Comment
comment on: http://stackoverflow.com/a/27812920

http://stackoverflow.com/a/27756406
upvote count: 3
answers question: http://stackoverflow.com/q/27756366
type: AcceptedAnswer
type: Answer
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/43923540
has comment: http://stackoverflow.com/comment/43923505
has comment: http://stackoverflow.com/comment/43923594
has body: Instead of writing: apagar.onclick = cl.teste(this); You can write: apagar.onclick = function () { cl.teste(apagar); }; The onclick event can be attached to a function not to a function-call. Here cl.teste is a function, while cl.tests(this) is a function call. With my workaround, it should work.
accepted answer of: http://stackoverflow.com/q/27756366
has comment: http://stackoverflow.com/comment/43923778

http://stackoverflow.com/q/27707714
has comment: http://stackoverflow.com/comment/43827514
has comment: http://stackoverflow.com/comment/43827673
has comment: http://stackoverflow.com/comment/43827343
tagged with: expression
has answer: http://stackoverflow.com/a/27709120
tagged with: javascript
has comment: http://stackoverflow.com/comment/43827593
downvote count: 3
answer count: 1
favorite count: 0
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/43827379
has comment: http://stackoverflow.com/comment/43827685
has comment: http://stackoverflow.com/comment/43827824
tagged with: c++
upvote count: 0
has title: JS vs C++ expression evaluation
has body: I have to rewrite some algorithms from JavaScript to C++. So I have a question: what should I look out for? What differences are between evaluating in JS and C++? For example, this easing algorithm: var pi2 = Math.PI * 2; var s = period/pi2 * Math.asin(1/amplitude); if ((t*=2)&lt;1) return -0.5*(amplitude*Math.pow(2,10*(t-=1))*Math.sin( (t-s)*pi2/period )); return amplitude*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*pi2/period)*0.5+1; When I simply change vars to doubles and Math. to std::, it will compile but -= in expression will cause an UB (my compiler says it). What other tricky differences you know?
type: Question
has comment: http://stackoverflow.com/comment/43827448

http://stackoverflow.com/comment/43963137
comment on: http://stackoverflow.com/q/27775848
score: 0
type: Comment
type: QuestionComment
has text: `$(window).scroll(function(){/* code*/}).scroll()` ... the last part triggers the event to happen right away and thus will run the code inside the handler for that event

http://stackoverflow.com/comment/43722358
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27652564
has text: @Barmar the komenty() was made to read out the comments from the database but it was problematic too. Anyway it doesnt matter i think since i cant even add a comment :D
score: 0

http://stackoverflow.com/comment/43994140
has text: Are you definitively certain that `<%=rs_list_task.getString("task_id")%>` is returning non-empty?
comment on: http://stackoverflow.com/q/27792243
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27650979
has comment: http://stackoverflow.com/comment/43719096
type: AnsweredQuestion
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43719124
has answer: http://stackoverflow.com/a/27651029
has comment: http://stackoverflow.com/comment/43719204
type: Question
linked to: http://stackoverflow.com/q/500431
has comment: http://stackoverflow.com/comment/43719133
possible better answer: http://stackoverflow.com/a/27651170
tagged with: javascript
tagged with: jquery
has body: var variable = "before"; change(); alert(variable); function change(){ variable = "after"; } Does in possible to change global variable inside function without return ? I need after call function change have output "after"
has answer: http://stackoverflow.com/a/27651170
has comment: http://stackoverflow.com/comment/43719072
has title: jquery change global variable inside function
answer count: 2
accepted answer: http://stackoverflow.com/a/27651029
downvote count: 0
linked to: http://stackoverflow.com/q/14220321
favorite count: 0
has comment: http://stackoverflow.com/comment/43719084

http://stackoverflow.com/comment/43733460
type: Comment
score: 0
type: AnswerComment
has text: Strange. I just added your code to mine... Can you share you full code?
comment on: http://stackoverflow.com/a/27658603

http://stackoverflow.com/comment/43964948
type: QuestionComment
type: Comment
has text: @nnnnnn you gave me a hint. thanks man!
comment on: http://stackoverflow.com/q/27777111
score: 0

angularjs
tags question: http://stackoverflow.com/q/27652155
tags question: http://stackoverflow.com/q/27734341
tags question: http://stackoverflow.com/q/27791754
tags question: http://stackoverflow.com/q/27653842
tags question: http://stackoverflow.com/q/27736568
tags question: http://stackoverflow.com/q/27647399
tags question: http://stackoverflow.com/q/27778501
tags question: http://stackoverflow.com/q/27712496
tags question: http://stackoverflow.com/q/27793676
tags question: http://stackoverflow.com/q/27701620
tags question: http://stackoverflow.com/q/27640914
tags question: http://stackoverflow.com/q/27779833
tags question: http://stackoverflow.com/q/27668501
tags question: http://stackoverflow.com/q/27710615
tags question: http://stackoverflow.com/q/27700171
tags question: http://stackoverflow.com/q/27649658
tags question: http://stackoverflow.com/q/27773150
tags question: http://stackoverflow.com/q/27711124
tags question: http://stackoverflow.com/q/27725427
tags question: http://stackoverflow.com/q/27645260
tags question: http://stackoverflow.com/q/27712004
tags question: http://stackoverflow.com/q/27745605
tags question: http://stackoverflow.com/q/27704004
tags question: http://stackoverflow.com/q/27643109
tags question: http://stackoverflow.com/q/27723498
tags question: http://stackoverflow.com/q/27766646
tags question: http://stackoverflow.com/q/27701833
tags question: http://stackoverflow.com/q/27671729
tags question: http://stackoverflow.com/q/27657024
tags question: http://stackoverflow.com/q/27694873
tags question: http://stackoverflow.com/q/27759898
tags question: http://stackoverflow.com/q/27661312
tags question: http://stackoverflow.com/q/27736546
tags question: http://stackoverflow.com/q/27640941
tags question: http://stackoverflow.com/q/27644965
tags question: http://stackoverflow.com/q/27795102
tags question: http://stackoverflow.com/q/27744561
tags question: http://stackoverflow.com/q/27738692
tags question: http://stackoverflow.com/q/27663027
tags question: http://stackoverflow.com/q/27775418
tags question: http://stackoverflow.com/q/27707159
tags question: http://stackoverflow.com/q/27787992
tags question: http://stackoverflow.com/q/27757860
tags question: http://stackoverflow.com/q/27787361
tags question: http://stackoverflow.com/q/27717819
tags question: http://stackoverflow.com/q/27670048
tags question: http://stackoverflow.com/q/27703531
tags question: http://stackoverflow.com/q/27729351
tags question: http://stackoverflow.com/q/27801153
tags question: http://stackoverflow.com/q/27711088
tags question: http://stackoverflow.com/q/27686717
tags question: http://stackoverflow.com/q/27769535
tags question: http://stackoverflow.com/q/27803340
tags question: http://stackoverflow.com/q/27770066
tags question: http://stackoverflow.com/q/27781268
tags question: http://stackoverflow.com/q/27760538
tags question: http://stackoverflow.com/q/27784522
tags question: http://stackoverflow.com/q/27775318
tags question: http://stackoverflow.com/q/27731110
tags question: http://stackoverflow.com/q/27696713
tags question: http://stackoverflow.com/q/27705108
tags question: http://stackoverflow.com/q/27797294
tags question: http://stackoverflow.com/q/27663250
tags question: http://stackoverflow.com/q/27672775
tags question: http://stackoverflow.com/q/27687262
tags question: http://stackoverflow.com/q/27717501
tags question: http://stackoverflow.com/q/27754740
tags question: http://stackoverflow.com/q/27727498
tags question: http://stackoverflow.com/q/27692657
tags question: http://stackoverflow.com/q/27707753
tags question: http://stackoverflow.com/q/27760451
tags question: http://stackoverflow.com/q/27779199
tags question: http://stackoverflow.com/q/27784319
tags question: http://stackoverflow.com/q/27795314
tags question: http://stackoverflow.com/q/27756763
tags question: http://stackoverflow.com/q/27655827
tags question: http://stackoverflow.com/q/27736326
tags question: http://stackoverflow.com/q/27770546
tags question: http://stackoverflow.com/q/27777620
tags question: http://stackoverflow.com/q/27758908

http://stackoverflow.com/a/27750880
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/43912911
has body: Firstly your button has no parent('tr'), it's parent is a &lt;td&gt;. An element has only one parent, the single element that it is contained in. I suspect you want something like: var upvotes = $(caller).closest("tr").find('td').eq(3).text(); This looks up the tree to the closest tr then looks within that row using find to locate the td with index = 3. Reference : closest() API Docs
downvote count: 0
has comment: http://stackoverflow.com/comment/43912933
answers question: http://stackoverflow.com/q/27750841
has comment: http://stackoverflow.com/comment/43912951
has comment: http://stackoverflow.com/comment/43912948
upvote count: 2

http://stackoverflow.com/a/28075422
downvote count: 0
has comment: http://stackoverflow.com/comment/44545533
score: 4
type: AcceptedAnswer
has body: I work on the IE team. These settings have changed meaning a bit recently, so I'll try to clarify: Disable script debugging (Internet Explorer) This setting only has impact on Visual Studio versions prior to 2013. When enabled (unchecked), Visual Studio can attach its debugger to already running instances of IE. When disabled (checked), Visual Studio can only debug IE if Visual Studio is the one to launch the browser. In other words, already running instances of IE cannot be debugged by older versions of VS if this is checked. Disable script debugging (Other) When enabled (unchecked), this setting allows Visual Studio (all versions) to debug web content in applications that host the WebBrowser control. Checking this box prevents VS from debugging these applications. Display a notification about every script error This controls whether a dialog box that comes up as a script error is hit. The dialog gives you the opportunity to launch a system debugger (e.g. Visual Studio) at the time of the error. Recommended Configuration You only need to consider changing these settings if you use an older version of Visual Studio (pre-2013). In fact, changing these settings could negatively affect the performance of your page's JavaScript as this can cause the engine to not use JIT compilation. If you use the built-in F12 debugging tools or newer versions of Visual Studio, the debug console replaces the need for the script error notification as errors are logged there. The other two settings do not affect F12 or new versions of VS's ability to debug script.
accepted answer of: http://stackoverflow.com/q/27795254
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/27795254

http://stackoverflow.com/q/27748708
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/37190576
tagged with: testing
score: 1
type: Question
has comment: http://stackoverflow.com/comment/43917439
answer count: 1
tagged with: javascript
tagged with: jasmine
has comment: http://stackoverflow.com/comment/43910299
has body: I am struggling to get a simple test to run on an async function in a module. I am trying to get my head around testing and so have built a working module and manually tested it in repl.it http://repl.it/7Qf My module looks like this: var weather = (function() { var location; var url = 'http://api.openweathermap.org/data/2.5/weather?units=metric&amp;q='; function getData(loc, callback) { var xhr = new XMLHttpRequest(); xhr.open("GET", url+loc, true); xhr.onload = function (e) { if (xhr.readyState === 4) { if (xhr.status === 200) { callback(JSON.parse(xhr.responseText)); } else { callback(JSON.parse(xhr.statusText)); } } }; xhr.onerror = function (e) { console.error(xhr.statusText); }; xhr.send(null); } return { getTemp: function(location, callback) { getData(location, function(data) { var temp = data.main.temp.toFixed(2); callback(temp); }); } } }()); My test suite looks like this: describe("Weather Module", function() { it('get temperature', function(done) { weather.getTemp('coventry,uk', function(data){ console.log(data); expect(data).toBe(2.66); done(); }); }); }); I get a timeout error when I run this test. Can anyone see where I am going wrong? EDIT: I tried a different approach but get the same error. describe("Weather Module", function() { beforeEach(function(done) { this.temp = null; weather.getTemp('coventry, uk', function(data) { this.temp = data; done(); }); }); it('should get temp', function() { expect(this.temp).toBe(2.66); }); }); I still get this error Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
upvote count: 1
tagged with: asynchronous
favorite count: 0
downvote count: 0
has title: Simple Jasmine Async Test causes timeout

http://stackoverflow.com/q/27768906
has answer: http://stackoverflow.com/a/27769084
linked to: http://stackoverflow.com/q/22391527
type: Question
has title: Gulp watch not working for subdirectory
tagged with: javascript
tagged with: gulp-watch
has comment: http://stackoverflow.com/comment/43949134
answer count: 1
downvote count: 0
tagged with: gulp
has comment: http://stackoverflow.com/comment/43948968
favorite count: 0
type: UnansweredQuestion
score: 2
has body: I'm use gulp. I have a task gulp.task('watch', function () { gulp.watch(['app/**/*.js'], ['scripts']); }); I have same folder structure: app modules admin adminCtrl.js home homeCtrl.js app.js If I add file *.js or new subdirectory, for example, into 'modules/admin', gulp watch working, but, if I create new subdirectory in modules/, for example, 'about', and add into 'about' file, for example, aboutCtrl.js, gulp watch is not working. How I can fix this problem?
upvote count: 2

http://stackoverflow.com/comment/43782760
score: 0
type: Comment
has text: try this `var t=JSON.parse(result); alert (t['name'])`
type: AnswerComment
comment on: http://stackoverflow.com/a/27677143

http://stackoverflow.com/comment/43793723
type: AnswerComment
score: 0
type: Comment
has text: Your comment is rather vague. How exactly do you want to orient it? And this should probably be a separate SO question.
comment on: http://stackoverflow.com/a/27690211

http://stackoverflow.com/comment/43841411
has text: He said _"if I do this it does what I expect it to do"_ then has the `if (deletemode == false`).
type: Comment
comment on: http://stackoverflow.com/q/27714619
type: QuestionComment
score: 1

http://stackoverflow.com/a/27759913
has body: Why don't you just compare your joined array with a string? var piecesArray = [], word; $(".pieces").each(function() { piecesArray.push(this.id); }); word = piecesArray.join(""); if (word === "idaho"){ alert(word); }
score: 0
answers question: http://stackoverflow.com/q/27759809
type: Answer

appium
tags question: http://stackoverflow.com/q/27686986
tag name: appium
type: Tag

http://stackoverflow.com/comment/43892265
comment on: http://stackoverflow.com/q/27740712
has text: Tip: you can use `var id = $(this).data("id");` instead of `var id = $(this).attr("data-id");`
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/27733466
favorite count: 0
score: -1
has comment: http://stackoverflow.com/comment/43878426
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27733491
possible better answer: http://stackoverflow.com/a/27733491
downvote count: 1
has body: $('#table').click(function(){ var value1 = "" ; value1 = $(this).val(); alert(value1); }); I'm trying to get the value from any of the buttons to echo out in the jQuery function, but oddly nothing is working. Here is the full file --> isn't very huge http://jsfiddle.net/yr2x7dnd/1/
has answer: http://stackoverflow.com/a/27733510
upvote count: 0
tagged with: javascript
tagged with: jquery
has title: Using JQuery to get the values from the buttons in Div Table - made in JavaScript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43878502
accepted answer: http://stackoverflow.com/a/27733510

http://stackoverflow.com/a/27691250
score: 8
upvote count: 8
type: Answer
has comment: http://stackoverflow.com/comment/66612932
accepted answer of: http://stackoverflow.com/q/27668926
answers question: http://stackoverflow.com/q/27668926
type: AcceptedAnswer
downvote count: 0
has body: Just in case someone's looking for the answer to this question, I have solved this problem: $('.grid-stack').on('change', function (e, items) { var widgets = []; for (i = 0; i &lt; items.length; i++) { var widgetsObj = { 'widgetId': items[i].el.context.id, 'x': items[i].x, 'y': items[i].y, 'width': items[i].width, 'height': items[i].height } widgets.push(widgetsObj); } } Because the items variable may contain multiple objects, I loop through it to create a single array of objects with properties I need.
has comment: http://stackoverflow.com/comment/79173550

http://stackoverflow.com/comment/43871115
has text: I'm talking about actual value of "value" attribute in each option. This in your plunk goes 0,1,2, I need these to be custom values of whatever grade.id contains, in my example 100,200,300
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27729081

http://stackoverflow.com/a/27770922
has comment: http://stackoverflow.com/comment/43981930
has comment: http://stackoverflow.com/comment/44011969
has comment: http://stackoverflow.com/comment/43981190
has comment: http://stackoverflow.com/comment/43955645
has comment: http://stackoverflow.com/comment/43954890
has comment: http://stackoverflow.com/comment/43955064
has comment: http://stackoverflow.com/comment/43954298
has comment: http://stackoverflow.com/comment/43953240
answers question: http://stackoverflow.com/q/27770247
score: 0
has comment: http://stackoverflow.com/comment/43981205
has comment: http://stackoverflow.com/comment/43954666
type: Answer
has comment: http://stackoverflow.com/comment/43954846
has comment: http://stackoverflow.com/comment/43976557
has comment: http://stackoverflow.com/comment/43954705
has comment: http://stackoverflow.com/comment/43954861
has comment: http://stackoverflow.com/comment/43955016
has comment: http://stackoverflow.com/comment/44010948
has comment: http://stackoverflow.com/comment/43954493
has body: If you do location.href="/dashboard", the browser will discard all the page's state (including scripting variables) and load "/dashboard" (assigning a value to location.href is identical to calling location.assign("/dashboard")). The jQuery load function will probably not even require you to reposition the scroll offset, if you gave it chance to execute! Try: $('#feed1').load("/dashboard #feed1"); UPDATE: It seems the HTTP request fired by jQuery's load mechanism is receiving a truncated response in your case (content-length: 0). You would have to put the scroll position you want to keep into localStorage. Try: var time = new Date().getTime(); var refreshTime = 20*1000; $(document).bind("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error hover change", function(e) { time = new Date().getTime(); }); var previousScrollPos = localStorage.getItem("lastScrollPos"); if(previousScrollPos) { $('#feed1').scrollTop(previousScrollPos); localStorage.removeItem("lastScrollPos"); } function refresh() { if(new Date().getTime() - time &gt;= refreshTime) { localStorage.setItem("lastScrollPos", $('#feed1').scrollTop()); location.reload(); } } setInterval(refresh, refreshTime); I'm not 100% sure that you want to bind to the scroll event of #feed1 or just of body, I haven't seen your page. If anybody clicks "load more" on the news feed, those additional items will be hidden again since you're reloading the page. Not ideal at all. Many users will hate having the page periodically reload, it's also an accessibility failure since this will interfere with screen reading software. It might be a simpler idea to just put a refresh newsfeed icon on the page, which just reloads the whole page, when the user wants to (instead of periodically).
has comment: http://stackoverflow.com/comment/43955565
has comment: http://stackoverflow.com/comment/43955181
has comment: http://stackoverflow.com/comment/43981614

http://stackoverflow.com/comment/43775696
has text: Hi Mark, the shape method is called but the values of the shape in this function are nothing (null)..
type: QuestionComment
comment on: http://stackoverflow.com/q/27680146
score: 0
type: Comment

http://stackoverflow.com/comment/43880287
score: 0
type: Comment
has text: Because I thought it would have the same principle :x sorry, but yeah that's what i was wanted :)
comment on: http://stackoverflow.com/a/27734323
type: AnswerComment

http://stackoverflow.com/a/27661950
downvote count: 0
answers question: http://stackoverflow.com/q/27656777
has body: A: From the docs: http://www.yiiframework.com/doc-2.0/yii-web-view.html Your code seem correct. Do you register the js from the view file itself? not the controller? The registerJsFile() method is from the view class. Its highly possible that your IDE is not finding the method, have you tried it in a apache enviroment? B: Use a alias
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/43788331
upvote count: 1

http://stackoverflow.com/a/27723369
type: Answer
has comment: http://stackoverflow.com/comment/43898212
has comment: http://stackoverflow.com/comment/43865045
answers question: http://stackoverflow.com/q/27722596
has body: On your iframe'd website you do something like window.onload = function(){ parent.postMessage(message, url); } and on your website that hosts the iframe you have an event listener on the iframe for a message. check this link out http://javascript.info/tutorial/cross-window-messaging-with-postmessage
score: 0

http://stackoverflow.com/a/27652069
has comment: http://stackoverflow.com/comment/43732068
type: Answer
has body: simply, every form component has a property called "cls". So you can use the following: cls: 'myclass' Edit for the last issue: You have to override the x-btn-focus class, to remove/replace the blue background color: .x-btn-focus.green-button { background:#46a546; } Edit of your your fiddle's css: .green-button{ background:#46a546; border: none;!important; color: #ffffff;!important; } .green-button .x-btn-inner { color: #ffffff; } .green-button-over { background: #4cc54c; border: none; } .x-btn-over.green-button { background: #4cc54c; border-color: #4cc54c; } .x-btn-pressed.green-button { background: #5b9f5b; border-color: #5b9f5b; } .x-btn-focus.green-button { background:#46a546; }
has comment: http://stackoverflow.com/comment/43732141
answers question: http://stackoverflow.com/q/27649281
downvote count: 0
score: 7
has comment: http://stackoverflow.com/comment/43731421
has comment: http://stackoverflow.com/comment/43731991
accepted answer of: http://stackoverflow.com/q/27649281
has comment: http://stackoverflow.com/comment/43731914
has comment: http://stackoverflow.com/comment/43725058
has comment: http://stackoverflow.com/comment/43732228
has comment: http://stackoverflow.com/comment/43732093
has comment: http://stackoverflow.com/comment/43731772
upvote count: 7
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43731285
has comment: http://stackoverflow.com/comment/43732269

http://stackoverflow.com/q/27768097
answer count: 1
has answer: http://stackoverflow.com/a/27768376
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 0
has title: How to set active state on page load with Angular
accepted answer: http://stackoverflow.com/a/27768376
has body: I have the following set of Bootstrap nav pills in my navigation bar. As you can see from my Angular 'ng-init' code I'm setting 'dateState to 'past' on page load. My problem is that my 'Past Events' nav pill is not highlighted on page load. I have to explicitly click the nav pills to get their 'active' highlight. How would I set whichever pill I have set in 'ng-init' to also show its active state on page load (there's a chance I'll be changing ng-init to 'future' or 'live' in the future so I don't want to just hard code the 'active' state)? Live! Past Events Future Events
type: Question
has comment: http://stackoverflow.com/comment/43946829
tagged with: javascript

http://stackoverflow.com/comment/43735551
type: QuestionComment
has text: why not use jquery css() to set all at once
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27659907

http://stackoverflow.com/q/27650459
tagged with: ecmascript-5
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27650505
has body: Why parseInt(1/10000000) results 1, when parseInt(1/1000000) result is 0? I need some analog to Java's int casting like int i = -1/10000000;, Which is 0. Should I use Math.floor for positive and Math.ceil for negative? Or is there another solution?
has answer: http://stackoverflow.com/a/27650481
has comment: http://stackoverflow.com/comment/43720483
favorite count: 0
downvote count: 0
score: 6
has answer: http://stackoverflow.com/a/27650505
has title: Function parseInt (1/10000000) returns 1. Why?
has comment: http://stackoverflow.com/comment/43718016
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43718031
accepted answer: http://stackoverflow.com/a/27650481
has comment: http://stackoverflow.com/comment/43718036
answer count: 2
upvote count: 6

http://stackoverflow.com/q/27719680
favorite count: 0
type: UnansweredQuestion
tagged with: cross-browser
has comment: http://stackoverflow.com/comment/46691523
has body: I'm using BigVideo.js (http://dfcb.github.io/BigVideo.js/) and want to be able to check if it is supported by the browser, if not, then show a background image instead. Here's what I have: var BV = new $.BigVideo({ //set container for video container: $('#intro') }); BV.init(); //initialise if (Modernizr.touch) { //show background image for touch devices BV.show('img/intro-bg.jpg'); } else { BV.show('vids/bubble.mp4', { //set video format - x-browser support ambient: true }); BV.show('vids/bubble.webm', { ambient: true }); BV.show('vids/bubble.ogv', { ambient: true }); BV.show([{ type: "video/mp4", //make it loop src: "vids/bubble.mp4" }, { type: "video/webm", src: "vids/bubble.webm" }, { type: "video/ogg", src: "vids/bubble.ogv" }, { ambient: true } ]); } This works great in all modern browsers, but failed in an old version of Opera. When this happens we see an error message instead of the video: The video could not be loaded, either because the server or network failed or because the format is not supported. Rather than show this I would prefer to fallback to a background image. I've tried the following with no luck: if( !BV ){ //show fallabck } and if( !BV.init() ){ //show fallback } Anyone else figured out a way to do this?
upvote count: 1
has answer: http://stackoverflow.com/a/29243644
type: Question
tagged with: javascript
tagged with: fallback
has title: BigVideo.js - Check if supported by browser, background image fallback
tagged with: html5-video
answer count: 1
downvote count: 0
score: 1
tagged with: jquery

http://stackoverflow.com/a/27669369
downvote count: 1
has body: Use simply PHP code: &lt;?php // Include file with header include("./include/header.php"); // This bit always includs to the "center" Call page file via URL if (isset($_GET['page'])){ $file=$_GET['page']; $file2= dirname($_SERVER['SCRIPT_FILENAME'])."/".$file.".php"; if(file_exists($file2)){ if(substr_count($file,"../")&gt;0){ echo "Warning!"; }elseif($file=="index" or $file=="/index"){ echo "Warning!"; }else{ include $file2; } }else{ include "./include/404.php"; } }else{ include "uvod.php"; } // Include file with footer include("./include/footer.php"); ?&gt;
score: -1
upvote count: 0
answers question: http://stackoverflow.com/q/27662098
type: Answer

http://stackoverflow.com/q/27730904
type: Question
accepted answer: http://stackoverflow.com/a/27730919
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/27730925
tagged with: concatenation
possible better answer: http://stackoverflow.com/a/27730925
favorite count: 0
has answer: http://stackoverflow.com/a/27730919
upvote count: 1
score: -2
has body: I am working with loop in javascript. I need to display some JavaScript variable with HTML tag. Here is my script. for (var i = 0; i < result.length; i++) { document.write(" XYZ "); } Here result variable is used to store different color-code array(#FFFFFF,000000 etc). Now i want to display value of result like document.write(" XYZ "); Here result variable have some color-code to display background style proper and it'll display as i need.
type: AnsweredQuestion
has title: javascript concat without string concat function not working properly
has comment: http://stackoverflow.com/comment/43873246
downvote count: 3

http://stackoverflow.com/q/27697369
type: AnsweredQuestion
tagged with: java
tagged with: eclipse
type: Question
tagged with: javascript
has title: js file in maven multi-module without any reason became with mistake
has comment: http://stackoverflow.com/comment/43808045
score: 0
has body: I have maven multi module project with spring and hibernate in eclipse. After some time one of files from folder WEB-INF/resources/js became with red icon with shows that there is some mistake. It wasn't first time of this situation. Previously I just delete project and download it from github. What is the reason? Maybe it is bug in eclipse. (no changes to this file wasn't added)
upvote count: 1
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43807939
favorite count: 0
has answer: http://stackoverflow.com/a/27697442
tagged with: maven
accepted answer: http://stackoverflow.com/a/27697442
tagged with: spring

http://stackoverflow.com/comment/43876260
type: Comment
has text: it might be more clear to make it a computed property.
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27732474

http://stackoverflow.com/q/27661573
score: 12
type: Question
type: AnsweredQuestion
tagged with: java
possible better answer: http://stackoverflow.com/a/27661611
linked to: http://stackoverflow.com/q/27670407
has answer: http://stackoverflow.com/a/27661611
has body: I'm setting up an ubuntu server that has jenkins for CI. When I try to run a build I get failure Question: How can I make npm install work from my jenkins job? build 1: [morningharwood] $ /bin/sh -xe /tmp/hudson8925730298288495807.sh + pwd /var/lib/jenkins/workspace/morningharwood + ls bower.json client e2e Gruntfile.js karma.conf.js package.json protractor.conf.js server + npm install /tmp/hudson8925730298288495807.sh: 5: /tmp/hudson8925730298288495807.sh: npm: not found Build step 'Execute shell' marked build as failure Finished: FAILURE Jenkin build UPDATE: ~$ pwd /home/ubuntu ls -a . .bash_history .bashrc .config .gem .gnupg .node-gyp .nvm .rbenv .ssh .viminfo .. .bash_logout .cache .dotfiles .gemrc .local .npm .profile .rvm .vim Now that I see the .npm + /home/ubuntu/.npm/npm install /tmp/hudson1456103398115324880.sh: 5: /tmp/hudson1456103398115324880.sh: /home/ubuntu/.npm/npm: not found Build step 'Execute shell' marked build as failure Finished: FAILURE Configuration Script: What happens when you run from ssh terminal? npm WARN engine karma@0.12.28: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.11.14","npm":"2.0.0"}) npm ERR! Linux 3.13.0-36-generic npm ERR! argv "/home/ubuntu/.nvm/v0.11.14/bin/node" "/home/ubuntu/.nvm/v0.11.14/bin/npm" "install" npm ERR! node v0.11.14 npm ERR! npm v2.0.0 npm ERR! path /var/lib/jenkins/workspace/morningharwood/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ERR! Error: EACCES, mkdir '/var/lib/jenkins/workspace/morningharwood/node_modules' ... So I've CHOWN the folder: + pwd /var/lib/jenkins/workspace/morningharwood sudo chown ubuntu /var/lib/jenkins/workspace/morningharwood/ -Rv ... Ran npm install after that npm install It was successful! NEW PROBLEM: My build now fails when trying to clone the repository from github via jenkins. Console log Started by user matthew harwood Building in workspace /var/lib/jenkins/workspace/morningharwood &gt; git rev-parse --is-inside-work-tree # timeout=10 Fetching changes fr…
answer count: 2
upvote count: 12
has answer: http://stackoverflow.com/a/27668330
downvote count: 0
tagged with: javascript
has title: Jenkin's build failing on npm install
tagged with: node.js
favorite count: 0
accepted answer: http://stackoverflow.com/a/27668330
tagged with: jenkins
tagged with: npm

http://stackoverflow.com/q/27775848
type: Question
tagged with: slideup
has body: I have made a simple Jquery slide down/up function that triggers when scroll is above and under 40. That seems to work decent, but if I refresh the page when i scrolled to bottom at page etc the script re-runs the animation and sometimes it just show as initial state, and I have to scroll again to hide the top header division. Is there an option to avoid this? Some kind of "if the scroll interaction is over 40 it wont trigger. Tips / help much appreciated. &lt;script&gt; $(window).scroll(function(){ if($(window).scrollTop() &gt; 40){ $(".header-top").slideUp(); } if($(window).scrollTop() &lt; 40) { $(".header-top").slideDown(); } }); &lt;/script&gt;
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43963364
has title: On page refresh avoid re-running a Jquery slide down/up function.
has comment: http://stackoverflow.com/comment/43962934
favorite count: 0
has comment: http://stackoverflow.com/comment/43962502
type: UnansweredQuestion
tagged with: slidedown
answer count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43963137

http://stackoverflow.com/comment/43832882
type: Comment
comment on: http://stackoverflow.com/a/27699389
score: 0
type: AnswerComment
has text: A more experienced user may be able to better clarify, but my best guess is that the question was down voted because your plunk did not initially run the way you explained it. I had to make a number of unrelated changes to get it to a running state. Make sure your example code behaves exactly how you have explained in your questions.

http://stackoverflow.com/comment/43721217
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27651094
has text: My advice is repost your question on [SuperUser](http://superuser.com/) because it's inappropriate for this forum.

http://stackoverflow.com/q/27692417
has title: Differential content draft saving in web app
has body: I've seen that Medium.com as well as Google Drive docs/sheets/etc. all use draft content saving so your editing doesn't get lost. Well Google's version is used for content versioning, but that's just an additional side effect as they're apparently not updating the same content but rather saving all of them getting content history records. I'm interested in the way these two internally work. If you observe Ajax calls being exchanged between the client and server one can see that both of them send some sort of partial content or user action saves. These kind of draft saving is very quick because even lengthy content can utilize tiny requests making draft saving a quick process. The problem is of course because these partial saves are now stateful, so they heavily rely on existing content state. I'm also working on a web app that would benefit from such feature of tiny and quick saves, but I don't want to reinvent the wheel and jumping over all the hurdles. I'm not sure whether I should be recording keystrokes and send them immediately which would then have to be replayed on the server to actually generate matching content state there. should it work in any other way like recording keystrokes and sending them in predefined intervals? not recording keystrokes at all but rather calculating content diffs in some way. Content diffs are done in CVSs like GitHub and I suppose this algorithm is very well defined by now and correctly shows removed as well as added content. If this process is not too complex for client-side processing I may go down this route and send small diffs These are just three ways from the top of my head (although the first two are similar in nature) but there may be others that I haven't thought about. I'm sure some of you may have done this before and have some experience as well as pros and cons of different techniques and if there's maybe an existing open source lib that can help simplify this without doing it all from scratch. How should this be do…
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: diff
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: web-applications
type: Question
tagged with: algorithm

http://stackoverflow.com/comment/43812785
comment on: http://stackoverflow.com/q/27693904
type: Comment
type: QuestionComment
score: 0
has text: sorry i didn't mention that, i will update the question

http://stackoverflow.com/comment/45114838
score: 0
has text: _Quick note:_ I'm sorry for not marking your answer as accepted or asking a further question until now. The project priorities have changed so that I have to implement other components first.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27762044

http://stackoverflow.com/comment/43717864
has text: Blend compositing will certainly be the future of image filtering. But as of this post (Dec2014) most of the common browsers have not implemented blend compositing.
type: Comment
comment on: http://stackoverflow.com/a/27646113
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43791235
type: Comment
comment on: http://stackoverflow.com/a/27653045
score: 0
type: AnswerComment
has text: i have variable defined in the Tabinator, how to access it.

http://stackoverflow.com/a/27783681
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27783543
has comment: http://stackoverflow.com/comment/43977477
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27783543
has comment: http://stackoverflow.com/comment/43977645
type: Answer
has body: As I showed you in my comment, there are quite a few changes in the versions of jQuery that you refer to. You can use the jQuery Migrate plugin (made by the jQuery team) to help troubleshoot the changes, but in a nutshell you can boil your code down to: $('.check').click(function () { $('input:checkbox').prop('checked', !$('input:checkbox').prop('checked')); $(this).val(($(this).val() == 'uncheck all') ? 'check all' : 'uncheck all') }) &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="button" class="check" value="check all" /&gt; &lt;input type="checkbox" class="cb-element" /&gt;Checkbox 1 &lt;input type="checkbox" class="cb-element" /&gt;Checkbox 2 &lt;input type="checkbox" class="cb-element" /&gt;Checkbox 3

http://stackoverflow.com/comment/43718272
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27650399
type: Comment
has text: Alright, thanks. I'll read up more on asynchronous. So how can I create the button listener?

http://stackoverflow.com/a/27654890
has body: App.CurrentListController is not an array. It's an object, a controller object. (btw it is not recommended to access the global namepsace [ ie. using anything with an uppercase letter ] in your template) What you should do instead is: App.StatController = Ember.ObjectController.extend({ needs:['currentList'], currentList: Ember.computed.alias('controllers.currentList.model'), ... This way you can access the underlying model of your currentList controller (which is an array) and make it available to your template as currentList. {{#each business in currentList}} ... {{/each}}
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/43743125
type: Answer
accepted answer of: http://stackoverflow.com/q/27654052
has comment: http://stackoverflow.com/comment/43745421
answers question: http://stackoverflow.com/q/27654052

http://stackoverflow.com/comment/43773760
has text: Yep it works. But I want the results to include `"count": 0` items too. for an example the result should also contain `{ "_id" : { "type" : "murder", "year" : "2014" }, "count" : 0 }`... I want to know if there is a way to do that? @Disposer
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27679415
score: 0

http://stackoverflow.com/comment/43906206
comment on: http://stackoverflow.com/a/27747497
has text: Thanks..but since there are too much forms with inputs visible on that page..so how can I get only these ones please..!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27799897
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44008333
has body: Adding the items to the &lt;svg&gt; element dynamically via .innerHTML is not supported, only implied by the HTML5 spec . Dynamically adding to &lt;svg&gt; elements is a new feature that has not yet been implemented in all browsers. To dynamically add/create svg items, use createElementNS: var circle = document.createElementNS("http://www.w3.org/2000/svg", "circle");
downvote count: 0
has comment: http://stackoverflow.com/comment/44009054
accepted answer of: http://stackoverflow.com/q/27799755
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44009445
has comment: http://stackoverflow.com/comment/44009702
answers question: http://stackoverflow.com/q/27799755
type: Answer

http://stackoverflow.com/q/27697757
has body: I'm trying to have a circle follow an elliptical path that is rotated, using Snap.svg, but I've ran into a problem. Using the getPointAtLength only returns the point of the path that is not rotated, so when I rotate the path, the circle will still follow the original path, before rotation. var firstOrbit = s.path("M250,400a150,75 0 1,0 300,0a150,75 0 1,0 -300,0") .attr({stroke: "#000", strokeWidth:"5", fill: "transparent"}); var len = firstOrbit.getTotalLength(); firstOrbit = firstOrbit.transform('r75,400,400'); var circleA = s.circle(0,0,10); var startingPointA = Snap.path.getPointAtLength(firstOrbit, 0); Snap.animate(0, len, function(value){ var movePoint = firstOrbit.getPointAtLength(value); circleA.attr({ cx: movePoint.x, cy: movePoint.y }); }, 2000, mina.linear); The problem is, that the ellipse rotates, but the path that circleA follows does not, so it follows a wrong path. Is there an easy way to fix this, or do I have to calculate the difference at each step of the animation?
possible better answer: http://stackoverflow.com/a/27699360
tagged with: http://stackoverflow.com/tag/svg
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/27700992
type: Question
has answer: http://stackoverflow.com/a/27699360
tagged with: rotation
answer count: 2
accepted answer: http://stackoverflow.com/a/27700992
tagged with: javascript
has title: SVG - Follow rotated path

http://stackoverflow.com/comment/43924732
type: Comment
has text: Btw, how do you call that $in operator in JS? Is the $ sign somehow special? Or is it just arbitrary mongoDB name and it could be 'in' as well?
comment on: http://stackoverflow.com/a/27756647
type: AnswerComment
score: 0

http://stackoverflow.com/a/39863811
score: 3
type: Answer
has body: This is the solution I used to get login callback. You can add this code for your Facebook login button in your render method: Login In your code, add these lines: componentDidMount: function() { // facebook signin button render window.fbAsyncInit = function() { FB.init({ appId : 'replace with your app id here', cookie : true, // enable cookies to allow the server to access // the session xfbml : true, // parse social plugins on this page version : 'v2.1' // use version 2.1 }); // login callback implementation goes inside the function() { ... } block FB.Event.subscribe('auth.statusChange', function(response) { // example implementation if (response.authResponse) { console.log('Welcome! Fetching your information.... '); FB.api('/me', function(response) { console.log('Good to see you, ' + response.name + '.'); }); } else { console.log('User cancelled login or did not fully authorize.'); } }); }.bind(this); // Load the SDK asynchronously (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); } } Calling FB.Event.subscribe('auth.statusChange', callback_function) during component initialization is important because that's basically your login callback. Checkout here for FB.Event documentation.
answers question: http://stackoverflow.com/q/27717555
has comment: http://stackoverflow.com/comment/78202837
downvote count: 1
upvote count: 4

http://stackoverflow.com/q/27751548
has comment: http://stackoverflow.com/comment/64656562
tagged with: validation
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
upvote count: 2
has body: I need to "reset" the state (validations too) of a form every time i'm going to revalidate it. I know $setPristine() function but this doesn't reset the validation state of the controls (i want to remove ng-invalid css-class). Is there a function to do this to all the controls in a form at once? I'm in Angular 1.3.8
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27751625
has title: Angular: Reset validation state of all controls in a form
score: 2
type: Question
linked to: http://stackoverflow.com/q/18648427
tagged with: javascript

http://stackoverflow.com/a/27698845
type: Answer
has comment: http://stackoverflow.com/comment/43810766
has body: Your code is behaving as you originally expected it to, in that the result of .first() is returning only the li element containing the text "I am first". The reason all of the elements appear red when you open this in a browser is that you are reusing the class emphasis for both the parent and the child. Since color and font-weight are inherited CSS attributes all of the li elements under ul.emphasis are going to be red and bold. But like I said, only the first li element has the emphasis class.
answers question: http://stackoverflow.com/q/27698773
score: 0

http://stackoverflow.com/comment/48753242
type: AnswerComment
type: Comment
has text: It's a very user unfriendly error message! This really helped to clarify my issue.
comment on: http://stackoverflow.com/a/27659465
score: 0

http://stackoverflow.com/q/27715151
has body: I am using jade.compileClient to convert jade files to JS functions and I am having an issue when using escaped html. When in jade I write: h2= conditional ? 'String1 ' + moreText : otherCondition ? 'String2' : 'String3' It is converted to: function template(locals) { var buf = []; var jade_mixins = {}; var jade_interp; buf.push("&lt;h2&gt;" + (jade.escape(null == (jade_interp = conditional ? 'String1 ' + moreText : otherCondition ? 'String2' : 'String3') ? "" : jade_interp)) + "&lt;/h2&gt;"); // [more code, beside the point] Seems great! The only problem is that the jade object doesnt exists (at least in my code), and, as you see, the converted functions calls to jade.escape (and some other functions like jade.attr, in other cases). How can I make it work? Is something that I have to include that I am missing? Thanks in advance.
answer count: 1
accepted answer: http://stackoverflow.com/a/27715612
has title: jade.compileClient fails when invoking jade.escape
score: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27715612
tagged with: pug
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/13814153
type: Question

http://stackoverflow.com/comment/43812003
type: Comment
type: QuestionComment
score: 6
comment on: http://stackoverflow.com/q/27699493
has text: It's not baked into the language, but check this article out http://ejohn.org/blog/partial-functions-in-javascript/ where he shows a way of doing it by specifying `undefined` for the parameters you want to fill in later.

http://stackoverflow.com/q/27739723
downvote count: 0
has comment: http://stackoverflow.com/comment/43891624
tagged with: javascript
has comment: http://stackoverflow.com/comment/43892180
has title: Get value from javascript
has comment: http://stackoverflow.com/comment/43893583
has comment: http://stackoverflow.com/comment/43892688
has comment: http://stackoverflow.com/comment/43890898
has body: I have to get id from table data (SQL). Below is a form, in which I have to get proper id. But in JavaScript I don't get id from more data. I am getting only same data id from table. please tell me how to get id from table in SQL HTML Form: <input type="hidden" id="cid1" value="<?php echo $ws1['forum_id']; ?>"> User name Email id Mobile no Javascript: function xxx() { regexp=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; regexp1=/^\d{10}$/; function showError(id, msg) { if (msg != "") { document.getElementById(id).innerHTML = '*' + msg; } else { document.getElementById(id).innerHTML = msg; } } err = ''; var username = document.getElementById("username").value; if (username == "" || username == null) { showError('username_error', 'Please Fill Name'); err = 1; } else { showError('username_error', ''); } var email = document.getElementById("email").value; if (!regexp.test(email)) { showError('email_error', 'Please Fill valid Email address.'); err = 2; } else { showError('email_error', ''); } var phone = document.getElementById("phone").value; if (!regexp1.test(phone)) { showError('phone_error', 'Please Fill valid Phone Number.'); err = 3; } else { showError('phone_error', ''); } if(err!=''){ return false } else { cmnt = document.getElementById('comment').value; usr = document.getElementById('username').value; emil = document.getElementById('email').value; phn = document.getElementById('phone').value; fid = document.getElementById('cid').value; $.ajax({ type: "POST", url:'submit_form/insert_comment.php', dataType: "html", cache: false, async: false, data: { comment: cmnt, username: usr, email:emil, phone:phn, id: fid } }); } showError('error','Your comment have been sent sucessfully'); $("#please").click(); }
favorite count: 0
has comment: http://stackoverflow.com/comment/43890238
has comment: http://stackoverflow.com/comment/43892782
has comment: http://stackoverflow.com/comment/43893026
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/43893702
has comment: http://stackoverflow.com/comment/43890312
has comment: http://stackoverflow.com/comment/43891916
has comment: http://stackoverflow.com/comment/43890235
score: 1
tagged with: mysql
has comment: http://stackoverflow.com/comment/43893381
type: Question

http://stackoverflow.com/comment/43811337
has text: I haven't worked on spynner. But can you try this ret = br.runjs('document.getElementById('someID').getAttribute('visibility');") for reading visibility value. Similarly try for other attributes if it works.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27683103
type: Comment

http://stackoverflow.com/a/27714024
answers question: http://stackoverflow.com/q/27698388
upvote count: 0
type: AcceptedAnswer
score: -1
accepted answer of: http://stackoverflow.com/q/27698388
type: Answer
downvote count: 1
has body: I Ended up rolling my own: app.filter('formatMoney', ['$filter', function ($filter) { return function (value, format) { var v = format.split(';'); var index = 2; if (value &gt; 0) index = 0; else if (value &lt; 0) index = 1; else { return v[index]; } var len = v[index].length; var fIndex = v[index].indexOf('#'); var lIndex = v[index].lastIndexOf('0'); var f = v[index].substring(fIndex, lIndex + 1); var symbolFirst = ''; var symbolLast = ''; if (lIndex !== len - 1) { symbolLast = v[index].substring(len, len - 1); } if (fIndex &gt; 0) { symbolFirst = v[index].substring(0, fIndex); } var valueStr = value.toFixed(2).toString(); for (var i = f.length - 1; i &gt; 0 &amp;&amp; valueStr.length &gt; 0; i--) { var slice = valueStr.slice(-1); if (f[i] === '#' || f[i].isNumeric()) { valueStr = valueStr.slice(0, -1); if (slice.isNumeric()) { f = f.replaceAt(i, slice); var j = valueStr.length - 1; while (j &gt; 0 &amp;&amp; !valueStr[j].isNumeric()) { valueStr = valueStr.slice(0, -1); j = j - 1; } } } } return symbolFirst + f.substr(f.search(/\d/), f.length - 1) + symbolLast; }; }]);

http://stackoverflow.com/comment/43928739
type: Comment
has text: How is exporting to objects or JSON is useful or scalable? like let's say an object is at 50,50 with width 100 and height 200, in a bigger screen when I load the stored json it's still the same size. So, I guess however, scaling is supposed to be managed for JSON, it's possible for svg as well. And Actually, I am not sure how to do it.Right now I just render svg. The user might put so many picture on the canvas and I can't just upload everything first. It's a mobile app, so pictures come from camera I can't waste users time and data with uploading so many things and then finally choose one.
score: 0
comment on: http://stackoverflow.com/a/27745823
type: AnswerComment

http://stackoverflow.com/comment/43766154
type: Comment
has text: It doesn't work too - JSON.parse throws error, because it parses {{collection}} string, not the collection JSON itself yet. I found another solutions: 1) **domReady** event handler for the attributes parsing; 2) **$watch**ing document.querySelector('my-element').initList for the assigning the list data inside an AngularJS controller. Its _undefined_ at the beginning of controller loading.
comment on: http://stackoverflow.com/a/27657548
score: 1
type: AnswerComment

http://stackoverflow.com/q/27677449
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43769321
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27677499
has title: Toggle expand when over 900px toggle collapse when under 900px
type: Question
tagged with: responsive-design
has body: I want this to be expanded when I am on a screen that has more than 900px(min-width: 901px;) and when I am on a screen that has less than 900px (max-width; 900px) I want it to be closed so that I can manually click on it and so that it will be expanded. This is the code that I have for the div to expand when I click on it $('.exp_collapsed').click(function(){ $('.text_ads_expand_button_mer_info').slideToggle('slow'); }); the .text_ads_expand_button_mer_info is the text that I want user to be able to click on and when they do it will expand. am I changing this in the jquery or in the css ?
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27677499

http://stackoverflow.com/q/27761146
type: AnsweredQuestion
score: 2
has body: So i is the instruction pointer and ptr is the data pointer. I'm trying to get this right: [ - if the byte at the data pointer is zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching ] command. ] - if the byte at the data pointer is nonzero, then instead of moving the instruction pointer forward to the next command, jump it back to the command after the matching [ command. var memory = new Array(); for ( var ptr = 0; ptr < 1000; ptr++ ) memory[ptr] = 0; var ptr = 0; var src = document.getElementById("source").value; for ( var i = 0; i < src.length; i++ ) { // other code if ( src[i] == "[" ) if ( memory[ptr] == 0 ) { for ( var j = i; j < src.length; j++ ) if ( src[j] == "]" ) { i = j; break; } continue; // so we don't enter the next if } if ( src[i] == "]" ) if ( memory[ptr] != 0 ) for ( var k = i; k > 0; k-- ) if ( src[k] == "[" ) { i = k; break; } } Everything works but trying the Hello World example with loops generates wrong output, the [ and ] messed up somewhere. Any suggestions on how to fix the loop? Edit Here are the modified ifs with the suggested nesting handlers, it now executes the Hello World example properly. if ( src[i] == "[" ) if ( memory[ptr] == 0 ) { var count = 1; for ( var j = i + 1; j < src.length; j++ ) { if ( src[j] == "[" ) count++; if ( src[j] == "]" ) count--; if ( count == 0 ) { i = j; break; } } continue; } if ( src[i] == "]" ) if ( memory[ptr] != 0 ) { var count = 1; for ( var k = i - 1; k > 0; k-- ) { if ( src[k] == "]" ) count++; if ( src[k] == "[" ) count--; if ( count == 0 ) { i = k; break; } } }
tagged with: brainfuck
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27761176
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/27761176
favorite count: 0
upvote count: 2
has title: Implementing Brainf*ck loops with JavaScript

http://stackoverflow.com/comment/43959982
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27771524
has text: I was checking whether the argument was supplied rather than whether it was a function. You're probably right that checking that it's a function makes sense but I'm not sure `isEmpty` is really being used wrong. Looking at the code on Github, the comments and the code tell me that if you pass null, you get true. Here: `if (obj == null) return true;`. (https://github.com/jashkenas/underscore/blob/master/underscore.js#L1168) So while the comment does not explicitly reference `null` as a possible "empty" value, the code does. I believe this is how almost all empty or blank functions work.

http://stackoverflow.com/comment/43924522
has text: pubsub might not help here.pubsub is used in a case something like if you want one view trigger updates in other views which aint the view's child view.and the question is if it's able to ensure the models are fetched when he use them or not
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27756807

http://stackoverflow.com/a/27785103
type: Answer
has comment: http://stackoverflow.com/comment/44000264
has body: You can hide the select input until the promise is finished and show it only after. I usually show a loader gif until all my promises are finished and only then display all the content so there are no empty zones in the page. Also, be careful to set the value of the ng-model to be identical to one of the options value.
has comment: http://stackoverflow.com/comment/44001069
answers question: http://stackoverflow.com/q/27784522
score: 0

http://stackoverflow.com/comment/43745887
comment on: http://stackoverflow.com/a/27665115
has text: This is because getSelection returns a documentFragment that has 'no parent'
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27761834
has body: First I converted the table to a two dimensional array to represent the grid. Each item is an object which contains the cells. I do this by getting all the rows and then for each row getting all the cells; var rows = document.getElementsByTagName("tr"); var matchAim = 3; var data = []; for( var i = 0; i &lt; rows.length; i++){ var rowData = []; var cellBlocks = rows[i].getElementsByTagName("td"); for( var j = 0; j &lt; cellBlocks.length; j++){ var cellBlock = cellBlocks[j]; rowData.push(cellBlock); } data.push(rowData); } I then use this array to check for matches. I created a function checkForMatches which checks for matches either horizontally or vertically. When a match is found the changeColorForMatch function loops through the array and changes the color for the cells: function checkForMatches(isHorizontal) { console.debug('Checking matches ' + (isHorizontal ? 'horizontally' : 'vertically')); for (var k = 0; k &lt; data[0].length; k++) { var currentNumber; var matchCount = 1; for (var l = 0; l &lt; data.length; l++) { var cellBlock = isHorizontal ? data[k][l] : data[l][k]; var cellNumber = cellBlock.innerText; if (!currentNumber || currentNumber !== cellNumber) { if (matchCount &gt;= matchAim) { var horizontalIndex = isHorizontal ? l: k; var verticalIndex = isHorizontal ? k : l changeColorForMatch(matchCount, isHorizontal, horizontalIndex, verticalIndex); } currentNumber = cellNumber; matchCount = 1; } else { matchCount++; } } if (matchCount &gt;= matchAim) { var horizontalIndex = isHorizontal ? data.length: k; var verticalIndex = isHorizontal ? k : data.length; changeColorForMatch(matchCount, isHorizontal, horizontalIndex, verticalIndex); } } } function changeColorForMatch(matchCount, isHorizontal, horizontalIndex, verticalIndex) { for (var i = matchCount; i &gt; 0; i--) { var cellBlock = isHorizontal ? data[verticalIndex][horizontalIndex - i] : data[verticalIndex - i][horizontalIndex]; cellBlock.style.backgroundColor = 'red'; } } I then call checkForMatches f…
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27761143
type: Answer
answers question: http://stackoverflow.com/q/27761143

typescript
tags question: http://stackoverflow.com/q/27766361
tags question: http://stackoverflow.com/q/27708301
tags question: http://stackoverflow.com/q/27700840
tags question: http://stackoverflow.com/q/27696982
tags question: http://stackoverflow.com/q/27796664
tag name: typescript
tags question: http://stackoverflow.com/q/27686897
tags question: http://stackoverflow.com/q/27764720
tags question: http://stackoverflow.com/q/27787368
tags question: http://stackoverflow.com/q/27670824
tags question: http://stackoverflow.com/q/27777499
tags question: http://stackoverflow.com/q/27764930
tags question: http://stackoverflow.com/q/27787361
tags question: http://stackoverflow.com/q/27709636
tags question: http://stackoverflow.com/q/27686304
tags question: http://stackoverflow.com/q/27686119
tags question: http://stackoverflow.com/q/27665032
tags question: http://stackoverflow.com/q/27708578
tags question: http://stackoverflow.com/q/27694914
tags question: http://stackoverflow.com/q/27705765
type: Tag
tags question: http://stackoverflow.com/q/27689521
tags question: http://stackoverflow.com/q/27697770

http://stackoverflow.com/comment/43745292
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27664894
has text: Might it be the action function? https://github.com/zabuto/calendar/blob/master/examples/action.html
score: 0

http://stackoverflow.com/a/27784813
type: Answer
has body: I think the problem may well be the order in which you are including your scripts: Try the following: Reasoning is that app.js tries to define a controller using a function that has not been defined when the function is run. Points that {{scope.data}} should be {{data}} are correct, but do not explain {{6+9}} not working.
has comment: http://stackoverflow.com/comment/43979646
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27784547
upvote count: 1

http://stackoverflow.com/q/27661643
upvote count: 2
has answer: http://stackoverflow.com/a/27661684
has comment: http://stackoverflow.com/comment/43739065
downvote count: 1
has title: JavaScript operator precedence and associativity
accepted answer: http://stackoverflow.com/a/27661691
type: AnsweredQuestion
score: 1
has body: In JavaScript var x = (5 &gt;= 9 &gt;= 0); console.log(x); // returns true What is happening in that statement and what is the reason for that output?
has answer: http://stackoverflow.com/a/27661691
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43739049
possible better answer: http://stackoverflow.com/a/27661684
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43739015
linked to: http://stackoverflow.com/q/19839952
tagged with: operators

http://stackoverflow.com/comment/67451212
comment on: http://stackoverflow.com/a/29592334
score: 7
type: AnswerComment
type: Comment
has text: For some reason this doesn't work for me; I'm running eslint 3.8.0. I have to use /*eslint-disable */ and /*eslint-enable */. Any idea why this might be? I like the single line approach

http://stackoverflow.com/comment/44007683
has text: @Clive Yes i have. Just added the square brackets in the initialization now this is the error i get, Unknown Provider.
comment on: http://stackoverflow.com/q/27799529
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27698904
answer count: 1
has answer: http://stackoverflow.com/a/27993619
has comment: http://stackoverflow.com/comment/43813609
has title: Why is generated parser so slow?
has body: I was playing around on PEG.js in an attempt to create a parser that is able to take a string and create an object. For example, take the string "a&amp;b" and create: {type:"operator",value:operator, children:[a, b]} However, I have reached the stage where returning a result can take over 10 seconds if there are two or more nests. The test argument I have been using is: (All a (All a (All a b))) The grammar does return the right answer, but takes far too long. My question is, what is causing this time delay for such a simple parse? It is possible to try and edit the grammar online at PEG.js My grammar is: start = sep* All:All sep* {return All} All = sep* operator:"All" sep* xValue: Ex sep* pValue: Ex{return {type:"operator",value:operator, children:[xValue, pValue]}} /Ex Ex = sep* operator:"Ex" sep* xValue: AND sep* pValue: AND {return {type:"operator",value:operator, children:[xValue, pValue]}} /AND AND= left: Plus sep* operator:"&amp;" sep* right:AND {return {type:"operator", value:operator, children:[left,right]}} / Plus Plus = left: Equals sep* operator:"+" sep* right:Plus{return {type:"operator", value:operator, children:[left,right]}}/ Equals Equals = left:GEQ sep* operator:"=" sep* right:Equals{return {type:"operator", value:operator, children:[left,right]}}/GEQ GEQ = left:implication sep* operator:"&gt;=" sep* right:GEQ{return {type:"operator", value:operator, children:[left,right]}}/implication implication = left:OR sep* operator:"-&gt;" sep* right:implication{return {type:"operator", value:operator, children:[left,right]}}/OR OR = left:Not sep* operator:"|" sep* right:OR{return {type:"operator", value:operator, children:[left,right]}}/Not Not = sep* operator:"¬" sep* right:Suc{return {type:"operator", value:operator, children:[right]}}/Suc Suc = sep* operator:"suc" sep* right:primary{return {type:"operator", value:operator, children:[right]}}/primary primary = letter:letter{return {type:"variable", value:letter}}/ "{" sep* All:All sep* "}" {return All}/"("…
tagged with: peg
tagged with: javascript
type: UnansweredQuestion
tagged with: logic
type: Question
tagged with: parsing
score: 0

http://stackoverflow.com/comment/43858260
comment on: http://stackoverflow.com/a/27696271
score: 0
type: AnswerComment
type: Comment
has text: Actually I'm using that router, could I do a dinamic declaration of the views? Because I have a Quiz with diferent kind of tests (some with 100 questions, other with 30...). Thank you.

http://stackoverflow.com/q/27798990
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
downvote count: 0
score: 1
type: Question
tagged with: internet-explorer-8
tagged with: javascript
has body: I currently have an app which has 2 buttons that must both be disabled when either is clicked. Initially, I had decided to use ng-disabled, however, to my amazement it is not compatible with ie8. I have been scouring the web for a solution but am unable to find one. Any help would be greatly appreciated. If you need more information on my problem do not hesitate to ask. Thanks in advance. Update: I have decided to try use doucumentById to set the buttons to disabled but still no luck. Clicking the first button will disable the first button, it should disable both, and clicking the second disables both buttons, as it should.
has comment: http://stackoverflow.com/comment/44028681
upvote count: 1
has title: I am trying to find a workaround for using ng-disabled in ie8
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/27712047
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/27712409
score: -3
has body: I am looking in google for some kind of popup. Lets say when i press on something a little cloud will appear and it disapears after few seconds or wherever i click. How is that called?? All popup/modal window scripts in google are big like screen size, make the rest of page disapear or require pressing X to close it. What should I type in google to find something like this?
type: AnsweredQuestion
tagged with: popup
has title: I am looking for kind of popup
downvote count: 3
type: Question
has answer: http://stackoverflow.com/a/27712409
tagged with: javascript
has comment: http://stackoverflow.com/comment/43836135
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43836139

http://stackoverflow.com/a/27782483
downvote count: 1
answers question: http://stackoverflow.com/q/27773816
upvote count: 0
score: -1
has comment: http://stackoverflow.com/comment/43978586
has comment: http://stackoverflow.com/comment/43978230
type: Answer
has body: Ignore all below the first horizontal rule - short story it was a CSP issue but Rob W's solution is far superior: manifest.json { "name": "Todoist Gmail Sidebar", "manifest_version": 2, "description": "Toggle a Todoist sidebar on the gmail tabs when the page action is clicked", "version": "0.9", "homepage_url": "http://turkeyphant.org", "icons": { "16": "icon16.png", "48": "icon48.png", "128": "icon128.png" }, "permissions": [ "tabs", "https://*/*","http://*/*","activeTab" ], "background":{ "persistent":true, "scripts": ["background.js"] }, "browser_action": { "default_icon": "icon128.png", "default_title": "Toggle Todoist sidebar" }, "content_scripts": [ { "js": [ "jquery.min.js", "jquery.easing.1.3.js", "contentscript.js" ], "matches": [ "*://mail.google.com/*" ], "run_at": "document_end" } ], "web_accessible_resources": [ "frame.html", "toggleSidebar.js" ] } contentscript.js if (typeof sidebarOpen == 'undefined') { //if not set yet, it's closed console.log("sidebar initiated"); sidebarOpen = false; //set closed var width = '400';//variables //resolve html tag, which is more dominant than &lt;body&gt; var html; if (document.documentElement) { html = $(document.documentElement); //just drop $ wrapper if no jQuery } else if (document.getElementsByTagName('html') &amp;&amp; document.getElementsByTagName('html')[0]) { html = $(document.getElementsByTagName('html')[0]); } else if ($('html').length &gt; -1) {//drop this branch if no jQuery html = $('html'); } else { alert('no html tag retrieved...!'); throw 'no html tag retrieved son.'; } //position if (html.css('position') === 'static') { //or getComputedStyle(html).position html.css('position', 'relative');//or use .style or setAttribute } // Avoid recursive frame insertion... var extensionOrigin = 'chrome-extension://' + chrome.runtime.id; if (!location.ancestorOrigins.contains(extensionOrigin)) { var iframe = document.createElement('iframe'); // Must be declared at web_accessible_resources in manifest.json iframe.sr…
has comment: http://stackoverflow.com/comment/43978550

http://stackoverflow.com/comment/43808563
has text: I read your SO answer here: http://stackoverflow.com/questions/16727922/access-meteor-userid-from-outside-a-method-publish, can I use this process now (that was written in '13)? If so, would I place the cookie checking code in the onBeforeAction method or in the server side route?
comment on: http://stackoverflow.com/a/27695076
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27693960
upvote count: 1
downvote count: 0
answer count: 1
tagged with: javascript
has title: How to use Ruby's asset_url in JS (Ruby interpolation in JS??)
favorite count: 0
tagged with: asset-pipeline
type: UnansweredQuestion
has body: Ok so I have a JS function that changes the image source, but I need to fingerprint that image source per Ruby's asset pipeline. In other words, I need to marry this code: // JS code changeImage("assets/How-to/" + step_to_remove + ".gif"); With the fingerprinting that's normally done by # Ruby code asset_path "How-to/#{step_to_remove}.gif" The stopgap solution I have now is just to manually remove the fingerprints, but I know there's a better way than that.
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/27694096
score: 1
type: Question

http://stackoverflow.com/a/27783068
type: AcceptedAnswer
downvote count: 0
has body: try with this, example here in fiddle $('.typeahead').typeahead().bind('typeahead:close', function () { $('.typeahead').typeahead('val', ''); });
type: Answer
has comment: http://stackoverflow.com/comment/44219503
accepted answer of: http://stackoverflow.com/q/27781213
score: 7
upvote count: 7
answers question: http://stackoverflow.com/q/27781213
has comment: http://stackoverflow.com/comment/111029996
has comment: http://stackoverflow.com/comment/53921377

http://stackoverflow.com/q/27737976
has answer: http://stackoverflow.com/a/27738077
accepted answer: http://stackoverflow.com/a/27738077
tagged with: http://stackoverflow.com/tag/html
has title: mail alert is not working
tagged with: php
possible better answer: http://stackoverflow.com/a/27738031
has comment: http://stackoverflow.com/comment/43887338
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43887369
has comment: http://stackoverflow.com/comment/43887326
type: Question
has comment: http://stackoverflow.com/comment/43887310
has answer: http://stackoverflow.com/a/27738095
has comment: http://stackoverflow.com/comment/43887300
tagged with: javascript
has answer: http://stackoverflow.com/a/27738031
has comment: http://stackoverflow.com/comment/43887405
has body: Am trying ti set a form in my contact page,where the user can send their feedback to me through mails. The problem here is am receiving the mail,but the page is not refreshing and no alert box comes...help to solve this My Php code- <?php if (isset($_POST['submit'])) { //print_r($_POST); $name=$_POST['name']; $email=$_POST['email']; $message=$_POST['message']; $to='xyz@gmail.com'; //$subject='Send mail using php'; //$message='This mail send using php'; $headers="From: $name"; $mail=mail($to,$name,$email,$message); if($mail) { echo'Mail send successfully'; } else { echo'Mail is not send'; }} ?> and my form is- Your Name Phone Email Address Message
has comment: http://stackoverflow.com/comment/43887289
score: 0
has comment: http://stackoverflow.com/comment/43887331
answer count: 3
has comment: http://stackoverflow.com/comment/43887276

http://stackoverflow.com/a/28438751
upvote count: 3
type: Answer
has body: You can fix your problem by using the ui-grid-auto-resize directive. Said directive is available inside ui.grid.autoResize module, so remember to add that module to your application in order to use the directive. I have update your plunk here to show how it works.
answers question: http://stackoverflow.com/q/27697281
score: 3
downvote count: 0

http://stackoverflow.com/q/27710563
tagged with: html5-history
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27715541
upvote count: 1
type: Question
tagged with: backbone-routing
accepted answer: http://stackoverflow.com/a/27715541
tagged with: pushstate
tagged with: javascript
has body: I've set up a super simple Backbone app with just a router and two views to try and nail down the correct way to handle routing with no hashbangs. var Router = Backbone.Router.extend({ routes: { '': 'index', 'episodes': 'episodes' }, index: function () { var view = new IndexView(); view.render(); }, episodes: function () { var view = new EpisodesView(); view.render(); } }); var IndexView = Backbone.View.extend({ el: $('#primary'), render: function () { console.log('index view'); } }); var EpisodesView = Backbone.View.extend({ el: $('#primary'), render: function () { console.log('episodes view'); } }); var router = new Router; Backbone.history.start({pushState: true}); I realize that the history object allows forward and backward navigation between pages, which is great. However, the way it's actually implemented seems a little messed up to me. For instance, I created a simple MAMP server to serve an index.html file and the JS file. Navigating to http://backbone:8888/, the console logs index view like I'm telling it to. However, navigating to http://backbone:8888/episodes (by typing it into the address bar) returns a 404. BUT, if I navigate to http://backbone:8888/#episodes, the URL redirects to http://backbone:8888/episodes (without the hashbang) and I get episodes view logged to the console, which obviously means it's hitting that EpisodesView view. From here, I can go back and forth between the index and episodes views. (back hits /, forward hits /episodes). That's all fine and dandy until I hit refresh while on /episodes again. 404... So my question is this: how can Backbone be set up to handle URLs without relying on hashbangs? Everything I've found on the topic says "oh just pushState!". Well, I'm using pushState and, like I described above, you can't hit a URL like /episodes directly without getting a 404.
answer count: 1
downvote count: 0
has title: Backbone router with no hashbangs
has comment: http://stackoverflow.com/comment/43835238
favorite count: 0
tagged with: backbone.js

http://stackoverflow.com/q/27671916
linked to: http://stackoverflow.com/q/17316562
has body: How do you control the attributes, such as position and size, for the "download video as mp4" button that shows up when you embed a youtube video. For example: I checked the google developers page and searched around, but didn't find an answer.
type: Question
tagged with: youtube
answer count: 1
score: 0
tagged with: youtube-api
has title: youtube embedded player download video as mp4 button attributes
tagged with: javascript
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27672120

http://stackoverflow.com/comment/44014385
comment on: http://stackoverflow.com/a/27802613
has text: I haven't used jQuery modal (to my knowledge, or memory), I wasn't sure if `this` would refer to the modal. I have amended the selector in the explained code, though, to try and show the need/use of the context.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43738696
has text: [link](https://wellsfargo.customercarenet.com/ccn/wellsfargo/mymortgage.html#pid=HOME-C) try filling in this web site the form and press login . It wont detect anything you entered
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27661154

http://stackoverflow.com/q/27672717
has title: Flip content of a div on clicking a button
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27672747
upvote count: 5
has answer: http://stackoverflow.com/a/27672746
type: Question
has answer: http://stackoverflow.com/a/27672812
possible better answer: http://stackoverflow.com/a/27672746
tagged with: javascript
tagged with: jquery
score: 4
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27672747
has answer: http://stackoverflow.com/a/27672763
tagged with: css
answer count: 4
has body: I am learning this 3D effect of flipping content of a div. On hover the div code below works perfectly. But What I want is that, if someone only click on the button flip this flipping of div should work. I want this flipping effect only if button is clicked not if hover or anything. lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen This is nice for exposing more information about an image. Any content can go here. Flip
downvote count: 1

http://stackoverflow.com/q/27697594
has comment: http://stackoverflow.com/comment/43808448
accepted answer: http://stackoverflow.com/a/27697654
possible better answer: http://stackoverflow.com/a/27698063
favorite count: 0
has title: Which is the standard in JSON: Objects inside Objects, or Objects inside Array
has comment: http://stackoverflow.com/comment/43808478
downvote count: 1
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
score: -1
type: Question
has body: I've a question, not in how to do something but rather in the "standard" or "accepted" way. Which of this is the preferred one, and why? var data = { employees:{ "John Williams":{ ... }, "Susane Rodgers":{ ... }, "Clint Eastwood":{ ... } } }; var data = { employees:[ { name:"John Williams",... }, { name:"Susane Rodgers",... }, { name:"Clint Eastwood",... } ] };
answer count: 2
has answer: http://stackoverflow.com/a/27697654
has answer: http://stackoverflow.com/a/27698063
upvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/43926835
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27757557
has text: @RolandJansen i fixed both of those and its still not working http://jsfiddle.net/alienc/0eg10fbe/7/
score: 0

http://stackoverflow.com/q/27791386
has body: I was trying to redirect IE8 (and downwards) to a different page. I currently have the following: &lt;!--[if lt IE 9]&gt; &lt;script type="text/javascript"&gt; var oldURL = document.location.href; var code = url.slice(-3); window.location = "http://www.example.com/" + code; &lt;/script&gt; &lt;![endif]--&gt; Of course this works if an IE8 visitor is on the address: http://www.example.com/index.htm#!/ABC but not if they're at: http://www.example.com/index.htm#!/ABC/subpage or http://www.example.com/index.htm#!/ABC/subpage/anotherpage The code I want is always following a #!/ but I cannot control what trails it. I went after some regular expression help here: http://txt2re.com/index-javascript.php3?s=http://www.example.com/index.htm%23!/ABC&amp;18 but the solution seems a bit flakey if the URL structure changes in the future. I expect the output ABC in each of the examples above. What's the next step here? I would like to understand the most stable solution.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27792207
downvote count: 1
type: Question
has title: Regular expression with JavaScript URL redirect
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/43993218
has answer: http://stackoverflow.com/a/27791524
answer count: 2
upvote count: 0
accepted answer: http://stackoverflow.com/a/27792207
possible better answer: http://stackoverflow.com/a/27791524
favorite count: 0
tagged with: regex

http://stackoverflow.com/a/27792435
upvote count: 2
score: 0
has body: refer the below code, call the preventdetfault after the submission $('#tableForm').submit(function (e) { $.ajax({ type: "POST", cache: false, url: $(this).attr('action'), data: $(this).serialize(), succes: function (data) { alert(data); }, error: function (jXHR, textStatus, errorThrown) { alert(errorThrown); } }); e.preventDefault(); });
downvote count: 2
answers question: http://stackoverflow.com/q/27792416
has comment: http://stackoverflow.com/comment/43994488
type: Answer

http://stackoverflow.com/a/27792728
has body: I didn't read everything in detail, but I guess you want to create a new scope to capture the current value of your variable. Functions create scope and an easy way to create and call a function is to use an IIFE: var x = 5; setTimeout((function(y) { // this function is executed immediately and passed the current value of `x` return function () { // this is function that is passed to setTimeout // since every function is a closure, it has access to the IIFE parameter y console.log(y); }; }(x)), 2500); x = 10; See also: JavaScript closure inside loops – simple practical example However, there is an even simpler option: You can bind a specific value to a parameter of a function using .bind: setTimeout(function(y) { console.log(y); }.bind(null, x), 2500); .bind creates a new function and sets this and parameters to the specific values you pass to it.
score: 3
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27792688
has comment: http://stackoverflow.com/comment/43995299
accepted answer of: http://stackoverflow.com/q/27792688
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/43995348

http://stackoverflow.com/a/27729379
has comment: http://stackoverflow.com/comment/43870368
answers question: http://stackoverflow.com/q/27729358
has comment: http://stackoverflow.com/comment/43870290
score: 9
has comment: http://stackoverflow.com/comment/43870301
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43870464
has comment: http://stackoverflow.com/comment/43870470
has comment: http://stackoverflow.com/comment/43870339
has body: Just adding all the steps:- 1). Taking your JSON in a variable. data = {"url":"http://example.com/main.aspx","report_template_id":"1","interval_secs":"86400","analysis_type":"lite","email":"rokumar@example.com","alerts":["num_domains","med_load_time","avg_load_time","tot_req"]}; 2). Parse JSON data to object. Assuming the JSON is a string initially do a typeof(data) to be clear. data = JSON.parse(data); 3) Change list of alerts to comma separated values data.alerts = data.alerts.join(','); 4) Convert back to string data = JSON.stringify(data) So data will look like { "url": "http://example.com/main.aspx", "report_template_id": "1", "interval_secs": "86400", "analysis_type": "lite", "email": "rokumar@example.com", "alerts": "num_domains,med_load_time,avg_load_time,tot_req" } Note:- If you will just say join() then also it will work, because default delimiter is , only, just to clarify I have given that.
type: Answer
has comment: http://stackoverflow.com/comment/43870350
has comment: http://stackoverflow.com/comment/43870412
upvote count: 9
accepted answer of: http://stackoverflow.com/q/27729358
has comment: http://stackoverflow.com/comment/43870288

recursion
type: Tag
tags question: http://stackoverflow.com/q/27736773
tag name: recursion
tags question: http://stackoverflow.com/q/27799052
tags question: http://stackoverflow.com/q/27644192
tags question: http://stackoverflow.com/q/27765321
tags question: http://stackoverflow.com/q/27713045
tags question: http://stackoverflow.com/q/27734341
tags question: http://stackoverflow.com/q/27722890
tags question: http://stackoverflow.com/q/27796754

http://stackoverflow.com/comment/43957388
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27773247
score: 0
has text: Why didn't a local HTTP server work?

http://stackoverflow.com/comment/43761973
type: QuestionComment
comment on: http://stackoverflow.com/q/27673519
score: 1
type: Comment
has text: Please show the relevant code directly in your question. And describe the problem: does your code result in errors shown in the browser dev console, or does your code do *something* but not the *right* thing, or...?

http://stackoverflow.com/comment/43944180
type: AnswerComment
has text: I did however transpose SerializeJson to JsonSerialize by mistake originally
comment on: http://stackoverflow.com/a/27761746
score: 0
type: Comment

http://stackoverflow.com/q/27713911
has title: Set user-agent with selenium-webdriver and phantomjs in nodejs
score: 5
upvote count: 5
tagged with: javascript
accepted answer: http://stackoverflow.com/a/41466705
has body: I need to change the User-Agent of my PhantomJS browser that's driving selenium-webdriver. I've found methods to change the user agent in C#, Ruby and Java This is what I've tried: var webdriver = require('selenium-webdriver'); var useragent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0"; var driver = new webdriver.Builder(). withCapabilities(webdriver.Capabilities.phantomjs("phantomjs.page.settings.userAgent", useragent)). build(); The result on the web server still looks like this: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34
tagged with: user-agent
answer count: 1
downvote count: 0
favorite count: 0
tagged with: node.js
tagged with: selenium-webdriver
has answer: http://stackoverflow.com/a/41466705
tagged with: phantomjs
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/27798576
has body: I am trying to retrieve values from the url and displaying it in my web page using angular JS. what i am doing is 1) saving the entire url to a variable and split it so that i can filter to the value i need. 2) However when there is a space it is shown as %20. i want this %20 to be displayed as space itself. Example : john doe is shown as john%20doe Controller function InboxController($scope, $http, $cookieStore, $location) { $scope.single_mail = function() { var url = $location.url(); var split_url = url.split('='); var mess_id = split_url[1]; var from = split_url[2]; var id_value = mess_id.split('&'); var inbox_id = id_value[0]; var from_value = from.split('&'); $scope.inbox_from = from_value[0]; $scope.single_message = []; $scope.single_message = []; var single_inbox_mail ="https://phoe.manage.com/app/inbox/message.html?contactid="+conId+"&token="+token+"&id="+inbox_id; $http.get(single_inbox_mail).success(function(response) { $scope.single_message = response[0]; }); HTML view {{single_message.subject}} From : {{inbox_from}} {{single_message.body}}
answer count: 2
possible better answer: http://stackoverflow.com/a/27798640
accepted answer: http://stackoverflow.com/a/27798633
favorite count: 0
upvote count: 9
tagged with: angularjs
has title: JavaScript how to replace %20 to space
has answer: http://stackoverflow.com/a/27798633
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27798640
type: Question
score: 9
tagged with: javascript
tagged with: urldecode

http://stackoverflow.com/comment/43719204
comment on: http://stackoverflow.com/q/27650979
type: Comment
type: QuestionComment
score: 2
has text: If it's ajax, you should say so in the question, as Asynchronous Javascript And XML is ... wait for it... asynchronous, and setting global variables is not the solution, as others above have noted.

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/27746941
tags question: http://stackoverflow.com/q/27675968
tags question: http://stackoverflow.com/q/27669347
tags question: http://stackoverflow.com/q/27747765
tags question: http://stackoverflow.com/q/27786513
tags question: http://stackoverflow.com/q/27741403
tags question: http://stackoverflow.com/q/27755735
tags question: http://stackoverflow.com/q/27667155
tags question: http://stackoverflow.com/q/27772737
tags question: http://stackoverflow.com/q/27770941
tags question: http://stackoverflow.com/q/27743649
tags question: http://stackoverflow.com/q/27796008
tags question: http://stackoverflow.com/q/27731561
tags question: http://stackoverflow.com/q/27786616
tags question: http://stackoverflow.com/q/27799281
tags question: http://stackoverflow.com/q/27759753
tags question: http://stackoverflow.com/q/27780176
tags question: http://stackoverflow.com/q/27665505
tags question: http://stackoverflow.com/q/27649397
tags question: http://stackoverflow.com/q/27704406
tags question: http://stackoverflow.com/q/27767782
tags question: http://stackoverflow.com/q/27775222
tags question: http://stackoverflow.com/q/27780802
tags question: http://stackoverflow.com/q/27721666
tags question: http://stackoverflow.com/q/27709714
tags question: http://stackoverflow.com/q/27714541
tags question: http://stackoverflow.com/q/27670843
tags question: http://stackoverflow.com/q/27747899
tags question: http://stackoverflow.com/q/27684579
tags question: http://stackoverflow.com/q/27650584
tags question: http://stackoverflow.com/q/27696201
tags question: http://stackoverflow.com/q/27662098
tags question: http://stackoverflow.com/q/27731255
tags question: http://stackoverflow.com/q/27771920
tags question: http://stackoverflow.com/q/27729492
tags question: http://stackoverflow.com/q/27797434
tags question: http://stackoverflow.com/q/27792947
tags question: http://stackoverflow.com/q/27744823
tags question: http://stackoverflow.com/q/27797392
tags question: http://stackoverflow.com/q/27653396
tags question: http://stackoverflow.com/q/27732055
tags question: http://stackoverflow.com/q/27676896
tags question: http://stackoverflow.com/q/27685744
tags question: http://stackoverflow.com/q/27721801
tags question: http://stackoverflow.com/q/27714886
tags question: http://stackoverflow.com/q/27783426
tags question: http://stackoverflow.com/q/27666569
tags question: http://stackoverflow.com/q/27673036
tags question: http://stackoverflow.com/q/27721359
tags question: http://stackoverflow.com/q/27658259
tags question: http://stackoverflow.com/q/27655818
tags question: http://stackoverflow.com/q/27764318
tags question: http://stackoverflow.com/q/27687714
tags question: http://stackoverflow.com/q/27764949
tags question: http://stackoverflow.com/q/27670522
tags question: http://stackoverflow.com/q/27670193
tags question: http://stackoverflow.com/q/27665129
tags question: http://stackoverflow.com/q/27787387
tags question: http://stackoverflow.com/q/27714959
tags question: http://stackoverflow.com/q/27758312
tags question: http://stackoverflow.com/q/27736808
tags question: http://stackoverflow.com/q/27785518
tags question: http://stackoverflow.com/q/27737453
tags question: http://stackoverflow.com/q/27729475
tags question: http://stackoverflow.com/q/27656139
tags question: http://stackoverflow.com/q/27644085
tags question: http://stackoverflow.com/q/27679904
tags question: http://stackoverflow.com/q/27779859
tags question: http://stackoverflow.com/q/27717325
tags question: http://stackoverflow.com/q/27795631
tags question: http://stackoverflow.com/q/27745687
tags question: http://stackoverflow.com/q/27780281
tags question: http://stackoverflow.com/q/27731687
tags question: http://stackoverflow.com/q/27778433
tags question: http://stackoverflow.com/q/27766900
tags question: http://stackoverflow.com/q/27683042
tags question: http://stackoverflow.com/q/27660729
tags question: http://stackoverflow.com/q/27755506
tags question: http://stackoverflow.com/q/27653139
tags question: http://stackoverflow.com/q/27668973

http://stackoverflow.com/comment/43763853
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27671685
has text: so did u made any change how i fix this
type: AnswerComment

http://stackoverflow.com/q/27741546
has answer: http://stackoverflow.com/a/38098773
has answer: http://stackoverflow.com/a/30048920
has comment: http://stackoverflow.com/comment/43894437
linked to: http://stackoverflow.com/q/1357118
has comment: http://stackoverflow.com/comment/43895776
linked to: http://stackoverflow.com/q/18971284
has comment: http://stackoverflow.com/comment/43895398
has comment: http://stackoverflow.com/comment/43894172
score: 0
answer count: 3
has body: Chrome : Following code is working in Chrome. $('.links').click(function(e) { if(e.which == 2) { console.log(e.which); // prints 2 //e.preventDefault(); //e.stopPropagation(); return false; } }); Firefox : Since above code doesn't catch middle button / mouse wheel click event in firefox, I tried following which is able to catch mouse wheel click event. $('.links').mousedown(function(e) { if(e.which == 2) { console.log(e.which); // prints 2 //e.preventDefault(); //e.stopPropagation(); return false; } }); Above code prints 2. But return false; is not working. When I replaced console.log with alert then it works. But I can't &amp; don't want to use alerts. I tried mouseup, mousewheel events also. But it didn't work. I tried attachEvent also but, I got an error(attchEvent is not a function). I am using below mentioned js files : jQuery-1.10.2.min.js jquery.easyui.min.js jquery-ui.js jquery.ui.core.js You can refer below links for more clarity. jsfiddle.net/nilamnaik1989/vntLyvd2/3 jsfiddle.net/nilamnaik1989/2Lq6mLdp http://jsfiddle.net/nilamnaik1989/powjm7qf/ http://jsfiddle.net/nilamnaik1989/q6kLvL1p/ Following are some good links. But anyhow it doesn't solve my problem. event.preventDefault() vs. return false event.preventDefault() vs. return false (no jQuery) http://www.markupjavascript.com/2013/10/event-bubbling-how-to-prevent-it.html I need your valuable inputs.
has title: e.preventDefault() & return false not working in firefox
has answer: http://stackoverflow.com/a/27741687
has comment: http://stackoverflow.com/comment/43894196
has comment: http://stackoverflow.com/comment/43894973
tagged with: mouseevent
has comment: http://stackoverflow.com/comment/43894271
tagged with: firefox
has comment: http://stackoverflow.com/comment/43895152
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has comment: http://stackoverflow.com/comment/43894420
type: Question

durandal
tags question: http://stackoverflow.com/q/27663011
tag name: durandal
type: Tag
tags question: http://stackoverflow.com/q/27712450
tags question: http://stackoverflow.com/q/27670518
tags question: http://stackoverflow.com/q/27691812

http://stackoverflow.com/q/27671208
answer count: 0
has comment: http://stackoverflow.com/comment/43757199
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43758268
has comment: http://stackoverflow.com/comment/43758525
tagged with: meteor
has comment: http://stackoverflow.com/comment/43757303
has body: I'm using iron router and I simply want to check if there are no users then to route to an install page. One of the problems I'm having is that in my routes.js file located: /client/routes.js the line of code I use to determine that always returns with a length of 0. I can confirm that I have registered a user by simply running the same line in the console: Meteor.users.find().fetch().length // 0 in client/routes.js Meteor.users.find().fetch().length // 1 in console Its a mystery to me. Thanks for any help :) Best,
has title: I have a clear discrepancy between what Meteor.find().fetch().length returns in my meteor code and that from the console?
type: UnansweredQuestion
tagged with: meteor-accounts
has comment: http://stackoverflow.com/comment/43757431
has comment: http://stackoverflow.com/comment/43862116

http://stackoverflow.com/comment/43969290
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27779668
score: 0
has text: you should use `$.get()` instead and set some logic inside success callback

http://stackoverflow.com/a/27788172
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43988262
has body: $('#Spch2TxtArea').val(event.results[i][0].transcript); You had ('#Spch2TxtArea').val($('#Spch2TxtArea').val()+event.results[i][0].transcript); Which means "set the value to that value followed by(+) the transcript
accepted answer of: http://stackoverflow.com/q/27785494
answers question: http://stackoverflow.com/q/27785494
type: AcceptedAnswer

http://stackoverflow.com/q/27795174
has comment: http://stackoverflow.com/comment/44002471
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44005720
score: 0
tagged with: fullpage.js
tagged with: css
has comment: http://stackoverflow.com/comment/44004952
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44008023
has body: I implemented the fullPage.js script for fullpage srolling. The fullpage scroll works fine. However, I'm having an issue with the menubar. I seems to appear behind the sections. Also the links don't seem te be functioning. the html markup for my page looks like this: Adlit Home Nieuws Info Adlit, Een onderzoeksproject rond reclamewijsheid bij minderjarigen Grid Item Lorem ipsum dolor sit amet, elit. Rem, illum. Grid Item With an Image Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem, illum. Wie zijn we Non-profit an public affairs organizations need to communicate their message with a loud and clear voice Wat doen we? You’ll be hard-pressed to find a team more experienced building brands and websites for Democratic political campaigns. We’re design trend-setters and know political tech inside and out. Rapporten en Publicaties We partner with agencies all the time to expand their services for their own clients. We fit in seamlessly. We can also do the same with your startup to get your big idea from “dream” to “reality”. Valorizatie tools We can leverage our extensive experience in design, tech and brand strategy to promote your idea or product. Whether it’s a campaign, an org or you’re just selling a widget, the goal of our services is always the same: to inspire. my styles for the menubar are: nav { margin-top: em(20); margin-right: em(100); float: right; li { float: left; margin-right: em(40); } a { font-weight: 600; color: $dark-gray; &.active { padding-bottom: 2px; border-bottom: 3px solid $light-green; } } } So I'm not sure what's going on. I tried to fix it by changing the z-index of my sections but this doesn't seem to have any affect. The sections appear in front of the menubar. thanks for your help, Anthony
has comment: http://stackoverflow.com/comment/44002136
has title: Fullpage.js works but menubar appears behind sections
has comment: http://stackoverflow.com/comment/44008598
has comment: http://stackoverflow.com/comment/44006581

http://stackoverflow.com/comment/43870812
score: 0
type: Comment
type: QuestionComment
has text: Insert a bigger max value or none at all and check the value yourself.
comment on: http://stackoverflow.com/q/27729624

http://stackoverflow.com/comment/43889284
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27739256
has text: just make an ajax call to autosave on `keyup`. Those boxes are annoying
score: 0

http://stackoverflow.com/q/27792818
has comment: http://stackoverflow.com/comment/43995535
tagged with: angularjs
tagged with: twitter-bootstrap
upvote count: 1
downvote count: 1
tagged with: angularjs-directive
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43995166
type: Question
accepted answer: http://stackoverflow.com/a/27794042
has comment: http://stackoverflow.com/comment/43995867
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43997531
has comment: http://stackoverflow.com/comment/43996041
has body: I have an App for sending emails (using angular and bootstrap). And I have some 1000 email-ids in my db. I want to implement an auto-complete suggestion type of thing in To and CC field( same like Gmail-compose modal box). If any one has an idea please suggest or suggest some links/tutorials for this.
favorite count: 0
has title: auto-complete suggestion for email id using angular js
score: 0
has answer: http://stackoverflow.com/a/27794042
tagged with: email

http://stackoverflow.com/q/27797513
tagged with: cordova
has title: How add dynamically JSON data to the JQuery Mobile List view in PhoneGap application?
has comment: http://stackoverflow.com/comment/44003871
upvote count: 2
score: 0
downvote count: 2
has answer: http://stackoverflow.com/a/27798337
answer count: 1
has body: I am getting JSON data list of collage within given distance in K.M. Now I have to add this collage list to the JQuery Mobile List View. In register page student information will fill. Then after pressing Register button javascript will execute and In Java script we are passing the distance as parameter, On server will fetch list of collage located within given distance. I intentionally did not mentioned longitude and latitude simplify reason. Letter We will pass two parameter current longitude and latitude instead of distance. Now fetched data which will in json formate I have to add this information to page CollageOptions under ul view. Please tell me what should I write inside success: function(response) in javascript. Structure of database is Name : Email: Mobile: Distance: Register Here I have to list list of collage available with in given distance Now suppose distance is 35 k.m. then list of collage will fetch <?php header('Access-Control-Allow-Origin: *');//Should work in Cross Domaim ajax Calling request mysql_connect("localhost","root","1234"); mysql_select_db("foodybuddy"); if(isset($_GET['type'])) { if($_GET['type']=="login"){ $distanceInKM=$_GET['Distance']; $query="Select * from collage where Distance<='$distanceInKM'"; $result=mysql_query($query); $totalRows=mysql_num_rows($result); if($totalRows>0){ $recipes=array(); while($recipe=mysql_fetch_array($result, MYSQL_ASSOC)){ $recipes[]=array('Chef'=>$recipe); } $output=json_encode(($recipes)); echo $output; } } } else{ echo "Invalid format"; }
accepted answer: http://stackoverflow.com/a/27798337
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44004048
has comment: http://stackoverflow.com/comment/44003915
type: AnsweredQuestion
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/27731448
type: Question

http://stackoverflow.com/a/70180892
answers question: http://stackoverflow.com/q/27740692
type: Answer
score: 0
has body: I've encountered similar issues and fixed! my problem is that small files upload is ok, but with large files it stalled for very long time, and from the net-log viewer I found that the full size of the file data actually uploaded but somehow the the tcp connection automatically closed afterwards, then from https://netlog-viewer.appspot.com/#sockets I found that the http request has to go through a proxy sever, so I tested again using firefox with no-proxy setting to bypass, but still unsuccessful, then from the firefox about:networking#dns I found that actually the domain not resolved to the web server directly but resolved to a bunch of ip addresses, it turned out they the WAF, finally I changed the hosts setting point the domain to the web server ip address directly, then the problem gone! so I identified the root cause is the proxy server and waf! they may have some kind of default timeout

http://stackoverflow.com/comment/43919203
has text: You need to add `option` tags in your `select` tags
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27744392
type: Comment

http://stackoverflow.com/a/29214591
has body: I know this is kind of old, but I had the same issue as well. I did not get a resolution, but I asked the author, and he had me do some tests using a non-wordpress html file. Here is his answer: https://github.com/BrowserSync/browser-sync/issues/435#issuecomment-73732362 I am still boggled on why this doesn't work only in Firefox. In chrome, and other browsers, they link through fine. It seems like it's something in firefox though, just don't know what.
answers question: http://stackoverflow.com/q/27761775
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/47858669
upvote count: 1
has comment: http://stackoverflow.com/comment/47845702
downvote count: 0

http://stackoverflow.com/comment/43830003
type: QuestionComment
comment on: http://stackoverflow.com/q/27708688
score: 0
has text: You're assigning an array with a method that contains a callback to `$scope.eventSources` is that intended? Can't you just do `$scope.eventSources = events`?
type: Comment

http://stackoverflow.com/comment/44008817
type: QuestionComment
has text: I just improved the formatting of the result.
comment on: http://stackoverflow.com/q/27799780
score: 0
type: Comment

http://stackoverflow.com/a/27673475
answers question: http://stackoverflow.com/q/27673323
type: Answer
has body: According to MDN "The get syntax binds an object property to a function that will be called when that property is looked up." This means that whenever you try to access fullName of an instance of Name (e.g. person.fullName), javascript will delegate to that getter function, which happens to lie on the Name.prototype object. Additionally, "The set syntax binds an object property to a function to be called when there is an attempt to set that property." So even though are explicitly giving each instance a fullName property, javascript actually looks to that set function on the prototype. If you want to get around this, and have person.hasOwnProperty("fullName") return true, you could do something like this: function Name(first, last) { this.first = first; this.last = last; this.fullName = first + " " + last } Name.prototype.setFullName = function(fullName){ var names = fullName.split(" "); this.first = names[0]; this.last = names[1]; this.fullName = fullName; }; var person = new Name("Foo", "Bar"); // person.fullName = "Foo Bar" person.hasOwnProperty("fullName") // true
score: 0
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/27791709
type: Answer
has body: You need to use javascript if you want the hover event on an element to affect another element that is not a child of the original. CSS .transparent{ opacity: 0 !important; } Edit: You need to make sure to either include the jQuery after the HTML, or wrap it in a ready block. jQuery $(document).ready(function () { $('li:last-child').hover(function () { $('#test').addClass('transparent'); //mouseover }, function () { $('#test').removeClass('transparent'); //mouseout }); });
has comment: http://stackoverflow.com/comment/43999518
answers question: http://stackoverflow.com/q/27791529
score: 0
has comment: http://stackoverflow.com/comment/44008097
has comment: http://stackoverflow.com/comment/43993097

http://stackoverflow.com/comment/43986904
comment on: http://stackoverflow.com/q/27787992
has text: @Djave You would have to loop over the object in your controller with angular.forEach and populate an array with the values you want on each iteration. Then use new array as the object to which you will apply the ng-repeat directive.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43841370
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27714619
has text: @Alnitak I think he's talking about the case `if (deletemode)` returns `true`, which appears to be expected behavior.

http://stackoverflow.com/q/27681949
linked to: http://stackoverflow.com/q/369498
tagged with: framebusting
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/43779001
has title: Anti frame breaker on Firefox and IE
type: Question
linked to: http://stackoverflow.com/q/958997
has comment: http://stackoverflow.com/comment/43778784
has body: Referring to question here The anti frame busting js code works well on Chrome, but it's not working on either Firefox or IE. I think this may be due to the fact that the site I am trying to iframe puts the frame busting code on the top of the page. I am trying and researching to find a way to get around this and here's what I've come with: window.onbeforeunload = function() { window.onbeforeunload = null return "CLICK STAY ON THIS PAGE OF YOU SEE THIS BOX" } Basically this ask the user to click stay on this page and it worked but I am trying to find any better way that doesn't need user interaction. This is not for an evil purpose so try to help with it.
tagged with: javascript
has comment: http://stackoverflow.com/comment/43778590
tagged with: ajax
has comment: http://stackoverflow.com/comment/43779473
has comment: http://stackoverflow.com/comment/43778660
has comment: http://stackoverflow.com/comment/43778820
has comment: http://stackoverflow.com/comment/43778741
type: UnansweredQuestion
tagged with: iframe
linked to: http://stackoverflow.com/q/752465
has comment: http://stackoverflow.com/comment/43779562

http://stackoverflow.com/a/27743256
type: Answer
has comment: http://stackoverflow.com/comment/43897652
has body: You are missing the classname of the group that identifies the collapse, so when you click the first time the action just toggle that classnames. Add this: &lt;div class="collapse in" id="items-list" style="padding-left:32px;"&gt; UpdatedBootply
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/27743168
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27743168
downvote count: 0
has comment: http://stackoverflow.com/comment/43897661

http://stackoverflow.com/a/27714169
type: Answer
has comment: http://stackoverflow.com/comment/43865100
has comment: http://stackoverflow.com/comment/43851587
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/43851277
answers question: http://stackoverflow.com/q/27714053
accepted answer of: http://stackoverflow.com/q/27714053
has body: You need to put your alert code in the AboutUs.html file.
has comment: http://stackoverflow.com/comment/43850837
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43851795

http://stackoverflow.com/q/27716986
has comment: http://stackoverflow.com/comment/43846381
downvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/43845898
upvote count: 0
score: -2
has title: Ajax implementation on table portion of jsp page
tagged with: jsp
tagged with: javascript
has answer: http://stackoverflow.com/a/27717356
tagged with: ajax
has body: I have to implement Ajax on a table,so that I can partially update the table after every ! hour.My JSP code is < head > < meta http - equiv = "Content-Type" content = "text/html; charset=ISO-8859-1" > < title > Insert title here < /title> < body > < jsp: useBean id = "bs" class = "beam_Status.BeamStatus_Bean" > < /jsp:useBean> < br > < h1 > Total Beamlines open are $ { bs.total_Beamopen()} < /h1> BEAMLINE STATUS < /CENTER> BEAMLINES < /h1> < th > < h1 > < b > STATUS < /b> < /th> SYMBOLIC REPRESENTATION < /th> < c: forEach var = "country" items = "${bs.beam_CurrentStatus()}" > < h3 > < b > < c: choose > < c: when test = "${country.value == 'IN OPERATION'}" > < tr > < td class = "green" style = "text-transform: uppercase; " width = "400px" > < center > < h1 > $ { country.key } < /h1> < /td> ${country.value} < /center> < td width = "200px" > < center > < img src = "red.png" align = "middle" width = "100" height = "110" / > < /center> < /tr> </c: when > < c: otherwise > < tr > < td class = "red" style = "text-transform: uppercase; " width = "400px" > < center > < h1 > $ { country.key } < /h1> < /td> ${country.value} < /center> < td width = "200px" > < center > < img src = "green.png" align = "middle" width = "100" height = "110" / > < /center> < /tr> </c: otherwise > < /c:choose> < /h3> </c: forEach > < /table> RIGHT NOW ,WHOLE PAGE IS BEING REFRESHED, AS I HAVE USED. <% response.setIntHeader("Refresh", 5); %> I'm very new to Ajax.Help me on implementing Ajax on it.
answer count: 1
has comment: http://stackoverflow.com/comment/43845907
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/27647387
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/7389069
accepted answer: http://stackoverflow.com/a/27647416
has comment: http://stackoverflow.com/comment/43713036
favorite count: 0
has comment: http://stackoverflow.com/comment/43712514
type: Question
tagged with: reverse
has comment: http://stackoverflow.com/comment/43712546
score: 0
upvote count: 1
answer count: 1
downvote count: 1
has title: reverse() on json obj array
has answer: http://stackoverflow.com/a/27647416
has body: why my json array is not reversing ? var arr = [{"myId":"7d8f72c3f070736caf399df0a8211f5ei324410"}, {"myId":"963d01cfa92a4f9d3cb755c7d3822e68i1744695"}, {"myId":"5994f40a1b2fd9ff69d4e4551d18766ci2977900"}, {"myId":"25bb4db94056ec38ba7ed1ee96e90006i2956275"}, {"myId":"7720ec9200d5a6f5d16a447bc5ff7f2ci1080950"}, {"myId":"f8a21d90a3adb464e7c3782471e1455bi3087305"}]; console.log(arr); arr.reverse(); console.log(arr); // not reversing :-( Can anyone suggest me why my array is not reversing ? http://jsfiddle.net/rkq8cxma/
has comment: http://stackoverflow.com/comment/43712886
type: AnsweredQuestion
tagged with: arrays

http://stackoverflow.com/q/27759875
type: AnsweredQuestion
has title: Socket.io with two node apps?
type: Question
has body: I am serving my main website with express and node.js, this gives me tremendous flexibility with my site. I also have a back end app which runs on a separate node.js server, I think I may consider just combining it all into one, that strikes up some problems though and I like them being abstracted. The only real issue I have had is socket.io communication between the two. On the front end site, a user can login/signup to the site and has access to a chat box that has limited features, just limited to a quick chat module. The user object and any messages are sent to the same DB as the backend app, so the two share the same data, but the real time events don't work as both are loading different client side scripts. So my question is what should I do to allow the two node.js servers/clients communicate with websocket events? I tried within my site loading the socket.io script from my app &lt;script src="http://app.example.com/socket.io/socket.io.js"&gt;&lt;/script&gt; for some reason I get // adds :3000 ?? GET http://app.example.com:3000/socket.io/1/?t=1420321032701 net::ERR_CONNECTION_REFUSED
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27759979
accepted answer: http://stackoverflow.com/a/27759979
tagged with: sockets
tagged with: node.js

http://stackoverflow.com/comment/43991672
has text: It does and song plays.
score: 0
comment on: http://stackoverflow.com/q/27790666
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43901521
type: AnswerComment
type: Comment
has text: @Shomz OK, `c` now references the same function object as `a` does.
comment on: http://stackoverflow.com/a/27745240
score: 0

http://stackoverflow.com/q/27787033
type: Question
has title: AngularJS form validation not showing up
tagged with: angularjs
score: 0
has answer: http://stackoverflow.com/a/27788636
answer count: 1
has comment: http://stackoverflow.com/comment/43986647
has comment: http://stackoverflow.com/comment/43984519
type: UnansweredQuestion
tagged with: validation
tagged with: javascript
has body: I am unable to populate error messages with the following AngularJS form validation code. Its a nested loop where I am trying to validate the drop down box containing questions and its corresponding answers can be validated. Following is a code sample: HTML Choose a question Answer: Answer is a mandatory field. Please enter the answer Maximum 50 characters are allowed JS app.controller('Contract', ['$scope', function($scope) { $scope.answers = []; $scope.randomQuestionList = [ { "questionList": [ { "questionDes": "What is the first name of the person you first kissed?", }, { "questionDes": "Where were you when you had your first kiss?", } ] }, { "questionList": [ { "questionDes": "What was the name of your elementary / primary school?", }, { "questionDes": "What was your favorite place to visit as a child?", } ] } ]; }]);

http://stackoverflow.com/q/27697313
possible better answer: http://stackoverflow.com/a/27697359
accepted answer: http://stackoverflow.com/a/27697367
favorite count: 0
has answer: http://stackoverflow.com/a/27697359
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/43807877
has answer: http://stackoverflow.com/a/27700169
tagged with: dom
has title: Trouble with "mouseup" once DOM has been updated
has answer: http://stackoverflow.com/a/27697367
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/16062899
has comment: http://stackoverflow.com/comment/43807891
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I am writing a function that will be triggered every time I release the mouse(mouseup) from a inside a table row. This is accomplished using jquery: $('textarea').mouseup(function (e){ ...code }); Everything works fine except for when I add a new row to the table. Once I add the new row, i seems that the mouseup event is not detected. See the code in the link and do the following: 1. Write some text in the Col2 or Col3 2. Highlight the text. Expected: An alert will be shown with the text. 3. Press Add Row button, write something and highlight the text. The expected alert is not shown. JsFiddle Thanks!
score: 1

http://stackoverflow.com/q/27707377
tagged with: jquery
has title: css animation works just once in FF and works fine other webkit browsers(like Chrome etc)
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43826753
has comment: http://stackoverflow.com/comment/43826821
answer count: 0
downvote count: 0
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/43826708
score: 1
has body: I have two css classes called slideLeft and slideRight. I am adding them dynamically using jquery like the code below for jquery. but animation just takes effect only once in FF while works completely as expected in webkit browsers. Here is the Fiddle(try this in FF and Chrome) I have the following html: LOGIN | REGISTER Name: Email: Password: Register Email: Password: Login and my jquery: $('#login').css('color', '#000'); $('#register').on('click', function(){ $('#register').css('color', '#000'); $('.login').removeClass('slideRight'); $('.login').hide(); $('.register').addClass('slideRight'); $('.register').show(); $('#login').css('color', '#006699'); }); $('#login').on('click', function(){ $('#login').css('color', '#000'); $('.register').removeClass('slideLeft'); $('.register').hide(); $('.login').addClass('slideLeft'); $('.login').show(); $('#register').css('color', '#006699'); }); and my css: .slideLeft{ animation-name: slideLeft; -webkit-animation-name: slideLeft; animation-duration: 1s; -webkit-animation-duration: 1s; animation-timing-function: ease-in-out; -webkit-animation-timing-function: ease-in-out; visibility: visible !important; } @keyframes slideLeft { 0% { transform: translateX(150%); } 50%{ transform: translateX(-8%); } 65%{ transform: translateX(4%); } 80%{ transform: translateX(-4%); } 95%{ transform: translateX(2%); } 100% { transform: translateX(0%); } } @-webkit-keyframes slideLeft { 0% { -webkit-transform: translateX(150%); } 50%{ -webkit-transform: translateX(-8%); } 65%{ -webkit-transform: translateX(4%); } 80%{ -webkit-transform: translateX(-4%); } 95%{ -webkit-transform: translateX(2%); } 100% { -webkit-transform: translateX(0%); } } /* ============================================== slideRight ============================================== */ .slideRight{ animation-name: slideRight; -webkit-animation-name: slideRight; animation-duration: 1s; -webkit-animation-duration: 1s; animation-timing-function: ease-in-out; -webkit-animation-timing-fun…
upvote count: 1
has comment: http://stackoverflow.com/comment/43827015
tagged with: javascript

http://stackoverflow.com/comment/43832459
score: 0
has text: Yes, with the condition that each of the model in your collection does has a valid Id property (usually the Id is null for a new model, and expecting the server-end to provide a new Id after saving the model via REST). the `get` on the collection is to get the model from the collection using the Id [backbone doc](http://backbonejs.org/#Collection-get)
comment on: http://stackoverflow.com/a/27709395
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/43757889
has text: When you do it, make it as user-friendly as possible :-). Glad to be of service.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27671464

http://stackoverflow.com/a/27762956
upvote count: 1
has comment: http://stackoverflow.com/comment/43936916
type: AcceptedAnswer
downvote count: 0
has body: You could modify the function as below to simultaneously alert the description as well as the phone info. $(document).on('click','#saveRecord',function() { var contact = $("input[name=studentContactDesc]"); var phone = $("input[name=studentContactPhone]"); for(var i=0;i&lt;contact.length;i++){ alert(contact[i].value); alert(phone[i].value); } });
type: Answer
accepted answer of: http://stackoverflow.com/q/27762864
answers question: http://stackoverflow.com/q/27762864
score: 1

http://stackoverflow.com/comment/43733356
has text: `hasOwnProperty([i]['sidebar'])` won't work. That doesn't resolve to a string
score: 2
comment on: http://stackoverflow.com/q/27658787
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27674823
tagged with: reactjs
accepted answer: http://stackoverflow.com/a/27691030
tagged with: javascript
tagged with: mouseevent
has comment: http://stackoverflow.com/comment/43798044
score: 2
answer count: 1
downvote count: 0
has title: Reactjs, Rxjs and mouse events
tagged with: rxjs
favorite count: 0
has comment: http://stackoverflow.com/comment/43797234
has answer: http://stackoverflow.com/a/27691030
has comment: http://stackoverflow.com/comment/43794833
type: AnsweredQuestion
upvote count: 2
has body: I'm trying to piece together a draggable component using Rx and React using various articles, examples etc. (First time I've tried using Rxjs). So far, my code is var Draggable = React.createClass({ getInitialState: function () { return { x: 0, y: 0 } }, componentDidMount: function () { var dragTarget = $(this.getDOMNode()) this.mouseup = Rx.Observable.fromEvent(dragTarget, 'mouseup') this.mousemove = Rx.Observable.fromEvent(document, 'mousemove') this.mousedown = Rx.Observable.fromEvent(dragTarget, 'mousedown') this.mousedrag = this.mousedown.flatMap(function(md){ var startX = md.offsetX var startY = md.offsetY return this.mousemove.map(function(mm) { mm.preventDefault() return { x: mm.clientX - startX, y: mm.clientY - startY } }).takeUntil(this.mouseup) }) console.log(dragTarget) console.log(this.mouseup) console.log(this.mousemove) console.log(this.mousedown) console.log(this.mousedrag) this.subscription = this.mousedrag.subscribe(function(pos){ &lt;= Error here - No Listener Found console.log(pos) this.setState({ x: pos.x, y: pos.y }) this.props.onDrag(pos) }) }, render: function () { console.log("render:"+ this.state.x) console.log("render:"+ this.state.y) // transferPropsTo will merge style &amp; other props passed into our // component to also be on the child DIV. return this.transferPropsTo(React.DOM.div({ style: { position: 'absolute', left: this.state.x + 'px', top: this.state.y + 'px' } }, this.props.children)) } }) Now I'm not sure if I've even architected this correctly. What I am finding is that Rx is failing with a No Listener Found error on the mousedrag.subscribe line during the call to subscribe. The Console.log tells me that mouseup, mousemove and mousedown all have undefined sources - but I'm not sure why since the dragTarget is correctly - apparently - set to the DOM element underlying this component or at least a DOM element (see here for the example I've drawn from). Now I'm not sure where the problem resides. I tended to think that the compon…
type: Question

http://stackoverflow.com/q/27740712
tagged with: javascript
tagged with: jquery
has body: I have the following setup for a community website: Friend Requests getRequests.js appends the following into the container div: Random Guy Accept Deny friendResponse.js has the following: $(function(){ $(".accept").click(function(){ var id = $(this).attr("data-id"); $("#"+id).remove(); }); }); So, you would expect that when I click the accept button, the container with id=1 should get removed, but for some reason, it doesn't. And also, to add to the peculiarity, the code works if I inject it through the console. And, for the record, the script is not showing any errors.
tagged with: ajax
duplicate of: http://stackoverflow.com/q/203198
accepted answer: http://stackoverflow.com/a/27740776
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: JQuery script wont work
has comment: http://stackoverflow.com/comment/43892428
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27740776
has comment: http://stackoverflow.com/comment/43892265
has comment: http://stackoverflow.com/comment/43892479
type: Question
has comment: http://stackoverflow.com/comment/43892419
linked to: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/43892430
answer count: 1

http://stackoverflow.com/q/27691088
answer count: 1
tagged with: kendo-ui
tagged with: angularjs
tagged with: telerik
has answer: http://stackoverflow.com/a/27693333
has title: Disparity between Mobile Tabstrip and Angular Form
type: UnansweredQuestion
type: Question
tagged with: kendo-mobile
tagged with: javascript
score: 0
has body: For Kendo Mobile TabStrip demos taken from the Kendo UI site, the default sample mobile tab is the following markup: foo bar baz But the AngularJS equivalent is: Why the disparity between formats?

http://stackoverflow.com/comment/43752258
comment on: http://stackoverflow.com/a/27668739
score: 0
type: AnswerComment
type: Comment
has text: Thanks, I have been using Google Apps Scripts to add data to the spreadsheets, but I didn't know about URL Fetch Service. I will check it out. Thanks

http://stackoverflow.com/a/27698838
answers question: http://stackoverflow.com/q/27698532
score: 0
type: Answer
has body: I think that you should store the image file reference in a data attribute, and then pass the attribute to your function. I haven't check the formatting of this In your php stuff you could have hidden id like below called hiddendiv with no content, you can then create a data attribute for this div with the reference to your image file. if you also create a class you can reference all items in the class with the same data, by just passing the image file reference to the class. &lt;div id="hiddendiv" data-image="&lt;?php bloginfo('template_url '); ?&gt;/img/"&gt;&lt;/div&gt; Then on page load look at the data-image attribute of the "hiddendiv" element .

http://stackoverflow.com/comment/43753116
score: 0
type: Comment
has text: Thanks a lot, I followed the first approach and it works great. Additionaly, I used [these examples](https://docs.angularjs.org/api/ng/service/$q) to modify `verifyAccess()` so that it returns a promise.
type: AnswerComment
comment on: http://stackoverflow.com/a/27659329

http://stackoverflow.com/q/27802453
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27802565
has title: Focus on first form element, whatever it may be. jQuery dialog
answer count: 5
has answer: http://stackoverflow.com/a/27802613
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27802565
type: Question
has body: I have a jQuery modal dialog, when it opens I want it to focus on the first form element. At the moment I have this: the_dialog.dialog({ modal: true, width: 700, title: 'title', close: suicide , open: function(event, ui) { setTimeout(function() { jQuery('#').focus(); <-- VERY SPECIFIC CSS SELECTOR PERHAPS? }, 220); } } ); My problem is that the this dialog is called from a few different places in my application and the first form element can sometimes be an input or sometimes be a select. The layout of the form is always the same, only the first form element is subject to change. LABEL FIRST FORM ELEMENT LABEL LABEL LABEL Without adding any CLASSes or IDs, when the form opens, can I focus on the FIRST FORM ELEMENT, whatever it may be?
has answer: http://stackoverflow.com/a/27802514
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/27802569
has comment: http://stackoverflow.com/comment/44013801
tagged with: forms
score: 0
possible better answer: http://stackoverflow.com/a/27802514
has answer: http://stackoverflow.com/a/27802510

http://stackoverflow.com/q/27748016
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27748056
type: Question
has title: JQuery ScrollLeft with easing
duplicate of: http://stackoverflow.com/q/12592279
has body: I am trying to scrollLeft with an easing applied. It scrolls just fine if I took out the ease $("#content").animate({ scrollLeft: '+=' + $(window).width() }, "slow"); But when I try to add an easing to the animation $("#content").animate({ scrollLeft: '+=' + $(window).width() }, "slow", "easeInOutBounce"); I get an error that looks like: TypeError: m.easing[this.easing] is not a function Any help would be appreciated
has answer: http://stackoverflow.com/a/27748048
score: 0
has answer: http://stackoverflow.com/a/27748062
tagged with: javascript
has comment: http://stackoverflow.com/comment/43907211
tagged with: jquery
tagged with: jquery-easing
answer count: 3
linked to: http://stackoverflow.com/q/12592279

http://stackoverflow.com/a/27726821
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: Try this $('.myClass').click( function(){ $(this).css('width', '30%'); // or $(this).css('width', '30% !important'); }) In your code there are two mistakes 1. $('this') should be $(this) 2. $('this').css("width: 30% !important"); should be $('this').css("width", "30% !important"); if you want change more than one option you can do it like this $(this).css({backgroundColor: "green", borderColor: "black", borderWidth: "30px"}); // or $(this).css({'background-color': "green", 'border-color': "black", 'border-width': "30px"}); $.css - on this page you can find good explanation about $.css syntax
type: Answer
accepted answer of: http://stackoverflow.com/q/27726806
score: 2
answers question: http://stackoverflow.com/q/27726806

http://stackoverflow.com/comment/43770195
has text: what you mean when try pass to `setTimeout` negative interval like `-20*degrees`?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27677861

http://stackoverflow.com/q/27780802
tagged with: jquery
score: 4
favorite count: 0
has answer: http://stackoverflow.com/a/27780889
has answer: http://stackoverflow.com/a/27781057
accepted answer: http://stackoverflow.com/a/27780944
tagged with: http://stackoverflow.com/tag/html
has body: I have made an imagebox, that when you click on it, a textbox slides down with the slideToggle effect. When i click on the box again to close the textbox, the slideToggle works. But when the text has slid down, i put a fa-angle-up fontawesome icon in the textbox, so visitors can close the textbox, instead of having to press on the imagebox again. Here is my fiddle. Now i can't seem to figure out how to make the fa-angle-up icon working. If i need to give more information i'm glad to help ofcourse. i have tried this code, but nothing is happening: (function($) { $('.popup_trigger').on('click', function(e, ui) { $('.popup_community', $(this).parent('.wrapper_community')).slideToggle('slow'); e.preventDefault(); }); $('.fa-angle-up').on('click', function(e, ui) { $('.popup_community', $(this).parent('.wrapper_community')).slideUp('slow'); e.preventDefault(); }); })(jQuery);
tagged with: css
has title: slideUp on fontawesome icon in slideToggle
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27780944
type: Question
upvote count: 4
answer count: 3
downvote count: 0
possible better answer: http://stackoverflow.com/a/27780889
tagged with: javascript

http://stackoverflow.com/q/27709746
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43832254
favorite count: 0
type: UnansweredQuestion
has body: html code Item Cost Item 1 Item 2 Item 3 Item 4 Item 5 Total 0 jquery code $('body').on('keyup','.elm',function(){ var sum = 0; $('.elm').each(function() { if($(this).val() != '' && !isNaN($(this).val())){ sum += parseInt($(this).val()); } }); $('#total').text(sum); }) i used this code but this is only for 5 inputs .But i need a program which adds unlimited number of user input values dynamically and calculate its output sum automatically and also alert the user if user enters other than number.what is the modification i have to do in this code please help me.thank you in advance.
has comment: http://stackoverflow.com/comment/43832327
has answer: http://stackoverflow.com/a/27709943
has comment: http://stackoverflow.com/comment/43831449
has comment: http://stackoverflow.com/comment/43831380
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43832526
tagged with: javascript
tagged with: jquery
has title: find sum of numbers automatically as user inputs values dynamically irrespective of number of inputs.talert user if user enters other than numbers
has answer: http://stackoverflow.com/a/27709878
has comment: http://stackoverflow.com/comment/43831419
has comment: http://stackoverflow.com/comment/43831388
has comment: http://stackoverflow.com/comment/43832042

http://stackoverflow.com/comment/43780799
score: 0
type: Comment
type: QuestionComment
has text: @Ojay: The HTML is still a mess. There is a close form tag with no open form tag, there's an extra close div tag, and a main.js script is referenced that does not exist on that server.
comment on: http://stackoverflow.com/q/27681323

http://stackoverflow.com/a/27728797
upvote count: 3
has body: Demo HTML &lt;input type="text" id="datepicker" style="visibility:hidden"&gt; &lt;div class="date"&gt; &lt;h4&gt; Fri Nov 28 &lt;/h4&gt; &lt;/div&gt; Jquery $(function() { $("#datepicker").datepicker(); }); $('#datepicker').on('change', function() { $('h4').html($('#datepicker').val()); }); $('.date').on('click', function() { $('#datepicker').datepicker("show"); });
downvote count: 0
answers question: http://stackoverflow.com/q/27728734
score: 3
has comment: http://stackoverflow.com/comment/43869391
type: Answer
has comment: http://stackoverflow.com/comment/43869364

http://stackoverflow.com/q/27654052
answer count: 1
has title: Looping over an ArrayController fails as it is not an Array even though the Controller has the correct model with data
tagged with: ember.js
accepted answer: http://stackoverflow.com/a/27654890
tagged with: ember-controllers
type: AnsweredQuestion
has body: I am attempting to use an ArrayController to handle displaying some data that will be swapped out on user clicks. I currently get this error, Uncaught Error: Assertion Failed: The value that #each loops over must be an Array. You passed App.CurrentListController but If I look at Ember Inspector I can see the CurrentListController and it has the model and the data in it. Basically the Stat page lets you see a bunch of stats and clicking on a specific stat pops up a modal and shows all the record that relate to that stat. If I just store the records on the StatController it works fine but then I cant sort/filter using the ArrayController. So it all works except for when I try and display the contents of CurrentListController it freaks out. Thanks for any help or direction. CurrentListController: App.CurrentListController = Ember.ArrayController.extend({ sortProperties: ['name'], //Initial sort column. sortAscending: true, }); StatController: App.StatController = Ember.ObjectController.extend({ needs:['currentList'], currentList:[], actions: { viewBusiness: function(ids) { console.log(ids) var self = this console.log(this.get('controllers.currentList').get('sortProperties')) this.store.findByIds('business', ids.split(",")).then( function(results) { $('#editModal').modal('show'); //self.set('currentList', results.sortBy(["name"])) self.get('controllers.currentList').set('model', results) console.log(self.get('controllers.currentList').get('arrangedContent')) }); }, sortBy: function(prop){ var clController = this.get('controllers.currentList') clController.set('sortProperties', prop) clController.set('sortAscending', !clController.get('sortAscending')); } } }); Stat Template: {{#each business in App.CurrentListController}} {{business.name}} {{business.city}} {{business.state}} {{business.zip}} {{business.numVendors}}{{/link-to}} {{business.numClients}}{{/link-to}} {{/each}}
tagged with: javascript
has answer: http://stackoverflow.com/a/27654890
type: Question
score: 0

http://stackoverflow.com/a/27693598
score: 2
upvote count: 3
downvote count: 1
has body: you have to download jQuery first jQuery after you have downloaded jquery.js put it in the directory where you html file is located and in the &lt;head&gt; element of you html write &lt;script src = 'jquery.js' &gt;&lt;/script&gt;
has comment: http://stackoverflow.com/comment/43800280
answers question: http://stackoverflow.com/q/27693573
type: Answer

http://stackoverflow.com/q/27693904
tagged with: mongodb-query
upvote count: 1
has body: I am new to MongoDB, so far playing around with it, confronted with a problem, here i am having a hard time when trying to append multiple objects inside Schema-Less Array.So far i tried $push to append multiple objects inside array but got a Mongo Error. [MongoError: Can't use $push/$pushALL within non-array i don't know why i am getting this error, when using $push with array Schema: EventTypeSchema = new Schema(){ type: String, eventID: { type: Schema.Types.ObjectId, ref: 'User' } } PersonSchema = new Schema(){ PersonID: { type: Schema.Types.ObjectId, ref: 'User' } Invitation: [ ] //Schema-less } In Controller i have Access to both EventType and Person Model Controller: exports.update = function(req,res){ var event = new EventType(); event.type = 'EVENT'; event.eventID = req.body.eventid; var query = {'PersonID': req.body.personid}; var update = {$push:{'Invitation': event}}; Person.update(query,update,function(err,user){...}) }; for debugging purposes i tried to give Mixed type Schema for Array but didn't get it to work PersonSchema = new Schema(){ PersonID: { type: Schema.Types.ObjectId, ref: 'User' } Invitation: [ { type: Schema.Types.Mixed } ] } When i removed $push on update then only whole event object is getting inside Invitation, the reason i created Schema-less array is because i am dealing with different type of invitation, here i just described about event invitation, otherwise there are different type of invitations i am dealing with like, User Invitation for request, Conference invitation, so there would combination of different objectId's, i think there should be the way to append to schema-less array in mongoDB. EDIT: The following is what I came up with. Not able to get it to work though. function PortalTypes() { Schema.apply(this,arguments); this.add({ object_type: String, }); } util.inherits( PortalTypes, Schema ); var userType = new PortalTypes({ ID : { type: Schema.Types.ObjectId, ref : 'User' } }); var eventType = new PortalTypes({ ID : { typ…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43812785
score: 1
accepted answer: http://stackoverflow.com/a/27698285
type: Question
tagged with: mongodb
answer count: 1
downvote count: 0
tagged with: mongoose
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43801144
has title: Append inside Schemaless Array
has answer: http://stackoverflow.com/a/27698285
tagged with: node.js

http://stackoverflow.com/a/27788615
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43987597
has body: Get rid of the inline event handlers and use: $('.navigateTest').click(function () { alert("test called"); var serviceID = $(this).attr('id'); alert("serviceID :: " + serviceID); }) Column1 Column2 Row1 - Data1 Row1 - Data2 Row2 - Data1 Row2 - Data2
answers question: http://stackoverflow.com/q/27788570

http://stackoverflow.com/a/27762908
answers question: http://stackoverflow.com/q/27759196
type: Answer
has comment: http://stackoverflow.com/comment/43943306
has body: The problem is that you don't handle async request properly, so: $scope.feeds = []; console.log('TEST : Load feeds async'); FeedList.get().then(function () { // each feed comes as argument angular.forEach(arguments, function (feed) { $scope.feeds.concat(feed); // merge arrays }); window.localStorage.setItem('savedData', JSON.stringify($scope.feeds)); console.log('TEST : ' + window.localStorage['savedData']); console.log('TEST : ' + JSON.parse(window.localStorage.getItem('savedData'))); console.log('TEST : ' + JSON.parse(window.localStorage['savedData'])); }); Service: .service('FeedList', function ($q, $rootScope, FeedLoader) { this.get = function () { var promises = []; // to handle async loading var feedSources = [{ title: 'rss1', url: 'http://www.website.com/rss/feed/rss_feed_25300' }, { title: 'rss2', url: 'http://www.website.com/rss/feed/rss_feed_10720' }]; angular.forEach(feedSources, function (source) { var defer = $q.defer(); FeedLoader.fetch({ q: source.url, num: 10 }, {}, function (data) { var feed = data.responseData.feed; defer.resolve(feed.entries); // todo - need to handle errors with 'defer.reject' }); promises.push(defer.promise); }); return $q.all(promises); }; })
score: 0

http://stackoverflow.com/a/27784403
has comment: http://stackoverflow.com/comment/43978894
has comment: http://stackoverflow.com/comment/43978827
has comment: http://stackoverflow.com/comment/43979266
type: Answer
has comment: http://stackoverflow.com/comment/43978754
has comment: http://stackoverflow.com/comment/43978850
score: 7
has comment: http://stackoverflow.com/comment/43978664
has comment: http://stackoverflow.com/comment/43978753
upvote count: 7
has body: JavaScript is call/assign by value (more specifically, call/assign by sharing) I.e. when you assign a variable to another variable, the value of the variable is copied. Assigning a new value to a variable never changes the value of another variable. There is no implicit link between them. A bit more visual: Assuming that b holds the value v, then after a = b, we have b -&gt; v a -&gt; v You seem to think that we have a -&gt; b -&gt; v instead, which is not the case. In your example: c = a; // c now holds the value 1 a = b; // a now holds the value 2 b = c; // b now holds the value 1
has comment: http://stackoverflow.com/comment/43978862
has comment: http://stackoverflow.com/comment/44002703
accepted answer of: http://stackoverflow.com/q/27784370
has comment: http://stackoverflow.com/comment/43978864
has comment: http://stackoverflow.com/comment/43979964
answers question: http://stackoverflow.com/q/27784370
has comment: http://stackoverflow.com/comment/43978883
has comment: http://stackoverflow.com/comment/43978816
has comment: http://stackoverflow.com/comment/43978688
has comment: http://stackoverflow.com/comment/43978780
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43978929
has comment: http://stackoverflow.com/comment/43978708

http://stackoverflow.com/q/27715481
tagged with: audio
has answer: http://stackoverflow.com/a/27715870
has title: detect audio data peaks using waveform image (not using web audio)
score: 1
type: Question
has body: I was reading G. Skinner's take on using an image to detect volume peaks in order to create a custom visualizer display for audio and was wondering If anyone ever tried it using waveform images( like from soundcloud) to detect the peaks( volume/ amplitude/ frequency or whatever the term is) from an audio file. I want to use this as an alternative to using the Web Audio API which is a bit more tedious if you ask me and not supported in older devices( android 4.0). Is there a way to process the colour data from a waveform image that can use to simulate such tasks?
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/q/27694320
has comment: http://stackoverflow.com/comment/43802022
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/27695474
type: Question
upvote count: 2
possible better answer: http://stackoverflow.com/a/27695378
has body: I have create a small plugin that customize select menu. I have to implement search functionality in that dropdown. However I have add the functionality but sometimes it is not giving correct result for example. if you type 'a' in input box then it should display result as given below but my plugin is giving result below. It is also replacing uppercase letter with lowercase. I am trying to solve this but could not getting any idea to fix it. fiddle searchItem: function () { var patt = new RegExp(this.value, 'gi') var val = this.value; $('#options li').each(function () { if (!patt.test($(this).text())) { $(this).hide(); } else { $(this).show(); apply.highlight.call(this, val); } }); $('#options h2').each(function () { if (!patt.test($('label', this).text())) { $(this).hide(); } else { $(this).show(); apply.highlight.call(this, val) } }); }
tagged with: javascript
has answer: http://stackoverflow.com/a/27860835
tagged with: jquery
has answer: http://stackoverflow.com/a/27695474
answer count: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has title: .test in javascript not working as per expectation
favorite count: 0
has answer: http://stackoverflow.com/a/27695378
tagged with: regex
has comment: http://stackoverflow.com/comment/43802014

http://stackoverflow.com/q/27656184
has comment: http://stackoverflow.com/comment/43979945
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27656580
type: Question
accepted answer: http://stackoverflow.com/a/27656580
has comment: http://stackoverflow.com/comment/43729314
has comment: http://stackoverflow.com/comment/43728749
tagged with: javascript
has body: I am trying to pull in vars from a config file to display in a template. Below are my files related.. index.php <?php //Setting up important stuff require_once('class/template.class.php'); define('INCLUDES_PATH', 'includes'); require_once(INCLUDES_PATH.'/config.php'); require_once(INCLUDES_PATH.'/css.php'); require_once(INCLUDES_PATH.'/js.php'); define('TEMPLATES_PATH', 'templates'); define('PARTIALS_PATH', TEMPLATES_PATH.'/partials'); //Instanciate new object $template = new Template(TEMPLATES_PATH.'/index.tpl.php'); //Assign values $template->assign('title', 'Home'); $template->assign('content', '<?php echo $script; ?> TEST'); $template->assign('footer', 'This is my Footer'); //Use a Partial $template->renderPartial('table_here', PARTIALS_PATH.'/table.part.html', array('username' => 'Blood_Wolf89', 'age' => 25)); //Showing content $template->show(true); ?> template.class.php <?php class Template { private $assignedValues = array(); private $partialBuffer = ''; private $tpl = ''; function __construct($_path = ''){ if(!empty($_path)){ if(file_exists($_path)){ $this->tpl = file_get_contents($_path); }else{ echo "Template Error: Base File Inclusion Error. File: '$_path' "; } } } function assign($_searchString, $_replaceString = ''){ if(!empty($_searchString)){ $this->assignedValues[strtoupper($_searchString)] = $_replaceString; } } function renderPartial($_searchString, $_path, $_assignedValues = array()){ if(!empty($_searchString)){ if(file_exists($_path)){ $this->partialBuffer = file_get_contents($_path); if(count($_assignedValues) > 0){ foreach ($_assignedValues as $key => $value){ $this->partialBuffer = str_replace('{'.strtoupper($key).'}', $value, $this->partialBuffer); } } $this->tpl = str_replace('['.strtoupper($_searchString).']', $this->partialBuffer, $this->tpl); $this->partialBuffer = ''; }else{ echo "Template Error: Partial Inclusion Error. File: '$_path' "; } } } function show($debug = false){ if(count($this->assignedValues) > 0){ foreach ($this->assigned…
score: 0
has comment: http://stackoverflow.com/comment/43728569
has title: How can I get a $var from a config file to display in my template?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/43728387
has comment: http://stackoverflow.com/comment/43728957
tagged with: php

http://stackoverflow.com/q/27795256
linked to: http://stackoverflow.com/q/8890524
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43999699
possible better answer: http://stackoverflow.com/a/27795523
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43999451
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/27795523
has body: I had an array like the following var a = [ { "start":"2015-01-12T00:00:00.000Z", "allDay":false, "promotion_option":"banner" }, { "start":"2015-01-13T00:00:00.000Z", "allDay":false, "promotion_option":"banner" } ]; And I post that object of array like the following using JQuery Ajax $.ajax({ type: method, url: url, data: a, success: function(res) { var message = res.mesg; if (message) { $('.flash').html(message).fadeIn(300).delay(250).fadeOut(300); }; } }); In my controller when I try dd(Input::all()), it's just return array(1) { ["undefined"]=&gt; string(0) "" } So, How I can get the value of what I had posted?
has answer: http://stackoverflow.com/a/27795533
accepted answer: http://stackoverflow.com/a/27795533
has title: How I can post JavaScript array to Laravel's Controller using jquery
tagged with: laravel

http://stackoverflow.com/comment/43983210
type: Comment
type: QuestionComment
has text: Why didn't you just edit your [previous question](http://stackoverflow.com/q/27786128/1169519)?
comment on: http://stackoverflow.com/q/27786592
score: 0

graphics
tag name: graphics
type: Tag
tags question: http://stackoverflow.com/q/27792463

http://stackoverflow.com/comment/43720447
comment on: http://stackoverflow.com/q/27651598
type: Comment
type: QuestionComment
score: 0
has text: thank you @adeneo for the great topic link.... I will restructure my code

http://stackoverflow.com/comment/43938158
type: AnswerComment
comment on: http://stackoverflow.com/a/27758866
type: Comment
has text: Thanks a lot. The above code is really fast compared to what I was implementing in JavaScript. But, can you tell me how I can do this with datalist. I am trying this code, ` ` But, I am not getting the desired result. In browser source I can see datalist is getting repeated.
score: 0

http://stackoverflow.com/q/27800493
type: Question
has body: Issue: When I use btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click, btnSearchTop.Click the code works perfectly and ignores any 'shown' values that there by default to help users i.e. in the 'street' box it says 'street'. However when I run btnRiskRating_Click(sender As Object, e As CommandEventArgs) it being in these values so I end up with a search that has the values in (if I then hit 'btnSearch_Click' it works correctly). I assume it's something to so with the e As part but it's not my strong point at all! If you need the javascript I can pop that too. There are two 'search' buttons as one is a 'quick link' essentially as 80-90% of the time in this internal website case it's all they need. Protected Sub btnRiskRating_Click(sender As Object, e As CommandEventArgs) Dim vRiskRating As String = Trim(e.CommandArgument.ToString()) Session.Item("sRiskRating") = vRiskRating.ToString With oAuditData .EventType = "LOG" .EventDescription = "User clicked Risk Rating " &amp; vRiskRating.ToString &amp; "" .PemcoModule = "All" .SiteID = 0 .UserID = CInt(oUser.UserID) .EmployeeID = Session("EmployeeID") End With oAudit.WriteAuditTrailItem(oAuditData) Call PrcSearch() End Sub Protected Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click, btnSearchTop.Click Call PrcSearch() End Sub Public Sub PrcSearch() Session.Item("sUPRN") = Trim(sUPRN.Text) Session.Item("sStreet") = Trim(sStreet.Text) Session.Item("sSurveyCompany") = Trim(sSurveyCompany.Text) Session.Item("sPostcode") = Trim(sPostcode.Text) Session.Item("sPropertyName") = Trim(sPropertyName.Text) Session.Item("sDateFrom") = sDateFrom.Text Session.Item("sDateTo") = sDateTo.Text Dim vSearch As String vSearch = Trim(sUPRN.Text) &amp; " - " &amp; Trim(sSurveyCompany.Text) &amp; " - " &amp; Trim(sPostcode.Text) vSearch = vSearch &amp; " - " &amp; Trim(sPropertyName.Text) &amp; " - " '&amp; Trim(sDateFrom.Text) &amp; " - " &amp; Trim(sDateTo.Text) With oAuditData .EventType = "LOG"…
has comment: http://stackoverflow.com/comment/44009462
accepted answer: http://stackoverflow.com/a/27839317
tagged with: javascript
has comment: http://stackoverflow.com/comment/44009729
has answer: http://stackoverflow.com/a/27839317
has comment: http://stackoverflow.com/comment/44009772
has comment: http://stackoverflow.com/comment/44010126
upvote count: 1
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44009550
tagged with: asp.net
favorite count: 0
has title: .Net not triggering Javascript on search (?) - should ignore default value
tagged with: vb.net
type: AnsweredQuestion
score: 1

http://stackoverflow.com/q/27683220
has body: hi im trying out a servlet based ajax here in my program im using a html page with button and textbox when i click the button it should fire some ajax request to the server done some computations and return result in the same page Ajax in servlets hi there in this html page a text box and a button when i click on the button it should execute the following java script function var xmlreq=null; var a=document.getElementById("fname"); function ajaxreq(){ if(window.XMLHttpRequest){ xmlreq=new XMLHttpRequest(); } else if(window.ActiveXObject){ xmlreq=new ActiveXObject("Microsoft.XMLHTTP"); } try{ xmlreq.onreadystatechange=response; xmlreq.open("GET","Servlethello?an=+a",true); xmlreq.send(); } catch(e){ alert("some error") } } function response(){ var res=xmlreq.responseText; document.write(res); alert(res); document.getElementById("change").innerHTML=res; } here i have created a ajax call and send the request to the servlet Servlethello public class Servlethello extends HttpServlet { @Override public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println(" "); String a=req.getParameter(an); out.println("solorules"+a); out.println(" "); out.close(); } } the variable a fetches the value entered in the textbox and send it to the servlet xmlreq.open("GET","Servlethello?an=+a",true); to this servlet public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println(" "); String a=req.getParameter(an); out.println("solorules"+a); out.println(" "); and this servlet should be displayed here hi there using this java script var res=xmlreq.responseText; document.write(res); alert(res); document.getElementById("change").innerHTML=res;
favorite count: 0
tagged with: ajax
type: AnsweredQuestion
downvote count: 2
possible better answer: http://stackoverflow.com/a/27683746
upvote count: 1
has answer: http://stackoverflow.com/a/27683746
has title: HTML+Ajax+servlet not working
type: Question
has answer: http://stackoverflow.com/a/27683267
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/27683267
tagged with: servlets
answer count: 2
has comment: http://stackoverflow.com/comment/43781047

http://stackoverflow.com/q/27659974
tagged with: setinterval
tagged with: xmlhttprequest
has title: XMLHttpRequest() SetInterval
favorite count: 0
has body: My setInterval is firing, but it seems the XMLHttpRequest(); is not going through? I get the first console.log(), but not the second. Any insight into this would be highly appreciated. Code below: var countdown = 1000; var region = "the_Pacific"; var jsonrequestInterval = function () { console.log("The clock was updated"); var jsonrequestIntervaled = new XMLHttpRequest(); jsonrequestIntervaled.open("GET", 'myURL' + region, true); jsonrequestIntervaled.onreadystatechange = function () { if (jsonrequestIntervaled.readyState == 4) { console.log("The request was made"); if (clock.getTime() &gt;= jsonrequestIntervaled.responseText.match(/-?[1-9]\d+/g)) { clock.setTime(jsonrequestIntervaled.responseText.match(/-?[1-9]\d+/g)); } if (time &gt; 300) { countdown = 10000; } else if (time &lt; 60) { countdown = 1000; } else if (time &lt; 300) { countdown = 5000; } } }; }; //problem not updating!!!!!!!!!!!!!!!!!!!!! setInterval(jsonrequestInterval, countdown);
score: 4
answer count: 1
has answer: http://stackoverflow.com/a/27660009
upvote count: 4
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27660009
tagged with: ajax
type: Question
type: AnsweredQuestion

http://stackoverflow.com/q/27745982
tagged with: javascript
tagged with: jquery
score: 0
has body: I'm very new to jQuery, and I'm attempting to populate a select box from a collection. Basically, I want to take the code below, where "statuses" is the collection and move it to jQuery: &lt;widget:select property="statusCode" styleId="STATUSCODELIST" labelKey="label.status"&gt; &lt;html:option value=""/&gt; &lt;c:forEach var="status" items="${applicationScope.statuses}"&gt; &lt;html:option value="${status.key}"&gt;&lt;c:out value="${status.key} - ${status.value}"/&gt;&lt;/html:option&gt; &lt;/c:forEach&gt; &lt;/widget:select&gt; I'm trying to figure out how to get "statuses" to work something like the numbers array in this sample: var numbers = [ 1, 2, 3, 4, 5] var list = $('#STATUSCODELIST')[0]; $.each(numbers, function(index, text) { list.options[list.options.length] = new Option(index, text); }); Thanks for any help.
type: UnansweredQuestion
tagged with: collections
type: Question
has answer: http://stackoverflow.com/a/27746683
has title: Populating Select Box from Collection using jQuery
answer count: 1

http://stackoverflow.com/q/27666107
upvote count: 0
has comment: http://stackoverflow.com/comment/43747257
tagged with: javascript
tagged with: jquery
tagged with: ajax
has title: Bring checked checkboxes on top of the list
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
score: -4
has answer: http://stackoverflow.com/a/27666208
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27666159
accepted answer: http://stackoverflow.com/a/27666208
has answer: http://stackoverflow.com/a/27666159
type: Question
answer count: 2
downvote count: 4
linked to: http://stackoverflow.com/q/8746913
has body: On clicking a radio button, an Ajax request is send and the Div with checkbox[employee] is returned. I want the checked checkboxes to come on top. Was thinking, if there could be some index attribute which I can change dynamically.

http://stackoverflow.com/comment/43980585
type: AnswerComment
type: Comment
has text: Awesome! Please edit your question to indicate how you solved the problem, or select an answer. Thanks!
comment on: http://stackoverflow.com/a/27744845
score: 0

http://stackoverflow.com/comment/43970710
type: Comment
has text: It does **not** return an array, actually.
comment on: http://stackoverflow.com/a/27780453
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43790378
type: Comment
has text: i have a lot of area and audio tags there. i put here only one of each for the example. i do want it to be responsive or something that will not force the browser to run all 300 of my audio tags at once
type: AnswerComment
comment on: http://stackoverflow.com/a/27688131
score: 0

http://stackoverflow.com/q/27736674
answer count: 2
has comment: http://stackoverflow.com/comment/43884843
upvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/58038012
has title: Insert javascript DIV in LI
has answer: http://stackoverflow.com/a/27736694
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43884836
type: UnansweredQuestion
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43884833
score: -1
has body: i have a free html5 radio player and i need to add the song titles from a working javascript: ("track_name" is generated by a java script function and work ok. Print: "Abba - Happy new year" and i wanna to insert "track_name" in html5 player, here at PLACE : both codes are in the same html page. thanks for any help! UPDATE, complet code: this is index.html: Amazing HTML5 Audio Player, powered by http://amazingaudioplayer.com and this is the javascript "track_name" function:

http://stackoverflow.com/comment/44009347
comment on: http://stackoverflow.com/q/27800367
has text: I didn't say it wouldn't work. I said it is invalid markup. What's the point of having two clickable elements nested? You click one, you clicked both.
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/comment/43907562
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27748122
has text: What happens when you point a web browser at http://localhost:3000/ ?

http://stackoverflow.com/q/27772251
favorite count: 0
has title: How do you add the "each in" to work in handlebars
tagged with: handlebars.js
tagged with: ember.js
has comment: http://stackoverflow.com/comment/43956618
answer count: 4
has body: Ember is migrating to a non-context switching #each helper. For a compatibility piece I need to do the same from raw handlebars. However the trivial attempt fails var f = Handlebars.compile("{{#each numbers}}{{this}}{{/each}}"); console.log(f({numbers: [1,2,3]})); // works var f2 = Handlebars.compile("{{#each number in numbers}}{{number}}{{/each}}"); console.log(f2({numbers: [1,2,3]})); // fails How do I get {{#each number in numbers}} to work in raw handlebars 2.0? EDIT Added a bounty here, for a handlebars extension based off https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/lib/ember_compat_handlebars.js that gives us each.. in support. It is clear its not built into handlebars. It is also clear Ember is able to extend this.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27867416
has comment: http://stackoverflow.com/comment/43956583
accepted answer: http://stackoverflow.com/a/27812722
has answer: http://stackoverflow.com/a/27877664
score: 9
type: Question
upvote count: 9
has answer: http://stackoverflow.com/a/27772765
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27772765
has answer: http://stackoverflow.com/a/27812722

http://stackoverflow.com/comment/44005996
type: QuestionComment
comment on: http://stackoverflow.com/q/27797216
has text: @arman1991 im new in angular i dnt think i do understand your question
score: 0
type: Comment

http://stackoverflow.com/q/27676598
accepted answer: http://stackoverflow.com/a/27677069
answer count: 1
downvote count: 1
tagged with: textselection
has body: I have lines of text generated by ng-repeat, displayed within a div. I would like the user to be able to select from those lines and press a button, and have the application know which lines the user selected Is there any way to do that in AngularJS
tagged with: javascript
has comment: http://stackoverflow.com/comment/43768002
score: 2
type: AnsweredQuestion
favorite count: 0
tagged with: angularjs
type: Question
linked to: http://stackoverflow.com/q/5801347
has answer: http://stackoverflow.com/a/27677069
upvote count: 3
has title: How can I detect text selected in a div?

http://stackoverflow.com/comment/43753046
has text: Another option using a similar technique to just drop the last part of the `/`: `location.split('/').reverse().slice(1).reverse().join('/')`
type: QuestionComment
comment on: http://stackoverflow.com/q/27669081
score: 0
type: Comment

http://stackoverflow.com/q/27775442
tagged with: kendo-ui
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43966225
type: Question
has body: i would like to display grouped data in grid by default? Should I do it during the read method? Many Thanks for any help. Edit: Model filed for the object what i want to use for default grouping is following: partner: { defaultValue: {}, nullable: false, type: "object" }, Column field is: { field :"partner.name", title : $translate.instant('PARTNER'), width: 250, filterable: { cell: { operator: "contains" } } }, If i tried following in requestEnd: var grid = $("#locations_grid").data('kendoGrid'); grid._group = true; grid.dataSource._group.push({ aggregates: [], dir: "asc", field: "partner.name" }); grid.refresh(); I always get empty grid. Request strtucture for grouping is following: { "entityName": "Location", "data": { "take": 10, "skip": 0, "page": 1, "pageSize": 10, "group": [ { "field": "partner.name", "dir": "asc", "aggregates": [] } ] } } EDIT2 - WHOLE CODE OF THE GRID INIT: $scope.initGrid = function() { // set container for loading spinner gridView = $("#locations_grid"); // set all properties for data grid gridView.kendoGrid({ dataSource: { transport: { // READ REQUEST read: function (options) { console.log("List"); console.log(options.data); requestParams = { "entityName": "Location" }; requestParams.data = options.data; console.log(requestParams); ApiService.doHttpRequest( "POST", $rootScope.apiBaseUrl + "location/search", requestParams ) .success(function (data, status, headers, config) { // successful data retrieval console.log("request success, checking state"); console.log(data); // sent status to global HTTP status service var jsonResponse = ApiService.processReturnedHttpState(status); console.log("Status response is " + jsonResponse.result); // do something with data switch (jsonResponse.result) { case true: options.success(data); break; case false: growlNotifications.add($translate.instant('LIST_LOADING_ERROR'), 'error', $rootScope.notificationLifetime); break; } }) .error(function (data, status, headers, config) { var jsonResponse = ApiService.p…
tagged with: kendo-grid
has comment: http://stackoverflow.com/comment/43975244
tagged with: datagrid
tagged with: javascript
has title: Kendo Grid - How to make grid displayed grouped data by one column by default (init)?
has answer: http://stackoverflow.com/a/27779513
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43979017

http://stackoverflow.com/a/27747010
answers question: http://stackoverflow.com/q/27746973
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43905242
upvote count: 2
has body: You must check for changes into the input element. Use the following code: $("input").change(function() { // your action });
type: Answer

http://stackoverflow.com/q/27686717
has comment: http://stackoverflow.com/comment/43787255
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43787894
has title: Angular highlightjs I can not make the css value appears without the single quote
favorite count: 0
has comment: http://stackoverflow.com/comment/43787168
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43789310
tagged with: css
has comment: http://stackoverflow.com/comment/43787370
tagged with: angularjs
answer count: 0
has comment: http://stackoverflow.com/comment/43787507
type: UnansweredQuestion
upvote count: 1
score: 1
has body: I can not make the css value appears without the single quote: display #item { width: '200px'; height: '200px'; } when should appear as follows, without the quotes #item { width: 200px; height: 200px; } the truth, I'm new with angular and I am really impressed with this issue, because with jQuery already have solved ....
type: Question

http://stackoverflow.com/q/27662828
linked to: http://stackoverflow.com/q/11935701
has comment: http://stackoverflow.com/comment/43741558
has comment: http://stackoverflow.com/comment/43806575
score: 0
answer count: 3
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43815342
has comment: http://stackoverflow.com/comment/43806616
favorite count: 0
has comment: http://stackoverflow.com/comment/43741610
has comment: http://stackoverflow.com/comment/43741788
has comment: http://stackoverflow.com/comment/43810955
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27662934
has comment: http://stackoverflow.com/comment/43811260
has comment: http://stackoverflow.com/comment/43806531
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27662990
type: Question
has comment: http://stackoverflow.com/comment/43742028
has answer: http://stackoverflow.com/a/27699265
tagged with: javascript
has title: Caching Javascript inlined in HTML
has comment: http://stackoverflow.com/comment/43806684
has body: Instead of having an external .js file, we can inline Javascript directly in HTML, i.e. Externalized version Inlined version However, it's not recommended: https://developer.yahoo.com/performance/rules.html#external Put javascript and css inline in a single minified html file to improve performance? The main reason is caching and pre-compiling - in the externalized version, the browser can download, pre-compile and store the file once for multiple pages, while it cannot do the same for inlined version. However, is it possible to do something along these lines: Inlined keyed version That is, do this: In the first invocation, send the whole script and somehow tell the browser that the script hash is abc Later, when the browser loads that or other pages containing the same script, it will send this key as a cookie. The server will only render the contents of the script if the key has been received. That is, if the browser already knows about the script, the server will render just this: Inlined keyed version, subsequent fetches (of the same or other pages) where notably the script contents are empty. This would allow for shorter script fetching with a natural fallback. Is the above possible? If not, is some other alternative to the above possible?

http://stackoverflow.com/q/27700420
has answer: http://stackoverflow.com/a/27700778
has body: The solution provided in Print the contents of a DIV works for me, but alongwside passing styles I also want to pass some jQuery code to the Print Preview page. How do I do that? I tried adding mywindow.document.write('$(document).ready(function(){ /* do this */ });'); but it is not working as expected. This is my code : Similar to the way I am passing stylesheets, I also want to pass some jQuery code to check the URL of the print preview page for a string and if the string exists then hide a class on the page. The jQuery code would look something like this :
favorite count: 0
has comment: http://stackoverflow.com/comment/43813831
has comment: http://stackoverflow.com/comment/43813767
type: AnsweredQuestion
has title: How do I print the contents of a DIV and also include tags in it
accepted answer: http://stackoverflow.com/a/27700778
has comment: http://stackoverflow.com/comment/43814112
has comment: http://stackoverflow.com/comment/43813939
downvote count: 2
has comment: http://stackoverflow.com/comment/43813893
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/2255291
has comment: http://stackoverflow.com/comment/43813732
tagged with: javascript
tagged with: jquery
score: -1
answer count: 1

http://stackoverflow.com/comment/43907530
score: 0
type: QuestionComment
type: Comment
has text: @Rooster, I added the error that occurred to the question. Is that what you mean?
comment on: http://stackoverflow.com/q/27748042

http://stackoverflow.com/q/27764529
tagged with: php
has answer: http://stackoverflow.com/a/32208906
has body: I'm in trouble with search.php file of sphider website indexing and search script. I need your help. Actually i want to put sphider search script in my website to search the pages with keywords. But i have a problem. i have attached a search box in each page of website and now i want to put search.php file of sphider in form action. But when i checked i got that it don;t search results but beside it shows a search box in search.php file and when i enter any keyword and hit enter then it shows the results. So my question is. How to remove this search box from this search.php file and only get the search result. ' search.php?query= [---Here comes the search keywords entered in box--] &amp;search=1' this is URL that shows after hitting enter from search.php search box but when putting all details right in my page search engine it doesn't do anything and only ask to search through that box... So guys please help me.... &lt;?php /******************************************* * Sphider Version 1.3.x * This program is licensed under the GNU GPL. * By Ando Saabas ando(a t)cs.ioc.ee ********************************************/ //error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING); error_reporting(E_ALL); $include_dir = "./include"; include ("$include_dir/commonfuncs.php"); //extract(getHttpVars()); if (isset($_GET['query'])) $query = $_GET['query']; if (isset($_GET['search'])) $search = $_GET['search']; if (isset($_GET['domain'])) $domain = $_GET['domain']; if (isset($_GET['type'])) $type = $_GET['type']; if (isset($_GET['catid'])) $catid = $_GET['catid']; if (isset($_GET['category'])) $category = $_GET['category']; if (isset($_GET['results'])) $results = $_GET['results']; if (isset($_GET['start'])) $start = $_GET['start']; if (isset($_GET['adv'])) $adv = $_GET['adv']; $include_dir = "./include"; $template_dir = "./templates"; $settings_dir = "./settings"; $language_dir = "./languages"; require_once("$settings_dir/database.php"); require_once("$language_dir/en-language.php"); requi…
score: 1
has title: Modify sphider search.php file and help me please
tagged with: mysql
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/q/27736183
type: Question
has title: Passing values to server
tagged with: serverside-javascript
linked to: http://stackoverflow.com/q/1917576
answer count: 2
has comment: http://stackoverflow.com/comment/43883897
has body: I have been trying to find methods to pass variables from client to server What is making it difficult for me is: I have an unknown number of variables( The program that I am working on pass different number of variables/arrays to server side depending on what the user is doing ) The user could be using any character including &amp; and = therefore if I passed the variables as multiple/one GET variable/s the user could pass = and &amp; which will affect the GET variables I am looking for methods ( a solution ) to pass variables, preferably arrays, to server side ( like PHP ) Appreciate your time and help :)
tagged with: javascript
duplicate of: http://stackoverflow.com/q/1917576
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/27736276
has comment: http://stackoverflow.com/comment/43883936
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/27736219

http://stackoverflow.com/comment/43736318
has text: @user3739453 You can easily switch background image
type: Comment
comment on: http://stackoverflow.com/q/27660272
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43757570
type: QuestionComment
has text: Just… don’t use quirks mode…. Fixing that might take some effort, but it’s worth it.
comment on: http://stackoverflow.com/q/27671406
score: 2
type: Comment

http://stackoverflow.com/comment/43742956
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27663482
has text: oooohhhh. ok. i totally misunderstood. and lol on the epiphany. Happens to the best of us, man.

http://stackoverflow.com/comment/43772443
has text: @DaveBriand I just gave a few relative simple tips how they could improve their questions. Adding capitals and full stops to a text greatly improves readability, even if other words are misspelled and the order of the words is incorrect. I would have changed it myself, but this question needs to be closed and I don't want to invalidate close-votes.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27678614
type: QuestionComment

http://stackoverflow.com/comment/43752096
type: Comment
has text: like the first time slide run.like i said before first time you run page and the way slide changes is that i want but when time passes it's getting bad
score: 0
comment on: http://stackoverflow.com/q/27663125
type: QuestionComment

http://stackoverflow.com/comment/44011181
has text: @Pete: i added my source code. The core functionality is the same as in the Github repository.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/27799564
type: QuestionComment

http://stackoverflow.com/comment/43992952
type: Comment
has text: I dont want to change the value in the input. I want to select the dropdown based on the querystring which i am passing through.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27791596

http://stackoverflow.com/comment/43906737
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27737922
has text: If the video's original aspect ratios are exactly the sizes you want to start with, it might be possible. But if they are all the same I think it won't work. See the pen I created and have a play, it's running fitvids and has three sample videos in a layout: http://goo.gl/3KpGoJ

http://stackoverflow.com/comment/43729431
type: QuestionComment
score: 0
has text: Change your CSS from .sub1:hover to .hovered. Then, add class name "hovered" in JS to the element that you want
comment on: http://stackoverflow.com/q/27656722
type: Comment

http://stackoverflow.com/q/27792276
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27792306
has answer: http://stackoverflow.com/a/27792351
tagged with: regex
linked to: http://stackoverflow.com/q/1623221
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27792330
has answer: http://stackoverflow.com/a/27792330
has body: How do I extract the number inside of a string like the examples below? myform-5-id myform-32-id myform-0-id The number will always be an integer >= 0, and the text will always be the same.
type: Question
accepted answer: http://stackoverflow.com/a/27792306
score: 0
answer count: 3
has title: JQuery Regex - get the number inside of a string

http://stackoverflow.com/a/27726880
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27726806
has body: $('.myClass').click( function(){ $('this').css("width", "30% !important"); alert("THIS ALERT WORKS"); })

http://stackoverflow.com/a/27648561
upvote count: 1
has comment: http://stackoverflow.com/comment/43714549
has comment: http://stackoverflow.com/comment/43714609
type: AcceptedAnswer
downvote count: 0
score: 1
has body: Just use .change() and wrap your function in there or call your trigger. $("#pNo").change(function(){ if($(this).val() == ""){ $(this).val("1"); } //your function to be triggered on change }
answers question: http://stackoverflow.com/q/27648357
type: Answer
accepted answer of: http://stackoverflow.com/q/27648357

http://stackoverflow.com/comment/43793685
comment on: http://stackoverflow.com/q/27685449
type: Comment
type: QuestionComment
score: 1
has text: After setting Cat.prototype you can do `Cat.prototype.constructor = Cat;` then myCat would be both an instance of Mammal and Cat.

http://stackoverflow.com/comment/43955437
has text: @Robert: It doesn't work or throwing this event at all on change.
score: 0
comment on: http://stackoverflow.com/q/27743496
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43920451
comment on: http://stackoverflow.com/a/27751019
has text: Worked nicely -- thank you! Amazing how much time I spent on something this simple.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44042896
comment on: http://stackoverflow.com/q/27798899
has text: @bestmike007 Yes I have monitored the requests through developer tools, and found that the page initially shows up without product listing, at the beginning of the page there is a form tag with post method, that submits to the same link. Then the page submits that form using javascript to refresh itself with the list of products, at the moment I'm trying to mimic this behavior by making another curl call using that form data as a new POST request. I'll let you know what happens. Thanks for your assistance.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27792781
tagged with: angularjs
type: AnsweredQuestion
has title: Use a single ng-model to filter results and display filter method
type: Question
has answer: http://stackoverflow.com/a/27792896
has body: I have an HTML select element that gives some options on how to sort a list, it looks like this: &lt;select ng-init="sortMethod=sortMethods[0]" ng-model="sortMethod"&gt; &lt;option ng-repeat="sortMethod in sortMethods"&gt;{{sortMethod}}&lt;/option&gt; &lt;/select&gt; and here's sortMethod: $scope.sortMethods = ['created', 'likes.count']; I'm using sortMethod to sort a bunch of objects: &lt;li ng-repeat="story in feedData|orderBy:sortMethod"&gt; Panel Count: {{story.frameURIs.length}} &lt;/li&gt; And all of this works just fine, but the issue is that the options in the select box are ugly, it displays "created" and 'likes.count", but it should say something like "Most Recent" and "Most Popular". I tried to changing sortMethod to an array of objects like this: $scope.sortMethods = [{'displayVal': 'Most Recent', 'sortVal': 'created'}, {'displayVal': 'Most Popular', 'sortVal': 'likes.count'}]; and displaying sortMethod.displayVal in the select element, and using &lt;li ng-repeat="story in feedData|orderBy:sortMethod.sortVal" but that seems to sort them in a seemingly random order. How do I make pretty select options without changing the info in feedData? feedData comes from another party and I can't change it.
accepted answer: http://stackoverflow.com/a/27792896
tagged with: javascript
tagged with: sorting
score: 0
answer count: 1

http://stackoverflow.com/q/27799917
answer count: 2
has body: I have class and know row ID, try update this row how it's showed in this topic https://parse.com/questions/updating-a-field-without-retrieving-the-object-first var Point = Parse.Object.extend("items"); var point = new Point(); point.id = "L8bc5utrVD"; // Set a new value on quantity point.set("title", "new title"); // Save point.save(null, { success: function(point) { // Saved successfully. }, error: function(point, error) { // The save failed. // error is a Parse.Error with an error code and description. console.log('Failed to create new object, with error code: ' + error.message); } }); but get error "Failed to create new object, with error code: have this item"
tagged with: parse-platform
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28233932
score: 0
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27820973
has title: parse.com row updates javascript

http://stackoverflow.com/a/32491825
upvote count: 17
score: 17
answers question: http://stackoverflow.com/q/27706594
downvote count: 0
type: Answer
has body: I found this to be a quick & easy way to do it. Add this to your headers: This only works in HTML5, and is (or should be) supported by these browsers: http://caniuse.com/#feat=form-validation (The JS console in Chrome shows this error message: "Invalid form control" only in Google Chrome , and I haven't been able to work around this. Hopefully someone else will improve this response.)
has comment: http://stackoverflow.com/comment/135467106

http://stackoverflow.com/a/27736688
has body: I assume you meant replace the string "Test(5)" into "Test\(5\)" In which case: var string = "Test(5)"; string = string.replace("(","\\("); string = string.replace(")","\\)"); console.log(string); Escape the backslash
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27736680
answers question: http://stackoverflow.com/q/27736680
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer

json-rpc
tag name: json-rpc
tags question: http://stackoverflow.com/q/27747558
type: Tag

global
type: Tag
tags question: http://stackoverflow.com/q/27730949
tags question: http://stackoverflow.com/q/27704123
tags question: http://stackoverflow.com/q/27765666
tag name: global
tags question: http://stackoverflow.com/q/27695719

http://stackoverflow.com/q/27712080
tagged with: javascript
has comment: http://stackoverflow.com/comment/43836240
has body: I have a JavaScript array of numbers like Array("1","2","3") and I want to convert it to a string that preserves the quotes around each number like this '"1","2","3"' But the Array.join() and Array.toString() functions strip the quotes. "1,2,3" How can I convert my Array to a string that preserves quotes?
favorite count: 0
has comment: http://stackoverflow.com/comment/43836241
has answer: http://stackoverflow.com/a/27712151
score: -4
has answer: http://stackoverflow.com/a/41931027
accepted answer: http://stackoverflow.com/a/27712532
answer count: 4
downvote count: 4
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/27712532
has title: Why does Array("1","2","3").join() convert strings to numbers in JavaScript?
possible better answer: http://stackoverflow.com/a/27712119
type: Question
has comment: http://stackoverflow.com/comment/43836315
has answer: http://stackoverflow.com/a/27712119
tagged with: arrays

http://stackoverflow.com/q/27790795
has answer: http://stackoverflow.com/a/27790850
type: Question
has body: Currently I use: $(':submit').click(function(event) { event.preventDefault(); //Stop the browser from submitting the form. $.ajax( { //Handle forms in ajax }); }); To handle all forms on a website, as 95% of forms are handled in ajax. This saves me having to apply it to a class and then having to add that class to every form. My issue now is that 2 forms need to be handled without ajax to work correctly. So how would I apply this same function to all submit inputs apart from 2 with a particular class without hardcoding those specific elements in the function? Is this even possible? Is there a negative selector of this type? I chose this approach as most forms use ajax submission, so please don't suggest targetting a class unless you're sure there isn't an alternative.
tagged with: forms
has title: How to apply Javascript click function to elements without class?
tagged with: function
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/27790828
answer count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27790842

http://stackoverflow.com/q/27656310
type: Question
answer count: 1
has body: I am trying to read a csv on my local apache server using Javascript but I get the following error . Below is my code:- Circles But I get this error XMLHttpRequest cannot load http://localhost:8080/example/data.csv. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. I create this csv using a java program . So can anyone give me an alternative solution for this ? Can anyone please help me fix this .
tagged with: javascript
has answer: http://stackoverflow.com/a/27656334
tagged with: http://stackoverflow.com/tag/csv
accepted answer: http://stackoverflow.com/a/27656334
score: 0
has title: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access
type: AnsweredQuestion

http://stackoverflow.com/comment/43775196
has text: Have definitely thought of pagination.. but will have to see how it fits in with my current response servlet (need to make change there? or only in the client code part)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27679932
type: Comment

http://stackoverflow.com/comment/43836884
type: AnswerComment
has text: + 1 Very very cool. A small while loop and a callback will make this very dynamic and easy to implement!
type: Comment
comment on: http://stackoverflow.com/a/27712338
score: 1

http://stackoverflow.com/q/27725141
has answer: http://stackoverflow.com/a/27725159
accepted answer: http://stackoverflow.com/a/27725159
has answer: http://stackoverflow.com/a/27725163
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has title: dynamic elements and listening for events on them
possible better answer: http://stackoverflow.com/a/27725163
tagged with: ajax
tagged with: php
type: AnsweredQuestion
has body: I have a list of emails on a page. echo "&lt;div class='comms'&gt;"; $sel = "SELECT * from emails where customerId=:custId"; $stmt = $db-&gt;prepare($sel); $stmt-&gt;bindParam(':custId',$_POST['custId']); $stmt-&gt;execute(); while($r = $stmt-&gt;fetch()) { echo "&lt;li class='emails'&gt;" . $r['date']. " " . substr($r['data'],0,15) . "....&lt;/li&gt;"; } echo "&lt;/div&gt;"; I also have an ajax call every minute to check for new email. var getMail = function(){ var custId = "&lt;?php echo $_POST['custId'];?&gt;"; $.ajax({ type:"POST", url:"installManager/getMail.php", data:"custId="+custId, success: function(result){ $('.comms').html(result); } }); } var interval = 1000 * 60 * 1; setInterval(getMail,interval); I am trying to setup the listening event for hovering over these newly created li's. $('.emails').on('mouseover',$('li'),function(){ alert('this is an email'); }); hover doesnt trigger after ajax fires. what am i doing wrong?

http://stackoverflow.com/comment/43836999
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27712428
has text: So what makes the space trigger functionality, probably an event, I'm guessing the `change` or `keyup` event, so just add on `.trigger('change')`. And BTW, it would be a great idea to actually add that fact to the question, as there are ways to trigger events, for instance key events, and pass a certain key, but one has to know what event to trigger.

http://stackoverflow.com/a/27658272
has body: You can add this code to your javascript var select = document.getElementsByTagName('select')[0]; select.onchange = function(event) { var btns = document.querySelectorAll('[name^="radio_value"]'); btns[event.target.value].checked = true } working example Documentation Events Selectors
answers question: http://stackoverflow.com/q/27658178
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43732476
accepted answer of: http://stackoverflow.com/q/27658178
has comment: http://stackoverflow.com/comment/43732569
has comment: http://stackoverflow.com/comment/43732513
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43732610
has comment: http://stackoverflow.com/comment/43777316

http://stackoverflow.com/comment/121638405
comment on: http://stackoverflow.com/a/68824022
type: AnswerComment
has text: pro tip: you can add code fences to format the code
score: 0
type: Comment

http://stackoverflow.com/comment/43831502
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27709784
has text: Or from harddisk. Same problem

http://stackoverflow.com/a/45888947
answers question: http://stackoverflow.com/q/27693332
score: 0
type: Answer
has body: You can use javascript by checking the element classList Like this: var el = document.getElementById("elementId"); el.classList.contains("foo"); More information in Mozilla Docs

http://stackoverflow.com/comment/43934075
type: QuestionComment
comment on: http://stackoverflow.com/q/27761380
has text: It *is* a string. The type of an empty string is still `"string"`.
score: 2
type: Comment

http://stackoverflow.com/comment/43985021
comment on: http://stackoverflow.com/a/27786849
type: AnswerComment
type: Comment
score: 0
has text: Awesome - I'll check it out.

http://stackoverflow.com/a/27711311
type: Answer
accepted answer of: http://stackoverflow.com/q/27711004
has comment: http://stackoverflow.com/comment/43835610
answers question: http://stackoverflow.com/q/27711004
upvote count: 1
has comment: http://stackoverflow.com/comment/43834945
has body: Can you post your configuration code? Routes are still matched on a path, so if you only mount your authenticate middleware on those paths then it should work as expected. EG: app.use('/private', passport.authenticate());
score: 1
has comment: http://stackoverflow.com/comment/43834800
has comment: http://stackoverflow.com/comment/43835179
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43835244

http://stackoverflow.com/comment/43800214
has text: That is exactly what I am doing :-) Thanks Pawel, good to know I am on the right track. The tricky bit is to rebuild the array (I am a bit of an array rook)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27692037

http://stackoverflow.com/a/27771120
type: AcceptedAnswer
has body: I have found the way, how to achieve the texture change. You can do this with using the next code: window.setTimeout( function() { var image = new Image(); image.src = 'new-file-path.jpg'; image.onload = function( event ) { var handledImage = event.target || event.srcElement; cube.texture.image = handledImage; }; }, 1000 ); The texture will be updated in 1 second. Also, Gera right now doesn't provide CORS origin requests, so be careful with fetching image data, if you will try to fetch image from remote server it won't be updated, you should put your textures in localhost.
type: Answer
answers question: http://stackoverflow.com/q/27720493
accepted answer of: http://stackoverflow.com/q/27720493
score: 0

http://stackoverflow.com/a/27735739
downvote count: 0
answers question: http://stackoverflow.com/q/27735709
upvote count: 2
has body: getCarData() is an array of objects. getCarData()[0] is the first object of this array of objects, so it can be stringified. JSON.stringify(getCarData()[0]) will return a string of the the first object of the array of objects. JSON.stringify(getCarData()) will return a string of the entire array of objects. JSON.stringify(getCarData())[0] will return the first letter of the string produced by the above command, which is [, because you're essentially doing something like "hi"[0] which is a character, whereas previously you did {"hi","hello"}[0] which is a string element.
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/43883010

http://stackoverflow.com/q/27653261
tagged with: angularjs
has body: I'm creating an angular app using angular-google-maps. What I'm trying to do is loop through an array of locations in order to place a marker at each location's latitude and longitude. However, because I'm using a couple of closures within my for-loop, a marker is only showing up at the last entry of the array. Here's the code: $scope.petMarkers = []; $http.get('/api/pets').success(function(foundPets){ $scope.foundPets = foundPets; var listOfPets = $scope.foundPets; var markerCreator = function(arrayOfPets){ for (var i = 0; i &lt; arrayOfPets.length; i++){ var singlePet = arrayOfPets[i]; var petName = arrayOfPets[i].name; var identity = singlePet._id; var location = singlePet.addressFound; var split = location.split(' '); var joined = split.join('+'); var httpAddress = 'http://maps.google.com/maps/api/geocode/json?address=' + joined + '&amp;sensor=false'; // anonymous function keeps reference to i, and when console.log is called, for loop has already finished and value of i is set to 4 $http.get(httpAddress).success(function(mapDataAgain){ var ladder = mapDataAgain.results[0].geometry.location.lat; var longer = mapDataAgain.results[0].geometry.location.lng; var obj = { latitude: ladder, longitude: longer, title: petName, id: i }; $scope.$watch(function(){ console.log('we are in scope.watch'); return $scope.map.bounds; }, function(){ var markers = []; //markers.push(obj); $scope.petMarkers.push(obj); //$scope.petMarkers = markers; console.log('markers = ', $scope.petMarkers); }, true); }); }; }; markerCreator(listOfPets); }); Any ideas as to how to use an immediately invoked function expression(IIFE) with this code? I'm having trouble figuring out whether I need two IIFEs (one for the anonymous function called upon success of the $http call and one for the anonymous function called as the argument to $scope.$watch). I'm kind of lost here, so any explanation/help/suggestions would be helpful.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27653426
score: 1
upvote count: 1
type: Question
tagged with: google-maps
has title: Javascript Closure Within a For Loop (2 closures involved - an $http.get call and a $scope.$watch) using angular.js
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27653426
tagged with: iife
tagged with: anonymous-function
answer count: 1
favorite count: 0

http://stackoverflow.com/q/27773674
type: UnansweredQuestion
type: Question
has body: How would you download an Audio object created dynamically? var audioPlaying = new Audio(); audioPlaying.src = link; audioPlaying.addEventListener("loadedmetadata", function(_event) { audioPlaying.play(); });
has comment: http://stackoverflow.com/comment/43958110
tagged with: javascript
has answer: http://stackoverflow.com/a/57152229
has comment: http://stackoverflow.com/comment/43959913
score: 3
answer count: 1
downvote count: 0
favorite count: 0
has title: Download Audio Object through javascript
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43960027
has comment: http://stackoverflow.com/comment/43959946
tagged with: audio
upvote count: 3

http://stackoverflow.com/a/34151215
answers question: http://stackoverflow.com/q/27699641
type: Answer
score: 2
upvote count: 2
has body: You can use Tampermonkey for chrome and you can learn how to use it from sites like hibbard tampermonkey tutorial . Overall your sript would look like this: // ==UserScript== // @name Enter any name you like here // @namespace URL of website you own // @version 0.1 // @description retrive data using sql // @author Your name here // @match relevant url // ==/UserScript== /* jshint -W097 */ // Your code here... //select the textarea to insert retrieved queries document.querySelector("textarea").textContent = "SELECT * FROM CI_INFOOBJECTS"; //click the submit button document.getElementsByTagName('input')[0].click(); //code to export the query result //after click(), the page reloaded and it won't executed the following code. document.addEventListener("DOMContentLoaded", function() { //back to the previous page, run the previous code again window.history.back(1); }, false); Make neccesay changes like in @match. Please Comment if you have any doubts . hope it helps
downvote count: 0

http://stackoverflow.com/q/27744506
tagged with: javascript
tagged with: ajax
has title: Including php file with php and javascript variables into ajax file
has answer: http://stackoverflow.com/a/27744689
answer count: 3
downvote count: 0
favorite count: 0
has body: I have an application that contains language file "lang.php", "index.php" and ajax calling file "ajax.php". Lang file contains php and javascript variables which I include in "index.php" and "ajax.php" so I can change langugage with translating "lang.php" file. Problem is that when i include "lang.php" in "ajax.php" because it contains javascript variables inside &lt;script&gt;&lt;/script&gt; tags and ajax interprets it like output. When I remove &lt;script&gt; tags and when "lang.php" only contains php variables, it works correctly. Here is the content of my files. How can I do this without removing javascript variables (because I need one langugage file per language). index.php include "lang.php"; function test() { $.ajax({ url: 'ajax.php', type: 'POST', success: function(data) { //manipulating returned json; }, error: function() { alert(errorMessage); } }); }; &lt;input type="button" onclick="test();"&gt; lang.php &lt;script&gt; var errorMessage = "Error during ajax call"; &lt;/script&gt; &lt;?php $var1 = "Welcome"; $var2 = "Header"; ?&gt; ajax.php include "lang.php"; $array = array($var1, $var2); echo json_encode($array); die(); Thank you for your help.
has comment: http://stackoverflow.com/comment/43900242
upvote count: 2
tagged with: php
accepted answer: http://stackoverflow.com/a/27744689
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43900081
possible better answer: http://stackoverflow.com/a/27744686
type: Question
has answer: http://stackoverflow.com/a/27744686
has answer: http://stackoverflow.com/a/27745237
has comment: http://stackoverflow.com/comment/43901503

http://stackoverflow.com/q/27688311
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27688350
tagged with: events
has body: I have just started using React, and a couple of times I have thought to myself: "Why is there no componentDidRender event?". Say that I have a component that renders a table to the DOM, and I want to use bootstrap-sortable on this table to allow the user to sort on whatever column he wants. In the case of bootstrap-sortable you need to run $.boostrapSortable() after the table is drawn, in order to initialize the plugin. As I see it, there are two handlers on a React component that would be logical to consider to use for this purpose: componentDidMount: This does not work because the DOM does not seem to be updated at this point of the execution. componentDidUpdate: This could possibly work, but it does not fire on the initial render. I am not saying that React is actually missing a componentDidRender function, because I assume that there is a perfectly logical explanation as to why it is not there. I am just asking if someone could explain why such a function is not present, and what would be the "React way" to handle a case like the one above.
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/40775373
has title: React.js: Why is there no componentDidRender event?
has answer: http://stackoverflow.com/a/27688350
tagged with: dom
possible better answer: http://stackoverflow.com/a/40775373
type: Question
tagged with: reactjs
answer count: 2
score: 5
upvote count: 5

http://stackoverflow.com/comment/43966978
has text: Actually no, it almost never triggers - Thats code I dont use any more. Its the ReadRecievedData that almost always trigger.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27777564

http://stackoverflow.com/comment/43906923
score: 1
has text: @docwho have you checked the code? There might be some AJAX stuff dynamically adding content to the element you're reading, or some content is added in a `window.onload` handler. Or you've some invalid HTML, and the content is only partially returned. Please show all the relevant HTML for `td.product-title-cell`. (In my previous comment the end part should had been "... instead of OP's case #1.")
comment on: http://stackoverflow.com/q/27747525
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27644598
has comment: http://stackoverflow.com/comment/43712564
has comment: http://stackoverflow.com/comment/43709076
has comment: http://stackoverflow.com/comment/43712767
has comment: http://stackoverflow.com/comment/43713444
answer count: 4
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27644631
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27644759
has comment: http://stackoverflow.com/comment/43707809
favorite count: 0
has comment: http://stackoverflow.com/comment/43707787
has title: Select anyone of the radio button in a radio group using Javascript
type: Question
has body: I am a beginner in terms of Javascript. There are lot of similar questions in Stackoverflow. But none of that solve my this small example. I like to select a particular radio button by default using only javascript. I tried this below simple example in my localhost. But it didn't work. It is selecting the last radio button JS Test Name Select Position First Second Third Fourth Fifth Check out the JSFIDDLE Sorry friends, I can't add id to each radio button.
accepted answer: http://stackoverflow.com/a/27644759
has answer: http://stackoverflow.com/a/27645423
upvote count: 1
has comment: http://stackoverflow.com/comment/43707799
has comment: http://stackoverflow.com/comment/43712661
possible better answer: http://stackoverflow.com/a/27644605
tagged with: javascript
has answer: http://stackoverflow.com/a/27644605

http://stackoverflow.com/a/27776832
answers question: http://stackoverflow.com/q/27776743
type: Answer
has comment: http://stackoverflow.com/comment/43964165
has comment: http://stackoverflow.com/comment/43964143
has body: Try this: &lt;input type="text" value="" step="100" /&gt; EDIT: FIDDLE My answer was not sufficent so I made a short fiddle. HTML: &lt;input type="number" step="100" value="000" min="0" max="900" onchange="checkZero(this)"&gt; JS: function checkZero(input) { if (!parseInt(input.value)){ // if value is not in format "000", is "0" or 0 input.value = "000"; } } Use ng-model and ng-change. I suggest wrapping it in a directive. Feel free to ask for a snippet if you need.
score: 0

http://stackoverflow.com/q/27686817
downvote count: 0
tagged with: javascript
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/27686916
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs-ng-repeat
has body: So basically when I was using native html5 i was using five &lt;img src=""&gt; tags to load five images. When i wanted to use AngularJS i thought of iterating a div five times through ng-repeat and using ng-src="" get the image whose source path is stored in an array in the controller. But some how im always getting this error GET file:///home/sanad/Desktop/drag/x.source net::ERR_FILE_NOT_FOUND This is my html: &lt;div ng-repeat="x in img"&gt;{{x.source}} &lt;img ng-id="x.id" ng-src="x.source" &gt; &lt;/div&gt; This is my js: var app=angular.module('d2d',[]); app.controller('imageCtrl',function($scope){ $scope.img=[ {id:'table',source:'images/table.jpg'}, {id:'paper',source:'images/paper.jpg'}, {id:'computer',source:'images/computer.jpg'}, {id:'ac',source:'images/ac.jpg'}, {id:'sofa',source:'images/sofa.jpg'} ]; });
has comment: http://stackoverflow.com/comment/50148089
has comment: http://stackoverflow.com/comment/43787702
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27686916
has answer: http://stackoverflow.com/a/40743091
has answer: http://stackoverflow.com/a/35556031
upvote count: 5
has title: Image not loading using AngularJS ng-repeat and ng-src directive
type: Question
possible better answer: http://stackoverflow.com/a/35556031
score: 5

http://stackoverflow.com/comment/43962182
type: AnswerComment
has text: nope. There is two popup windows, when you see that question ,simply click that "stay on this page" button, after that there will also show the real popup. I want that SECOND popup instead of the question. In the other hand, I want only show that second window while we closing the browser. Thanks
comment on: http://stackoverflow.com/a/27775737
score: 0
type: Comment

http://stackoverflow.com/comment/43885073
comment on: http://stackoverflow.com/q/27736773
has text: This is a very good question - I'm building a system wherein folders and files in a filesystem tree correspond with documents in a document DB - e.g. every picture in the /foo/bar/pictures dir has a document in mongo with metadata, as does the /foo/bar/pictures directory itself. I'm attempting to verify that the enclosing directories' documents exist as well as the files/folders themselves. Hope thats a decent explanation of my thinking. :3
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43771477
type: Comment
comment on: http://stackoverflow.com/a/27678489
has text: By prefixing it with a class you initially don't use. See the sample between parentheses in my answer.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43953308
comment on: http://stackoverflow.com/a/27759359
type: Comment
score: 0
type: AnswerComment
has text: I did that with $(hiddenDiv).html('whole data'); and no rerendering occurs. Is this because of the <use> in the displaying div?

http://stackoverflow.com/a/27705520
score: 0
has comment: http://stackoverflow.com/comment/43824049
type: Answer
answers question: http://stackoverflow.com/q/27704894
has body: The spacing between points can be control by pointPadding groupPadding pointWidth

http://stackoverflow.com/a/27645669
accepted answer of: http://stackoverflow.com/q/27645619
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27645619
has comment: http://stackoverflow.com/comment/43709642
type: Answer
upvote count: 11
has body: You do have to use logic to avoid repetitive events on a key being pressed, because there's no specific and compatible event for key being just pressed. More specifically, the easiest solution is to store a boolean, setting it true on key up, false on key down (after having done your action), and ignoring the key down event while it's false: (function(){ var shouldHandleKeyDown = true; document.onkeydown = function(){ if (!shouldHandleKeyDown) return; shouldHandleKeyDown = false; // HANDLE KEY DOWN HERE } document.onkeyup = function(){ shouldHandleKeyDown = true; } })(); Demonstration EDIT for 2019 Now that IE is dead, you can also use the event.repeat property, which is true when the event is a repetition.
has comment: http://stackoverflow.com/comment/43709425
has comment: http://stackoverflow.com/comment/97670699
score: 11
has comment: http://stackoverflow.com/comment/97657048
has comment: http://stackoverflow.com/comment/43709523
has comment: http://stackoverflow.com/comment/43709463
has comment: http://stackoverflow.com/comment/97662498
has comment: http://stackoverflow.com/comment/43709520

http://stackoverflow.com/q/27773645
tagged with: viewdata
type: Question
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/27774212
has body: I am retrieving a variable value from ViewData to a javascript variable as follows. var selectedList= &lt;%= ViewData["selectedList"] %&gt;; and by nature ViewData expired after some time. I am looking for a way to check whether this variable has expired from the JavaScript side. I am trying to do this without using a session .
answer count: 1
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/27774212
has title: How to check whether a ViewData variable expired from javascript or Jquery side
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43958888

http://stackoverflow.com/q/27724483
type: Question
has comment: http://stackoverflow.com/comment/43863671
has body: I've looked around a bit, and found issues similar to mine, but not quite the same. I have a page template that is laid out in 4 columns in HTML. Inside column 4, I have a php function echoing a gallery of images. <?php echo get_homepage_img_small_1(); ?> <?php echo get_homepage_img_small_2(); ?> <?php echo get_homepage_img_small_3(); ?> <?php putRevSlider("homepage"); ?> <?php echo get_homepage_img_med_1(); ?> <?php echo get_homepage_img_med_2(); ?> <?php putRevSlider("home_small"); ?> I'm using jQuery to change the layout of the site based on the width of the window. var column3 = $("#homepage-column-3").contents(); var column4 = $("#homepage-column-4").contents(); var swapped = false; $(window).on('resize', function() { if( $(window).width() <= 700 && !swapped){ $("#homepage-column-3").html(column4); $("#homepage-column-4").html(column3); swapped = true; } else if( $(window).width() > 700) { $("#homepage-column-3").html(column3); $("#homepage-column-4").html(column4); swapped = false; } }); However, when the window size triggers the jQuery, the RevSlider from Column 4 freezes on the image it was displaying at the time, and the only way to get it running again is to refresh the page. Any thoughts? Or, if this question has been answered already, please point me in the right direction. Thanks!
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27769331
has comment: http://stackoverflow.com/comment/43861070
has title: How do I move a php call to another div and have it still work
has comment: http://stackoverflow.com/comment/43861040
tagged with: http://stackoverflow.com/tag/html
score: 0
tagged with: php
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43861069
has answer: http://stackoverflow.com/a/27769331
has comment: http://stackoverflow.com/comment/43861779

http://stackoverflow.com/comment/43748318
type: Comment
has text: i did that but nothing happens :(
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27660822

http://stackoverflow.com/q/27701513
type: UnansweredQuestion
has body: I found a greasemonkey script on the net which opens all the links on a webpage in new tabs. What I want to do is edit it so that it only opens particular links that contain the word forum. This is the script I am currently using: javascript: (function () { { var links = document.getElementsByTagName('a'); for (i in links) { window.open(links[i].href); } } })() How can I edit it to do what I want?
type: Question
has answer: http://stackoverflow.com/a/27701759
answer count: 3
score: -11
tagged with: greasemonkey
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/49694613
has title: How to open links in new tabs only if they contain a specific keyword?
downvote count: 72
upvote count: 61
has answer: http://stackoverflow.com/a/27711878

http://stackoverflow.com/a/27694228
score: 1
answers question: http://stackoverflow.com/q/27694127
has comment: http://stackoverflow.com/comment/43801860
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
has body: You've got your parentheses in the wrong places: CellID.get({id:cellnumber}), function(data){ $scope.info = data; } This is doing a get with the cellnumber, doing nothing with the result, and then just dropping a function into the ether. I think you meant to do this: CellID.get({id:cellnumber}/* &lt;-- no parenthesis here */, function(data){ $scope.info = data; }); // &lt;-- parenthesis here (and a semicolon) You should also be able to just do this: $scope.info = CellID.get({id:cellnumber});
accepted answer of: http://stackoverflow.com/q/27694127

http://stackoverflow.com/q/27767030
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/27769734
score: 0
type: Question
tagged with: linkedin-jsapi
tagged with: javascript
has title: Meteor: create user account when the client is authenticated the fist time they signin with linkedin?
answer count: 1
has body: I am running meteor.js and have globally installed npm package node-linkedin https://www.npmjs.com/package/node-linkedin I have registered my application with linkedin which means I have my api key, secret key and oAuth redirect urls to localhost:3000 My app currently displays the 'sign in' linkedIn button where the user grants my application access to the full profile of the user. According to linkedIn javascript API docs, the onLinkedInAuth() object (which runs upon successful authentication) contains the linkedin id of the user. How do I create a user account, Accounts.createUser when the user is authenticated and store the id from the onLinkedInAuth() object in the user collection? server.js var Linkedin = Npm.require('node-linkedin')('api', 'secret', 'I-PUT-REDIRECT-URL-HERE'); How do I make the get requests using the npm package https://www.npmjs.com/package/node-linkedin (see under heading oAuth 2.0) which redirects the user to linkedins authorization dialog and subsequently retrieve the access token. HTML: //layout template
tagged with: meteor
tagged with: oauth

http://stackoverflow.com/q/27772947
answer count: 2
has title: indexedDB objectStore.get() always returns undefined despite results in DB
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27810278
possible better answer: http://stackoverflow.com/a/72311661
has comment: http://stackoverflow.com/comment/43974420
has answer: http://stackoverflow.com/a/72311661
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43985966
has comment: http://stackoverflow.com/comment/43991920
has comment: http://stackoverflow.com/comment/44020679
favorite count: 0
score: 8
upvote count: 8
has body: I've been reworking an older project and making some improvements and I can no longer seem to figure out how to load a single entry from the indexedDB. I have cleared the DB and done a fresh import and I can see all the records (including the one I am using for the entryID) in the chrome inspectors Resource section. I have tried pulling all sorts of ID numbers, all of which I can confirm are in the DB from the inspector, they all return undefined. This is the code I'm using. /* This loads up a specific entry and fills in the #entry-details div with it's data. This div is placed overtop the search content so that when it is closed the user remains exactly where they were and the search does not need to re-process. */ function getEntryDetails(){ var entryID = 193; // just for now, this will be grabbed from somewhere else later // Where going to need a varible to store all this generated HTML in var html = ''; // First we need to load up the indexedDB and get the record in question. var db = indexedDB.open('pediaCache'); // lets get a couple of the errors out of the way. db.onerror=function(e){html += 'There was an error loading the database.&lt;br/&gt;'+e;} db.onblocked=function(e){html += 'Database access blocked.&lt;br/&gt;'+e;} // Now for when things go the right way db.onsuccess=function(e){ var db = e.target.result; // Get the requested entry console.log('Attempting to load entry ID '+entryID); var transaction = db.transaction(['entries'],'readonly'); var objectStore = transaction.objectStore('entries'); var entry = objectStore.get(entryID); entry.onerror = function(e) { console.log('error'); console.log(e.target.result); console.log(e); }; entry.onsuccess = function(e) { console.log('success'); console.log(e.target.result); console.log(e); }; } } This is really just some slightly modified code from the original version (since this functionality is the same, I really only modified the database and ObjectStore names both here and in the importer). Running this cod…
has answer: http://stackoverflow.com/a/27810278
type: AnsweredQuestion
tagged with: indexeddb
type: Question

http://stackoverflow.com/comment/43898009
score: 1
has text: `$POST` that is invalid. They are all missing an underscore.
type: QuestionComment
comment on: http://stackoverflow.com/q/27743558
type: Comment

http://stackoverflow.com/a/27657866
answers question: http://stackoverflow.com/q/27657613
downvote count: 0
type: Answer
upvote count: 1
has body: If I am able to understand you want to run same callback after completion of animations but only once. Following code will do it. This is little bit old school but works. We need to somehow identify that we have ran callback. So we pass a token to callback. It then identifies if token is present (means not run for that token) and it removes token and run code. var tokens = []; function animCallback(token) { var i = tokens.indexOf(token); if (i < 0) { //token already removed return; } tokens.splice(i, 1); alert('finished'); } function animateBoth() { tokens.push('mytoken'); animation1(function() { animCallback('mytoken'); }); animation2(function() { animCallback('mytoken'); }); } function deleteel(element) { element.parentNode.removeChild(element); } var tokens = []; function animCallback(token) { var i = tokens.indexOf(token); if (i < 0) { //token already removed return; } tokens.splice(i, 1); alert('finished'); } function animateBoth() { tokens.push('mytoken'); animation1(function() { animCallback('mytoken'); }); animation2(function() { animCallback('mytoken'); }); } function animation1(inputcallback) { var div1 = document.createElement("div"); div1.style.position = "absolute"; div1.style.left = "0px"; div1.style.top = "0px"; div1.style.width = "10px"; div1.style.height = "10px"; div1.style.backgroundColor = "red"; document.getElementById("animationcontainer").appendChild(div1); $(div1).animate({ top: "50" }, "slow", function() { $(div1).animate({ left: "+50" }, "slow", function() { $(div1).animate({ top: "20", left: "0" }, "slow", function() { $(div1).animate({ height: "50", top: "110", left: "0" }, "slow", function() { $(div1).remove(); inputcallback(); }); }); }); }); } function animation2(inputcallback) { var div1 = document.createElement("div"); div1.style.position = "absolute"; div1.style.left = "100px"; div1.style.top = "100px"; div1.style.width = "15px"; div1.style.height = "15px"; div1.style.backgroundColor = "blue"; document.getElementById("animationconta…
score: 1

http://stackoverflow.com/comment/43887379
comment on: http://stackoverflow.com/q/27738050
score: 0
type: Comment
type: QuestionComment
has text: Why are you trying to do this? It looks like a complete mess of program flow going in every different direction. Could you give us a concrete example of the use case you are trying to solve?

http://stackoverflow.com/q/27800375
has comment: http://stackoverflow.com/comment/44015473
upvote count: 10
score: 9
answer count: 3
has comment: http://stackoverflow.com/comment/44009218
has comment: http://stackoverflow.com/comment/44075309
has title: CKEditor Insert HTML
favorite count: 0
accepted answer: http://stackoverflow.com/a/27801191
tagged with: http://stackoverflow.com/tag/html
has body: I have a data from database. In my js file, I would like to change my CKEditor text editor's value. My value is raw html. I want this raw value to be written on an empty CKEditor text editor. I tried these but got an undefined function error all the time : CKEDITOR.instances.myEditorID.insertHtml( ' This is a new paragraph. ' ); CKEDITOR.instances.myEditorID.setData( ' This is the editor data. ' ); I tried this too but still undefined function error : CKEDITOR.instances.YOUREDITORID.updateElement(); alert( document.getElementById( 'YOUREDITORID' ).value ); Instead of myEditorID i tried 'editor', 'editor1', 'editor2' but still doesn't work for me. Thanks in advance. ---Update--- This is the html of my ckeditor text editor :
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/65714750
has comment: http://stackoverflow.com/comment/44047098
downvote count: 1
possible better answer: http://stackoverflow.com/a/64585076
type: Question
has answer: http://stackoverflow.com/a/64585076
has answer: http://stackoverflow.com/a/27801191
has comment: http://stackoverflow.com/comment/44074302
tagged with: javascript
tagged with: ckeditor
has comment: http://stackoverflow.com/comment/44075365
has comment: http://stackoverflow.com/comment/44046890

http://stackoverflow.com/q/27737453
has answer: http://stackoverflow.com/a/27737553
accepted answer: http://stackoverflow.com/a/27737553
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to implement a responsive video "collage" that display videos of various aspect ratios in a flexible grid. In each row, the videos have the same height, but they fill the horizontal width of a div. Since the width and the aspect ratio of each video are known, I think it's straightforward to calculate the height. Not sure how to implement it with CSS + Javascript. Anyone can help? Thank you very much.
tagged with: css
has title: creating HTML5 video tile
favorite count: 0
possible better answer: http://stackoverflow.com/a/27737922
has comment: http://stackoverflow.com/comment/43886320
has answer: http://stackoverflow.com/a/27737922
answer count: 2
linked to: http://stackoverflow.com/q/1186414
upvote count: 1
tagged with: video

http://stackoverflow.com/comment/43794953
has text: @Patrick. I have corrected the things you pointed out. I am typing on a mobile device and ot is a little rough. The users keep trying to use commas and spaces to differentiate between multiple entries. If I were to remove spaces upon submission it would change the entegrity of the intended data.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27690748

http://stackoverflow.com/comment/43960063
score: 0
type: Comment
type: QuestionComment
has text: you can iterate thorogh elements with the same name as in this question http://stackoverflow.com/questions/2505786/iterating-through-same-form-elements
comment on: http://stackoverflow.com/q/27774464

http://stackoverflow.com/a/27655605
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27655561
score: 2
accepted answer of: http://stackoverflow.com/q/27655561
upvote count: 2
has body: line IS the .date element, but find() finds descendant elements, what you really want to do is just use line directly, there's nothing to find line.datepicker(); JSBIN
type: AcceptedAnswer

http://stackoverflow.com/comment/43996432
comment on: http://stackoverflow.com/q/27793522
score: 1
has text: Show us what you have tried so far
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43918849
type: AnswerComment
comment on: http://stackoverflow.com/a/27753500
type: Comment
has text: if($(this).children().hasClass('active')){ $option.prop('selected', true); } else {}
score: 0

http://stackoverflow.com/a/27744748
has comment: http://stackoverflow.com/comment/43900698
answers question: http://stackoverflow.com/q/27744561
has comment: http://stackoverflow.com/comment/43900503
type: Answer
score: 1
has body: As the error message from the console suggests it looks like you've got some broken javascript and mismatched closing parenthesis. Try fixing your code: Parse.initialize("id", "id"); var module = angular.module("AuthApp", []); module.controller("MyCntrl", function($scope) { $scope.userIdChanged = function () { // now access $scope.userId here var query = new Parse.Query(Parse.User); query.get($scope.userId, { success: function(userInfo) { // The object was retrieved successfully. var address = userInfo.get("Address"); $scope.address = 'addresss: ' + address; }, error: function(object, error) { // The object was not retrieved successfully. // error is a Parse.Error with an error code and message. } }); // &lt;!-- HERE you forgot to close the opening parenthesis of the query.get method }; });
upvote count: 1
has comment: http://stackoverflow.com/comment/43900658
downvote count: 0
has comment: http://stackoverflow.com/comment/43901092

http://stackoverflow.com/q/27678419
favorite count: 0
has title: Trigger dual functions, one at a time
upvote count: 0
accepted answer: http://stackoverflow.com/a/27678453
score: -4
has body: I have two different functions, I want the first one to run when I shake my iPhone the first time and the second one to run the second time I shake my phone, after that I want it to start over. I'm using the gShake plugin for jQuery so the shaking part is already finished. But how do I trigger the two functions every other time? Thanks in advance!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27678453
type: Question
downvote count: 4
tagged with: function
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/27738476
upvote count: 1
answers question: http://stackoverflow.com/q/27738372
has body: $('#sel').change(function(){ var temp = this[this.selectedIndex].innerHTML; if(temp == "Option 1") { alert("Option 1 is selected"); } if(temp == "Option 2") { alert("Option 2 is selected"); } if(temp == "Option 3") { alert("Option 3 is selected"); } }); Also add this Options: to your select box in order to have all options available for the event. Demo
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/q/27689925
has comment: http://stackoverflow.com/comment/43826244
has body: I'm unsure why example 1 don't give the same result as example 2. Example 1: var a = [1,6,2,4]; var b = []; function minT(data){ var d = []; d = data; d.sort(function(a, b){return a-b}); return d; }; b = minT(a) console.log("b =" + b); console.log("a =" + a); Results: b =1,2,4,6 a =1,2,4,6 Example2: var a = [1,6,2,4]; var b = []; function minT(data){ var d = []; d = data.slice(0,10); d.sort(function(a, b){return a-b}); return d; }; b = minT(a) console.log("b =" + b); console.log("a =" + a); Results: b = 1,2,4,6 a = 1,6,2,4 Why does example 1 affect array a? How can I write a function minT that does not affect array a. (without a slice inside the function)?
has answer: http://stackoverflow.com/a/27690217
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43793061
has answer: http://stackoverflow.com/a/27689996
has title: Variables equality
has comment: http://stackoverflow.com/comment/43793700
type: AnsweredQuestion
tagged with: function
tagged with: arrays
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27689996
possible better answer: http://stackoverflow.com/a/27690217
type: Question

http://stackoverflow.com/a/27689629
answers question: http://stackoverflow.com/q/27689534
has body: JSON is a data serialization format. You shouldn't expect a serialization format to serialize functions. In the other hand, JSON property names are surrounded by double quots. It's still valid JavaScript since you can declare an object literal using JSON notation (of course, JSON stands for JavaScript Object Notation...!). If you want to use a JSON serializer to output an object literal containing functions and/or getters/setters, you're not using the right tool. Or you can still use it and perform further string manipulations/replaces to get what you expect like you already did...
type: Answer
score: 0

http://stackoverflow.com/comment/43993341
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27791762
has text: It seems to be going to http://www.myDomain/foo@bar.com which I'm guessing why it is giving me a 404, rather than my mail client on my site.

http://stackoverflow.com/q/27785511
type: Question
has title: Javascript - closure concept unclear
tagged with: closures
has body: Please refer the JSfiddle - http://jsfiddle.net/r0ejq8h8/ var buttons = document.getElementsByTagName("button"); for (i = 0; i &lt; buttons.length; i++) { buttons[i].addEventListener("click", function () { alert("You just clicked " + i); }); } It always alerts "You just clicked 5". I understand this. There might be many solutions for this problem. One of them I found is there in JSfiddle. No explanation in the net was good enough. Can someone please explain to me in detail as to what is happening with "i". Any other solution with explanation would also be great.
tagged with: javascript
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/27785566
favorite count: 0
has comment: http://stackoverflow.com/comment/43981373
has answer: http://stackoverflow.com/a/27785545
has answer: http://stackoverflow.com/a/27786347
type: UnansweredQuestion
score: 1
upvote count: 1
linked to: http://stackoverflow.com/q/750486

http://stackoverflow.com/comment/43976567
type: Comment
type: QuestionComment
score: 0
has text: elements don't exist when you run the plugin code. Check API docs to see if there is an event delegation approach for initializing, or an otherwise you would need to initialize after inserting new elements
comment on: http://stackoverflow.com/q/27772568

http://stackoverflow.com/a/27741093
has comment: http://stackoverflow.com/comment/43893307
score: -2
downvote count: 2
answers question: http://stackoverflow.com/q/27741004
type: Answer
upvote count: 0
has body: I would recommend having an ng-class="{'className': whenEntryURLisWhatever}" in your td, and make it change the css styles accessed, e.g: td span{ /*#normal styles#*/ } .className span{ /*#styles in the case of added classname (when it is a link)#*/ text-decoration: underline; cursor: pointer; } Then just change what happens on ng-click within a function defined in your javascript code. $scope.yourFunction = function(url){ if(!!url){ window.location = YourURL; } } This would cut down on code repetition, as your html could now be: &lt;tr ng-repeat="entry in tableEntries"&gt; &lt;td ng-class="{'className': !!entry.url}"&gt; &lt;span ng-click="yourFunction(entry.url)"&gt;{{entry.school}}&lt;/span&gt; &lt;/td&gt; ... &lt;/tr&gt;
has comment: http://stackoverflow.com/comment/43893457
has comment: http://stackoverflow.com/comment/43893677

http://stackoverflow.com/q/27695921
has body: I am trying to submit a parameter using JavaScript on click event on a li item, inside a foreach loop, the answers are pulled out of the database and each answer have an id, I want to write the JavaScript code to redirect to another PHP page carrying the parameter, which I pull out with GET, I pasted the code below for the foreach and the JavaScript function is called clickFunc(), foreach ($questions_answers_list as $questionID ) { $questionID = $questions_answers_list[$answerCount]['questionID']; if ($questionID !== "$quesID") { $answerCount++; continue; } else { ?&gt; &lt;li class="answersList" onclick="clickFunc()"&gt; &lt;?php echo $questions_answers_list[$answerCount]['answerArabic']; ?&gt; &lt;/li&gt; &lt;?php $answerCount++; } break; } Thanks in advance!
has comment: http://stackoverflow.com/comment/43805366
has comment: http://stackoverflow.com/comment/43805343
type: Question
accepted answer: http://stackoverflow.com/a/27695985
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43805633
has answer: http://stackoverflow.com/a/27695985
answer count: 1
has title: passing php to javascript onclick event using foreach loop
tagged with: php
type: AnsweredQuestion
tagged with: onclick

http://stackoverflow.com/comment/43910583
score: 0
type: Comment
has text: This function is not called when the server is created; it is called when a request is received by the http server.
comment on: http://stackoverflow.com/a/27749592
type: AnswerComment

http://stackoverflow.com/a/27719226
has comment: http://stackoverflow.com/comment/100951157
has body: Playing two rather ill constructed libraries against each other can be fun. Rather than doing all the work, I'll help you along with ideas as requested: rather than removing key bytes, PHP expands them using zero padding to the next available key size - that would be 192 bits or 24 bytes in your situation; to do this you need to specify aes-192-ecb as algorithm (you need to keep using MCRYPT_RIJNDAEL_128 but substitute, that 128 in PHP is the block size not the key size) the padding is not correct, PHP pads 0..15 zero bytes instead of 1..16 bytes you cannot use the 2 argument createCipher as the second argument is the password; node.js performs key derivation if you use that one, so you need to use the three argument createCipher instead and supply any 16 byte IV The IV code in PHP only taxes the random number generator needlessly, the IV is not used. Code to do the padding var padSize = 16 - ((len + 16 - 1) % 16 + 1); for (var i = 0; i &lt; padSize; i++) { // pad 0 .. 15 until to multiple of block size text += '\0'; } Or you could use your own padding method (in the question) unless len % 16 == 0.
has comment: http://stackoverflow.com/comment/43934518
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43876927
has comment: http://stackoverflow.com/comment/101003206
upvote count: 5
accepted answer of: http://stackoverflow.com/q/27714694
has comment: http://stackoverflow.com/comment/43862325
type: Answer
answers question: http://stackoverflow.com/q/27714694
has comment: http://stackoverflow.com/comment/43934232
downvote count: 0
has comment: http://stackoverflow.com/comment/100959531
has comment: http://stackoverflow.com/comment/43850063
score: 5

http://stackoverflow.com/comment/43712238
type: QuestionComment
type: Comment
has text: Nope it's the original question, not going to fix that. See the answer section for answers to your code!
comment on: http://stackoverflow.com/q/27647062
score: 0

http://stackoverflow.com/a/27656786
answers question: http://stackoverflow.com/q/27656130
has comment: http://stackoverflow.com/comment/43730158
has comment: http://stackoverflow.com/comment/43729831
has comment: http://stackoverflow.com/comment/43730239
has comment: http://stackoverflow.com/comment/43729523
has comment: http://stackoverflow.com/comment/43729599
type: Answer
upvote count: 1
has body: It is not that your service is not called from the directive, it is that your directive is not called at all based on the html you've provided. You should call a directive by transforming camel case notation to a dashed notation, as follows : &lt;input id="search" ng-model="searchText" auto-complete /&gt; You can find all about directive matching in the AngularJS Directive Documentation.
score: 1
has comment: http://stackoverflow.com/comment/43729777
downvote count: 0

http://stackoverflow.com/a/27711799
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27711731
upvote count: 1
has body: As well as Theraot solution you can try something like this: http://jsfiddle.net/3ukb41gp/1/ function encode(str) { var number = str; var hash = md5(number).toString(); hash = sha1(hash).toString(); hash = md5(hash).toString(); hash = md5(hash).toString(); hash = sha1(hash).toString(); hash = sha1(hash).toString(); hash = md5(hash).toString(); hash = sha1(hash).toString(); return hash; }

http://stackoverflow.com/q/27692049
type: Question
has comment: http://stackoverflow.com/comment/43798695
accepted answer: http://stackoverflow.com/a/27698526
tagged with: javascript
has comment: http://stackoverflow.com/comment/43797426
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43797622
has title: Bootstrap Modal Element's Height Issue
has comment: http://stackoverflow.com/comment/43798858
has comment: http://stackoverflow.com/comment/43797200
has comment: http://stackoverflow.com/comment/43797613
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27698526
has comment: http://stackoverflow.com/comment/43797859
has comment: http://stackoverflow.com/comment/43797287
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43798786
tagged with: twitter-bootstrap
score: 0
has comment: http://stackoverflow.com/comment/43799186
has body: I'm trying to display an Image in a Bootstrap Modal by using a div. Assume this: &lt;div class="modal-body"&gt; &lt;div class="row"&gt; &lt;div class="col-md-6 col-sm-6"&gt; &lt;div class = 'img-modal'&gt; &lt;img src="&lt;?php echo base_url().$articulo[0]-&gt;rutaImagen;?&gt;"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; The problem is that when the Modal opens, I want to center the Image, but the Image's Height and Width are, according to jquery/Javascript, 0. My Idea was to make the Image's position relative, and then use the Height/2 and Width/2 in order to center it in the div, but as I mentioned before, Height and Width appear to be 0. My question is: is there some workaround so that Height/Width appear correctly? Thanks in Advance, Hope it's clear enough now. NOTE: The Modal is working fine. Though I'm only showing the Body part, the rest is there.
has comment: http://stackoverflow.com/comment/43797249

http://stackoverflow.com/comment/44013724
type: Comment
has text: @T.J.Crowder: I had to deal with IE8 (and once even IE7, it was horrible) at work (I'm a webdev). I'm ***so*** glad my boss said we're only supporting IE9+ from now on. Though, I still have my Windows XP VM set up... just in case.
comment on: http://stackoverflow.com/a/27802010
type: AnswerComment
score: 0

http://stackoverflow.com/a/27703298
has body: The parent reference does not exist in javascript. What you can do is build an helper recursive function that will parse all your object and add a reference to the parent. This will build a more complex object. Here is a video which shows how to : http://blog.wax-o.com/2014/01/how-to-find-deep-and-get-parent-in-javascript-nested-objects-with-recursive-functions-and-the-reference-concept-level-beginner/
answers question: http://stackoverflow.com/q/27703029
score: 0
type: Answer

http://stackoverflow.com/q/27664013
has comment: http://stackoverflow.com/comment/43744924
has comment: http://stackoverflow.com/comment/43744312
has comment: http://stackoverflow.com/comment/43744249
has comment: http://stackoverflow.com/comment/43744940
has comment: http://stackoverflow.com/comment/43744837
has comment: http://stackoverflow.com/comment/43744191
has body: I have an encoded data that has to be sent by Ajax to a route which is in the end send via a controller to a function. WebPage=>Click Button=>Ajax Request=>route=>Controller var val=eval("CKEDITOR.instances.content"+id+".getData()"); $.ajax({ type: "POST", url: "/xarticle", data: { id:id, val:val, column:"content" }, success:function(data){ data=Number(data); } }); //the encoded data %3Cp%3E%3Cimg+alt%3D%22%22+src%3D%22%2Fjs%2Fimported%2Fckeditor%2Fplugins%2Fdoksoft_uploader%2Fuserfiles%2F96546165_large_4171694_prodykti_sjigaushie_jiri.jpg%22+style%3D%22float%3Aleft%3B+height%3A338px%3B+width%3A450px%22+%2F%3E%3C%2Fp%3E%0A%0A%3Cp%3EFirst+and+foremost+key+to+fast+metabolism+is+the+right+correlation+of+%3Cstrong%3Eprotein%3C%2Fstrong%3E%2C+%3Cstrong%3Efat%3C%2Fstrong%3E+and+%3Cstrong%3Ecarbohydrates%3C%2Fstrong%3E.%26nbsp%3B+To+reach+the+balance+here+will+help+a+classic+formula%3A+for+every+1+g+of+protein+come+3.5+g+of+carbohydrates+and+around+0.8+g+of+fats.+The+amount+of+proteins+shouldn%26rsquo%3Bt+comprise+more+than+25-33%25+from+the+whole+meal.%26nbsp%3B+In+case+the+amount+of+fat+and+carbohydrates+is+exceeded+you+will+be+gaining+weight.+For+example%2C+you+eat+a+lot+of+salads-absolutely+healthy+food.+But+you+keep+on+putting+on+those+pounds.+Let+me+guess%2C+you+are+pouring+5-6+table+spoons+of+oil+to+add+some+taste+to+every+salad.+Well%2C+that+is+a+problem+in+fact.+The+majority+of+diets%2C+by+the+way%2C+are+based+on+shrinking+the+amount+of+fat+and+carbohydrates.%3C%2Fp%3E%0A%0A%3Cp%3EI+know+it+seems+quite+time-consuming+to+count+all+those+proteins%2C+fats+and+carbohydrates.+However+it+is+enough+to+make+sure+that+fats+don%26rsquo%3Bt+prevail+upon+proteins.+To+make+it+even+easier%2C+you+might+choose+as+well+beforehand+a+dozen+of+meals+which+approximately+would+correspond+to+the+above+%26ndash%3Bmentioned+formula.+In+both+ways+for+the+majority+of+working+people+the+everyday+menu+doesn%26rsquo%3Bt+vary+that+much.%3C%2Fp%3E%0A%0A%3Cp%3E%3Cstrong%3EIron%3C%2Fstrong%3E%3C%2…
has answer: http://stackoverflow.com/a/27665698
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2364840
downvote count: 0
has comment: http://stackoverflow.com/comment/43744222
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43745413
type: Question
has comment: http://stackoverflow.com/comment/43744114
score: 1
accepted answer: http://stackoverflow.com/a/27665698
has comment: http://stackoverflow.com/comment/43743978
has comment: http://stackoverflow.com/comment/43745405
has comment: http://stackoverflow.com/comment/43743965
has title: Jquery Ajax working on localhost but refuses to work on server
has comment: http://stackoverflow.com/comment/43744791
has comment: http://stackoverflow.com/comment/43746621
upvote count: 1
has comment: http://stackoverflow.com/comment/43743937
answer count: 1
linked to: http://stackoverflow.com/q/332872
has comment: http://stackoverflow.com/comment/43744287
has comment: http://stackoverflow.com/comment/43744372

http://stackoverflow.com/q/27687679
score: 1
type: Question
tagged with: javascript
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/43789034
has comment: http://stackoverflow.com/comment/43795334
favorite count: 0
tagged with: rest
has answer: http://stackoverflow.com/a/27687781
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43788897
has title: WoW Armory APi - Can't get Title
tagged with: world-of-warcraft
has body: Hello I'm trying to pull my characters title from the Warcraft Armory but I don't get any returned results. My code is as follows with my character name being replaced with my actual character name . HTML Title Prefix: Test Javascript $(window).load(function getSite(){ $.ajax({ url: "http://eu.battle.net/api/wow/character/server/character?fields=titles&jsonp=GoGet", type: 'GET', dataType: 'jsonp', }); } ); function GoGet(data) { $("#title").html(data.titles.name) ;} The api documentation shows the json items for "titles" as follows: { "achievementPoints": 675, "battlegroup": "Test Battlegroup", "calcClass": "f", "class": 10, "gender": 1, "lastModified": 1348187981118, "level": 90, "name": "Peratryn", "race": 25, "realm": "Test Realm", "thumbnail": "test-realm/1/1-avatar.jpg", "titles": [ { "id": 285, "name": "%s, Savior of Azeroth", "selected": true } ] } Where am I going wrong?
downvote count: 0

http://stackoverflow.com/q/27727909
type: UnansweredQuestion
type: Question
tagged with: performance
tagged with: javascript
has comment: http://stackoverflow.com/comment/43869744
has comment: http://stackoverflow.com/comment/43868343
score: 0
has title: NodeJS writing out large file using pipes
has comment: http://stackoverflow.com/comment/43882465
has body: I'm new to nodejs...doing some serverside file conversion. I'm using pipes to read data from a stream, convert, then write the converted data into a file. Works great for small files. But for large files, it suffers from two issues: The data isn't written to the file gradually. It is using a lot of memory, so every consecutive 100,000 lines takes longer to process. I think it has something to do with calling process.nextTick. I can't figure out how to put the whole thing together. I have something like: readableFileStream.pipe(through(convert)).pipe(fileWritableStream); function convert(buf) { //do something to buf this.queue(convertedBuf); } I wanted to something like: var threashold = 100000; var cnt = 0; function convert(buf) { cnt++; if (cnt &gt; threashold &amp;&amp; cnt % threashold == 0) { process.nextTick(doSomething); } //do something to buf this.queue(convertedBuf); } Clearly that doesn't work, nextTick doesn't take a parameter. How should one deal with a situation like this?
tagged with: node.js
answer count: 0
has comment: http://stackoverflow.com/comment/43878688
has comment: http://stackoverflow.com/comment/43879500

http://stackoverflow.com/comment/44163745
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27792091
type: QuestionComment
has text: did you try to add if(!$scope.$$phase) $scope.$apply(); after receiving data?

http://stackoverflow.com/comment/43751726
score: 0
type: Comment
has text: I want work to building something where once the two dates are selected,you the start and end of each week within the selected range. Ex) December 28 2014 and January 10 2015 : week 1- December 28 2014-January 3 2014 week 2 January 4 2014 January 10 2014. I realize the first step is getting the total weeks, next step is the addition of each week.
type: AnswerComment
comment on: http://stackoverflow.com/a/27660204

http://stackoverflow.com/a/27682937
score: 0
has comment: http://stackoverflow.com/comment/43811067
has comment: http://stackoverflow.com/comment/43788559
has comment: http://stackoverflow.com/comment/43780672
answers question: http://stackoverflow.com/q/27682880
type: Answer
has body: You have double " on the inside of the beginning of your strings, see edited example below. Also includes a few other changes for the following reasons It looks like you have the script in the table tag, put the script into the head portion of the document, and you are using the type text/jquery when you should be using text\javascript, change those two issues and see if that resolves the issue Also as noted by @Mouser you need a separate tag for the jQuery reference
has comment: http://stackoverflow.com/comment/43781029

http://stackoverflow.com/comment/43730395
type: Comment
type: QuestionComment
has text: try this $('#messageme').val(data);
comment on: http://stackoverflow.com/q/27657277
score: 4

http://stackoverflow.com/a/27735591
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43882608
answers question: http://stackoverflow.com/q/27735547
score: 1
accepted answer of: http://stackoverflow.com/q/27735547
upvote count: 1
has body: You have to use event delegation as the content are dynamically changed. $(document).on('click','.del-goods',function(){
has comment: http://stackoverflow.com/comment/43882751
type: AcceptedAnswer

http://stackoverflow.com/a/27745276
answers question: http://stackoverflow.com/q/27745235
downvote count: 0
type: Answer
score: 2
has body: You should be using &amp;&amp; in place of + in your condition: if (ui.zoomer.length &amp;&amp; $( '.activate' ).hasClass( "activated" )) { var div = document.createElement('div'); div.setAttribute('class', 'glass'); ui.glass = $(div); $('body').append(div); }
upvote count: 2

http://stackoverflow.com/a/27742680
accepted answer of: http://stackoverflow.com/q/27742281
answers question: http://stackoverflow.com/q/27742281
type: Answer
has comment: http://stackoverflow.com/comment/43897084
has body: When your code snippet is evaluated, this has no specific meaning and is set to whatever the context is. It would only make sense in an instance context which happens way later. If you want to set a dynamic el, provide a function to be evaluated when you instantiate a view: var TableView = Backbone.View.extend({ el: function() { return '#'+this.id+'_div'; } }); var v = new TableView({id: 'x'}); console.log(v.$el.text()); http://jsfiddle.net/nikoshr/bcfhqq18/ Or, if you prefer to modify the prototype TableView.prototype.el = function() { return '#'+this.id+'_div'; } http://jsfiddle.net/nikoshr/bcfhqq18/2/ Finally, note that extending a class via Backbone sets the prototype chain and instanceof should be true when testing against an ancestor class: var TableView = Backbone.View.extend({ }); var DeepTableView = TableView.extend({ el: function() { return '#'+this.id+'_div'; } }); var v = new DeepTableView({id: 'x'}); console.log(v instanceof Backbone.View); // true console.log(v instanceof TableView); // true console.log(v instanceof DeepTableView); // true http://jsfiddle.net/nikoshr/bcfhqq18/3/
has comment: http://stackoverflow.com/comment/43897163
upvote count: 3
score: 3
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43896936

http://stackoverflow.com/a/27760957
has comment: http://stackoverflow.com/comment/43934105
type: Answer
has comment: http://stackoverflow.com/comment/43934868
score: 0
has comment: http://stackoverflow.com/comment/43949372
accepted answer of: http://stackoverflow.com/q/27760517
has body: For Javascript, client side execution, to call a PHP function, a server side execution, you will need to create a very small API using ajax. If you include jQuery into your project, you could send Javascript variables to a PHP file and send the mail using PHP. Javascript: $.ajax({ type: "POST", url: "path/to/file/mail.php", data: { message : "&lt;?php echo the_title(); ?&gt;", subject : "Expired post report" } }).done(function( msg ) { alert( msg ); }); PHP file called mail.php: $message = $_REQUEST['message']; $to = "my@outlook.com", $subject = $_REQUEST['subject']; $headers = "From: reporting@website.com"; echo mail($to, $subject, $message, $headers); mail() returns true if it was successful, so the Javascript function will alert true / false.
answers question: http://stackoverflow.com/q/27760517
has comment: http://stackoverflow.com/comment/43983466
has comment: http://stackoverflow.com/comment/43935294
has comment: http://stackoverflow.com/comment/43934219
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43935415

http://stackoverflow.com/a/27713230
has comment: http://stackoverflow.com/comment/43859636
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27702292
has body: You are close, you don't pass all of the animations as the second parameter in THREE.Animation, you just pass the one animation. animation = new THREE.Animation(mesh, model.animations[0]); // EDIT: First parameter is the SKinnedMesh not geometry.
upvote count: 2
type: Answer

http://stackoverflow.com/q/27709714
has comment: http://stackoverflow.com/comment/43831742
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43832202
has title: Overflow hidden property is not working with parallax scrolling
accepted answer: http://stackoverflow.com/a/27710329
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43831621
type: Question
has comment: http://stackoverflow.com/comment/43831345
has comment: http://stackoverflow.com/comment/43831909
tagged with: javascript
has body: The overflow hidden property is not working as expected when trying it with parallax scrolling. I am trying to accomplish parallax scrolling with JavaScript everything should work fine but when i try to set the overflow to hidden the image still appearing outside the div Here is the HTML The title //Some title //Blue box in front of the image(design decision) //The image which has the proprety Here is my JavaScript eventListener and the function : window.addEventListener("scroll",func,false); function func(){ prlx_lyr_1 = document.getElementById("prlx"); prlx_lyr_1.style.top = (window.pageYOffset/4)+"px" } And this is my CSS for the image which i am trying to hide the overflowing parts : #page2 img{ position:relative; top:-300px; } And this is the CSS of the div which contain the image #page2{ overflow:hidden; height:250px; } There is some extra CSS for the #bg Update: here is a You can notice that the overflow is not hidden the container div is the blue side in the page Here is a js fiddle
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27710329
tagged with: parallax
favorite count: 0
has comment: http://stackoverflow.com/comment/43831487

http://stackoverflow.com/comment/43996512
comment on: http://stackoverflow.com/a/27789579
has text: I'm sorry I forgot about adding the `.navbar` class to the navbar, but the menus shouldn't have `.navbar-nav` as they are justified pills. I was hoping for a JS solution rather than a CSS one, since I'm aiming to make it compatible up to IE 8. I'll still mark your answer the right one since I didn't specify wanting a JS solution except through the tags, maybe. Let me know if you've figured out a JS solution, though. Thanks!
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43887312
type: Comment
comment on: http://stackoverflow.com/a/27737974
score: 1
has text: Awesome Code! Thanks :P I'm going to try and add this in now, Thanks so much for the effort you put in :)
type: AnswerComment

http://stackoverflow.com/q/27762860
has answer: http://stackoverflow.com/a/27762889
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27762889
linked to: http://stackoverflow.com/q/86653
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/27767397
favorite count: 0
has body: I'm parsing a Ruby object into JSON, rendering it in a js.erb file, and printing it to console (Chrome Browser). In my js.erb file, when I print this: console.log("&lt;%= @search.attributes.to_json %&gt;") I get this: {&amp;quot;id&amp;quot;:124,&amp;quot;period_start&amp;quot;:null,&amp;quot;period_end&amp;quot;:null,&amp;quot;user_id&amp;quot;:null,&amp;quot;created_at&amp;quot;:&amp;quot;2015-01-04T05:54:05.133Z&amp;quot;,&amp;quot;updated_at&amp;quot;:&amp;quot;2015-01-04T05:54:05.133Z&amp;quot;,&amp;quot;onscreen_people_rank_lower&amp;quot;:null,&amp;quot;onscreen_people_rank_upper&amp;quot;:null,&amp;quot;incl_onscreen_people_unranked&amp;quot;:null,&amp;quot;offscreen_people_rank_lower&amp;quot;:null,&amp;quot;offscreen_people_rank_upper&amp;quot;:null,&amp;quot;incl_offscreen_people_unranked&amp;quot;:null} which is very hard to read. I want to make the JSON pretty so that I can read it more easily. In my js.erb file, I've tried this: console.log(eval("(" + "&lt;%= @search.attributes.to_json %&gt;" + ")")) and this: console.log( jQuery.parseJSON("&lt;%= @search.attributes.to_json %&gt;") ) and this: console.log( "&lt;%= JSON.pretty_generate(@search.attributes) %&gt;" ) but none work--the code is not evaluated and nothing is outputted. What am I doing wrong?
has title: Pretty print a JSON object created in Ruby to Chrome browser console
type: AnsweredQuestion
score: 2
upvote count: 2
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43936751
accepted answer: http://stackoverflow.com/a/27767397
tagged with: ruby-on-rails

http://stackoverflow.com/a/27831080
has body: One recursive function able to go n subcategories deep! Have fun. obj = {"categories":[{"ic_id":"100002","ic_disp_val":"Campaigns","ic_sub":1,"ic_sub_categories":[{"ic_id":"100021","ic_disp_val":"Campaigns sub categorist","ic_sub":1,"ic_sub_categories":[{"ic_id":"100118","ic_disp_val":"camp 1","ic_sub":0},{"ic_id":"100119","ic_disp_val":"camp 2","ic_sub":0},{"ic_id":"100120","ic_disp_val":"camp 3","ic_sub":0}]}]},{"ic_id":"100002","ic_disp_val":"Products","ic_sub":1,"ic_sub_categories":[{"ic_id":"100021","ic_disp_val":"cxtest","ic_sub":1,"ic_sub_categories":[{"ic_id":"100118","ic_disp_val":"camp 1","ic_sub":0},{"ic_id":"100119","ic_disp_val":"camp 2","ic_sub":0},{"ic_id":"100120","ic_disp_val":"camp 3","ic_sub":0}]}]},{"ic_id":"100002","ic_disp_val":"Campaigns / Products","ic_sub":1,"ic_sub_categories":[{"ic_id":"100021","ic_disp_val":"cxtest","ic_sub":1,"ic_sub_categories":[{"ic_id":"100118","ic_disp_val":"camp 1","ic_sub":0},{"ic_id":"100119","ic_disp_val":"camp 2","ic_sub":0},{"ic_id":"100120","ic_disp_val":"camp 3","ic_sub":0}]}]}]}; function addCategories(obj) { htmlBuilder = ""; for (var i = 0; i &lt; obj.length;i++) { htmlBuilder +='&lt;li&gt;'+obj[i].ic_disp_val; if (obj[i].ic_sub==1) { htmlBuilder +='&lt;ul&gt;'; htmlBuilder += addCategories(obj[i].ic_sub_categories); htmlBuilder +='&lt;/ul&gt;'; } htmlBuilder +='&lt;/li&gt;'; } return htmlBuilder; } document.getElementById("expList").innerHTML = addCategories(obj.categories); prepareList(); See this http://jsfiddle.net/uqgd07kp/3/ for a working example.
downvote count: 0
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27653972
type: Answer
accepted answer of: http://stackoverflow.com/q/27653972
score: 2

http://stackoverflow.com/a/27984712
has comment: http://stackoverflow.com/comment/98678675
downvote count: 0
has body: You can use the JS method from S3: var AWS = require('aws-sdk'); AWS.config.loadFromPath('./credentials-ehl.json'); var s3 = new AWS.S3(); var params = { Bucket: 'your bucket', Key: 'your object' }; s3.deleteObject(params, function(err, data) { if (err) console.log(err, err.stack); // error else console.log(); // deleted }); Be aware that S3 never returns the object if it has been deleted. You have to check it before or after with getobject, headobject, waitfor, etc
has comment: http://stackoverflow.com/comment/67643684
score: 144
answers question: http://stackoverflow.com/q/27753411
has comment: http://stackoverflow.com/comment/98740637
upvote count: 144
has comment: http://stackoverflow.com/comment/49615642
type: Answer
has comment: http://stackoverflow.com/comment/96459730
has comment: http://stackoverflow.com/comment/98750046

http://stackoverflow.com/a/27653976
upvote count: 1
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27653554
has body: there are a lot more TLDs than that. Why not loosen your regex to something like this? var myRegExp = /^(\w+\.)+(\w+)$/;

http://stackoverflow.com/comment/43718031
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27650459
has text: because 1/10000000 returns 1e-7 while 1/1000000 returns 0.000001. it differs how parseInt actually works...
type: Comment

http://stackoverflow.com/q/27699710
has answer: http://stackoverflow.com/a/27699942
accepted answer: http://stackoverflow.com/a/27699942
linked to: http://stackoverflow.com/q/750486
tagged with: node.js
type: AnsweredQuestion
tagged with: mysql
has title: Variable within for loop giving max value
type: Question
tagged with: cheerio
tagged with: for-loop
tagged with: javascript
has body: EDIT: Updated with full code. I'm writing javascript code in node.js that is meant to loop through an array of data that I have scraped from the web. The purpose of the code is to: 1) Check the player table to see if that player's name exists in a record, and 2) If that player doesn't exist, add him to the database. Here is my code: var cheerio = require('cheerio'); var request = require('request'); var data = []; var mysql = require('mysql'); var connection = mysql.createConnection({ host: 'localhost', user: 'root', password: 'blahblah', database: 'test', port: 3306 }); connection.connect(); request('http://www.basketball-reference.com/friv/dailyleaders.cgi?month=12&amp;day=28&amp;year=2014', function(err, response, body){ if(!err &amp;&amp; response.statusCode ==200){ var $ = cheerio.load(body); $('td', 'tbody').each(function(){ var url = $(this).attr('href'); var text = $(this).text(); data.push(text); }); for(i=1;i&lt;data.length;i+=26){ var query = connection.query( "SELECT * FROM player WHERE name = '"+data[i]+"'",function(err, result, fields) { if (err) throw err; if(result.length==0){ //var insertQuery = "INSERT INTO player (provider_id, team_id, position_id, name) VALUES (1, (SELECT id FROM team WHERE slug = '"+data[i+1]+"'),1,'"+data[i]+"');"; console.log(i); } }); } } }); Note that I commented out my INSERT query for testing purposes, but the player name is located in data[i] while the team name is in data[i+1]. To test, I am just printing i to the console, and every loop it prints out the max value of i, which is 3225. However, that console.log command is INSIDE the for loop, so shouldn't it print each value of i as it is incremented?
score: 0
answer count: 1

http://stackoverflow.com/a/27721427
upvote count: 1
has comment: http://stackoverflow.com/comment/43857254
has comment: http://stackoverflow.com/comment/43854593
has comment: http://stackoverflow.com/comment/43857415
has comment: http://stackoverflow.com/comment/43857111
has comment: http://stackoverflow.com/comment/43855189
has comment: http://stackoverflow.com/comment/43854517
downvote count: 0
has comment: http://stackoverflow.com/comment/43857748
has comment: http://stackoverflow.com/comment/43854896
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43856969
has comment: http://stackoverflow.com/comment/43857362
has body: The below answer provides a list of known advertiser domain names, which may be useful Finding Ads on a web page To detect advertisements on a page, I would check for iframes on the page and then check to see if the iframe's src domain is in a list of known advertisers. You could just check to see if it matches the current websites domain but this would identify external scripts/widgets like Facebook like buttons as advertisements as they use embedded iframes too. You can use the below code to get the src var frames = document.getElementsByTagName("iframe"); var frame = frames[0]; var srcString = frame.src You could then extract the domain name from this src string and compare to your list of advertisers, which could simply be an array or stored within a database. This code should help get all iframes on the website using jQuery and get the domain for each $('iframe').each(function(index, frm) { if (undefined != frm.src &amp;&amp; frm.src != '') { var parser = document.createElement('a'); parser.href = frm.src; console.log(parser.hostname); } }); You can do it without jQuery if needed
has comment: http://stackoverflow.com/comment/43855578
has comment: http://stackoverflow.com/comment/43857589
type: Answer
has comment: http://stackoverflow.com/comment/43855025
has comment: http://stackoverflow.com/comment/43857340
accepted answer of: http://stackoverflow.com/q/27721343
has comment: http://stackoverflow.com/comment/43854821
score: 1
answers question: http://stackoverflow.com/q/27721343

http://stackoverflow.com/q/27644965
tagged with: angularjs
type: UnansweredQuestion
has title: Using namespaces in Angular
has comment: http://stackoverflow.com/comment/43712511
has body: I am new to Angular, but the first thing I wanted to use was namespaces (as use them elsewhere) I have read a number of posts regarding namespaces in Angular, and wanted to get an opinion on an approach I was going to perhaps take... I was thinking of structuring very similar to what is suggested elswhere (ie have a main app.js, and then divide by features or "views". For example, if I wanted to use a namespace such as TestModule, I would have each Feature/View and it's associated Controller in a separate js file... eg such a file will look something like... var TestModule = TestModule || {}; TestModule.View1 = function () { // Private helpers function cellTemplate(cellElement, cellInfo) { var div = document.createElement('div'); ...... }; function controller($scope) { $scope.testText = "umm, hello"; $scope.gridData = [ { col1: 'data 1', col2: 'data 2' }, { col1: 'data 3', col2: 'data 4' }, ]; $scope.cellTemplate = cellTemplate; } return { // Controller Controller: controller } } And then in the main app.js. have something like.. "use strict"; var TestModule = TestModule || {}; var ngGridApp = angular.module("ngTestApp", ['dx']); ngGridApp.controller("gridController1", TestModule.View1().Controller); ngGridApp.controller("listController1", TestModule.View2().Controller); etc These are just my initial ideas, perhaps as I learn more I may find this approach won't be a good one, but it seems ok to me? I would be interested in any feedback on this 2 cents worth :-) Cheers
answer count: 0
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43714322

http://stackoverflow.com/comment/77663595
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27804099
type: Comment
has text: could you locate an example of edge bundling with super conductor? any with pixi.js ?

http://stackoverflow.com/comment/43869091
comment on: http://stackoverflow.com/q/27718438
score: 0
has text: Are you using pre-compiled templates?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/130014664
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27760489
has text: @r3wt actually, in both of those valid reasons for checking I gave, it is still more appropriate to just check if it fulfills the thenable interface, because that's what would align with the expectations of programmers who actually take the time to get fully correct expectations by learning the spec.

http://stackoverflow.com/comment/43944790
has text: @joasisk I'm glad that I was able to provide some assistance :-) I remember when I was doing similar type of event handling for the very first time, I found it really tricky, and spend hours trying to figure out whats going on with dynamically created elements and their event handling. Anyway, you are doing great and progressing really well with JavaScript!
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27755422

http://stackoverflow.com/q/27787087
score: 2
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27787221
linked to: http://stackoverflow.com/q/14419651
has body: How do we apply number filter on input field? I works fine on displaying on non-input field. However when I set the filter on input field I get an error. &lt;input type="number" name="input" ng-model="value2 | number:2" min="0" max="99" size="20"&gt; Error: [ngModel:numfmt] http://errors.angularjs.org/1.3.8/ngModel/numfmt?p0=98.77 at Error (native) at http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:6:416 Here is a plunk for testing. number format
type: Question
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43984229
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28353080
has title: Apply number filter on input field in AngularJS

http://stackoverflow.com/comment/82864758
comment on: http://stackoverflow.com/a/27659267
score: 0
type: Comment
has text: I/O bound work does not require CPU, so blocking a thread waiting on that to complete is inefficient. Javascript uses events/callbacks when the data is ready, allowing the running thread to utilize CPU resources. https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/
type: AnswerComment

http://stackoverflow.com/a/27660682
has comment: http://stackoverflow.com/comment/43737617
has body: Use a variable to detect if you found an old item: var found = false; for(var x=0; x &lt; mycart.length; x++){ if(mycart[x].id == newid ){ var tmpq = mycart[x].quantity; mycart[x].quantity = parseInt(tmpq) + parseInt(q); found = true; break; } } if (!found) { mycart.push ({ id: newid, quantity: newquantity }); } It would be simpler if you made mycart an object whose keys are the IDs, so you wouldn't have to do a linear search. It would be like this: var mycart = { "1": { quantity: 10 }, "6": { quantity: 20 }, ... }; Then your code would be: if (mycart.hasOwnProperty(newid)) { mycart[newid] += newquantity; } else { mycart[newid] = { quantity: newquantity }; }
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/27660622
has comment: http://stackoverflow.com/comment/43737433
score: 2
answers question: http://stackoverflow.com/q/27660622
has comment: http://stackoverflow.com/comment/43737352
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/43889226
type: Comment
type: QuestionComment
has text: please elaborate because i think that's what i did.
comment on: http://stackoverflow.com/q/27739138
score: 0

http://stackoverflow.com/q/27729779
has answer: http://stackoverflow.com/a/27729932
accepted answer: http://stackoverflow.com/a/27729830
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43871795
downvote count: 0
has comment: http://stackoverflow.com/comment/43871173
type: Question
possible better answer: http://stackoverflow.com/a/27729932
answer count: 2
tagged with: javascript
tagged with: jquery
score: 4
has body: I'm trying to split a string from where a number is encountered. The problem is the number can sometimes have decimals in it. I tried this without any luck: str = "hello there can sometimes be decimals like 1.5 in here" var parts = str.split(/\d*\.?\d*/); The intended result would be an array with everything before the number in first position, then the number, then the rest of the string. What am I doing wrong?
has title: Split from number with possible decimals
tagged with: regex
upvote count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/27729830

http://stackoverflow.com/q/27748931
has answer: http://stackoverflow.com/a/30260359
accepted answer: http://stackoverflow.com/a/27749644
upvote count: 4
has body: I want to create a polymer element with function attribute, which will be called when getting a success response. func function(){ alert('hi'); } I tried this: It doesn't work. How can I call this succCallback function? Thanks!
has answer: http://stackoverflow.com/a/27749021
favorite count: 0
possible better answer: http://stackoverflow.com/a/27749021
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27749644
has title: How to add function attribute to polymer element
type: Question
tagged with: polymer
has answer: http://stackoverflow.com/a/28006820
downvote count: 0
tagged with: javascript
score: 4

http://stackoverflow.com/comment/44013784
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27802360
has text: I'm still not sure what you are trying to accomplish...sorry
type: AnswerComment

http://stackoverflow.com/q/27692611
has answer: http://stackoverflow.com/a/27692715
linked to: http://stackoverflow.com/q/8837454
duplicate of: http://stackoverflow.com/q/8837454
tagged with: javascript
tagged with: sorting
type: AnsweredQuestion
has title: Sort an arary of objects by date
accepted answer: http://stackoverflow.com/a/27692715
has comment: http://stackoverflow.com/comment/43798262
type: Question
answer count: 1
has body: I got an array of objects which I want to sort by date. I've got the date formatted like this with a property - created_at: "2014-09-26 19:27:43". If any one could point me in the right direction, that would be great.
score: 0

http://stackoverflow.com/q/27648177
downvote count: 0
favorite count: 0
has title: SQL to Mongo Transactions Schema
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27649125
score: 1
upvote count: 1
type: Question
tagged with: mongodb
has body: I have collection where I collect bills and income information. It consist of: _id billName type (usually - income, fixedBill or variableBill) amount start_date end_date timestamp And now I need to register payments on this bills. In SQL I would create a transactions table and register the payments there. For each payment, I would save the bills._id as key and then join it whenever I need to see the transactions under one bill. Now, since I'm using Mongodb, I would like to use the proper way. How would be the schema for this in Mongo?
tagged with: javascript
tagged with: express
accepted answer: http://stackoverflow.com/a/27649125
tagged with: sql
answer count: 1

http://stackoverflow.com/comment/43794883
type: AnswerComment
has text: Grezzo brings up a valid point: The OP gives the impression that he cannot change or control the HTML content returned from the method. That makes me wonder whether the HTML given back can always be trusted not to contain a click-hijacker or something...
type: Comment
comment on: http://stackoverflow.com/a/27690647
score: 1

http://stackoverflow.com/comment/43947679
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27767954
score: 3
has text: that's the part I don't understand. It is e.lengthComputable 'true ' for mozilla, but not for chrome... If another txt based file is specified as url instead of an html, it is 'true' for Chrome as well. For example, I tried with '/Site.master' and was computable. When I change it to html, it is not...

http://stackoverflow.com/a/27648581
type: Answer
accepted answer of: http://stackoverflow.com/q/27648328
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/27648328
has body: I recall Rob Dodaon saying in one of his videos, that core-list and its hosting parent need to be given a height. You did specify it on core-list, but not on the body. There are two solutions: Add html, body { height: 100%; } to the CSS style of the page you are using your my-el in. (or put your element in a fullbleed body: ) Wrap your core-list into a div and specify the height of the div. I put the latter example on jsfiddle and as a snippet here: http://jsfiddle.net/kreide/a9yg71zm/ адfа {{ model.text }}
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/43813981
type: QuestionComment
comment on: http://stackoverflow.com/q/27700437
score: 0
has text: What is the name of your php file?
type: Comment

http://stackoverflow.com/q/27777980
has comment: http://stackoverflow.com/comment/43990767
tagged with: zooming
type: Question
tagged with: d3.js
has title: Changing rectangle dimensions in d3 zoom
has comment: http://stackoverflow.com/comment/44013580
upvote count: 1
has comment: http://stackoverflow.com/comment/43973726
has comment: http://stackoverflow.com/comment/44065658
has comment: http://stackoverflow.com/comment/43973854
has answer: http://stackoverflow.com/a/27781999
has body: I am using d3 to build a piano roll editor (which looks kind of like this). I need the rectangles to always be snapped onto the grid so when I pan or zoom the shapes will stay relative to the grid lines. It doesn't matter if the vertical grid lines redraw as I move in and out, but the number of horizontal grid lines should always stay the same, and the rectangle shapes are always locked on. An example of it not quite working can be seen here: http://jsfiddle.net/jgab3103/e05qj4hy/ I can see lots of d3 zoom type of examples around the place but I can't find anything to address this kind of issue. I think I am just not understanding how to scale shapes properly when working with the the zoom function. Also, in trying to get this to work I am noticing the panning and zooming seems to have become a bit unreliable, not sure why. Anyway, if anyone had any ideas on how to solve this, it would be greatly appreciated. The code which is on the jsfiddle is below: UPDATE: Just to (hopefully!) clarify - both horizontal and vertical axis need to zoom. The constraint is that the number of horizontal grid lines needs to stay the same and the shapes must be locked on to the grid lines so the dimensions never change. If a rectangle starts with a width and height of 1, this always needs to be retained when zooming. //Data for note shapes var noteData = [ {frequency: 3, duration:1, startPoint: 1}, {frequency: 6, duration:1, startPoint: 2}, {frequency: 5, duration:1, startPoint: 3}, {frequency: 4, duration:1, startPoint: 4} ]; margin = { top: 20, right: 20, bottom: 20, left: 45 }; width = 400 - margin.left - margin.right; height = 200 - margin.top - margin.bottom; //SCALES var xScale = d3.scale.linear() .domain([0,width]) .range([0, width]) var yScale = d3.scale.linear() .domain([0,width]) .range([0, height]); var heightScale = d3.scale.linear() .domain([0,100]) .range([0,height]); //Set up zoom var zoom = d3.behavior.zoom() .x(xScale) .y(yScale) .scaleExtent([1,100]) .scale([50]) .on("…
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44013314
has comment: http://stackoverflow.com/comment/43971619
has comment: http://stackoverflow.com/comment/43984833
answer count: 1
downvote count: 0
score: 1
favorite count: 0

http://stackoverflow.com/q/27647695
tagged with: ajax
score: 0
has title: Multiple Ajax Request when refetching Events from fullcalendar.io
type: UnansweredQuestion
tagged with: fullcalendar
type: Question
has answer: http://stackoverflow.com/a/27648371
answer count: 1
tagged with: javascript
has body: I have the problem: hen i refetch the events from fullcalendar after i did the ajax request for inserting the event, he executes the ajax request multiple times. So the same event is twice or more in the database. Why that? Thanks! dayClick: function(date, jsEvent, view) { .... //alert(date.format()); $('#btnYesNew').click(function(){ var startTimeParam = 'startTime=' + date.format() + "%20" + $('#startTime').val(); var endTimeParam = 'endTime=' + date.format() + "%20" + $('#endTime').val(); var purposeParam = 'purpose='+ $('#zweck').val(); var carIdParam = 'carId=' + $('#auto').val(); var departmentIdParam = 'departmentId=' + $('#abteilung').val(); if (view.name != 'month'){ startTimeParam = 'startTime=' + date.format('YYYY-MM-DD') + "%20" + $('#startTime').val(); endTimeParam = 'endTime=' +date.format('YYYY-MM-DD') + "%20" + $('#endTime').val(); } var uri = startTimeParam + "&amp;" + endTimeParam + "&amp;" + purposeParam + "&amp;" + carIdParam + "&amp;" + departmentIdParam; // Add Event to database $.get( "kfz-buchung-ajax-rent-add?" + uri, function( data ) { }) .done(function(data){ $('#myModalNew').modal('hide'); }) $('#calendar').fullCalendar( 'refetchEvents' ); }); }
tagged with: jquery

http://stackoverflow.com/comment/133201455
has text: @ArtjomB. Can you help pleas? How encrypt in php if in CryptoJs side they decrypt like this - let bytes = AES.decrypt(user.password.toString(), secretKey); compareResult = password === JSON.parse(bytes.toString(CryptoJS.enc.Utf8)); secretKey I have.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27678978

http://stackoverflow.com/a/27744683
has comment: http://stackoverflow.com/comment/43900433
downvote count: 0
has comment: http://stackoverflow.com/comment/43900270
has comment: http://stackoverflow.com/comment/43900344
has comment: http://stackoverflow.com/comment/43900371
has comment: http://stackoverflow.com/comment/43900679
answers question: http://stackoverflow.com/q/27744625
type: Answer
has comment: http://stackoverflow.com/comment/43900568
has comment: http://stackoverflow.com/comment/43900625
has comment: http://stackoverflow.com/comment/43900724
upvote count: 1
has body: var listViewRef = document.getElementById(&lt;%= LV_Tickets.ClientID %&gt;); var elementArray = listViewRef.getElementsByTagName('Label'); listViewRef is a nodeList that means it's a collection of nodes. To call the function getElementsByTagName you need a node. I selected the first node in the list by [0]. This should return a node on which getElementsByTagName can be called.
score: 1
has comment: http://stackoverflow.com/comment/43900812
has comment: http://stackoverflow.com/comment/43900416
has comment: http://stackoverflow.com/comment/43900540

http://stackoverflow.com/comment/43995904
comment on: http://stackoverflow.com/q/27793288
has text: `key` must be unique in Object
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27695275
type: Question
has comment: http://stackoverflow.com/comment/43803876
has comment: http://stackoverflow.com/comment/43803921
tagged with: javascript
tagged with: jquery
has body: I'm trying to have five circles aligned, and then when I click on the circle, I want the number 5 to appear inside the circle, and if I click again the number 4 appears instead of the number 5 etc. some kind of counter. I drew the circles using CSS and tried using jQuery to manipulate the circles and have the numbers appear but I didn't have the desired result. When I click on the circle, the number 5 appears but the circle get displaced. Your help would be much appreciated. Thank you Here is my Example HTML: Circle clicking squat 5x5 100LB CSS: #first-exercise { background-color: #ffffff; width:60%; position: relative; margin-top: 8%; -moz-box-shadow: 0px 0px 7px #777777; -webkit-box-shadow: -5px 0px 7px #777777; box-shadow: 0px 0px 7px #777777; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; } .circle { width: 34px; height: 34px; background: #f91d04; -moz-border-radius: 50px; -webkit-border-radius: 50px; border-radius: 50px; border-style: solid; border-width: thin; border-color: lightgray; } .circle2 { width: 34px; height: 34px; background: #FFFFFF; -moz-border-radius: 50px; -webkit-border-radius: 50px; border-radius: 50px; border-style: solid; border-width: thin; border-color: lightgray; } .circle3{ width: 34px; height: 34px; background: #FFFFFF; -moz-border-radius: 50px; -webkit-border-radius: 50px; border-radius: 50px; border-style: solid; border-width: thin; border-color: lightgray; } .circle4 { width: 34px; height: 34px; background: #FFFFFF; -moz-border-radius: 50px; -webkit-border-radius: 50px; border-radius: 50px; border-style: solid; border-width: thin; border-color: lightgray; } .circle5 { width: 34px; height: 34px; background: #FFFFFF; -moz-border-radius: 50px; -webkit-border-radius: 50px; border-radius: 50px; border-style: solid; border-width: thin; border-color: lightgray; } #first-exercise p { display: inline-block; margin-left: 10%; margin-top: 0%; } #first-exercise h4 { display: inline-block; font-variant: small-caps; color:…
score: 0
answer count: 2
has title: Five circles aligned , and when i click on the circle i would like the number 5 to appear inside the circle
possible better answer: http://stackoverflow.com/a/27695671
has answer: http://stackoverflow.com/a/27695842
has answer: http://stackoverflow.com/a/27695671
tagged with: geometry
accepted answer: http://stackoverflow.com/a/27695842
has comment: http://stackoverflow.com/comment/43805298
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43805761
has comment: http://stackoverflow.com/comment/43803882

http://stackoverflow.com/comment/43858446
has text: after experimenting with this. It seems when I have equal heights on the ` `'s and a ` ` somewhere in the content they don't maintain the same height.
type: AnswerComment
comment on: http://stackoverflow.com/a/27716314
type: Comment
score: 0

http://stackoverflow.com/q/27753038
tagged with: backbone.js
has body: i have a view: define(['backbone', 'hbs!tmpl/test_tmpl'], function (Backbone, TestTmpl) { 'use strict'; return Backbone.Marionette.ItemView.extend({ initialize: function () { this.projects = {}; }, template: TestTmpl, templateHelpers: function () { return { projects: this.projects } }, ui: {}, events: {}, onRender: function () { this.projects = {title: 'a'}; return this; } }); }); then in the view: {{#each projects}}{{this.title}}{{/each}} in the onRender() method i update the project this.projects = {title: 'a'}; and when that is set, i want the view data to update as well any ideas?
type: AnsweredQuestion
type: Question
has title: how to update the view based on a object change in backbone and marionette?
tagged with: javascript
has answer: http://stackoverflow.com/a/27755366
accepted answer: http://stackoverflow.com/a/27755366
score: 0
tagged with: marionette
answer count: 1
tagged with: events

http://stackoverflow.com/comment/43859615
type: Comment
type: QuestionComment
has text: ...converting to < option > elements
comment on: http://stackoverflow.com/q/27723846
score: 0

http://stackoverflow.com/comment/43732412
has text: @AmirParsaKHademi friend so what you first have to do is to do is to say clearly what you are asking. You have to trigger an action when a set of keys are pressed, which is much different from asking "how can i change text direction" which is a thing you should already know. Your question is too open. Re-edit it and be more concrete.
comment on: http://stackoverflow.com/a/27658304
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/27658625
has comment: http://stackoverflow.com/comment/43733264
score: 1
has comment: http://stackoverflow.com/comment/43733270
has answer: http://stackoverflow.com/a/27658762
has title: Javascript : How to find the position of a zip code in a string?
has comment: http://stackoverflow.com/comment/43732945
has comment: http://stackoverflow.com/comment/43733126
tagged with: split
has comment: http://stackoverflow.com/comment/43732992
answer count: 3
has answer: http://stackoverflow.com/a/27659013
upvote count: 1
has body: I've got an address like this : 7 CITE VANEAU - 75007 PARIS. My goal is to get the zip code. The zip code can change for each address, but it's always 6 digits long. I want to find the position of the beginning of the zip code in the string. Do you have an idea ?
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/27659013
accepted answer: http://stackoverflow.com/a/27658825
tagged with: zipcode
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27658825
tagged with: digit
has comment: http://stackoverflow.com/comment/43733170
type: Question

http://stackoverflow.com/comment/43849536
has text: Ok, but the problem I pointed out above is still a problem with your code. It's not valid Javascript. Answer Updated
type: Comment
comment on: http://stackoverflow.com/a/27718096
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43997030
type: Comment
has text: var obj = { "hello" : "world", "Test" : [ "hello" ] } document.body.innerHTML = ""; document.body.appendChild(document.createTextNode(JSON.stringify(obj, null, 4))); I used this but doesn't work. Any library needed ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27793831

parsley.js
tags question: http://stackoverflow.com/q/27680655
tags question: http://stackoverflow.com/q/27711552
type: Tag
tags question: http://stackoverflow.com/q/27712408
tag name: parsley.js

http://stackoverflow.com/q/27713754
has answer: http://stackoverflow.com/a/27714120
tagged with: http://stackoverflow.com/tag/xml
has body: I'm trying to use a javascript XMLHttpRequest object to post back to my action method. currently I have the following: xmlhttp.open('POST', '../Employees1/HandleFileUpload', true); with my action method taking no parameters public PartialViewResult HandleFileUpload() { } how do I change the .open method if I want my action method to take one argument: public PartialViewResult HandleFileUpload(int year) { }
type: AnsweredQuestion
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/27714120
type: Question
tagged with: asp.net-mvc
tagged with: javascript
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43839870
has comment: http://stackoverflow.com/comment/43839858
has comment: http://stackoverflow.com/comment/43839833
favorite count: 0
has title: XMLHttpRequest.open POST request with parameters asp.net
tagged with: ajax

http://stackoverflow.com/a/27709540
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/43831141
score: 5
type: AcceptedAnswer
has body: You haven't created a new array for the second dimension: track[divID] = []; track[divID].push(wrapID); Otherwise track[divID] is undefined and doesn't have push method.
answers question: http://stackoverflow.com/q/27709520
type: Answer
accepted answer of: http://stackoverflow.com/q/27709520

http://stackoverflow.com/q/27662081
upvote count: 2
type: UnansweredQuestion
has body: I'm fairly new to programming and this is my first real project. I'm making a small game in Dart from one in JS. I have the following lines of codes in my head section of my HTML document: And this td under a tr in a table in the body: Play Stop The function it refers to is in my main.dart: play() { if (playing=true) { stop(); return; } playing=true; clear(); totalhits=0; state.querySelectorAll('[value="Playing"]'); start(); showtime(gamelength); } Now everytime I run the build from my editor it works fine, everything is where it's supposed to be. Once I click the startstop button, however, it gives me a referenceError and I don't understand why.
has comment: http://stackoverflow.com/comment/43742748
score: 2
type: Question
has comment: http://stackoverflow.com/comment/101593442
has comment: http://stackoverflow.com/comment/43740348
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27662322
tagged with: dart
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/43740230
favorite count: 0
has title: ReferenceError in Dart: function is not defined when pressing a button

http://stackoverflow.com/comment/69501405
score: 3
type: AnswerComment
has text: The new HTML5 validation APIs will not submit an invalid form unless you use the novalidation attribute on the form. See https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation
type: Comment
comment on: http://stackoverflow.com/a/27668925

http://stackoverflow.com/q/27671148
has answer: http://stackoverflow.com/a/27671414
has comment: http://stackoverflow.com/comment/43757592
type: Question
has title: Javascript load on page
tagged with: javascript
has body: I want that the title and subtitle shows up when the page loads. I tried several times to let it work but it won't. jQuery(document).ready(function(){ jQuery('.element').bind('mouseover', function() { jQuery(this).find('img').stop().each(function() { jQuery(this).animate({ 'opacity': 1 }, 200); }); }); jQuery('.element').bind('mouseout', function() { jQuery(this).find('img').stop().each(function() { jQuery(this).animate({ 'opacity': 0.4 }, 200); }); }); jQuery('.element').on('pageload', function() { jQuery(this).find('.title').stop().each(function() { jQuery(this).animate({ 'margin-left': 35, 'opacity': 1 }, 250); }); jQuery(thi2s).find('.subtitle').stop().each(function() { jQuery(this).animate({ 'opacity': 1 }, 0); jQuery(this).delay(150).animate({ 'margin-left': 35 }, 250); }); }); }); Can someone help me with this problem?
has comment: http://stackoverflow.com/comment/43757143
has comment: http://stackoverflow.com/comment/43757163
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
score: -1
type: UnansweredQuestion
downvote count: 2
upvote count: 1
tagged with: pageload
tagged with: css
has comment: http://stackoverflow.com/comment/43757109
has comment: http://stackoverflow.com/comment/43757121
has comment: http://stackoverflow.com/comment/43757101
has comment: http://stackoverflow.com/comment/43757615

http://stackoverflow.com/q/27677312
tagged with: jquery
has comment: http://stackoverflow.com/comment/43768997
answer count: 3
has answer: http://stackoverflow.com/a/27677359
has answer: http://stackoverflow.com/a/27677332
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Making images fade in
tagged with: css
score: 0
has answer: http://stackoverflow.com/a/27677438
has body: I have images that I want to be invisible and then faded in when certain events occur. My jQuery works fine and the elements are positioned correctly, I just can't get the elements to fade in. When I type in console $('#img1').fadeIn();nothing happens. CSS img { position: absolute; border-radius: 20px; height: 195px; width: 300px; opacity: 0; } #img1 { left: 270px; } #img2 { right: 270px; }
type: Question
tagged with: javascript

http://stackoverflow.com/q/27670017
type: Question
has comment: http://stackoverflow.com/comment/43754973
has answer: http://stackoverflow.com/a/27670079
has comment: http://stackoverflow.com/comment/43755713
has answer: http://stackoverflow.com/a/27671416
downvote count: 0
has comment: http://stackoverflow.com/comment/43754928
has comment: http://stackoverflow.com/comment/43754894
tagged with: javascript
linked to: http://stackoverflow.com/q/22115150
favorite count: 0
has comment: http://stackoverflow.com/comment/43755079
accepted answer: http://stackoverflow.com/a/27671416
answer count: 3
tagged with: php
has title: Form Post not taking links
upvote count: 3
has comment: http://stackoverflow.com/comment/43769940
has comment: http://stackoverflow.com/comment/43755216
type: AnsweredQuestion
has body: I got a post form and the issue is that It errors when I try to post a link like https://www.google.com/ into an imput type text, It akts as some command I do not understand, anyway heres my code and let me know what exactly is wrong. <?php if(isset($_POST['add'])){ $animeid = $_POST['animeid']; $number = $_POST['number']; $code = $_POST['code']; echo $animeid; echo $number; echo $code; } ?> <form method="post" action="<?php $_PHP_SELF ?>"> And its a simple thing really If Id to type anything other than a link it would work but I need it to be a link and thats that , I still can't see why from dosen't post links and Id like to know how can I make it post links.! OK I think I know how to solve It But Only Know How To I will really need help on it as I did not learn javascript but There should be a way to remove the http:// or https:// before Posting The FORM And then Ill reADD it in the PhP but Now What I got To Figure It Is How Can I make a javascript that will autoremove http:// or https:// Before posting The FORM , Thanks for the Answers You Gave Me Till Now , I will apriciate If SOmeone Will Know How to autoremove words with javascript Thanks !
score: 3
has comment: http://stackoverflow.com/comment/43755040
has answer: http://stackoverflow.com/a/27670123
tagged with: hyperlink
tagged with: forms
has comment: http://stackoverflow.com/comment/43755016
possible better answer: http://stackoverflow.com/a/27670079
tagged with: post

http://stackoverflow.com/comment/43821991
score: 0
type: QuestionComment
type: Comment
has text: My guess (without looking at the code): They use `mouseup` instead of `click` and prevent the default action. Have you found the code for the buttons that triggers the action and shows the popup?
comment on: http://stackoverflow.com/q/27703129

http://stackoverflow.com/comment/43924908
type: AnswerComment
score: 0
type: Comment
has text: I am not seeing that behavior. Are you sure you implemented it correctly? It should be grouping by city and country in the first `$group`, so there would only be a single 'London' when it gets to the second `$group`.
comment on: http://stackoverflow.com/a/27757055

http://stackoverflow.com/q/27653503
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27653596
has title: Calling PHP function wth HTML button
favorite count: 0
linked to: http://stackoverflow.com/q/27579480
has comment: http://stackoverflow.com/comment/43724066
answer count: 5
has comment: http://stackoverflow.com/comment/43723981
has body: I am developing website using php.I need to call php function using HTML Onclick event. How to do? Here I have given my code. <?php function insert() { echo "in insert "; $servername = "localhost"; $username = "shwetharao"; $password = "shwetha"; $dbname = "semilab"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $uname = $_POST['usernameu']; $upass = $_POST['passwordu']; echo $uname; $sql = "INSERT INTO login (id, username, password)VALUES ('id','$uname','$upass')"; if ($conn->query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: " . $sql . " " . $conn->error; } $conn->close(); } ?> Create User Account UserName : Password : I need to call function insert()[which is php function] on clicking button.How to achieve this?
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/43723851
has answer: http://stackoverflow.com/a/27653527
accepted answer: http://stackoverflow.com/a/27653527
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43723825
downvote count: 0
has answer: http://stackoverflow.com/a/27653634
score: 1
tagged with: mysql
type: Question
has answer: http://stackoverflow.com/a/27653599
tagged with: javascript
has answer: http://stackoverflow.com/a/27653658
has answer: http://stackoverflow.com/a/27653596
upvote count: 1
has comment: http://stackoverflow.com/comment/43723804

http://stackoverflow.com/a/31808999
has body: You can add your function to the object you are trying to parse with the template, and then call the function in your template. var userlist = { user: [ {name: 'name nameson', doRating: function() {someOtherFunction();}}, {name: 'some otherguy', doRating: function() {someOtherFunction();}} ] }; var someOtherFunction = function() { $("#rating").rateYo().on("rateyo.set", function (e, data) { //Do stuff? }); } &lt;script type="text/template" id="mustache-template"&gt; {{#user}}&lt;li&gt;{{name}} &lt;div id="rating"&gt;&lt;/div&gt;&lt;/li&gt;{{/user}}{{doRating}}; &lt;/script&gt; Or you could of course calculate the rating on beforehand, and implement some sort of {{user.rating}} and use that to generate in your template. Or as I look closer, you could just add the listener after mustache is done rendering. Since the div#rating would then be available (which should really be a class btw). This would be my approach at least.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27723285

http://stackoverflow.com/comment/43954980
score: 0
has text: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27771920

http://stackoverflow.com/q/27642015
score: 0
has answer: http://stackoverflow.com/a/27642315
accepted answer: http://stackoverflow.com/a/27642315
answer count: 1
tagged with: javascript
tagged with: express
has comment: http://stackoverflow.com/comment/43703221
has body: Using node.js with express I've made a simple https server. For testing purposes I've made a basic login form that gets posted to this https server. My expectation was that by simply doing: var app = require('../app'); var https = require('https'); var fs = require('fs'); // I used openssl to generate a ssl certificate var pkey = fs.readFileSync('key.pem'); var pcert = fs.readFileSync('cert.pem'); var options = { key: pkey, cert: pcert }; var httpsServer = https.createServer(options, app); httpsServer.listen(8081, 'localhost'); that data posted to /login would be properly encrypted: var express = require('express'); var router = express.Router(); router.post('/login', function(req, res) { console.log(req.body); // this is the post data sent from client }); I expected req.body to look like 'encrypted' data as I have no middleware decrypting anything, but instead I got {name: 'abc', 'password': '123'}. Am I missing a step in this process or does the node https module handle all of encryption/decryption stuff? Or am I completely missing the picture on what https is used for/does?
has comment: http://stackoverflow.com/comment/43703192
tagged with: encryption
has comment: http://stackoverflow.com/comment/43702802
tagged with: node.js
type: AnsweredQuestion
has title: express.js https server noob
type: Question

http://stackoverflow.com/q/27681546
tagged with: angularjs
score: 0
accepted answer: http://stackoverflow.com/a/27681637
type: AnsweredQuestion
has body: So I have a simple ng-repeat with enter animation defined in javascript. Sandbox: http://codepen.io/anri82/pen/KwgGeY Code: {{state}} {{item}} add angular.module('myApp', ['ngAnimate']) .controller("MyController", function($scope) { $scope.state ="idle"; $scope.id=3; $scope.list = [1,2]; $scope.add = function () { $scope.state="pushing"; $scope.list.push($scope.id++); $scope.state="done pushing"; }; }).animation('.repeat-animate', function () { return { enter: function (element, done) { element.hide().show(2000, done); } }; }); How do I switch $scope.state to done pushing only after animation is complete? Answer should be in angular way, don't suggest setTimeout.
type: Question
answer count: 1
tagged with: javascript
has title: ng-repeat animation complete callback
has answer: http://stackoverflow.com/a/27681637
tagged with: ng-animate

http://stackoverflow.com/q/27764320
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27765885
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43939439
type: UnansweredQuestion
upvote count: 1
has body: I have error in my program suddenly and i dont find where it comes from and the console show me this error from angular source, How i can know where in my code the error comes from? TypeError: undefined is not a function at http://localhost/lottery-hunter/public/build/app.min.js:10:4161 at Object.fn (http://localhost/lottery-hunter/public/build/app.min.js:8:21940) at h.$digest (http://localhost/lottery-hunter/public/build/app.min.js:8:22542) at h.$apply (http://localhost/lottery-hunter/public/build/app.min.js:8:24028) at f (http://localhost/lottery-hunter/public/build/app.min.js:8:4773) at F (http://localhost/lottery-hunter/public/build/app.min.js:8:6975) at XMLHttpRequest.x.onreadystatechange (http://localhost/lottery-hunter/public/build/app.min.js:8:7535)
score: 1
has comment: http://stackoverflow.com/comment/43939408
has title: Angular find where is the error come from undefined is not a function
has comment: http://stackoverflow.com/comment/43939461

http://stackoverflow.com/comment/44008743
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27800019
has text: These are generic function, you can add school as many you want. You have to call setCookie() function on button onclick event. and onload of body, call getCookie() to get already selected school from the user
type: AnswerComment

http://stackoverflow.com/a/27785439
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/27785357
score: 2
accepted answer of: http://stackoverflow.com/q/27785357
downvote count: 0
has body: Instead of using an HTML break, you should be able to use a new line character \n. Because the title attribute reads its content as a string, it will not render HTML data. Check it out: http://jsfiddle.net/tcjbkqqz/ var app = angular.module('test', []); app.controller('SampleCtrl', function($scope) { $scope.message = "Hi Mike!\nGood Morning!!!" });
upvote count: 2

http://stackoverflow.com/q/27695585
has body: I do Automation Testing with JavaScript (JScript actually, but I feel like it applies to either) and am wondering if anyone knows of a way to throw an exception inside a prototyped object method and have it be caught by the outer function as shown below. MyObject will be called inside the outer function (a "TestCase" to be run on the software using a Testing software called TestComplete). function MyObject() { //Object properties } //Inherits object properties and methods from ParentObject MyObject.prototype = new ParentObject(); MyObject.prototype.constructor = MyObject; MyObject.prototype.foo = function() { //Will try to perform some action and may throw an exception } In a separate file (after investigating more, this seems to be the main issue but cannot be fixed due to the overarching structure of the code/library): function TestCase() { try { var object = new MyObject() object.foo(); } catch(e) { //Log an error } finally { //Clean up } } What I am seeing now is that TestComplete 10 (my IDE/Debugger essentially) will cause a Runtime Error saying that an exception is thrown and not caught, even though the function is being called inside an external try catch. I have had this work using just other regular functions, and I need it to work this way so that if an exception is thrown, it will come out to the catch, ending the test case, and then cleaning up from the test case steps. Thanks!
accepted answer: http://stackoverflow.com/a/27696777
tagged with: javascript
tagged with: jscript
has comment: http://stackoverflow.com/comment/43804614
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43804598
has comment: http://stackoverflow.com/comment/43806539
has comment: http://stackoverflow.com/comment/43804487
type: Question
tagged with: exception
has comment: http://stackoverflow.com/comment/43804454
score: 0
has comment: http://stackoverflow.com/comment/43804831
has answer: http://stackoverflow.com/a/27696777
tagged with: testcomplete
answer count: 1
has title: Throwing exceptions inside prototypal methods not being caught in outer try catch (JavaScript)

http://stackoverflow.com/q/27676825
has title: Form submitting multiple times
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43768456
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43768107
has body: I have been using jQuery 1.8.3, and have two forms and two radio buttons, form will show when click on the radio buttons. what i am doing here is when click on save button, i will check which radio is checked, depends on that form will submit, the problem is after one form submit, that request going as ajax, so i am not refresh the page after one submit, when click on the save button, two times the form will submit, and next time 4 times...? js code $(".save").live("click", function() { if ($("#b1").is(":checked")) { $("#lForm1").submit(); } if ($("#b2").is(":checked")) { $("#lForm2").submit(); } }); $('input[type="radio"]').click(function() { //here toggle the form }); html &lt;input type="radio" name="optionsRadios" id="b1" checked&gt; &lt;input type="radio" name="optionsRadios" id="b2" &gt; &lt;%= form_tag '/contact/create_check', method: :post, remote: true, id: 'lForm1' %&gt; &lt;%= form_tag '/contact/create_count', method: :post, remote: true, id: 'lForm2' %&gt; &lt;input type="button" class="btn btn-success save" value="Save" /&gt;
downvote count: 0
has answer: http://stackoverflow.com/a/27676875
has comment: http://stackoverflow.com/comment/43768289
tagged with: ruby-on-rails
type: Question
score: 1
tagged with: javascript
upvote count: 1
answer count: 1

http://stackoverflow.com/a/27713387
answers question: http://stackoverflow.com/q/27712849
has body: Basically you just need to add another HTML element inside your "verticle-tool" Span tag that to capitalize on the display: table-cell property. CSS .cell { display:table-cell; vertical-align: middle; } HTML See your updated Js.Fiddle here.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43850825
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/27712849
upvote count: 1

http://stackoverflow.com/comment/43755150
type: QuestionComment
type: Comment
has text: Correct. Just a regular old text area. Could Bootstrap be messing with it at all? Just saying anything that could help.
comment on: http://stackoverflow.com/q/27660218
score: 0

http://stackoverflow.com/comment/43919547
score: 0
has text: That's pretty much all I need. I only wanted to know if it is commonly known as a bad habit or stuff, thanks.
comment on: http://stackoverflow.com/q/27747549
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43831968
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/27710040
has text: You should narrow down the code a bit. Also, any errors in the console?

http://stackoverflow.com/q/27712566
upvote count: 1
type: AnsweredQuestion
score: 1
tagged with: gulp-imagemin
type: Question
accepted answer: http://stackoverflow.com/a/27712748
tagged with: imagemin
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: gulp
has body: I'm using gulp-imagemin in it's basic form gulp.task('image', function() { return gulp.src('./images/*') .pipe(imagemin({ progressive: true, svgoPlugins: [{removeViewBox: false}], use: [pngquant()] })) .pipe(gulp.dest('./build/')); }); My images/ directory looks like images/ logo.png subfolder/ image.png I would like them to output as such: build/ logo.png image.png But they are retaining their folder structure. How can this be achieved?
favorite count: 0
has answer: http://stackoverflow.com/a/27712748
has title: gulp-imagemin - how to disregard directory structures?

http://stackoverflow.com/q/27701247
has comment: http://stackoverflow.com/comment/43822396
type: UnansweredQuestion
tagged with: regex
score: 0
tagged with: v8
tagged with: google-chrome
has title: Learning Regular Expressions Backtracking in Google Chrome
type: Question
has answer: http://stackoverflow.com/a/27704269
has body: I am trying to learn and understand the regular expressions in javascript and would like to understand the concept of backtracking for regular expressions in javascript. Can anyone point me to the source code or refer me to the algorithm which javascript in Google Chrome (V8 Engine) uses to parse regular expressions and to check how does it backtrack. As Google's V8 Engine is Open Source this must not be difficult.
tagged with: javascript
answer count: 1

http://stackoverflow.com/q/27760490
tagged with: defaults
score: 1
has title: How to update jQuery defaults on window resize?
upvote count: 1
tagged with: javascript
tagged with: resize
tagged with: jquery
favorite count: 0
has body: This is the section of code I'm trying to adjust: var documentWidth = jQuery(document).width(); var documentWidth2 = (documentWidth)/100*2; $.Grid.defaults = { orientation: 'vertical', aspectRatio: 'auto', gutterWidth: documentWidth2, gutterHeight: documentWidth2, rows: 3, columns: 4, onRenderStart: $.noop, onRenderComplete: $.noop, }; Now, I need 'gutterWidth' and 'gutterHeight' to be variable. I have these values being adjusted on page load, my issue is I need it to also work on window resize. I'm not a complete novice but this is driving me nuts! I have tried running the function on resize, but whilst the variable is definitely changing (I did a console.log of it), it seems that once that option is set in the code on page load it is no longer able to be updated. Help! FULL CODE HERE: function myfunction() { (function (window, $, $window) { $.Grid = function (el, options) { var that = this; this.options = $.extend({}, $.Grid.defaults, options); this.$el = $(el); this.$parent = this.$el.parent(); this.$items = this.$el.children(); // Parse aspectRatio if provided in X:Y format if (this.options.aspectRatio != 'auto') { var temp = this.options.aspectRatio.match(/(\d+):(\d+)/); if (temp &amp;&amp; (temp.length == 3) &amp;&amp; temp[2]) { this.options.aspectRatio = temp[1] / temp[2]; } } this.lastRender = { width: -1, height: -1 }; this.render(); this.$el.transition({ opacity: 1 }, 400); $window.on('resize.fluxus-grid-resize', _.debounce($.proxy(that.render, that))); }; var documentWidth = jQuery(document).width(); var documentWidth2 = (documentWidth)/100*2; $.Grid.defaults = { orientation: 'vertical', aspectRatio: 'auto', gutterWidth: documentWidth2, gutterHeight: documentWidth2, rows: 3, columns: 4, onRenderStart: $.noop, onRenderComplete: $.noop, }; $.Grid.prototype = { isHorizontal: function () { return this.options.orientation == 'horizontal'; }, getItemWidth: function () { var totalGutterWidth = (this.options.columns - 1) * this.options.gutterWidth; if (this.isHo…
downvote count: 0
answer count: 0
type: UnansweredQuestion
type: Question

http://stackoverflow.com/q/27761772
score: 1
has comment: http://stackoverflow.com/comment/43941805
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/13636528
has body: I'm trying to get breeze working with hand generated Metadata, but I can't seem to find documentation covering navigation properties through matrix tables. the data model is: Organization PK:OrganizationID User PK:UserID The table that joins them is: User_Organization PK:UserOrganizationID FK:OrganizationID FK:UserID When I retrieve an Organization I want it to have a property "users" which contains an array of User objects. How do I define this and specify the matrix table in Breeze Metadata, seeing as User does not have an organizationID? ** update My primary problem is that I'm linking Breeze to Sequelize, so I need to be able to manage this all through the metadata if possible. The first answer below from @Jeremy-Danyow solves the problem with client side code, but I'm looking for a way to present the final object graph to breeze as part of the metadata.
has answer: http://stackoverflow.com/a/27765847
tagged with: sequelize.js
has title: How to define Matrix/Link/Cross Table joins in BreezeJS Metadata?
favorite count: 0
tagged with: breeze
upvote count: 1
accepted answer: http://stackoverflow.com/a/27765847
type: AnsweredQuestion

http://stackoverflow.com/q/27787992
accepted answer: http://stackoverflow.com/a/27788552
has comment: http://stackoverflow.com/comment/43985974
has comment: http://stackoverflow.com/comment/43986904
has body: I'm using a Moltin Cart which I want to loop through, so I can read it in Angular JS and then I load the cart into a variable, which I'd like to &lt;div ng-repeat-start="item in cart.contents"&gt; and loop through the items in the cart. The issue I'm having is really a pretty basic JavaScript issue, that if I console.log the cart.contents I get this: Object{ 33bb9f991617377b9b8333a79ca9ce2c: Object { ... cart contents... }, 1ba14b804d0d81e49397b004e5f1c6d1: Object { ... cart contents... }, 33bb9f991617377b9b8333a79ca9ce2c: Object { ... cart contents... }, } Is there a way that I can fix this either in: Laravel Angular JS or Classic JavaScript
type: Question
has answer: http://stackoverflow.com/a/27788552
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43986776
answer count: 1
has comment: http://stackoverflow.com/comment/43985882
tagged with: angularjs
tagged with: laravel
type: AnsweredQuestion
has title: Moltin Cart, Laravel and Angular JS – looping through JS object

http://stackoverflow.com/a/27719184
downvote count: 0
upvote count: 2
type: Answer
score: 2
has body: You can do that by following: $.when(funct1).then(funct2).then(funct3).then(funct4) jQuery has own realization of promises, please take a look at documentation or nice tutorials like that http://tutorials.jenkov.com/jquery/deferred-objects.html
answers question: http://stackoverflow.com/q/27719078

http://stackoverflow.com/comment/43803515
score: 0
comment on: http://stackoverflow.com/a/27694967
has text: Hello Oliver, thanks for your response. Sorry for the question, but how would I use .equals in this case?
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27641731
has answer: http://stackoverflow.com/a/32272643
has answer: http://stackoverflow.com/a/53228574
has answer: http://stackoverflow.com/a/77893394
has answer: http://stackoverflow.com/a/57886391
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/60311705
has answer: http://stackoverflow.com/a/52230856
has answer: http://stackoverflow.com/a/38714852
has answer: http://stackoverflow.com/a/44098664
has title: is there a function in lodash to replace matched item
has answer: http://stackoverflow.com/a/50579416
has answer: http://stackoverflow.com/a/27641860
has answer: http://stackoverflow.com/a/57323931
has answer: http://stackoverflow.com/a/43141365
has answer: http://stackoverflow.com/a/43645934
type: Question
has comment: http://stackoverflow.com/comment/64412337
has answer: http://stackoverflow.com/a/60412209
has comment: http://stackoverflow.com/comment/91468486
has answer: http://stackoverflow.com/a/50374535
downvote count: 0
tagged with: javascript
answer count: 17
favorite count: 0
linked to: http://stackoverflow.com/q/19860039
possible better answer: http://stackoverflow.com/a/41799778
score: 182
accepted answer: http://stackoverflow.com/a/27641860
has body: I wonder if there is a simpler method in lodash to replace an item in a JavaScript collection? (Possible duplicate but I did not understand the answer there:) I looked at their documentation but could not find anything My code is: var arr = [{id: 1, name: "Person 1"}, {id:2, name:"Person 2"}]; // Can following code be reduced to something like _.XX(arr, {id:1}, {id:1, name: "New Name"}); _.each(arr, function(a, idx){ if(a.id === 1){ arr[idx] = {id:1, name: "Person New Name"}; return false; } }); _.each(arr, function(a){ document.write(a.name); }); Update: The object I'm trying to replace with has many properties like {id: 1, Prop1: ..., Prop2:..., and so on} Solution: Thanks to dfsq but I found a proper solution within lodash that seems to work fine and is pretty neat and I put it in a mixin as well since I've this requirement at many places. JSBin var update = function(arr, key, newval) { var match = _.find(arr, key); if(match) _.merge(match, newval); else arr.push(newval); }; _.mixin({ '$update': update }); var arr = [{id: 1, name: "Person 1"}, {id:2, name:"Person 2"}]; _.$update(arr, {id:1}, {id:1, name: "New Val"}); document.write(JSON.stringify(arr)); Faster Solution As pointed out by @dfsq, following is way faster var upsert = function (arr, key, newval) { var match = _.find(arr, key); if(match){ var index = _.indexOf(arr, _.find(arr, key)); arr.splice(index, 1, newval); } else { arr.push(newval); } };
has answer: http://stackoverflow.com/a/41799778
upvote count: 182
has comment: http://stackoverflow.com/comment/90940893
tagged with: lodash
has answer: http://stackoverflow.com/a/68447769

http://stackoverflow.com/q/27650386
score: 3
tagged with: arguments
upvote count: 3
answer count: 3
has answer: http://stackoverflow.com/a/27650468
has body: I need to write a function that retrieves the last parameter passed into the function. If it's just arguments, it should return the last element. If it's a string, it should return the last character. Arrays should return the last element of the array. My code works for arrays, strings and arguments as long as they are not all strings. function last(list){ var arr; if(list instanceof Array){ return list[list.length-1]; } if(typeof list === 'string' || list instanceof String){ arr = list.split(""); return arr[arr.length-1]; } return arguments[arguments.length-1]; } This works for almost every case, but I have a problem when the input is a bunch of string arguments. Test.assertEquals(last('a','b','c','z'), 'z'); returns 'a' Why are disjoint strings evaluating to true when testing if the arguments are arrays or strings and how can I universaly access the last value of arbitrary parameters?
possible better answer: http://stackoverflow.com/a/27650400
has title: individual characters treated as string in javascript arguments
has answer: http://stackoverflow.com/a/27650400
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27650468
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: string
favorite count: 0
has answer: http://stackoverflow.com/a/27650628
type: Question

http://stackoverflow.com/comment/43864296
type: AnswerComment
score: 0
type: Comment
has text: I actually was passing this when I ran into the problem, but after tearing out some of my hair and reading some more questions here, I tried it the way I have it above to see if that would help. Chrome/Firefox – for better or worse – doesn't seem to care if I use this, add/takeaway a semicolon, etc. Safari doesn't work with or without them. Thanks for the example. When I run your jsFiddle on my Mac (10.7.5) in Firefox (34.0.5) it returns "Boo:renewal". However, when I run it in Safari (6.1.6) it returns "Boo:undefined".
comment on: http://stackoverflow.com/a/27725925

http://stackoverflow.com/comment/86343802
score: 4
type: Comment
has text: For some reason, `$(this).find('.dropdown-toggle').prop('aria-expanded', 'true')` isn't working for me in this case, while `attr()` does. I'm using jquery v3.2.1
comment on: http://stackoverflow.com/a/27752257
type: AnswerComment

http://stackoverflow.com/q/27642322
has answer: http://stackoverflow.com/a/27933992
tagged with: ruby-on-rails
score: 2
type: Question
answer count: 2
has body: I'm trying to add the twitter-typeahead gem to my application, and I'm following this tutorial: http://blog.sed.hu/2014/07/11/ruby-on-rails-search-autocomplete-with-sunspot-solr-and-twitter-typeahead-js-part-2/. I'm getting a few different errors. Does anyone who has used Typeahead see anything glaringly wrong with the tutorial? Or am I doing something wrong? HERE'S WHAT I DID: application.html.erb &lt;div id="search-wrapper"&gt; &lt;input class="typeahead" type="text" placeholder="Search"&gt; &lt;/div&gt; app/assets/javascripts/search.js.coffee $(document).on 'ready page:load', -&amp;gt; users = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), queryTokenizer: Bloodhound.tokenizers.whitespace, remote: { url: '/users/index?q=%QUERY' } }) users.initialize() $('input.typeahead').typeahead( { hint: true, highlight: true, minLength: 1 }, { name: 'things', displayKey: 'title', source: User.all }) controllers/users_controller.rb def index if params[:search] @user = User.search(params[:search]).order("created_at DESC") respond_to do |format| format.json do results = @user.results.map do |user| { title: user.name } end render json: results end else @user = User.order("created_at DESC") end end THE ERRORS: Both errors point to this line in my head: &lt;%= javascript_include_tag "application", "data-turbolinks-track" =&gt; true %&gt; and if I remove it, the errors go away, but that's obviously not a preferable solution. First Error: SyntaxError: [stdin]: unexpected &amp; (in home/website/app/assets/javascripts/search.js.coffee) Then, if I remove the "&amp;" from "-&gt;" on the first line of search.js.coffee, I get this error: Second Error: SyntaxError: [stdin]:2:1: unexpected indentation (in home/website/app/assets/javascripts/search.js.coffee) I played around with some of the indentation, but this error I couldn't get to go away. UPDATE: I changed my search.js.coffee code as per suggested by NickM, but now I'm getting a different error. Updated …
tagged with: javascript
tagged with: twitter-typeahead
has answer: http://stackoverflow.com/a/27643293
tagged with: typeahead.js
downvote count: 0
favorite count: 0
has title: 'twitter-typeahead' gem syntax errors
tagged with: ruby
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/comment/43877956
type: QuestionComment
has text: It's either undefined, or it's not the code you think it is.
comment on: http://stackoverflow.com/q/27732062
score: 0
type: Comment

http://stackoverflow.com/comment/43818293
has text: Trying to add OrbitControls at the editor example in the THREE.JS causes the malfunctioning. But if I start the plain project from scratch adding the OrbitConstrols then everything works fine, I believe that it is obvious that editor example uses its own method of initialization for controls and which is conflicting with any attempt of adding additional control. I looked in editor folder to find that specific code for Control initialization, but I couldn't
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27665321

http://stackoverflow.com/comment/44014574
has text: Is the delay meant to increase by 200ms each time? It isn't working like that?
type: Comment
comment on: http://stackoverflow.com/q/27802498
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43959735
score: 5
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27774433
has text: Tested on [regex101](https://regex101.com/r/kL0iW9/1), works fine.

http://stackoverflow.com/q/27792779
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27792889
type: Question
has body: I have setup a responsive menu that on 480px or less the menu will collapse and show a button to click on and cause the menu to drop down. The problem I am having is, the menu will toggle down and immediately toggle back up. It won't stay open. I added a css to the js handler class called .nav-expanded to run after the toggle to allow the full menu to be displayed when opening up the screen to a larger dimension that 480px. If I remove the css from my stylesheet, or the code from the js, when I shrink the page to 480px or less, the new menu shows correctly, I can toggle open then close. However once I toggle close and widen my browser the menu remain hidden unless I refresh the browser. The page is here http://skeeterz71.com/gothic/ My js code: jQuery(document).ready(function(){ jQuery(".menu-trigger").click(function(){ jQuery("#first-nav").slideToggle(400, function(){ jQuery(this).toggleClass("nav-expanded").css('display', ''); }); }); }); CSS in the stylesheet media query .nav-expanded{ display:block; }
possible better answer: http://stackoverflow.com/a/27792918
has answer: http://stackoverflow.com/a/27792918
has title: JS toggle event trigger not working correctly
tagged with: javascript
has answer: http://stackoverflow.com/a/27792889
score: 0
answer count: 2
tagged with: drop-down-menu
tagged with: jquery

http://stackoverflow.com/comment/117492674
type: Comment
comment on: http://stackoverflow.com/a/27798313
has text: This is still working for me in Chrome 88 64 bit, Windows 10... However, you have to allow pop-ups (in the search bar). As @DBS suggests, running as an event handler in chrome 88 even with pop-ups blocked... Check updated demo.
score: 0
type: AnswerComment

http://stackoverflow.com/q/27652244
has answer: http://stackoverflow.com/a/27652502
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/43721635
has comment: http://stackoverflow.com/comment/43721693
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/27652676
tagged with: javascript
has comment: http://stackoverflow.com/comment/43721696
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/68431299
has body: I am trying with AngularJS directive, here is my code: index.html Directive <photo photo-src="abc.jpg" caption="This is so Cool" /> app.js var app = angular.module('myapp',[]); app.directive('photo',function(){ return { restrict: 'E', templateUrl: 'photo.html', replace: true, scope: { caption: '@', photoSrc: '@' } } }); photo.html {{caption}} I test the file by open it directly on browser. It works fine on Firefox, but not on IE & chrome. Both IE & Chrome show error of Failed to load template How can I fix it?
score: 2
downvote count: 0
has title: AngularJS Failed to load template

http://stackoverflow.com/a/27732499
upvote count: 2
has comment: http://stackoverflow.com/comment/43876734
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43877201
has body: Needs more jQuery ? var arr = $(".list").filter(function() { return $(this).data('type') != 0; }).map(function() { return { id : $(this).data('id'), type : $(this).data('type') }; }).get(); FIDDLE
has comment: http://stackoverflow.com/comment/43877008
answers question: http://stackoverflow.com/q/27732433
has comment: http://stackoverflow.com/comment/43876539

http://stackoverflow.com/q/27795210
has comment: http://stackoverflow.com/comment/43999388
has comment: http://stackoverflow.com/comment/43999405
type: AnsweredQuestion
upvote count: 0
possible better answer: http://stackoverflow.com/a/27795238
tagged with: jquery
has answer: http://stackoverflow.com/a/27795238
favorite count: 0
has answer: http://stackoverflow.com/a/27795266
type: Question
score: -2
downvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/27795232
accepted answer: http://stackoverflow.com/a/27795266
has title: What's the jQuery event for scrolling the page?
tagged with: javascript
has body: I want to remove a class focus-mode when the user scrolls the page either with the mouse wheel or the scroll bar: $("#input-content").on("SCROLLING_EVENT", function(e) { $(".chapter-form").toggleClass("focus-mode"); }); But I couldn't find anything about that online. Does jQuery have a scrolling event? If not, what's the best to achieve what I want?

http://stackoverflow.com/q/27764769
has title: Javascript or CSS fix for 100% that doesn't fill page when IE11 is zoomed
answer count: 1
has answer: http://stackoverflow.com/a/27764940
tagged with: internet-explorer-11
tagged with: javascript
type: UnansweredQuestion
has body: I have a scrolling &lt;div&gt; that is supposed to fill the visible area of the page: &lt;div id=allcontent style="width:100%;height:100%;overflow:scroll"&gt; (all page content) &lt;/div&gt; When I zoom in with ctrl+ IE11, there is extra space below and to the right of my div, where I see the &lt;body&gt; background color. I would like to resize the "allcontent" div to fill the page when IE zooms in, but I can't find a way to get the actual page size using javascript. Is there either: a way to get the real page size from IE11 after clicking ctrl+, or a way to specify the &lt;div&gt; dimensions in CSS that will cause it to resize correctly with the page? I have tried all sorts of measurements like ocument.body.clientWidth but not found anything that applies to the newly visible area outside of my &lt;div&gt;. Even weirder: the page slowly scrolls to cover up the (wrongly) exposed body color.
tagged with: zooming
type: Question
tagged with: css
has comment: http://stackoverflow.com/comment/43940246
linked to: http://stackoverflow.com/q/23573060
score: 0

http://stackoverflow.com/comment/43922062
score: 0
type: AnswerComment
type: Comment
has text: Hey Yotam, back again... I want this page to be skipped on back pressed. I've replaced window.location.href = '<?php echo $post_url ?>'; with window.location.replace('<?php echo $post_url ?>'); but the page still loads when the user presses back on browser from the page it was redirected to. Any idea? Thanks
comment on: http://stackoverflow.com/a/27677036

http://stackoverflow.com/comment/43728087
has text: @FinnLeSueur You might be a victim of jQuery conflict, if you are using multiple JS libraries that use the `$` symbol.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27655990
type: Comment

http://stackoverflow.com/a/27671673
has body: Try: window.onload = function () { var toggle_btn = document.getElementById('toggle_btn'), slide_menu = document.getElementById('slide_menu'); slide_menu.style.transform = toggle_btn.checked=== true ? "none" : "translateX(-200px)"; }; BTW - you don't need javascript for this: http://jsfiddle.net/w5te8qqx/1/
answers question: http://stackoverflow.com/q/27671597
accepted answer of: http://stackoverflow.com/q/27671597
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/43838780
type: QuestionComment
has text: You should do some reading on [`.bind`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind), [`.call`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call), and [`.apply`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply). `bind` is useful in this case and you'll find the other two of use elsewhere.
score: 1
comment on: http://stackoverflow.com/q/27713239
type: Comment

http://stackoverflow.com/q/27644779
tagged with: javascript
tagged with: image
has title: Javascript canvas.toDataURL() returning Blank image
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43708173
linked to: http://stackoverflow.com/q/4409445
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43709048
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27644871
score: 3
upvote count: 3
has body: I have the following code, which converts image to black and white: var canvas = document.createElement('canvas'); var imgObj="[binary]"; var canvasContext = canvas.getContext('2d'); var imgW = 300; var imgH = 300; canvas.width = imgW; canvas.height = imgH; //canvasContext.drawImage(imgObj, 0, 0); var imgPixels = canvasContext.getImageData(0, 0, imgW, imgH); for(var y = 0; y &lt; imgPixels.height; y++){ for(var x = 0; x &lt; imgPixels.width; x++){ var i = (y * 4) * imgPixels.width + x * 4; var avg = (imgPixels.data[i] + imgPixels.data[i + 1] + imgPixels.data[i + 2]) / 3; imgPixels.data[i] = avg; imgPixels.data[i + 1] = avg; imgPixels.data[i + 2] = avg; } } canvasContext.putImageData(imgPixels, 0, 0, 0, 0, imgPixels.width, imgPixels.height); console.log(canvas.toDataURL()); OUTPUT: [binary] When when i open the result i see blank image! I suspect its happening because i commented this line: canvasContext.drawImage(imgObj, 0, 0); But when i uncomment this line, i get: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap)' How to solve this? Pseudo Code Input: a colorful image base64 string output a black and white base64 string
type: Question

http://stackoverflow.com/q/27793769
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43997330
has comment: http://stackoverflow.com/comment/43996858
score: 0
has answer: http://stackoverflow.com/a/27794442
has comment: http://stackoverflow.com/comment/43997100
has answer: http://stackoverflow.com/a/27793981
has comment: http://stackoverflow.com/comment/43997067
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43997919
has body: I have a view for show a model.That when change dropdown, i show a special DIV. I have same property in divs. @Html.LabelFor(m =&gt; m.EstateType) @Html.DropDownListFor(m =&gt; m.EstateType) &lt;div id="apartment"&gt; &lt;div class="row"&gt; @Html.LabelFor(m =&gt; m.Space) @Html.TextBoxFor(m =&gt; m.Space) @Html.LabelFor(m =&gt; m.Area) @Html.TextBoxFor(m =&gt; m.Area) @Html.LabelFor(m =&gt; m.Rooms) @Html.TextBoxFor(m =&gt; m.Rooms) @Html.LabelFor(m =&gt; m.Floor) @Html.TextBoxFor(m =&gt; m.Floor) &lt;/div&gt; &lt;/div&gt; &lt;div id="shop" style="display: none"&gt; &lt;div class="row"&gt; @Html.LabelFor(m =&gt; m.Space) @Html.TextBoxFor(m =&gt; m.Space) @Html.LabelFor(m =&gt; m.Area) @Html.TextBoxFor(m =&gt; m.Area) @Html.LabelFor(m =&gt; m.Rooms) @Html.TextBoxFor(m =&gt; m.Rooms) @Html.LabelFor(m =&gt; m.Floor) @Html.TextBoxFor(m =&gt; m.Floor) &lt;/div&gt; &lt;/div&gt; and in change of dropdown $('#EstateType').change(function () { var item = $(this).val(); switch (item) { case "Apartments": $("#apartment").css("display", "block"); $("#shop").css("display", "none"); break; case "Shop": $("#apartment").css("display", "none"); $("#shop").css("display", "block"); break; I fill controll but when post data in Controller, data in empty when shop div in Block. Can i remove apartment div when show shop div?
has comment: http://stackoverflow.com/comment/43996761
has comment: http://stackoverflow.com/comment/43996881
has comment: http://stackoverflow.com/comment/43997002
has answer: http://stackoverflow.com/a/27793905
has comment: http://stackoverflow.com/comment/43996976
answer count: 4
accepted answer: http://stackoverflow.com/a/27794442
has comment: http://stackoverflow.com/comment/43997743
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43997446
possible better answer: http://stackoverflow.com/a/27793793
has comment: http://stackoverflow.com/comment/43996861
has answer: http://stackoverflow.com/a/27793793
type: Question
has title: How to hide a div of html using jQuery?
tagged with: asp.net-mvc

http://stackoverflow.com/comment/43744224
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27664194
score: 0
has text: Do you only want to detect if there are overflowing elements? Or which ones are overflowing? What do you want to do based on this information?

http://stackoverflow.com/q/27719498
answer count: 2
has answer: http://stackoverflow.com/a/32387560
has title: maxlength not working in textarea for ckeditor angularjs directive
has comment: http://stackoverflow.com/comment/43851776
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/43851212
has comment: http://stackoverflow.com/comment/43850650
has comment: http://stackoverflow.com/comment/43850525
tagged with: javascript
type: UnansweredQuestion
tagged with: ckeditor
has comment: http://stackoverflow.com/comment/43851032
has comment: http://stackoverflow.com/comment/43851429
upvote count: 4
has answer: http://stackoverflow.com/a/27720326
has comment: http://stackoverflow.com/comment/43851083
downvote count: 0
has body: I have created an application in angularjs with ckeditor plugin, I have created a directive for ckeditor, The application is working fine but the issue is that i need to set a max character length to be 50, so i put maxlength="50", but its not working, Can anyone please tell me some solution for this JSFiddle html CKEditor 4.2: New Editor script var app = angular.module('app', []); app.directive('ckEditor', [function () { return { require: '?ngModel', link: function ($scope, elm, attr, ngModel) { var ck = CKEDITOR.replace(elm[0]); ck.on('pasteState', function () { $scope.$apply(function () { ngModel.$setViewValue(ck.getData()); }); }); ngModel.$render = function (value) { ck.setData(ngModel.$modelValue); }; } }; }]) function myCtrl($scope){ $scope.ckEditors = [{value: ''}]; }
favorite count: 0
tagged with: angularjs
type: Question
tagged with: maxlength
score: 4

http://stackoverflow.com/comment/43772732
type: QuestionComment
has text: Something like this? http://jsbin.com/ralugu/1/
comment on: http://stackoverflow.com/q/27678614
score: 0
type: Comment

http://stackoverflow.com/q/27756020
has answer: http://stackoverflow.com/a/27756073
has comment: http://stackoverflow.com/comment/43922703
upvote count: 1
answer count: 1
tagged with: date
accepted answer: http://stackoverflow.com/a/27756073
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
type: Question
has body: I have this code: &lt;script&gt; var clientTime = (new Date()).getTime(), serverTime = &lt;?php echo(time()); ?&gt; * 1000, difference = clientTime - serverTime; setInterval(function () { var now = new Date(); now.setTime(now.getTime() - difference); $("#pewds_time").text("The current time in the United Kingdom: " + $.format.date(now, "hh:mm:ss a")); }, 1000); &lt;/script&gt; This is a "clock" counter. But it shows the time in my timezone.. I would like to get GMT+0, to check what time is in the United Kingdom. Can someone help me?
has title: Javascript get GMT+0 date?
has comment: http://stackoverflow.com/comment/43922705

http://stackoverflow.com/comment/43890095
type: AnswerComment
comment on: http://stackoverflow.com/a/27739308
has text: By the way, you can assign the event handling to `document.body` if the buttons are scattered over the page. The method `testdemo` in the snippet doesn't prevent that, it only runs if a `data-score` attribute is found.
type: Comment
score: 0

http://stackoverflow.com/comment/43744312
type: QuestionComment
type: Comment
has text: @vittore after several hours of debugging I found out that this request doesn't even reach the route there is something that is preventing it from I have searched about this error exception but the problems related to it are too broad
score: 0
comment on: http://stackoverflow.com/q/27664013

http://stackoverflow.com/a/27801608
has comment: http://stackoverflow.com/comment/44012501
has comment: http://stackoverflow.com/comment/44013031
answers question: http://stackoverflow.com/q/27801462
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/44013295
downvote count: 1
has body: Probably this line is the problem: print =print+"&lt;img src=\""+print[i]+"\" onClick=\"ShowPics(this);\" /&gt;" It should probably be: print =print+"&lt;img src=\""+pictures[i]+"\" onClick=\"ShowPics(this);\" /&gt;"
has comment: http://stackoverflow.com/comment/44013058
has comment: http://stackoverflow.com/comment/44012165
has comment: http://stackoverflow.com/comment/44012377
has comment: http://stackoverflow.com/comment/44013069
has comment: http://stackoverflow.com/comment/44012456
score: 0
has comment: http://stackoverflow.com/comment/44012727
has comment: http://stackoverflow.com/comment/44012551
has comment: http://stackoverflow.com/comment/44012295
has comment: http://stackoverflow.com/comment/44013000

http://stackoverflow.com/q/27794933
has answer: http://stackoverflow.com/a/27795367
tagged with: javascript
score: 0
has body: I have a website where I show information inside an iframe. And the information inside the iframe comes form Salesforce domain. The data that is being fetched comes in the form of a "training guide" with several pages in it. I have added the javascript code on both the domains for fixing the changing height thus removing the Vertical scrollbar. Code in salesforce page: function retrieveInfo(){ parent.postMessage(document.body.scrollHeight, '*'); } function showLoading(){ $('#dvLoading').show(); } Code written in my website page is : function resizeCrossDomainIframe(id, other_domain) { var iframe = document.getElementById(id); window.addEventListener('message', function(event) { var height = parseInt(event.data); // add some extra height to avoid scrollbar iframe.height = height + "px"; }, false); } and my iframe in the page is : &lt;iframe id="my_iframe" src="https://cp.secure.force.com/mydomainhome" width="100%" onload="resizeCrossDomainIframe('my_iframe', 'https://cp.secure.force.com/');" scrolling="yes"&gt;&lt;/iframe&gt; The data inside the iframe has a left pane and a right pane. Left pane contains a list of collapsable menu that shows respective course contents. The left pane manu expands on clicking.The issue that I am getting is that the javascript code for removing V-scroll is getting called on page load but once the page loads and I click on the left pane to expand it the v-scroll reappears. This is how the page renders on page load: This is how the page renders after I expand the left pane menus with inner scrollbar: Is there a way I can prevent the Vertical scrollbar appear even after expanding the left pane menu. I do not want to reload the page on clicking on each of the left pane menu links though.
answer count: 1
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: iframe
has title: Cross domain iframe resize fix without vertical scrollbar
type: Question

http://stackoverflow.com/comment/43984883
type: QuestionComment
has text: Here is no way else but recursion
comment on: http://stackoverflow.com/q/27787453
score: 0
type: Comment

http://stackoverflow.com/q/27686081
has comment: http://stackoverflow.com/comment/43786130
has title: Cannot bind trigger click on svg path element
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/27687402
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 1
has body: I cannot simmulate click on svg path element. But other actions like remove() are working. I have this and it does not work: $("#parentelement").on("click", "someelement", function() { $('g path[data-code="' + something + '"].jvectormap-region.jvectormap-element').trigger("click"); }); not working also with ....click(); But it works with .remove() or .trigger("remove"); Any ideas or help? Thanx!
favorite count: 0
has comment: http://stackoverflow.com/comment/43785971
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/43786387
type: UnansweredQuestion
score: 3

http://stackoverflow.com/a/52007082
type: Answer
answers question: http://stackoverflow.com/q/27688442
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27688442
score: 7
has body: I realize this is an old question, but thought I would provide some info. Per NatureShade's point, you can't edit the value in the localForage table, you can only pull the item, and set it. What I typically do for frequently changing variables/objects when using localForage is to have a global variable set for that item. When making changes I just update the global variable and then update the item in storage. The nice thing about this is you only have to worry about setting the localForage key/value, and don't have to mess with the asynchronous aspect as much. You also have a variable that you can always reference for this info as well, so you don't have to use .getItem all the time to access it. Having a global variable may not be the best practice, but it is an option. var globalObject; localforage.getItem('documents', function(err, value){ globalObject = value; } var obj = ...; globalObject.push(obj); localforage.setItem('documents', globalObject); var obj2 = ...; globalObject.push(obj2); localforage.setItem('documents', globalObject);
upvote count: 7
type: AcceptedAnswer

http://stackoverflow.com/comment/43749690
comment on: http://stackoverflow.com/a/27667366
score: 0
has text: @anubhava but the number could be dynamic, the first number
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27738306
upvote count: 1
has answer: http://stackoverflow.com/a/27738517
type: AnsweredQuestion
score: 1
type: Question
has answer: http://stackoverflow.com/a/27738536
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43887943
has answer: http://stackoverflow.com/a/27739596
answer count: 3
accepted answer: http://stackoverflow.com/a/27739596
has title: How to disable Bootstrap's typeahead data source?
has body: How to disable bootstap typahead data source when readonly Readonly Now i am using jquery to apply readonly but when we press back space it suggest the last element from data-source $('#readonly').on('click', function (e) { $("#test1").prop('readonly', true); })
tagged with: twitter-bootstrap
possible better answer: http://stackoverflow.com/a/27738517

http://stackoverflow.com/q/27742373
tagged with: javascript
has comment: http://stackoverflow.com/comment/43896150
has comment: http://stackoverflow.com/comment/43896100
tagged with: image
score: 0
has comment: http://stackoverflow.com/comment/43896586
has body: I have previously achieved something similar to this using the code below but I have no idea how I did it and am unable to reverse engineer my code. I have two divs called advert 1 and advert 2 and I need them after 1 minute to rotate to another image. Each div will have 3 images. Below is the code I used before years ago, however I do not know how I used it. Javascript: var rotators = [ { id: 'advert1', images: ['advert1.jpg', 'advert2.jpg', 'advert3.jpg'], selectedIndex: 0 }, { id: 'advert2', images: ['advert4.jpg', 'advert5.jpg', 'advert6.jpg'], selectedIndex: 0 } ]; var updateImages = function() { for (var i=0; i &lt; rotators.length; i++) { var rotator = rotators[i]; rotator.selectedIndex++; if (rotator.selectedIndex &gt;= rotator.images.length) { rotator.selectedIndex = 0; } document.getElementById(rotator.id).src = rotator.images[rotator.selectedIndex]; } }; var timer = setInterval(updateImages, 300000);
has comment: http://stackoverflow.com/comment/43898491
has comment: http://stackoverflow.com/comment/43896530
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43895926
tagged with: css
has comment: http://stackoverflow.com/comment/43895627
answer count: 0
type: Question
has title: javascript image rotation within 2 seperate divs

http://stackoverflow.com/a/27662515
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27662454
score: 0
answers question: http://stackoverflow.com/q/27662454
has body: Use: eval("myArray") It is an array which has the contents of myArray.

http://stackoverflow.com/q/27674650
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43764355
tagged with: uri
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43764369
has comment: http://stackoverflow.com/comment/43764447
has title: Regex: Match from character to end of line without the last match group
score: 0
has comment: http://stackoverflow.com/comment/43764703
has body: I want to extract the q param from some urls: .com/?gws_rd=ssl#q=test .com/search?q=something+else&amp;source=123 Here's a regex I came up with: q=(.*?)(&amp;|$). When &amp; terminates, the results are: ["q=test", "test", "&amp;"] otherwise, when it hits the end of line: ["q=test", "test", ""] This works but doesn't seem right. Is there a way to not include the last match group at all, since I'm not interested in it?
tagged with: regex
accepted answer: http://stackoverflow.com/a/27674658
has comment: http://stackoverflow.com/comment/43764345
has answer: http://stackoverflow.com/a/27674658

http://stackoverflow.com/q/27789662
has title: How to pass an additional parameter to graffle.js
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/27790176
accepted answer: http://stackoverflow.com/a/27790176
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
type: Question
possible better answer: http://stackoverflow.com/a/27790178
tagged with: javascript
has answer: http://stackoverflow.com/a/27790178
tagged with: raphael
answer count: 2
upvote count: 1
has body: I'm trying to pass an additional parameter to the graffle's connection function so that I can draw a connection with/without an arrow at the end of the line based on that new parameter. To draw a connection, I normally do something like : connections.push(paper.connection(obj1, obj2, "#000")); Now I want to add this new parameter this way: connections.push(paper.connection(condCol, ret, "#000",true)); But the parameter is always undefined This is how I've changed the connection function: Raphael.fn.connection = function (obj1, obj2, line, bg, addArrow) { //... if (line &amp;&amp; line.line) { //... } else { // based on the 'addArrow' parameter I can figure out // whether I should put an arrow at the end of the line or not var settings; if (addArrow) { //If addArrow was true, draw a arrow at the end of the line settings = { "stroke": color, fill: "none", 'stroke-width': 2, 'arrow-end': 'block-midium-midium' }; } else { //If addArrow was false, just draw a line settings = { "stroke": color, fill: "none", 'stroke-width': 2 }; } return { bg: bg &amp;&amp; bg.split &amp;&amp; this.path(path).attr({ stroke: bg.split("|")[0], fill: "none", "stroke-width": bg.split("|")[1] || 3 }), line: this.path(path).attr(settings), //use the settings from: obj1, to: obj2 }; } } Do you have any idea why this isn't working?? Thanks in advance.

http://stackoverflow.com/a/75121804
has body: Check out this: $.ajax({ type: 'POST', url: '/wp-admin/admin-ajax.php', dataType: 'html', data: { category: catName, }, success: function(response) { $('.show_best_top_popular').html(response); var owl = $('.owl-carousal'); owl.trigger('destroy.owl.carousel'); owl.owlCarousel({ loop: true, margin: 10, nav: true, }); } }); After lots of try, I did it. Thanks.
answers question: http://stackoverflow.com/q/27802064
type: Answer
score: 0

http://stackoverflow.com/q/27778159
has comment: http://stackoverflow.com/comment/43967074
upvote count: 2
has title: how to get managed bean property values inside javascript
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27778460
type: UnansweredQuestion
score: 2
tagged with: jsf
downvote count: 0
has body: Iam new to JSF, I want to retrieve bean values inside javascript. Could you please help me out? Tried like this: function Call() { var value= "#{myBean.property}"; alert(value); }
type: Question
tagged with: primefaces
tagged with: javascript

http://stackoverflow.com/comment/43736988
comment on: http://stackoverflow.com/q/27659305
score: 0
type: QuestionComment
has text: Which specific line has the error? Is there a stack trace? The error seems self explanatory; something (maybe not in this code, but in something it calls like `notifikasi` or `initialize`) is probably trying to read `selectionDirection` on a hidden element.
type: Comment

http://stackoverflow.com/comment/43873513
type: Comment
has text: This is very useful if you don't know the state of the element (but I do, so it's unnecessary).
comment on: http://stackoverflow.com/a/27730975
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44037082
has text: Please post a jsFiddle with that issue showing. It would also be of help to know if that happens on a specific browser only or on all of them. There must be something else specifically blocking these keys cause I never saw this problem.
type: Comment
comment on: http://stackoverflow.com/q/27781765
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43930947
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27759832
score: 1
has text: This is a CSS issue. When your remove jQM, its' CSS classes aren't applied anymore.

http://stackoverflow.com/comment/43850025
comment on: http://stackoverflow.com/q/27719054
has text: what library are the placeholders handled by? Handlebars, jquery templates...? Please add the appropriate tag to the question. Also what does your meeting object look like? I suspect you are trying to serialize a javascript object, as opposed to just a number like `meeting.id`.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27757637
has comment: http://stackoverflow.com/comment/43926124
has title: How to save the img tag image to Folder via save as dialog box
has comment: http://stackoverflow.com/comment/43926214
has body: How to make the Save as Dialog box in html design help with Javascript. I have one img tag and I would like to save the image to local drive via button click. Thanks
has comment: http://stackoverflow.com/comment/43934300
tagged with: javascript
has comment: http://stackoverflow.com/comment/43926193
accepted answer: http://stackoverflow.com/a/27757819
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/7951326
type: Question
score: 0
has comment: http://stackoverflow.com/comment/43926049
answer count: 1
has answer: http://stackoverflow.com/a/27757819
has comment: http://stackoverflow.com/comment/43925916
has comment: http://stackoverflow.com/comment/43926010

http://stackoverflow.com/q/27731327
type: Question
has answer: http://stackoverflow.com/a/27731456
tagged with: javascript
has body: $localStorage.doctorDateTime.push({ fullDate : new Date(doctorDateTime) }); I passed date string in new Date and then save it to local storage but when i retrieve it from local storage it showing me this format: 2015-01-01T13:41:18.300Z while if console.log(doctorDateTime). it is showing right date string
upvote count: 2
possible better answer: http://stackoverflow.com/a/27731403
answer count: 3
accepted answer: http://stackoverflow.com/a/27731417
has title: local storage returning invalid format of date
tagged with: angular-local-storage
downvote count: 0
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/27731417
tagged with: datetime
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/27731403

http://stackoverflow.com/q/27690925
tagged with: cryptography
has comment: http://stackoverflow.com/comment/43795728
has comment: http://stackoverflow.com/comment/43795986
tagged with: cryptojs
has answer: http://stackoverflow.com/a/27692379
has answer: http://stackoverflow.com/a/46587521
has comment: http://stackoverflow.com/comment/43795105
has comment: http://stackoverflow.com/comment/43795821
has comment: http://stackoverflow.com/comment/43795101
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43795593
score: 3
tagged with: des
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/43795767
answer count: 2
has title: CryptoJS DES in ECB mode
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43795476
favorite count: 0
has body: I'm dealing with a third-party gateway that requires DES ECB with PKCS1 padding. So this code is not for my own use, but to send the message to the other guys. Before you ask how come they're using symmetrical-key encryption on the internet: I first must send them symmetrical key encrypted with SHA algorithm and only then encode the message with the DES key. This is NOT MY IDEA doing it. But it's very important for my project etc. I will do my own padding function, so please don't point me on NoPadding option. This code is just to test if DES works fine on my side. I'm facing a weird (for me) behavior of the crypt-js module in node.js Here's the code: var C = require('crypto-js'), source = 'abcdefghabcdefgh', key = '1234test'; var encrypted = C.DES.encrypt( C.enc.Utf8.parse(source), C.enc.Hex.parse(key), { mode: C.mode.ECB, padding: C.pad.NoPadding } ).ciphertext.toString(); var decrypted = C.DES.decrypt( C.lib.CipherParams.create({ ciphertext: C.enc.Utf8.parse(encrypted) }), C.enc.Hex.parse(key), { mode: C.mode.ECB, padding: C.pad.NoPadding } ).toString(); if (source === decrypted) { console.log('Glad :)'); } else { console.log('Sad :('); } The code won't turn glad this way. Crypto-JS and all other modules are the latest versions. Can someone please explain this to me?

http://stackoverflow.com/comment/43814051
type: QuestionComment
has text: I have edited the question with more details.
comment on: http://stackoverflow.com/q/27691313
score: 0
type: Comment

http://stackoverflow.com/a/27713258
has comment: http://stackoverflow.com/comment/43838985
score: 2
has comment: http://stackoverflow.com/comment/43838728
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/43839055
has body: Bar is definitely less efficient than Foo but not in terms of time complexity. Instead, it's less efficient in terms of memory consumption since each instance of Bar will now have a UNIQUE and NEW 'greet' function object (the 'bind' function creates a new function object). Looking at your code, it actually becomes slightly convoluted to even have the 'greet' function on Bar.prototype. Instead, this works as well: function Bar(myName) { this.firstName = myName; this.greet = greet.bind(this); } var greet = function(yourName) { alert("Hello, " + yourName + ". I am " + this.firstName + "."); }; var happy = new Bar("Happy"); var happyGreet = happy.greet; happyGreet("Denny"); You can test that the 'greet' function is not identical to each instance's 'greet' function by simply trying this: console.log( greet === happyGreet );
has comment: http://stackoverflow.com/comment/43839164
has comment: http://stackoverflow.com/comment/43839404
accepted answer of: http://stackoverflow.com/q/27712385
has comment: http://stackoverflow.com/comment/43838752
answers question: http://stackoverflow.com/q/27712385
has comment: http://stackoverflow.com/comment/43839240

http://stackoverflow.com/comment/43816626
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27701953
has text: Try using clearTimeout() after calling your function.
type: Comment

http://stackoverflow.com/comment/43773883
type: Comment
has text: what does `$json_obj['id']` contains for each element?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27678881

http://stackoverflow.com/comment/43727923
type: Comment
score: 0
type: AnswerComment
has text: wow, thank you so much! sounds so plausible. works like a champ!
comment on: http://stackoverflow.com/a/27651465

http://stackoverflow.com/a/27765144
downvote count: 0
answers question: http://stackoverflow.com/q/27764777
type: Answer
score: 2
upvote count: 2
has body: You can do it with CSS only using the following trick with table simulation (I changed the text size and color to make it more visible): /* Theme Name: Theme URI: Description: Version: 1.0 Author: Author URI: */ html { color: #444; font-size: 100%; background: #f7f7f7 url(../images/bg.png) repeat center top; height: 100%; } body { line-height: 1; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; height: 100%; font-size: 24px; color: #000000; background-color: rgb(240, 240, 240); color: white; font-family: sans-serif; } /* Layout container Style */ #main { padding-top: 6em; padding-bottom: 3em; height: 82%; width: 97%; padding-left: 1em; } #layout, #menu, #frame, .slidee, .menu-link { -webkit-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-out; -ms-transition: all 0.3s ease-out; -o-transition: all 0.3s ease-out; transition: all 0.3s ease-in-out; } .pure-img-responsive { max-width: 100%; height: auto; } #frame { height: 100%; } .frame { width: 100%; height: 100%; padding: 0; overflow-y: hidden; } .frame .slidee { margin: 0; padding: 0; height: 100%; list-style: none; } .frame .slidee li { float: left; margin: 0 5px 0 0; padding: 0; width: 300px; height: 98%; border: solid #CCC 1px; } .ad { background-position: center; background-size: 100% auto; } #ad1 { background: url("http://blogs.arts.ac.uk/csm/files/2014/03/fashion-revolution.jpg"); } .tablediv{ display: table; width: 100%; height: 100%; } .trdiv{ display: table-row; } .tddiv{ display: table-cell; text-align: center; vertical-align: middle; } THIS IS TEXT

http://stackoverflow.com/q/27784529
has answer: http://stackoverflow.com/a/27784821
tagged with: http://stackoverflow.com/tag/json
score: 0
answer count: 1
tagged with: javascript
has title: Creating multi graph using multiple JSON array datasets
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
type: UnansweredQuestion
type: Question
has body: I'm learning D3 and as a sandbox example I'm trying to create a multi line graph but I don't want to use CSV, TSV or anything similar. The key portion is at the bottom where I'm basically doing iterating over an array of the datasets (which themselves are arrays of objects {data:blah, price:bleh}. And I'm trying to append each dataset to the inner svg space. The problem is that after the first dataset, each subsequent dataset will append to the right and go very far out of my svg container and I obviously want it to stay inside the same SVG space A lot of these functions are for helping me manage these randomly generated datasets. For my data I'm using: momentjs, underscorejs, and obviously d3js var margin, width, height, parseDate, xScale, yScale, xAxis, yAxis, valueLine, nextDay, dataSet1, dataSet2, dataSet3, dataSet4, innerSpace; function tlate(x, y){return 'translate(' + x + ',' + y + ')';} function day(){ var today = moment().subtract(1, 'year') return function(){ return moment( today.add(1, 'day') ); } } nextDay = day(); function randomPrice(){ return _.random(125, 200); } function minDay(arr){ var minimum = moment( moment().add(100, 'years') ); _.each(arr, function(elem){ minimum = moment.min(minimum, elem.date) }) return minimum; } function maxDay(arr){ var maximum = moment( moment().subtract(100, 'years') ); _.each(arr, function(elem){ maximum = moment.max(maximum, elem.date) }) return maximum; } function minOfMultiple(arr, key){ var min = Number.POSITIVE_INFINITY; _.each(arr, function(dataSet){ _.each(dataSet, function(element){ min = _.min([min, element[key]]) }) }) return min; } function maxOfMultiple(arr, key){ var max = Number.NEGATIVE_INFINITY; _.each(arr, function(dataSet){ _.each(dataSet, function(element){ max = _.max([max, element[key]]) }) }) return max; } function createDataSet(){ return [ {date: nextDay(), price: randomPrice()}, {date: nextDay(), price: randomPrice()}, {date: nextDay(), price: randomPrice()}, {date: nextDay(), price: randomPric…

http://stackoverflow.com/a/27738772
type: Answer
upvote count: 5
has body: There's a project on GitHub called RecordRTC. It also provides a live demo here. This tool could run on browsers supporting WebRTC and getUserMedia. It could record both audio and video. However, according to data from Can I Use, currently WebRTC and getUserMedia are only supported by Firefox, Chrome, and other blink engine browsers.
downvote count: 0
answers question: http://stackoverflow.com/q/27738608
score: 5

http://stackoverflow.com/a/27711181
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27708341
has body: My question, is there is a way to detect if the browser support WebApiAudio and offering a fallback if is not supported ? "use strict" function audioContextCheck() { if (typeof AudioContext !== "undefined") { return new AudioContext(); } else if (typeof webkitAudioContext !== "undefined") { return new webkitAudioContext(); } else if (typeof mozAudioContext !== "undefined") { return new mozAudioContext(); } else { // Do stuff with soundmanager or something else if Web Audio API is not supported } } var audioContext = audioContextCheck();
score: 9
upvote count: 9

http://stackoverflow.com/a/27767487
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/27749803
score: 0
accepted answer of: http://stackoverflow.com/q/27749803
has body: So, I was getting this error; 'undefined' is not an object (evaluating 'f.msie') which was resulting from one of the plugins using $.browser which has since been removed. Installed jQuery migrate gem, re-pushed code, all jQuery and javascript now works. Thanks to anyone who took the time to look this over.

http://stackoverflow.com/comment/43842808
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27715255
has text: I tried a methond of `.serialize` before and I couldn't get it to work, but I also don't have the `inputs` in a `form`. I tried so many different methods that I have them all confused now. I'll give it a shot and let you know. Thank you!

http://stackoverflow.com/q/27734158
has title: Bootstrap 3: Extending div outside container on right side
type: AnsweredQuestion
tagged with: twitter-bootstrap
score: 1
upvote count: 1
type: Question
tagged with: javascript
has body: I'm trying to make a layout which needs a div to extend it outside the .container div only on the right side. Here's the fiddle: http://jsfiddle.net/krish7878/c5n365ek/1/ HTML Code: Left Container Right Container CSS Code: .left{ background-color: #999; height: 50px; padding: 30px 0px; } .right{ background-color: #49c8ff; height: 50px; padding: 30px 0px; } I want the right container with blue background to extend on the right side fully.
has answer: http://stackoverflow.com/a/27734212
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/27734212

http://stackoverflow.com/a/27693607
answers question: http://stackoverflow.com/q/27693528
downvote count: 0
has comment: http://stackoverflow.com/comment/43804315
score: 3
type: Answer
has body: I've done it like here: &lt;div class="container"&gt; ... your code &lt;/div&gt; .container:hover .tabStyle{ background : #000; border-color: #000; } .container:hover .slopeLeft, .container:hover .slopeRight{ border-bottom-color: #000; } where .container is parent element for your div's JSFiddle: http://jsfiddle.net/svzrkdu6/12/
upvote count: 3

http://stackoverflow.com/comment/43896471
comment on: http://stackoverflow.com/q/27742654
type: QuestionComment
type: Comment
has text: Also could you post the output you're expecting?
score: 0

http://stackoverflow.com/a/27797632
upvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/27797626
has comment: http://stackoverflow.com/comment/44003962
answers question: http://stackoverflow.com/q/27797626
has comment: http://stackoverflow.com/comment/44004841
downvote count: 0
has comment: http://stackoverflow.com/comment/44004058
score: 1
has body: You should be able to do alphabet.replace('o', 'b');
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44003889

http://stackoverflow.com/comment/112305917
type: Comment
has text: @Shashank Agrawal - I want to add module conditionally. I tried to push module in myApp.requires but didn't worked with angularjs 1.x. . Tried in .run() , .config - no luck
comment on: http://stackoverflow.com/a/27687339
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43882910
score: 0
type: Comment
has text: what's the 3rd party library?
comment on: http://stackoverflow.com/a/27735656
type: AnswerComment

http://stackoverflow.com/a/27789957
has comment: http://stackoverflow.com/comment/43989895
score: 4
upvote count: 4
has body: Non-empty strings are truthy. "0" is not 0. However, comparison will coerce 0 to a number. Note, the only string which can be coerced to true during comparison is "1". (Please let me know if there are edge cases I'm missing!) "true" == true // false "foo" == true // false "0" == true // false "1" == true // true
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43990484
has comment: http://stackoverflow.com/comment/43990137
has comment: http://stackoverflow.com/comment/43990544
has comment: http://stackoverflow.com/comment/43990845
has comment: http://stackoverflow.com/comment/43989879
type: Answer
accepted answer of: http://stackoverflow.com/q/27789946
has comment: http://stackoverflow.com/comment/43989957
answers question: http://stackoverflow.com/q/27789946
has comment: http://stackoverflow.com/comment/43989929
has comment: http://stackoverflow.com/comment/43989872

http://stackoverflow.com/comment/43964022
type: QuestionComment
has text: thanks @jivings: i want to show download success message for user after download completes. Is there any better method??
score: 0
comment on: http://stackoverflow.com/q/27776719
type: Comment

http://stackoverflow.com/a/27794477
upvote count: 3
has body: This is a typical async problem. You make a request, compare the result that didn't come back yet with some strings, then the response to your request comes - way too late for it to matter. You are too fast with your check. Put your status comparisons inside the done callback.
type: Answer
answers question: http://stackoverflow.com/q/27794434
score: 3
downvote count: 0

http://stackoverflow.com/a/27642895
has comment: http://stackoverflow.com/comment/43704456
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27642277
score: 1
has comment: http://stackoverflow.com/comment/43710568
has body: I have 3 suggestions: Return only references to functions. Your pattern becomes messy with, let's say, 4+ methods. If you are sure you'll get a string HH:MM, why don't you simply split it? Avoid setting secondary variables just like you did. If you already have primary values (today and prayerTime) and you are able to derive various new measures (like hours, min, secs etc. left) leave your object as stateless as you can. Some other patterns would suggest declaring functions AFTER the return statement (instead of declaring vars and anonymous functions) function PrayerTimeLeft(prayerTime) { var today = new Date(); var prayerTimeDate = new Date(); var setPrayerTime = function() { var prayerHours = prayerTime.split(':')[0]; var prayerMin = prayerTime.split(':')[1]; if (today.getHours() &gt;= prayerHours) { prayerTimeDate.setDate(today.getDate() + 1); } prayerTimeDate.setHours(prayerHours); prayerTimeDate.setMinutes(prayerMin); }; var getDiffMin = function() { return (prayerTimeDate - today) / 1000 / 60; }; var getDiffHrs = function() { return Math.floor((prayerTimeDate - today) / 1000 / 60 / 60); }; setPrayerTime(); return { getDiffMin: getDiffMin, getDiffHrs: getDiffHrs }; } And testing: var test = new PrayerTimeLeft("00:00"); // and today was 12:00 in 24 format console.log(test.getDiffMin()); //It will show total minutes left console.log(test.getDiffHrs()); //It will show total hours left (without minutes) 14:59 left will be shown as 14 hours left (15 hours would be more inaccurate). EDIT: If you want to return HH:MM, here is a snippet with extra function. function PrayerTimeLeft(prayerTime) { var today = new Date(); var prayerTimeDate = new Date(); var setPrayerTime = function() { var prayerHours = prayerTime.split(':')[0]; var prayerMin = prayerTime.split(':')[1]; if (today.getHours() &gt;= prayerHours) { prayerTimeDate.setDate(today.getDate() + 1); } prayerTimeDate.setHours(prayerHours); prayerTimeDate.setMinutes(prayerMin); }; var getDiffMin = function() { return …
downvote count: 0
has comment: http://stackoverflow.com/comment/43712611
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27642277

http://stackoverflow.com/comment/43924179
comment on: http://stackoverflow.com/q/27756540
score: 2
has text: If you want to *execute* (not just read) the JavaScript on a web site, you need to run [a headless Web browser](https://gist.github.com/evandrix/3694955) instead of using an HTML parser.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27798170
has answer: http://stackoverflow.com/a/27798503
score: 0
has comment: http://stackoverflow.com/comment/44005844
has comment: http://stackoverflow.com/comment/44004921
has comment: http://stackoverflow.com/comment/44005592
has comment: http://stackoverflow.com/comment/44005044
has title: Angularjs and web services
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44005131
possible better answer: http://stackoverflow.com/a/27798551
has comment: http://stackoverflow.com/comment/44005028
has comment: http://stackoverflow.com/comment/44005318
accepted answer: http://stackoverflow.com/a/27798503
has answer: http://stackoverflow.com/a/27798551
answer count: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44005249
tagged with: javascript
has comment: http://stackoverflow.com/comment/44005065
has comment: http://stackoverflow.com/comment/44005088
has comment: http://stackoverflow.com/comment/44005146
has comment: http://stackoverflow.com/comment/44005063
tagged with: angularjs
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: &lt;div ng-app="myapp" ng-controller="hello"&gt; &lt;script&gt; function Hello($scope, $http) { $http.get('http://rest-service.guides.spring.io/greeting'). success(function(data) { $scope.greeting = data; }); } &lt;/script&gt; and I would like to print the content like this {{greeting.id}}. the code snippet is going to get data in JSON format from "http://rest-service.guides.spring.io/greeting" using angularjs. This isn't working in eclipse. Any ideas to make it work ?
has comment: http://stackoverflow.com/comment/44006133

http://stackoverflow.com/comment/43908814
type: QuestionComment
comment on: http://stackoverflow.com/q/27739546
type: Comment
has text: Works fine for me. Please show us your html with the embedded script and we might be able to help.
score: 0

http://stackoverflow.com/comment/43820297
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27704123
type: QuestionComment
has text: thx alexander, i have done this and it worked only once, i mean the variable doesn't change with the onchange event of select in HTML. it works like the variable get printed only once and stay fixed without being dynamic with the select onchange.

http://stackoverflow.com/q/27769623
tagged with: ajax
has title: AJAX does not POST results to php page
has answer: http://stackoverflow.com/a/27769777
tagged with: php
has comment: http://stackoverflow.com/comment/43950230
has comment: http://stackoverflow.com/comment/43950102
type: UnansweredQuestion
has body: I'm trying to create a player edit system for an admin section of a football website. The process goes as follows: Once a coach has logged in on 'coaches.php', they can then choose what coaching session they want to look at via dropdown, which then populates the 'player' dropdown (done via js below) form on coach-home.php Activity : --Select Activity Group-- <?php include('dbconnect.php'); $sql=mysql_query("select activity from coaches where username='$coach'"); while($row=mysql_fetch_array($sql)) { $activity2=explode(",",$row["activity"]); foreach ($activity2 as $activity) echo ' '.$activity.' '; } ?> Player : --Select Player-- <input type="text" name="pid" class="pid" id="pid" value="<?php echo $pid; ?>" /> JS request on coach-home.php username.php <?php if($_GET['activity']) { $activity=$_GET['activity']; $sql=mysql_query("SELECT pid, username FROM stats WHERE activity='$activity'"); while($row=mysql_fetch_array($sql)) { $pid=$row['pid']; $username=$row['username']; echo ' '.$username.' '; } } ?> Once all of this is done, the coach submits the form, taking them to coachplayer.php. This is where the problem begins. coachplayer.php is a template page, with empty fields filled with echo's, to echo the player details where necessary. A query runs to get the id of the selected player, bring up their details and fill the page. Instead, however, it echos what usually comes up if the query cannot find a matching result via $playerCount as shown below, saying "Player doesn't exist". coach-player.php Query <?php // Check to see the URL variable is set and that it exists in the database if (isset($_GET['username'])) { // Connect to the MySQL database $puser = preg_replace('#[^0-9]#i', '', $_GET['username']); // Use this var to check to see if this ID exists, if yes then get the product // details, if no then exit this script and give message why $sql = mysql_query("SELECT * FROM stats WHERE username='$puser' LIMIT 1"); $productCount = mysql_num_rows($sql); // count the outp…
has comment: http://stackoverflow.com/comment/43950520
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43951127
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27770216
has comment: http://stackoverflow.com/comment/43950923
has comment: http://stackoverflow.com/comment/43950350
has comment: http://stackoverflow.com/comment/43950216
tagged with: jquery
has comment: http://stackoverflow.com/comment/43950696
has comment: http://stackoverflow.com/comment/43950143

http://stackoverflow.com/a/27733505
has comment: http://stackoverflow.com/comment/43990584
downvote count: 0
has comment: http://stackoverflow.com/comment/43989138
has comment: http://stackoverflow.com/comment/43990631
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27679908
score: 2
has body: This should be a comment but don't have 50 rep yet... Why do you need various HTML pages? I think you should refactor your code so every form is on the same HTML and everything shows and hides with Jquery or Javascript. You can send the same URL but with differente URL parameters. If this isn't your case, you should post some code of yours and detail a little bit more your question. Also, wich limit does it triggers?

http://stackoverflow.com/q/27712664
has title: Passing Parameter to a Named Function with Dependency Injection
score: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/27712690
accepted answer: http://stackoverflow.com/a/27712690
has comment: http://stackoverflow.com/comment/43837515
has body: I have an angular app and I'm passing a named function into a controller. The problem is I want to inject a provider into that controller to use. The console gives me TypeError: object is not a function. My question is, what's wrong with my syntax? Am I thinking of this the wrong way? (function() { 'use strict'; angular.module('MyCoolApp.controllers') .controller('SignInCtrl', ['$scope', 'Avatar', SignInCtrl]); function SignInCtrl(Avatar) { var vm = this; // Error occurs here in reference to creating an instance of Avatar vm.avatar = new Avatar(); } })();
has comment: http://stackoverflow.com/comment/43837551
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43837588
upvote count: 1
downvote count: 1
type: Question
tagged with: dependency-injection

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/27773983
tags question: http://stackoverflow.com/q/27712014
tags question: http://stackoverflow.com/q/27642276
tags question: http://stackoverflow.com/q/27695597
tags question: http://stackoverflow.com/q/27798170
tags question: http://stackoverflow.com/q/27702126
tags question: http://stackoverflow.com/q/27691736
tags question: http://stackoverflow.com/q/27717852
tags question: http://stackoverflow.com/q/27701662
tags question: http://stackoverflow.com/q/27749218
tags question: http://stackoverflow.com/q/27789973
tags question: http://stackoverflow.com/q/27700128
tags question: http://stackoverflow.com/q/27695321
tags question: http://stackoverflow.com/q/27757860
tags question: http://stackoverflow.com/q/27749415
tags question: http://stackoverflow.com/q/27759902
tags question: http://stackoverflow.com/q/27775579
tags question: http://stackoverflow.com/q/27675726
tags question: http://stackoverflow.com/q/27797513
tags question: http://stackoverflow.com/q/27690240
tags question: http://stackoverflow.com/q/27750355
tags question: http://stackoverflow.com/q/27663858
tags question: http://stackoverflow.com/q/27683290
tags question: http://stackoverflow.com/q/27749675
tags question: http://stackoverflow.com/q/27782140
tags question: http://stackoverflow.com/q/27669648
tags question: http://stackoverflow.com/q/27704991
tags question: http://stackoverflow.com/q/27672103
tags question: http://stackoverflow.com/q/27773173
tags question: http://stackoverflow.com/q/27737899
tags question: http://stackoverflow.com/q/27759880
tags question: http://stackoverflow.com/q/27729358
tags question: http://stackoverflow.com/q/27643491
tags question: http://stackoverflow.com/q/27687620
tags question: http://stackoverflow.com/q/27707787
tags question: http://stackoverflow.com/q/27674141
tags question: http://stackoverflow.com/q/27684254
tags question: http://stackoverflow.com/q/27656389
tags question: http://stackoverflow.com/q/27798218
tags question: http://stackoverflow.com/q/27762526
tags question: http://stackoverflow.com/q/27710787
tags question: http://stackoverflow.com/q/27755545
tags question: http://stackoverflow.com/q/27754077
tags question: http://stackoverflow.com/q/27688160
tags question: http://stackoverflow.com/q/27665469
tags question: http://stackoverflow.com/q/27771523
tags question: http://stackoverflow.com/q/27764306
tags question: http://stackoverflow.com/q/27737156
tags question: http://stackoverflow.com/q/27673819
tags question: http://stackoverflow.com/q/27759718
tags question: http://stackoverflow.com/q/27770839
tags question: http://stackoverflow.com/q/27674950
tags question: http://stackoverflow.com/q/27668176
tags question: http://stackoverflow.com/q/27727749
tags question: http://stackoverflow.com/q/27670798
tags question: http://stackoverflow.com/q/27680122
tags question: http://stackoverflow.com/q/27761318
tags question: http://stackoverflow.com/q/27753628
type: Tag
tags question: http://stackoverflow.com/q/27658661
tags question: http://stackoverflow.com/q/27689904
tags question: http://stackoverflow.com/q/27744531
tags question: http://stackoverflow.com/q/27692289
tags question: http://stackoverflow.com/q/27653972
tags question: http://stackoverflow.com/q/27740649
tags question: http://stackoverflow.com/q/27799544
tags question: http://stackoverflow.com/q/27798751
tags question: http://stackoverflow.com/q/27784242
tags question: http://stackoverflow.com/q/27789533
tags question: http://stackoverflow.com/q/27690410
tags question: http://stackoverflow.com/q/27646952
tags question: http://stackoverflow.com/q/27644047
tags question: http://stackoverflow.com/q/27756069
tags question: http://stackoverflow.com/q/27732463
tags question: http://stackoverflow.com/q/27657178
tags question: http://stackoverflow.com/q/27729956
tags question: http://stackoverflow.com/q/27649157
tags question: http://stackoverflow.com/q/27798845
tags question: http://stackoverflow.com/q/27668836
tags question: http://stackoverflow.com/q/27738050

http://stackoverflow.com/q/27784899
has body: The following code displays in the console the difference between the requested interval and the actual interval. Does this enable us to say anything meaningful about the length of the event loop (in broad terms, I am not very interested in individual ticks)? If so, what? var start, interval; interval = 2000; // ms function go() { start = performance.now(); setTimeout(function() { var end = performance.now(); console.log(end-start-interval); go(); }, interval); } go();
has comment: http://stackoverflow.com/comment/43980066
has title: Gathering information about the event loop in a web browser
tagged with: javascript
has comment: http://stackoverflow.com/comment/43980195
has comment: http://stackoverflow.com/comment/43979953
has comment: http://stackoverflow.com/comment/43980464
has comment: http://stackoverflow.com/comment/43980104
has comment: http://stackoverflow.com/comment/43980250
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43979914
has comment: http://stackoverflow.com/comment/43980143
favorite count: 0
has answer: http://stackoverflow.com/a/27784952
has comment: http://stackoverflow.com/comment/43979873
has comment: http://stackoverflow.com/comment/43980194
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43980280
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43979951
has comment: http://stackoverflow.com/comment/43989294
has comment: http://stackoverflow.com/comment/43980368
has comment: http://stackoverflow.com/comment/43980329
type: Question

http://stackoverflow.com/a/27714101
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43856232
has comment: http://stackoverflow.com/comment/43857583
answers question: http://stackoverflow.com/q/27714025
has comment: http://stackoverflow.com/comment/43840855
type: Answer
score: 6
has body: You forgot to pass the name of the factory in the array. Typically you pass an array whose elements consist of a list of strings followed by the function itself. Be sure to keep the array in sync with the parameters in the function declaration. This way the injector knows what services to inject into the function. myApp.controller('smController', ['$scope', 'stadtMobilRates', function($scope, stadtMobilRates) { EDIT This is how I would do it...When routes are used I like to use resolve so the data gets loaded once and is stored. So in the $routeProvider, I would change the the smController part to the following... when('/sm', { templateUrl: 'partials/sm.html', controller: 'smController', resolve:{ load:function(stadtMobilRates){ return stadtMobilRates.LoadData(); } }). I've also modified the factory myApp.factory('stadtMobilRates', function ($q, $http) { var mobilRates = null; function LoadData() { var defer = $q.defer(); $http.get('stadtmobilRates.json').success(function (data) { mobilRates = data; defer.resolve(); }); return defer.promise; } return { GetData: function () { return mobilRates ; }, LoadData:LoadData } }); So before this route is loaded, it's going to call the LoadData function in the factory. Once the data gets loaded, it resolves the promise so this LoadData function will only get called once. Once the promise resolves, it will go ahead and load the view. So now in your controller, whenever you want to get the data, all you have to do is call the function GetData myApp.controller('smController', ['$scope', 'stadtMobilRates', function($scope, stadtMobilRates) { var stadtmobilRates = stadtMobilRates.GetData(); });
upvote count: 6
has comment: http://stackoverflow.com/comment/43840973
has comment: http://stackoverflow.com/comment/43882712
has comment: http://stackoverflow.com/comment/43840881
accepted answer of: http://stackoverflow.com/q/27714025
downvote count: 0

http://stackoverflow.com/comment/43980669
comment on: http://stackoverflow.com/q/27785172
type: Comment
type: QuestionComment
score: 1
has text: Your problem is due to the *asynchronous* nature of the database connector you are using. Unless that connector provides a synchronous alternative, what you are trying to do can't be done.

http://stackoverflow.com/comment/43843485
has text: How can _you_ tell that `I'm` should be split but `hey'there'` should not? Sounds like this might require a dictionary?
type: QuestionComment
comment on: http://stackoverflow.com/q/27715581
score: 0
type: Comment

http://stackoverflow.com/comment/43898540
score: 1
has text: It doesn't get any more efficient than that.
comment on: http://stackoverflow.com/q/27743867
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27642796
has comment: http://stackoverflow.com/comment/43704234
accepted answer: http://stackoverflow.com/a/27642845
has answer: http://stackoverflow.com/a/27642951
possible better answer: http://stackoverflow.com/a/27642886
has title: Including CSS, jQuery, and HTML all into one .html
tagged with: javascript
answer count: 6
tagged with: jquery
has answer: http://stackoverflow.com/a/27642886
has answer: http://stackoverflow.com/a/27642867
score: 0
has body: I've been looking around, but I can't seem to find exactly what I'm looking for. I want to include both my jQuery and CSS into one .html page, but I cant seem to get the jQuery working. I'm not new to coding, but I am new to jQuery. Here's what I have so far: http://jsfiddle.net/b63nLkfa/1/ aboutMe Obviously, I want to toggle classes when clicked (simply change the width of the div).
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27642845
has comment: http://stackoverflow.com/comment/43704293
tagged with: css
has answer: http://stackoverflow.com/a/27642972
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43704488
has answer: http://stackoverflow.com/a/27642854
type: Question

http://stackoverflow.com/q/27732463
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/56616623
tagged with: web-services
linked to: http://stackoverflow.com/q/206384
type: Question
has comment: http://stackoverflow.com/comment/56616814
has title: .NET WebService JSON date in ISO-8601 format
upvote count: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/43877800
score: 5
downvote count: 0
tagged with: .net
answer count: 1
has body: I am calling a .net asmx webservice that returns a number of fields. One of the fields in a date. The date is in the format of: "effective_date":"\/Date(978411600000)\/" According to this SO question: How do I format a Microsoft JSON date? it would be better if the date returned was in ISO 8601 format, this way JavaScript would be able to interpret it as a date. Currently I use the following javascript: new Date(d.effective_date) and I get the message Invalid Date. According to the linked SO question I should be able to do this if I can get the web service to pass the date in ISO format rather than in \/Date(978411600000)\/ format. My question is, how do I get the webservice to return the date in ISO 8601 format? Note: I'm aware that I can use this (per the answer from the linked question): var date = new Date(parseInt(d.effective_date.substr(6)));, however it is mentioned in a comment that Incoming date values should be formatted in ISO-8601, so I'm wondering how to get the incoming date from the web service to be in this ISO format.
has comment: http://stackoverflow.com/comment/43878137
has answer: http://stackoverflow.com/a/27732489
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/43951164
comment on: http://stackoverflow.com/q/27770140
score: 0
type: Comment
has text: Where is the "div box"? What is it's position? Fixed or relative? Is it at the bottom of the page, a few pixels up or something?
type: QuestionComment

http://stackoverflow.com/comment/43955656
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27772351
type: AnswerComment
has text: yeah that works, but I swear I have seen it without the self-invoking function style

http://stackoverflow.com/a/27786043
upvote count: 1
answers question: http://stackoverflow.com/q/27785892
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27785892
has comment: http://stackoverflow.com/comment/43982235
has comment: http://stackoverflow.com/comment/43982101
type: Answer
has body: jQuery checks the value you're supplying to .html() for &lt;script&gt;, &lt;style&gt; and &lt;link&gt; tags (among several other things). Only if it does not contain them will it continue to set the .innerHTML property of the matched elements. However, if the value does contain any of those tags, then jQuery chooses to execute $(element).empty().append(content); instead, which appends the text value (node) as a child element. That should at least explain the difference in behavior. Here's an excerpt from the source code (v1.11.1): html: function( value ) { return access( this, function( value ) { var elem = this[ 0 ] || {}; // ...ommitted // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" &amp;&amp; !rnoInnerhtml.test( value )) //... // ... elem.innerHTML = value; // ... } // ... else ... this.empty().append( value ); // .... end if }, null, value, arguments.length ); }, The rnoInnerhtml regular expression is: /&lt;(?:script|style|link)/i,
score: 1

http://stackoverflow.com/comment/43999518
type: Comment
comment on: http://stackoverflow.com/a/27791709
has text: @javascriptwillbetheendofme see edit, you probably have the script being run before the HTML is added to the dom
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43919794
score: 0
comment on: http://stackoverflow.com/q/27754459
type: Comment
type: QuestionComment
has text: you didn't pass size in options )) Please show code where you instantiate you class ( like $var = new Edit() ) - there you should pass some object inside new Edit() construction - it must contain size property

http://stackoverflow.com/comment/94119719
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/53628619
has text: Please add code snippets demonstrating and fully explain the cause of the problem and how your solution addresses it, preferably with links to and quotes from external documentation.

http://stackoverflow.com/q/27662729
tagged with: mongodb
tagged with: sails.js
has answer: http://stackoverflow.com/a/27674411
tagged with: javascript
answer count: 1
downvote count: 0
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27674411
has title: Sails.js: one-to-many relationship for a model itself
tagged with: angularjs
tagged with: node.js
type: AnsweredQuestion
has body: I am trying to use Sails.js and MongoDB to build a simple app that supports multi-level categories. A category can have many sub categories. So in my Category model, I set up the one-to-many relationship within itself Category: module.exports = { adapter: 'mongo', attributes: { categoryTitle: { type: 'string', required: true }, //owner or parent of the one-to-many relationship parentCat: { model: 'category' }, //sub categories subCategories: { collection: 'category', via: 'parentCat' }, }}; The categories are display in a select dropdown list using the ng-repeat directive in AngularJS, e.g. Choose a category or none {{cat.categoryTitle}} In the AngularJS CategoryController, I use $scope.category.parent to capture the value of the selected category (as parent category). This step works, because I am able to see the selected value by console.log($scope.category.parent);. However, when I save the new category together with its parent category to MongoDB, the parent category is null even though other fields are saved properly, as shown in the Mongo terminal. I guess the problem is with the 'create' API I wrote for saving the new category in Sails. Could you spot where might be wrong in the following code? create: function(req, res, next) { var params = req.allParams(); // set parent category if exists if (params.parentCat) { var parentCategory = Category.findOne({categoryTitle : params.parentCat}) .exec(function(err, category) { if (err) { return null; //not found } return category; //found, return the category }); params.parentCat = parentCategory; //set the parent category in params } //insert the new category to MongoDB Category.create(params, function(err, category) { if (err) { console.log('category addition failed'); return next(err); } console.log('successfully added the category: ' + category.categoryTitle); res.redirect('/category'); }); } //create
upvote count: 1
type: Question

http://stackoverflow.com/q/27660272
has comment: http://stackoverflow.com/comment/43736288
has body: I have a black icon which I would like to turn blue while the cursor is hovering over it. It does turn blue if I keep the cursor still, but if I move it around, the icon starts flickering blue and black. I made a jfiddle to illustrate: http://jsfiddle.net/8t2whdop/3/ And here's the code in my view: &lt;%= image_tag("IconBlack.png", class: "link", id: "icon-black") %&gt; &lt;%= image_tag("IconBlue.png", class: "link", id: "icon-blue") %&gt; &lt;script type="text/javascript"&gt; $('#icon-blue').hide(); $('#icon-black').mouseenter(function () { $('#icon-black').hide(); $('#icon-blue').show(); }); $('#icon-black').mouseleave(function () { $('#icon-black').show(); $('#icon-blue').hide(); }); &lt;/script&gt; Apparently this is a common problem with mouseenter/leave considering the number of similar questions. This isn't a duplicate however, because I tried all the solutions that I found, and none of them fixed my particular problem. For example, I tried all different combinations of mouseover/out/enter/leave/toggle/hover. How can I stop the flickering effect?
has answer: http://stackoverflow.com/a/27660330
type: Question
has comment: http://stackoverflow.com/comment/43736318
downvote count: 0
has comment: http://stackoverflow.com/comment/43736240
tagged with: javascript
tagged with: show
tagged with: jquery
tagged with: mouseover
accepted answer: http://stackoverflow.com/a/27660330
has answer: http://stackoverflow.com/a/27660325
answer count: 3
has title: Mouseenter / Mouseleave creates flickering effect
favorite count: 0
possible better answer: http://stackoverflow.com/a/27660325
score: 2
upvote count: 2
tagged with: hide
has answer: http://stackoverflow.com/a/27660358
type: AnsweredQuestion

http://stackoverflow.com/a/27768599
score: 0
has comment: http://stackoverflow.com/comment/43948991
type: Answer
has comment: http://stackoverflow.com/comment/43952487
has comment: http://stackoverflow.com/comment/43950064
has comment: http://stackoverflow.com/comment/43949096
has comment: http://stackoverflow.com/comment/43950640
has body: You could capture the click event and prevent it from submitting the form (thus preventing submitHandler from triggering). Then in the handler of the click event, you could add the desired functionality. Check if the email's been changed, if so, show the dialog which in turn will submit the form if the save button is clicked. If the email hasn't been changed, just trigger the submit event of the form. $("#hj").click(function (ev) { ev.preventDefault(); if (emailedChanged) { $("#dialog-password").dialog("open"); } else { $("#main_form").submit(); } }); fiddle
has comment: http://stackoverflow.com/comment/43949180
has comment: http://stackoverflow.com/comment/43948870
has comment: http://stackoverflow.com/comment/43951014
accepted answer of: http://stackoverflow.com/q/27768472
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43951079
answers question: http://stackoverflow.com/q/27768472

http://stackoverflow.com/a/27742578
has comment: http://stackoverflow.com/comment/43896241
has comment: http://stackoverflow.com/comment/43896281
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43933798
accepted answer of: http://stackoverflow.com/q/27742495
has body: you need to return the promise function compareCurrentUserWithListObject() { var userProp = this._userProfileProperties; var userName = userProp.get_userProfileProperties()['UserName']; return this._list.filter(function (element, index, array) { var promise = jQuery.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/GetUserById(" + element.user.get_lookupId() + ")", type: "GET", headers: { "Accept": "application/json;odata=verbose" } }); promise.done(function(data) { return (data.d.Email.indexOf(userName) &gt; -1); }); // return promise here return promise; }); } or this (which is cleaner IMO): function compareCurrentUserWithListObject() { var userProp = this._userProfileProperties; var userName = userProp.get_userProfileProperties()['UserName']; return jQuery.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/GetUserById(" + element.user.get_lookupId() + ")", type: "GET", headers: { "Accept": "application/json;odata=verbose" } }); } function init() { this.compareCurrentUserWithListObject() .done(function(data) { var res = data.d.Email.indexOf(userName) &gt; -1; if (res.length &gt; 0) { //Do some stuff after compare... } }); } it looks like you want to modify the response before using it in init. There is a way to do that but I'd do it inside the .done callback when using it. I didn't test this code so there might be mistakes. But the general answer is: you need to return the promise.
type: Answer
answers question: http://stackoverflow.com/q/27742495
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43896030
has comment: http://stackoverflow.com/comment/43897169
has comment: http://stackoverflow.com/comment/43896561
has comment: http://stackoverflow.com/comment/43896012

http://stackoverflow.com/q/27704894
has answer: http://stackoverflow.com/a/27705520
has answer: http://stackoverflow.com/a/27707059
has title: Highstock data points pixel spacing
type: Question
tagged with: highcharts
tagged with: javascript
score: 0
answer count: 2
has body: Is there a way to set point spacing in pixels on x/y axis for highstock? For example data points should be 5px apart. Also is there way to shift chart left or right? For example shift all data points 5px right or left?
type: UnansweredQuestion

http://stackoverflow.com/q/27652768
has body: I am currently having some problem with the spatial reference projection on the map in Android. Basically I have a base map which is OneMap and all the coordinates stored in database is in SVY21 format. However, I wanted to display it using GoogleMap which is in WGS84 format. I wonder is there any ways for me to convert it in Java? Because by using OneMap Api Documentation, it has a conversion method which is in JavaScript. However, I need it to be in Java for my Android project. Any ideas?
score: -1
type: UnansweredQuestion
downvote count: 1
type: Question
tagged with: java
has title: Spatial Reference Conversion
tagged with: google-maps
upvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27661897
favorite count: 0
has comment: http://stackoverflow.com/comment/43743244

http://stackoverflow.com/q/27676392
tagged with: asp.net
type: UnansweredQuestion
has title: How to close a popup downloading a file after the download is complete
type: Question
has answer: http://stackoverflow.com/a/27686609
tagged with: c#
has body: I send a query string to popup windows and download files from the server. I want to close the popup after the download is complete but I don't know how. My Javascript code that sends the query string is: var url = "../Msg/pgmsgAttachmentDownload.aspx?ID=" + ID; window.open(url, '_blank', "top=100,left=100,menubar=0,resizable=1,width=670,height=520,scrollbars=yes,status=yes", true); My code that downloads a file from the popup page (pgmsgAttachmentDownload.aspx) is: System.Web.HttpResponse response = System.Web.HttpContext.Current.Response; response.ClearContent(); response.Clear(); response.ContentType = "text/plain"; response.AddHeader("Content-Disposition", "attachment; filename=" + newfilename + ";"); response.TransmitFile(Server.MapPath(bomsgAttachments.FilePath)); response.Flush(); response.End(); My code doesn't work in Chrome, but works and closes windows in IE and Firefox.
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/43849750
has text: *"I am using jQuery v1.7.2"* ***Why?!?!?!***
score: 5
type: Comment
comment on: http://stackoverflow.com/q/27718996
type: QuestionComment

http://stackoverflow.com/q/27767564
has title: Read HTML block form variable,find specific tag element with id,and where find tag insert text ! with jQuery?
has body: I have a block of HTML as variable,then i need to find specific tag on this block (variable)for example (span,a,input) ,and create a list of them, and where find those tags , i must put a text ( for example 9). i was generated this code but can't insert my text (9) where tag was found. var htmlraw =' hello hello hello hello hello '; var html = $.parseHTML(htmlraw); var list = new Array(); $(htmlraw).find('span,a,input').each(function(){ var element = new Array(); element[0] = this.id; element[1] = '9'; list.push(element); }); alert(list); // get content for ( var i = 0, l = list.length; i < l; i++ ) { var element = list[i]; var id = element[0]; var value = element[1]; /* var results = $(htmlraw).find('#'+id); var obj = null; if (results != null && results.length > 0) obj = results[0]; alert(obj.id); */ $(html).('#'+id).text(value); } alert(htmlraw); http://jsfiddle.net/mkmazid/1uua57ys/
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43946477
score: 0
has comment: http://stackoverflow.com/comment/43946273
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43946069
has answer: http://stackoverflow.com/a/27768356
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43946345

http://stackoverflow.com/q/27672761
has comment: http://stackoverflow.com/comment/43760345
tagged with: dynamic
downvote count: 3
has comment: http://stackoverflow.com/comment/43760543
type: Question
has answer: http://stackoverflow.com/a/27673529
score: -2
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/27881449
has comment: http://stackoverflow.com/comment/43760917
has comment: http://stackoverflow.com/comment/43760414
has comment: http://stackoverflow.com/comment/43760674
has body: new to the site so not that familiar with the set-up. I've made a simple javascript application for personal use, which is essentially a calculator, and the output is dynamic (do not need to submit or press enter to retrieve results). I want to be able to record the calculations I make so that I can recall them at a later date should I require the need to. in simple terms, I have an input field on my website and would like to record the keystrokes and save them to a database or file so that I may read them later. I'm just learning javascript so if you can explain it as fully as possible that would be much appreciated! Thanks, -John EDIT-- Added code in it's simplest form: Text Summation first number: plus second number: is:
tagged with: calculator
accepted answer: http://stackoverflow.com/a/27673529
tagged with: keystroke
favorite count: 0
upvote count: 1
tagged with: record
has title: How to efficiently record user typing using javascript and store in database?
type: AnsweredQuestion

http://stackoverflow.com/q/27719358
has comment: http://stackoverflow.com/comment/43860724
has answer: http://stackoverflow.com/a/27724594
has comment: http://stackoverflow.com/comment/43860610
has answer: http://stackoverflow.com/a/27736074
has comment: http://stackoverflow.com/comment/43850272
tagged with: javascript
has comment: http://stackoverflow.com/comment/43850262
answer count: 2
has comment: http://stackoverflow.com/comment/43852230
has comment: http://stackoverflow.com/comment/43851885
possible better answer: http://stackoverflow.com/a/27736074
has comment: http://stackoverflow.com/comment/43860669
downvote count: 0
has comment: http://stackoverflow.com/comment/43850751
favorite count: 0
accepted answer: http://stackoverflow.com/a/27724594
has comment: http://stackoverflow.com/comment/43850290
has title: What was the rationale behind having the receiver in functions default to the global object?
has comment: http://stackoverflow.com/comment/43860699
has body: In early versions of JavaScript, what was the rationale behind having the receiver (aka context) default to the global object? function a() { console.log(this); // window }
has comment: http://stackoverflow.com/comment/43850337
has comment: http://stackoverflow.com/comment/43860711
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43851723
upvote count: 14
has comment: http://stackoverflow.com/comment/43851807
type: Question
score: 14

http://stackoverflow.com/comment/43884759
type: QuestionComment
type: Comment
has text: Basically the server is called using a URL. Inside the URL is an Info parameter. If the value of this parameter is "ALL", the program knows it has to create the JSON string based on every employee. This is when the JSON String previously stated is produced.
comment on: http://stackoverflow.com/q/27736589
score: 0

http://stackoverflow.com/q/27679287
tagged with: node.js
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/43773231
has comment: http://stackoverflow.com/comment/43773288
type: Question
has title: Why is this replace function not working for the string
has comment: http://stackoverflow.com/comment/43773194
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43773151
has answer: http://stackoverflow.com/a/27679381
tagged with: replace
has comment: http://stackoverflow.com/comment/43773242
has body: I have a filename i split in parts but for some reason there is one string in which I cannot replace one character var filename = "first part - 5-10 - third part.txt" var filenameparts = filename.split(" - "); console.log(filenameparts); console.log(filenameparts[0].substring(filenameparts[0].indexOf(' '))); //this prints fine Array[3] 0: "first part" 1: "5-10" 2: "third part.txt" length: 3 part When I add this line nothing prints to console and in the html appears: console.log(filenameparts[1].replace("-","/")); HTML: Uncaught node.js Error TypeError: Cannot read property 'replace' of undefined
has comment: http://stackoverflow.com/comment/43773188
has comment: http://stackoverflow.com/comment/43773360
has comment: http://stackoverflow.com/comment/43773531
tagged with: node-webkit
accepted answer: http://stackoverflow.com/a/27679381

http://stackoverflow.com/q/27751434
score: 0
has answer: http://stackoverflow.com/a/27753497
answer count: 1
tagged with: http://stackoverflow.com/tag/svg
tagged with: animation
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27753497
has title: Updating SVG animations
tagged with: dynamic
has body: My code shifts a shape to the left, and fades during 2 seconds and repeats everything 1 second later &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="636px" height="155px" version="1.1"&gt; &lt;g id="canvas" transform="translate(0.5,0.5)"&gt; &lt;/g&gt; &lt;/svg&gt; &lt;script language="javascript"&gt; var svgNS = "http://www.w3.org/2000/svg"; var canvas = document.querySelector('#canvas'); function svgElement(name, attributes) { var element = document.createElementNS(svgNS, name); //to create a circle, for rectangle use rectangle for (key in attributes) element.setAttribute(key, attributes[key]); return canvas.appendChild(element); } function render() { while (canvas.firstChild) canvas.removeChild(canvas.firstChild); svgElement('rect', {x:x, y:"20", width:"100",height:"100",style:"fill:blue"}) } var x = 100 render() var wait = 0 function clock() { if (wait &gt; 0) { wait -= 1 if (wait == 0) x = 100 } else { x -= 10 if (x &lt; 1) { svgElement('animate', {attributeType:"CSS", attributeName:"opacity", from:1, to:0, dur:"2s", fill:"freeze"}) wait = 30 } else render() } } setInterval(clock, 100) &lt;/script&gt; The problem is that opacity fading is immediate on the second iteration. The square disappears immediately.
tagged with: dom
type: Question
tagged with: javascript

phantomjs
tags question: http://stackoverflow.com/q/27687929
tags question: http://stackoverflow.com/q/27642875
type: Tag
tags question: http://stackoverflow.com/q/27713911
tags question: http://stackoverflow.com/q/27802736
tags question: http://stackoverflow.com/q/27712505
tags question: http://stackoverflow.com/q/27706808
tags question: http://stackoverflow.com/q/27764495
tags question: http://stackoverflow.com/q/27690342
tags question: http://stackoverflow.com/q/27725461
tag name: phantomjs
tags question: http://stackoverflow.com/q/27698714
tags question: http://stackoverflow.com/q/27656522
tags question: http://stackoverflow.com/q/27725193
tags question: http://stackoverflow.com/q/27659514
tags question: http://stackoverflow.com/q/27660353
tags question: http://stackoverflow.com/q/27662502
tags question: http://stackoverflow.com/q/27736883
tags question: http://stackoverflow.com/q/27785320
tags question: http://stackoverflow.com/q/27746647
tags question: http://stackoverflow.com/q/27768051
tags question: http://stackoverflow.com/q/27731020
tags question: http://stackoverflow.com/q/27643869

http://stackoverflow.com/comment/43959922
has text: That will only hide which one you click, I wanted to hide **ALL** divs.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27774511
type: AnswerComment

http://stackoverflow.com/comment/43838502
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27713057
has text: An `input` does fire a `scroll` event when the overflowing text "scrolls" via change in overflow, at least in Firefox.

http://stackoverflow.com/a/27794608
downvote count: 0
type: Answer
has body: since ajax is asynchronous by the time your code arrives at the conditional statments the code for the request might not returned yet, hence the var status might not be initialized yet. Try put the condicional statments inside the done function, like this: $('#login').click(function(){ $.get("login.php", { uname: document.getElementById('uname').value, pass: document.getElementById('pass').value } ) .done(function( data ) { if(data =='y') { alert('yes!'); // window.location.replace("welcome.html"); } else if(data =='n') { alert('no!'); } }); I think that should do the trick ;) ...for further clarifications you can visit the jQuery ajax api documentation: http://api.jquery.com/jquery.ajax/
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27794434

http://stackoverflow.com/comment/43890960
type: Comment
has text: Thank you jogesh_pi. But do you know how I can send the Form Data as post data with the ajax request?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27739998

http://stackoverflow.com/q/27728465
type: UnansweredQuestion
tagged with: mysqli
has comment: http://stackoverflow.com/comment/43868775
tagged with: php
duplicate of: http://stackoverflow.com/q/24644436
answer count: 0
score: 0
tagged with: mysql
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43868778
has body: I am trying to send email from localhost XAMPP, I have updated all the required files but still unable to send Email from localhost. php.ini sendmail_path = "\"D:\xampp\sendmail\sendmail.exe\" -t" sendmail.ini smtp_port=587 auth_username=myemail@gmail.com auth_password=mypassword After all these update i have created a PHP file mail.php to send mails but its not delivering any Email. include 'connect.php'; $subject = $_REQUEST['subject'] ; // Subject of your email $personal_email= "abc@hotmail.com"; $message .= 'Name: ' . $_REQUEST['name'] . "&lt;br&gt;"; $message .= $_REQUEST['product_type']. "&lt;br&gt;"; $message .= $_REQUEST['message']; $subject_to_sender= "Confirmation"; $message_to_sender = "Thanks for contacting us"; $name= $_REQUEST['name']; $email= $_REQUEST['email']; $message= $_REQUEST['message']; $product_type= $_REQUEST['product_type']; $address= $_REQUEST['address']; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= "From: " . $_REQUEST['email'] . "\r\n"; // Sender's E-mail $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; if (@mail($email, $subject_to_sender, $message_to_sender, $headers)) { mail($personal_email, $subject, $message, $headers); // Transfer the value 'sent' to ajax function for showing success message. echo 'sent'; } On Send Button i also send all the Data into Database, and its successfully inserting data into database. Kindly guide me. Thanks
has title: How to send Email from XAMPP localhost
tagged with: email
linked to: http://stackoverflow.com/q/15965376
has comment: http://stackoverflow.com/comment/43868865
linked to: http://stackoverflow.com/q/24644436

http://stackoverflow.com/a/28689081
answers question: http://stackoverflow.com/q/27665043
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: In jsp page: <portlet:resourceURL var="resourceURL"></portlet:resourceURL> <aui:layout> <aui:column columnWidth="20" cssClass="lableAlignMent"> Role names </aui:column> <aui:column columnWidth="65" cssClass="auto-fields-text-field"> <aui:input name="ListOfRoles" id="ListOfRoles" label="" type="hidden"/> <aui:input name="ListOfRolesNames" id="ListOfRolesNames" label="" type="hidden"/> <div id="<portlet:namespace/>rolesDiv" style=""> <aui:input name="roleNames" id="roleNames" title="Enter role names" placeholder="Role name"/> </aui:column> </aui:layout> <aui:script> var flag = true ; var rolesBoxList; AUI().ready('aui-textboxlist-deprecated', function(A) { try{ var roles = selectRoles(); rolesBoxList = new A.TextboxList({ contentBox: '#<portlet:namespace />rolesDiv', input:'#<portlet:namespace />roleNames', dataSource: roles, matchKey: 'name', schema: { resultFields: ['key', 'name'] }, queryMatchContains:true }).render(); }catch(e){ //alert('roles'+e); } function selectRoles(){ var jsonArray = []; try{ var url = '<%=resourceURL%>'; jQuery.ajax({ type: 'POST', url:'<%=resourceURL%>', data: { <portlet:namespace />cmd:'roles', }, dataType:'json', method:'post', success: function(msg) { try{ var jsonArrayTemp=msg.objJsonArray; for(var i=0;i < jsonArrayTemp.length ;i++ ){ jsonArray.push([jsonArrayTemp[i][0],jsonArrayTemp[i][1]]); } }catch(exception){ alert(exception); } } }); }catch(exception){ //alert(exception); } return jsonArray ; } </aui:script> In Controller serveResource() method: Role roleObj=null; if (cmd.equals("roles")) { JSONObject objJsonObject = JSONFactoryUtil.createJSONObject(); JSONArray objJsonArray = JSONFactoryUtil.createJSONArray(); System.out.println("IN serve resource roles..."); ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest .getAttribute(WebKeys.THEME_DISPLAY); List orgTypeRoleCategoriesList = null; try { orgTypeRoleCategoriesList = AttributeLocalServiceUtil .getOrganizationTypeRoleCategories(themeDisplay .getLayout().getGroup().getOrga…
accepted answer of: http://stackoverflow.com/q/27665043
upvote count: 1

http://stackoverflow.com/comment/43728515
type: QuestionComment
has text: You will need to get rid of `onload` and possibly substitute jQuery's `$(window).load`. `onload` is not compatible with jQuery.
score: 0
comment on: http://stackoverflow.com/q/27656248
type: Comment

http://stackoverflow.com/comment/43823271
comment on: http://stackoverflow.com/a/27705580
type: AnswerComment
has text: The children are actually loaded but the parent is collapsed. Scenario: I have a parent node called parent1. I expand it. The server brings the child nodes etc. I edit some of the child nodes since they are checkbox nodes. Then I collapse parent1 and move on to parent2 etc. After I've edited all the leaf nodes needed, I want to be able to access all previously loaded but now collapsed parent nodes and their children. They are not lost since when I re-expand the parent there is no server call and the leaf node state remains the same (i.e. they are checked or unchecked).
score: 0
type: Comment

http://stackoverflow.com/comment/43729962
score: 1
comment on: http://stackoverflow.com/q/27657037
has text: possible duplicate of [Why don't self-closing script tags work?](http://stackoverflow.com/questions/69913/why-dont-self-closing-script-tags-work)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43898064
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27743646
has text: Plus, missing DB connection to `mysqli_real_escape_string()`. So many things wrong with OP's code. I am not touching this lol
type: AnswerComment

http://stackoverflow.com/a/75069077
has comment: http://stackoverflow.com/comment/132476378
has body: As an update to @quarky's 2018 comment, as of 10 Jan 2023, it is still the case that in Firefox (108.0.1) the dragstart() event does not fire if the draggable element is inside an anchor element. In my case my draggable element was an < img > and I worked around it by removing the enclosing < a href > and using an onclick("window.open(URL, '_blank')") on the < img >.
type: Answer
answers question: http://stackoverflow.com/q/27788991
score: 0
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/43805433
has text: actually directive gets initialized quickly too and changes the value to "chnaged value". you can chnaged the value on click etc not on initialization?
type: AnswerComment
comment on: http://stackoverflow.com/a/27694975
score: 0
type: Comment

http://stackoverflow.com/a/27739790
upvote count: 5
has body: Answer 1: You can't do that. Browsers quite correctly don't let you. You can ask the browser to show a message when the user tries to close the tab/window, details in this answer, but the browser gives the user the option to go ahead and do it anyway. Answer 2: You shouldn't do that. You have no right to trap a user on your page&nbsp;&mdash; not for one second, much less 30 seconds.
type: Answer
has comment: http://stackoverflow.com/comment/43890352
downvote count: 0
score: 5
answers question: http://stackoverflow.com/q/27739776

http://stackoverflow.com/comment/43836377
comment on: http://stackoverflow.com/q/27711124
type: Comment
type: QuestionComment
score: 0
has text: Which version of angular-ui calendar and Full calendar are you using?

http://stackoverflow.com/comment/43983076
score: 0
type: Comment
type: QuestionComment
has text: `MY_GLOBAL` is local to the module. It is not a global variable. Node modules are not at the top level. If you want to share it with another module, you can create an accessor function for it and export it or there is a way to actually make it an actual global. See http://nodejs.org/api/globals.html for more info. All that aside, please read my first comment because stuff async results into a variable and hoping some other module can pick up that result is generally a bad way to program.
comment on: http://stackoverflow.com/q/27786463

http://stackoverflow.com/comment/43818500
type: QuestionComment
has text: `expectGET` has to be setup for each request I believe. So if you have only on `expectGET` in your test, and the test passes, there was only one request made.
type: Comment
comment on: http://stackoverflow.com/q/27702569
score: 3

http://stackoverflow.com/comment/43927129
comment on: http://stackoverflow.com/q/27757172
has text: Yeah, a simplified example might be interesting. I'm not using Mongoose, but I might be able to help you with underscore. Just simplify the loop you are looking for to convert with map and I'll have a look. Btw, you didn't add it in your previous comment.
score: 0
type: Comment
type: QuestionComment

bloburls
tags question: http://stackoverflow.com/q/27707322
type: Tag
tag name: bloburls

http://stackoverflow.com/comment/43927586
score: 0
type: Comment
type: QuestionComment
has text: Yes. Also, open the client-side source view and click on the link to styles.css. If it loads, then you're looking at something like your CSS failing to override due to ! or somesuch.
comment on: http://stackoverflow.com/q/27758383

http://stackoverflow.com/a/27708098
upvote count: 1
answers question: http://stackoverflow.com/q/27695124
has body: I ran into a similar issue using angularjs version 1.2.9. Turns out, angular doesn't do the best job detecting the availability of window.XMLHttpRequest(). jQuery is a little more thorough in their approach. angularjs 1.2.9 function createXhr(method) { // IE8 doesn't support PATCH method, but the ActiveX object does /* global ActiveXObject */ return (msie &lt;= 8 &amp;&amp; lowercase(method) === 'patch') ? new ActiveXObject('Microsoft.XMLHTTP') : new window.XMLHttpRequest(); } jQuery 1.10.2 // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal &amp;&amp; createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties xhrSupported = jQuery.ajaxSettings.xhr(); For me, the fix was to add an additional condition that checks for IE8 document mode to angular's createXhr method: function createXhr(method) { // IE8 doesn't support PATCH method, but the ActiveX object does /* global ActiveXObject */ return ((msie &lt;= 8 &amp;&amp; lowercase(method) === 'patch') || (msie &gt;= 8 &amp;&amp; document.documentMode == 8)) ? new ActiveXObject('Microsoft.XMLHTTP') : new window.XMLHttpRequest(); } The alternative would be to implement jQuery's approach which looks to see if ActiveXObject is available. If it is then tries to create a standard XMLHttpRequest, if that fails it falls back on the ActiveX altern…
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27695124
type: Answer
score: 1

http://stackoverflow.com/comment/43887971
type: Comment
has text: While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.
score: 0
comment on: http://stackoverflow.com/a/27737845
type: AnswerComment

http://stackoverflow.com/q/27727144
type: Question
type: AnsweredQuestion
tagged with: force-layout
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27727610
answer count: 1
downvote count: 0
score: 1
has body: It is possible to have a different link strength or length attribute for each link in a force based layout? Below is an example dataset where the length and strength of each link would be defined as an attribute var dataset = { nodes: [ { name: "Adam" }, { name: "Iris" }, { name: "Jerry" } ], edges: [ { source: 0, target: 1, strength : .1, length: 50 }, { source: 0, target: 2, strength: 1, length: 100 },
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/27727610
tagged with: d3.js
upvote count: 1
has title: Link Length and Strength from attribute

http://stackoverflow.com/a/27808908
has body: You guys are overcomplicating it, using third party libraries, etc, when none of it is necessary! Here's some example code i've used for something similar, it logs all requests to a certain directory to a database, mainly just to keep track of which files are popular, but you could certainly switch this to flatfile logging My code: package com.zack6849.website.filters; import com.zack6849.website.Database; import javax.servlet.*; import javax.servlet.annotation.WebFilter; import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.sql.ResultSet; import java.sql.SQLException; @WebFilter(urlPatterns = "/uploads/*") public class StatisticsFilter implements Filter { @Override public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; chain.doFilter(req, resp); System.out.printf("[STATS] request to %s", request.getRequestURI()); if (request.getRequestURI() != null) { Database database = new Database(); try { ResultSet count = database.query("SELECT COUNT (url) as results FROM requests WHERE url = ?", request.getRequestURI()); boolean exists = count.getInt("results") > 0; count.close(); if (!exists) { database.executeUpdate("INSERT INTO requests (url, hits) VALUES (?, ?)", request.getRequestURI(), 0); } System.out.printf("[STATS] INCREMENTING 'hits' FOR %s", request.getRequestURI()); database.executeUpdate("UPDATE requests SET hits = hits + 1 WHERE url = ?", request.getRequestURI()); database.closeConnection(); } catch (SQLException e) { e.printStackTrace(); } } } @Override public void init(FilterConfig filterConfig) throws ServletException { } @Override public void destroy() { } } Older servlet engines may require you to specify a filter for this in your web.xml, it should look something like this logging com.zack6849.website.filters.StatisticsFilter logging /uploads/*
type: Answer
answers question: http://stackoverflow.com/q/27796707
score: 0

http://stackoverflow.com/a/27773646
downvote count: 0
has comment: http://stackoverflow.com/comment/43958431
has comment: http://stackoverflow.com/comment/43958057
answers question: http://stackoverflow.com/q/27773633
has comment: http://stackoverflow.com/comment/43972983
has comment: http://stackoverflow.com/comment/43958938
type: Answer
has comment: http://stackoverflow.com/comment/43958674
has comment: http://stackoverflow.com/comment/43958424
has comment: http://stackoverflow.com/comment/43958228
has body: AngularJS does not allow duplicates in a ng-repeat directive. Therefore, you can add track by $index into the ng-repeat as following: {{person.name}} {{person.desc}} Edit Delete Track by $index tells angular to use $index, which is auto increment, as a key instead of each individual element in the array. So, it won't be duplicate anymore.
has comment: http://stackoverflow.com/comment/43958161
has comment: http://stackoverflow.com/comment/43958305
has comment: http://stackoverflow.com/comment/43958237
has comment: http://stackoverflow.com/comment/43958109
has comment: http://stackoverflow.com/comment/43958441
has comment: http://stackoverflow.com/comment/43958338
has comment: http://stackoverflow.com/comment/43958273
upvote count: 5
score: 5
has comment: http://stackoverflow.com/comment/43958462
has comment: http://stackoverflow.com/comment/43958082

http://stackoverflow.com/q/27707753
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43827849
answer count: 0
has comment: http://stackoverflow.com/comment/43846997
type: Question
has comment: http://stackoverflow.com/comment/43829067
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43827674
has body: I'm trying create variable in HTML but ngInit don't refresh it. Here's code: {{(dinners | filter : {id : menu.first} : true)[0].name}} {{(dinners | filter : {id : menu.second} : true)[0].name}} {{(dinners | filter : {id : menu.extra} : true)[0].name}} I need $scope.menu leter (as you can see). Have you any idea how to do this? I hope my post is clear enoght. EDIT I've got this line: and I'm using menu leter, eg. here: {{(dinners | filter : {id : menu.first} : true)[0].name}} But than when I change order variable menu doesn't update. I completely understand that it shouldn't, but I'm looking for alternative. So question is: how to create refreshable menu variable. It can be in controller, but I also don't have idea how can I do that. As you can see I'm using menu in many place so I don't to reevaluate it over and over again. I want to do this once in every loop iteration.
has comment: http://stackoverflow.com/comment/43830149
has title: Create refreshable scope variable in HTML
has comment: http://stackoverflow.com/comment/43827707
tagged with: angularjs

http://stackoverflow.com/comment/43726581
has text: Unless I'm misunderstanding something, this is the same approach used in the combineLatest example solution, where you have two separate observables for the count and the data. That does not work for the same reasons: after you split the observables, the added concurrency makes it difficult to correlate the corresponding elements, even if the values they originate from are trivially related. In the case of this specific example, when changing the search parameters from X to Y, you get a page of data for search X with the count for search Y.
type: AnswerComment
comment on: http://stackoverflow.com/a/27652529
score: 0
type: Comment

http://stackoverflow.com/a/62440452
upvote count: 11
has body: The way i got it to work correctly was using .is(':checked'). $('selector').change(function (e) { // checked will equal true if checked or false otherwise const checked = $(this).is(':checked')); });
answers question: http://stackoverflow.com/q/27758168
has comment: http://stackoverflow.com/comment/119447520
downvote count: 0
type: Answer
score: 11

http://stackoverflow.com/a/27661420
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47563510
has comment: http://stackoverflow.com/comment/47525951
type: Answer
answers question: http://stackoverflow.com/q/27661306
has comment: http://stackoverflow.com/comment/55134470
has comment: http://stackoverflow.com/comment/47567653
accepted answer of: http://stackoverflow.com/q/27661306
downvote count: 0
has comment: http://stackoverflow.com/comment/130129534
score: 363
has comment: http://stackoverflow.com/comment/73635648
has body: Can I use ES6's arrow function syntax with generators? You can't. Sorry. According to MDN The function* statement (function keyword followed by an asterisk) defines a generator function. From a spec document (my emphasis): The function syntax is extended to add an optional * token: FunctionDeclaration: "function" "*"? Identifier "(" FormalParameterList? ")" "{" FunctionBody "}"
has comment: http://stackoverflow.com/comment/47536781
has comment: http://stackoverflow.com/comment/47557902
has comment: http://stackoverflow.com/comment/111144852
has comment: http://stackoverflow.com/comment/73650112
upvote count: 363

http://stackoverflow.com/comment/43900503
has text: Lesson for the OP. Use a decent JavaScript editor that highlights syntax problems like this. If you really don't want one, you can paste it into http://jsfiddle.net/10sd8and/ and press "tidy up code" which should make mismatched elements obvious
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27744748
score: 1

http://stackoverflow.com/comment/43895163
score: 0
type: AnswerComment
type: Comment
has text: Wow, you did nothing more than copy-pasting my jsfiddle example from the comment as answer.
comment on: http://stackoverflow.com/a/27742141

http://stackoverflow.com/a/27675457
upvote count: 5
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27675223
answers question: http://stackoverflow.com/q/27675223
score: 5
has body: I would suggest solving it using the configuration options of Featherlight instead of adding jQuery events to its elements. Looking at the Configuration section of Featherlights documentation it seems you can define a function to be called when the lightbox is opened or closed, see beforeOpen, afterOpen, beforeClose and afterClose. You can either define those functions using a data attribute on the element, e.g. data-featherlight-before-open, by overriding the global defaults, e.g. $.featherlight.defaults. beforeOpen, or by adding them as a parameter to your featherlight call, e.g. $.featherlight('#element', { beforeClose: ... }); I've added a small example that uses the global configuration method to change the text Lightbox is closed into Lightbox is open when opening the lightbox. $(function() { $('#btn').featherlight('#lightbox'); $.featherlight.defaults.beforeOpen = setLightboxOpen; $.featherlight.defaults.afterClose = setLightboxClosed; }); function setLightboxOpen() { $('#text').text('Lightbox is open'); } function setLightboxClosed() { $('#text').text('Lightbox is closed'); } .hidden { display: none; } Open lightbox Lightbox is closed Lightbox contents
type: Answer

http://stackoverflow.com/comment/43778196
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27681637
type: Comment
has text: @PSL +1 for making it readable, but there **are** invalid angular expressions -- that is when it fails to `$parse`. Your old code `scope.$evalAsync(scope.state = "done pushing");` first performs the assignment and returns the assigned value (`"done pushing"`) to be evaluated by `$evalAsync` which throws an `Error: [$parse:syntax]`. [See for yourself](http://codepen.io/anon/pen/JoRmeE) (click "Add" and open DevTools console to view errors).

http://stackoverflow.com/q/27668145
has title: Changing 's innerHTML for adding new style lines?
score: 1
has comment: http://stackoverflow.com/comment/43750964
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43750944
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27668207
has comment: http://stackoverflow.com/comment/43750948
has comment: http://stackoverflow.com/comment/43751021
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43751087
has comment: http://stackoverflow.com/comment/43750918
favorite count: 0
accepted answer: http://stackoverflow.com/a/27668207
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43750924
has body: I have a solution for my problem, but im looking for a more efficient way to solve it. I basicly want to code a function, that adds new lines of styles in css with Javascript. My solution is this. function addStyle(newStyleLine){ var mainStyle = document.getElementsByTagName("style")[0]; mainStyle.innerHTML = mainStyle.innerHTML + "body {"+newStyleLine+"}"; } And i have a &lt;style&gt; tag in my html. It works fine, but i think when i will have a bigger css in the &lt;style&gt; it will not be that efficient. Does anybody have thoughts about a better way to solve this. Thank you.

http://stackoverflow.com/a/52910702
has body: You can do it by using the Javascript API to set the callback. This will allow you to use the namespaced callback, or even the scope protected callback when using a framework. I couldn't test it, so as an example: var script = document.createElement('script'); script.id = 'container' script.src = '//www.google.com/recaptcha/api.js?render=explicit'; script.async = true; script.defer = true; script.onload = () =&gt; { ... }; document.body.appendChild(script); For the V3 Your script.onload function could be like: grecaptcha.ready(function() { namespace.captcha(); }); For the V2 Your script.onload function could be like: grecaptcha.render('container', { callback: namespace.captcha });
answers question: http://stackoverflow.com/q/27776964
score: 2
downvote count: 0
type: Answer
upvote count: 2

http://stackoverflow.com/q/27746715
score: 0
tagged with: firefox-addon-restartless
answer count: 1
has title: Bootstrap addon: How to do proper cleanup on shutdown?
tagged with: garbage-collection
accepted answer: http://stackoverflow.com/a/28301588
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28301588
type: Question
has body: I am new to this and a bit at a loss about the exact way the garbage collection works for restartless addons. From my shutdown function I currently call all objects I have to do cleanup. They remove any event handlers to outside code they might have set and then delete all properties on themselves. Then I call delete namespace.ObjectA for all objects on there. The namespace itself is a variable I created in bootstrap.js. I'm wondering if this is necessary, or will firefox after calling the shutdown function of my addon remove all global variables from bootstrap.js and thus with that all other objects that aren't reachable from outside my addon? Obviously if the reason for shutdown is Firefox application shutdown, I don't do any cleanup. Am I missing anything I should do on cleanup?
tagged with: firefox
tagged with: javascript

http://stackoverflow.com/a/27726158
answers question: http://stackoverflow.com/q/27726118
has body: This is just a guess, since is a bit hard to tell what is going on with only part of the code, but could it be that you are assigning currnetLoc twice, and thus the first player's location will always be always be compared against p2Loc[0]? So when you call moveRight(1) it sets currentLoc to p1Loc[0] then proceeds. Then immediately after you call moveRight(2) which sets currentLoc to p2Loc[0]. So now the comparison for the interval for player 1 is no longer p1Loc[0]&gt;currentLoc+wu, but rather p2Loc[0]&gt;currentLoc+wu. Depending on the value of p2Loc this may always be false.
has comment: http://stackoverflow.com/comment/43864418
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27726118

http://stackoverflow.com/a/27715234
type: Answer
accepted answer of: http://stackoverflow.com/q/27714977
answers question: http://stackoverflow.com/q/27714977
has comment: http://stackoverflow.com/comment/43842563
type: AcceptedAnswer
score: 0
has body: Based on what you've explained in the question and comments, what we are trying to accomplish is selection of the object in myArray where the options does not contain null. In this case, we do not need to perform a merge, we can just search the array for the desired object. var newResults = _.find(myArray, function (obj) { return !_.contains(obj.options, null); }); newResults will be the first object in the array where options does not contain null.

http://stackoverflow.com/q/27746481
has comment: http://stackoverflow.com/comment/43909842
favorite count: 0
has comment: http://stackoverflow.com/comment/43906230
has title: Ember.js "calling set on destroyed object" Error after call to unloadRecord
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43911360
has comment: http://stackoverflow.com/comment/43904215
has comment: http://stackoverflow.com/comment/43932065
has comment: http://stackoverflow.com/comment/43908100
has comment: http://stackoverflow.com/comment/43909837
score: 3
has answer: http://stackoverflow.com/a/33440094
has comment: http://stackoverflow.com/comment/43907168
upvote count: 3
has comment: http://stackoverflow.com/comment/43907081
type: Question
has comment: http://stackoverflow.com/comment/43932022
has comment: http://stackoverflow.com/comment/43909553
tagged with: ember-data
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43932714
linked to: http://stackoverflow.com/q/20407096
has comment: http://stackoverflow.com/comment/43930896
tagged with: ember.js
has body: Within a sessioning system for a project I'm working on, I'm calling unloadRecord on a record like so: user.unloadRecord(); I'm not calling destroyRecord because I want to manually unload the record from the store without persisting it to the server. Removing the record from the store in this manner works perfectly, but when I log into the same account--which requires loading the same user record from the server and inserting it into the store manually using store.push--I get the following error message: Uncaught Error: Assertion Failed: calling set on destroyed object ember.js:3902 Again, this occurs at the following line after calling user.unloadRecord(): var user = this.store.push("user", response.user); Where the response is the JSON payload returned by the POST request to /session, an example of which is shown here: { "sessionToken":"f7a7247467b08818ead27441838df30fed0e0a79", "user": { "id":"5499bf5b7f25680761c9df7a", "email":"test@gmail.com", "accounts": [/* [account ids] */], "syncPaths":[/* [sync path ids] */] } } Is there any way to avoid this error? UPDATE: In response to requests to see more of the code, here is the file containing the unloadRecord call, and here is the file containing the store.push call. UPDATE 2: I included an example of the JSON payload returned by a POST request to /session, as requested. Here is the model for a user: DS.Model.extend({ email: DS.attr("string"), accounts: DS.hasMany("account"), syncPaths: DS.hasMany("syncPaths") });
answer count: 1

http://stackoverflow.com/a/27769603
accepted answer of: http://stackoverflow.com/q/27769476
answers question: http://stackoverflow.com/q/27769476
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 6
score: 6
has body: Could you do something like this? $( document ).ready(function() { $('#news').mouseup(function (e){ text = window.getSelection().toString(); $('#imp').append(text); }); }); Hope this helps. JS Bin: http://jsbin.com/xabije/edit?html,js,output

http://stackoverflow.com/a/27776615
accepted answer of: http://stackoverflow.com/q/27776520
has comment: http://stackoverflow.com/comment/43963832
answers question: http://stackoverflow.com/q/27776520
type: Answer
downvote count: 0
has body: You could try this EST ENG
score: 3
has comment: http://stackoverflow.com/comment/43964179
upvote count: 3
type: AcceptedAnswer

http://stackoverflow.com/a/66966944
downvote count: 3
score: 16
has body: You will need to add the following options in html2canvas. html2canvas(document.body, { allowTaint : true, useCors : true }).then(function(canvas) { ... }
answers question: http://stackoverflow.com/q/27754544
type: Answer
upvote count: 19

http://stackoverflow.com/comment/43953588
score: 0
type: Comment
type: QuestionComment
has text: The real question is why would you use `json_encode` there, and not supply the expected arguments ?
comment on: http://stackoverflow.com/q/27771190

http://stackoverflow.com/comment/43901121
score: 0
comment on: http://stackoverflow.com/q/27744823
has text: It's the form. Updated the code.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27696272
tagged with: sorting
has answer: http://stackoverflow.com/a/27696357
favorite count: 0
has comment: http://stackoverflow.com/comment/43805948
linked to: http://stackoverflow.com/q/1129216
type: Question
score: 3
accepted answer: http://stackoverflow.com/a/27696357
has body: I'm trying to sort an array based on the first digit encountered in the title. My attempt was replacing the non-numeric characters with '' (title.replace(/\D/g, ''). It gives me back the digits but I'm not sure how to sort the array from this point. So, test0 first followed by test1, test2 and test3. model = [ { "title": "test3" }, { "title": "test1" }, { "title": "test2" }, { "title": "test0" } ];
upvote count: 3
answer count: 3
has answer: http://stackoverflow.com/a/27696379
possible better answer: http://stackoverflow.com/a/27696380
has answer: http://stackoverflow.com/a/27696380
has title: Sorting an array based on first digit of property
linked to: http://stackoverflow.com/q/979256
type: AnsweredQuestion
tagged with: arrays
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/27884455
has body: If you pass element a string, morris will assume its an id. Otherwise, you can pass morris a jQuery object, or even a DOM object. So if your classname was .sales_statistics, you could do this: element: $('.sales_statistics'), or element: document.getElementsByClassName('sales_statistics'), A great way to learn about things like that is to look at the source code. The following is a snippet from Morris's Donut constructor, and the same logic is seen in Grid and other constructors (I found it by doing a search for element in the source): this.options = $.extend({}, this.defaults, options); if (typeof options.element === 'string') { this.el = $(document.getElementById(options.element)); } else { this.el = $(options.element); }
answers question: http://stackoverflow.com/q/27730190
score: 0
type: Answer

http://stackoverflow.com/q/27784216
has comment: http://stackoverflow.com/comment/47407709
tagged with: cordova
has comment: http://stackoverflow.com/comment/43982919
type: UnansweredQuestion
has title: ios to javascript convert
answer count: 0
has comment: http://stackoverflow.com/comment/47401905
has body: I am using the sample SensorTag application code in our application and our application is cordova based. Here I have one problem. In SensorTag application they are using the following line of code. Can you please tell what is it mean and How to convert that to JavaScript from the iOS code char scratchVal[data.length]; int16_t objTemp; int16_t ambTemp; [data getBytes:&amp;scratchVal length:data.length]; int16_t objTemp = (scratchVal[0] &amp; 0xff)| ((scratchVal[1] &lt;&lt; 8) &amp; 0xff00); int16_t ambTemp = ((scratchVal[2] &amp; 0xff)| ((scratchVal[3] &lt;&lt; 8) &amp; 0xff00)); Here the data is NSData type and from the which is data from the BLE device. Thanks in advance
type: Question
tagged with: javascript
score: 0
tagged with: objective-c

http://stackoverflow.com/q/27698844
answer count: 1
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43823793
has comment: http://stackoverflow.com/comment/43810762
favorite count: 0
has comment: http://stackoverflow.com/comment/43811628
has answer: http://stackoverflow.com/a/28301555
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43815789
has comment: http://stackoverflow.com/comment/43811128
has comment: http://stackoverflow.com/comment/43810778
has comment: http://stackoverflow.com/comment/43823583
upvote count: 1
type: Question
has title: jQuery src selector Issue
has comment: http://stackoverflow.com/comment/43810993
tagged with: javascript
tagged with: jquery
tagged with: jquery-selectors
has body: I'm doing a poker game. I have an issue about a jQuery selector. $('[src$='+a+']').replaceWith('&lt;img src="images/backcard.png" width = 118, height = 166, border=3, style = "border-color: #FFFFFF;" /&gt;'); It tells me Error: Syntax error, unrecognized expression: [src$=♠6.jpg] Here is the code : function CartesJoueur(){ var random1 = " "; // 1ere carte : variable aléatoire sur une même famille (famille ♦ par exemple) var random2 = " "; // 2eme carte : variable aléatoire sur les symboles (♦ ♣ ♥ ♠) var random3 = " "; // 1ere carte : variable aléatoire sur une même famille (famille ♦ par exemple) var random4 = " "; // 2eme carte : variable aléatoire sur les symboles (♦ ♣ ♥ ♠) random1 = getRandomInt(2, 14); //nombre aléatoire entre 2 et 14 random2 = getRandomInt(2, 14); //nombre aléatoire entre 2 et 14 random3 = getRandomInt(1, 4); //nombre aléatoire entre 1 et 4 random4 = getRandomInt(1, 4); //nombre aléatoire entre 1 et 4 if(random3 === 1) var string1 = "images/♠" + random1 + ".jpg"; else if(random3 === 2) var string1 = "images/♣" + random1 + ".jpg"; else if(random3 === 3) var string1 = "images/♦" + random1 + ".jpg"; else if(random3 === 4) var string1 = "images/♥" + random1 + ".jpg"; if(random4 === 1) var string2 = "images/♠" + random2 + ".jpg"; else if(random4 === 2) var string2 = "images/♣" + random2 + ".jpg"; else if(random4 === 3) var string2 = "images/♦" + random2 + ".jpg"; else if(random4 === 4) var string2 = "images/♥" + random2 + ".jpg"; //permet d'éviter d'avoir deux fois la même image if(random3 === random4 &amp;&amp; random1 === random2) { random2 = getRandomInt(2, 14); random4 = getRandomInt(1, 4); } //affichage des deux images $('#6row').after('&lt;img src=' + string1 + ' width = 118, height = 166, border=3, style = "border-color: #FFFFFF;" /&gt;'); $('#6row').after('&lt;img src=' + string2 + ' width = 118, height = 166, border=3, style = "border-color: #FFFFFF;" /&gt;'); // console.log("hey " + random1 + " " + random3); // DEBUG a =string1.substring(7…

http://stackoverflow.com/comment/122854708
type: Comment
has text: I feel like backticks are good for inserting quotes within quotes without having to worry about the inner quotes clashing with the outer ones. For example, alert(`They said, "Hello World!"`);
comment on: http://stackoverflow.com/a/27678299
score: 0
type: AnswerComment

http://stackoverflow.com/a/27803918
upvote count: 1
answers question: http://stackoverflow.com/q/27683919
has body: You can use this library for drawing SVG lines, its quite configurable and well documented. You basically need to specify your "From" and "To" elements and a line will connect them for you. Then you can play with the line's stroke-dasharray and stroke-dashoffset properties on scroll to achieve effect of the line being drawn. More of SVG animation here I have used this approach and its quite cool looking, hope this helps
downvote count: 0
has comment: http://stackoverflow.com/comment/44041448
type: Answer
score: 1

http://stackoverflow.com/comment/43933081
type: QuestionComment
comment on: http://stackoverflow.com/q/27760921
has text: id is objects name properties.TR78 is id
score: 0
type: Comment

http://stackoverflow.com/q/27745181
has answer: http://stackoverflow.com/a/27745419
type: Question
has comment: http://stackoverflow.com/comment/43901299
has comment: http://stackoverflow.com/comment/43901448
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43901569
tagged with: javascript
has title: Parsing json array to javascript array from file:
score: 0
has answer: http://stackoverflow.com/a/27745249
has body: I am using html5 filereader api, this is my file: {"menu_items":[' + '{"name":"m_div_img1", "icon":"m_img1.jpg", "tip":"m_tip1.png"},' + '],'+ '"desktop_items":[],'+ '"widget_items":[]} This is my code: http://jsfiddle.net/radibg2/kemqpruu/2/ I am getting this error: Uncaught SyntaxError: Unexpected token '
has answer: http://stackoverflow.com/a/27745430
tagged with: filereader
answer count: 4
accepted answer: http://stackoverflow.com/a/27745249
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27745252
has answer: http://stackoverflow.com/a/27745252

http://stackoverflow.com/q/27770525
downvote count: 1
possible better answer: http://stackoverflow.com/a/27770645
has answer: http://stackoverflow.com/a/27770645
has answer: http://stackoverflow.com/a/28322630
tagged with: javascript
tagged with: jquery
has body: I have a div set as contenteditable and everything inside of that div can be edited. Now when I click on the div I automatically add a class selected (If visible prior I remove it and add it to the new selection) I have next and forward buttons so I can change my selection if I'm on using a tablet or smart phone. Now here's where I need help. So I selected the middle div and as I move my cursor to another child of #dynamic-storage I'm left with the problem of removing the class selected and adding it to the new child that's selected. (Not the span in the example as it's parent is a div. That's what I want selected as the div's in this example are the children of #dynamic-storage (ex. #dynamic-storage > div) The snippet provided at the bottom of this post does not contain the arrows or menubar provided in the screenshot and fiddle links above as that code is not necessary at the given time of posting. I'm keeping this post focused on the one task being handling the .selected class for the focused child of #dynamic-storage. $(document).ready(function() { // Select Elements var SelectElements = function() { $("#dynamic-storage").children().on("mouseup touchend", function() { if ( $(".selected").is(":visible") ) { $(".selected").removeClass("selected"); } $(this).addClass("selected"); }); }; // Clear Selection var ClearSelection = function() { $(".selected").removeClass("selected"); }; SelectElements(); // Handles Hotkeys $(document).keyup(function(e) { // Up & Down Arrow Keys To Select/Deselect Element in Editable if (e.which === 38 || 40 ) { if ( $(".selected").is(":focus") ) { alert("correct"); } else if ( $(".selected").is(":blur") ) { alert("incorrect"); } } }); }); /* Body */ #dynamic-storage { position: absolute; top: 0; left: 0; right: 0; z-index: 0; outline: 0; } #dynamic-storage .selected { outline: 2px dotted #69f; } Welcome My name is Michael. Hello world Welcome My name is Michael. Welcome My name is Michael. Fiddle: http://liveweave.com/uyz4VK Fiddle: http…
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43952048
has title: Contenteditable add/remove class if child id :focus
favorite count: 0
accepted answer: http://stackoverflow.com/a/28322630
type: Question
upvote count: 2
answer count: 2

http://stackoverflow.com/a/30654633
upvote count: 16
has comment: http://stackoverflow.com/comment/60246506
downvote count: 1
has comment: http://stackoverflow.com/comment/90753839
score: 15
has comment: http://stackoverflow.com/comment/94371072
answers question: http://stackoverflow.com/q/27795730
has comment: http://stackoverflow.com/comment/59773557
has body: This should work. $.ajax({ type: 'get', url: '/public/index', dataType: 'script', data: data_send, success: function() { $('.skills_section').slick('reinit'); } });
has comment: http://stackoverflow.com/comment/59793416
type: Answer

http://stackoverflow.com/q/27704261
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43821861
type: Question
tagged with: combobox
tagged with: asp.net-mvc-4
tagged with: entity-framework
upvote count: 1
tagged with: asp.net-mvc
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has title: how to use combobox in asp.net MVC
has body: I want to have dropdown list which will have have values from database and for that I have following code in my view @Html.DropDownListFor(model =&gt; model.EmpId, (SelectList)ViewBag.EmpId) @Html.ValidationMessageFor(model =&gt; model.EmpId) Now I want it such a way that is should contain values from database and it should also allow user to put manual entry if choice is not available in database. and also do I need to use any java script plugin to have HTML helper for the same?

http://stackoverflow.com/comment/43977710
type: AnswerComment
has text: @jbuman22 yeah you are right, its a drop down you have in you question. Anyway i sorted the heading to update dynamically for the collapsible and created a demo for a drop-down.
score: 0
comment on: http://stackoverflow.com/a/27757467
type: Comment

http://stackoverflow.com/comment/43725293
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27654099
has text: no,i just am taking the name="txtFrom" for From-textbox and name= "txtTo" for To-Textbox
score: 0

http://stackoverflow.com/q/27759660
has comment: http://stackoverflow.com/comment/43930465
tagged with: for-loop
tagged with: javascript
has comment: http://stackoverflow.com/comment/43930301
favorite count: 0
has comment: http://stackoverflow.com/comment/43930404
has title: JavaScript for loop - document.write, cycling through variables
has comment: http://stackoverflow.com/comment/43930441
has comment: http://stackoverflow.com/comment/43931095
answer count: 0
upvote count: 2
type: UnansweredQuestion
downvote count: 1
has body: I need some input on the following code. I have the following variables 1 - 11 that I need to cycle through using the document.write function. var Ref = [ "r1c1", "r1c2", "r1c3", ....."r1c11" ]; My for loop first creates unique div ID's. I need help cycling through my variables references for the document.write. Thanks for any suggestions. for (var i = 1; i &lt; 11; i++) { var divTag = document.createElement("div"); divTag.id = 'div' + i; c = "rlc"+i divTag.innerHTML = document.write(c) document.body.appendChild(divTag); }
score: 1
has comment: http://stackoverflow.com/comment/43930492
has comment: http://stackoverflow.com/comment/43931242
type: Question

http://stackoverflow.com/a/27775953
downvote count: 0
has body: Depence on the string, for the given string "this is a -&gt;'&lt;-test'" "this is a -&gt;'&lt;-test'".replace(/'/g,"\""); // does both at the same time // output "this is a -&gt;"&lt;-test"" "this is a -&gt;'&lt;-test'".replace(/'/,"\"").replace(/'/,"\"") // or in two steps // output "this is a -&gt;"&lt;-test"" // tested with Chrome 38+ on Win7 the g in the first Version, does a global replace so it replaces all ' with \" (the Backslash is only the Escape Character). The second Version replaces only the first occurence. I hope this helps If you really, want match once the first and once the last(without selecting/replacing the first) you would have to do something like this: "this is a -&gt;'&lt;-test'".replace(/'/,"\""); // the first stays the same // output "this is a -&gt;"&lt;-test'" "this is a -&gt;'&lt;-test'".replace(/(?!'.+)'/,"\""); // the last // output "this is a -&gt;'&lt;-test"" // tested with Chrome 38+ on Win7
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27775787

promise
tags question: http://stackoverflow.com/q/27789535
tags question: http://stackoverflow.com/q/27694844
tags question: http://stackoverflow.com/q/27768948
tags question: http://stackoverflow.com/q/27777402
tags question: http://stackoverflow.com/q/27647742
tags question: http://stackoverflow.com/q/27642063
tags question: http://stackoverflow.com/q/27676850
tags question: http://stackoverflow.com/q/27707111
tags question: http://stackoverflow.com/q/27708688
tag name: promise
tags question: http://stackoverflow.com/q/27729674
tags question: http://stackoverflow.com/q/27715275
type: Tag
tags question: http://stackoverflow.com/q/27657538
tags question: http://stackoverflow.com/q/27759593
tags question: http://stackoverflow.com/q/27710140
tags question: http://stackoverflow.com/q/27646223
tags question: http://stackoverflow.com/q/27801153
tags question: http://stackoverflow.com/q/27711649
tags question: http://stackoverflow.com/q/27723121
tags question: http://stackoverflow.com/q/27764898
tags question: http://stackoverflow.com/q/27667680
tags question: http://stackoverflow.com/q/27757483
tags question: http://stackoverflow.com/q/27662980
tags question: http://stackoverflow.com/q/27746304
tags question: http://stackoverflow.com/q/27772868
tags question: http://stackoverflow.com/q/27798740
tags question: http://stackoverflow.com/q/27748368
tags question: http://stackoverflow.com/q/27643719
tags question: http://stackoverflow.com/q/27750537

http://stackoverflow.com/comment/44076878
score: 0
has text: @Bnaya Thank you. `email14.secureserver.net` is using document mode = 7, while other websites are using Edge. I think this is the reason why I can't define `window.addEventListener`.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27797803

http://stackoverflow.com/comment/44002218
type: QuestionComment
has text: Can u Please send the reference..
comment on: http://stackoverflow.com/q/27796743
score: 0
type: Comment

http://stackoverflow.com/comment/43886897
has text: It is setting the state value `isVisible` to false. I have added it to the above code.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27737535
type: QuestionComment

http://stackoverflow.com/q/27708460
upvote count: 1
type: Question
tagged with: javascript
has body: In my game I am going to add obstaceles that move left to right across the &lt;div id="outline"&gt;&lt;/div&gt; I've used setInterval(){...} with the .animate() In it, and it seems to work only issue is after a little bit of time it leaves the ouline, Below is some code and a link. $(document).ready(function() { setInterval(function(){ $("#CObject").animate({ 'marginLeft' : "+=220px" //moves left }, 900); }, 900); setInterval(function(){ $("#CObject").animate({ 'marginLeft' : "-=220px" //moves left }, 900); }, 1000); }); Link.
downvote count: 0
tagged with: jquery
favorite count: 0
has title: Moving object Left To Right
has answer: http://stackoverflow.com/a/27708605
has answer: http://stackoverflow.com/a/27708659
type: UnansweredQuestion
answer count: 4
has answer: http://stackoverflow.com/a/27708533
score: 1
has answer: http://stackoverflow.com/a/27708577

http://stackoverflow.com/a/77977815
has body: for my case the solution was actually to set display: block; on my contenteditable div.
type: Answer
answers question: http://stackoverflow.com/q/27786048
score: 0

http://stackoverflow.com/comment/43849163
has text: For example : dateFormat: 'Nov 2014'
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27718276

http://stackoverflow.com/q/27686162
has answer: http://stackoverflow.com/a/27686612
has body: I want to input a string in this web page http://www.ncbi.nlm.nih.gov/gorf/orfig.cgi and, after click analyze or something similar in an HTML (like clicking OrfFind in that webpage), get the output in a browser. Is that possible with NodeJS?
type: Question
tagged with: javascript
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27692302
tagged with: node.js
score: 3
upvote count: 3
has title: Fill form and visit webpage with NodeJS
tagged with: forms

http://stackoverflow.com/comment/43839870
has text: @Musa no I'm not, is it the .send?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27713754

http://stackoverflow.com/q/27683074
has body: define(function() { return { show: function(msg) { alert(msg); }, showing: function(msg) { adding(10); //it throws up an exception saying that adding is undefined. }, adding: function(x) { return x + 10; } }; }); I have tried to switch adding above the showing function but it doesnt seem to work as well. Am i misunderstanding something? I am still very new to require js.
has answer: http://stackoverflow.com/a/27683118
has answer: http://stackoverflow.com/a/27683100
tagged with: javascript
score: 0
answer count: 3
favorite count: 0
accepted answer: http://stackoverflow.com/a/27683118
upvote count: 1
tagged with: requirejs
downvote count: 1
type: AnsweredQuestion
has title: undefined function in the same js file
has answer: http://stackoverflow.com/a/27683128
type: Question
possible better answer: http://stackoverflow.com/a/27683128

http://stackoverflow.com/q/27800121
score: -2
tagged with: css
tagged with: menu
accepted answer: http://stackoverflow.com/a/27802120
has body: Ok, so I'm looking to implement a responsive side menu for my website using JQuery or CSS3. I have been looking for a side menu that will push the page content when the menu link is clicked. When the menu link is clicked, I am looking to add a X(close button) to the menu. I have had a look at some of the responsive menu's out there but can't seem to find one that will do what I am asking. I have however found a website on themeforest that has exactly what I'm looking for. Can someone help me by explaining what plugin they have used, where to find it and also how they achieved this outcome. This is the website that has the responsive menu I am looking for. They have implemented it well Sorry I just realized I am asking exactly how this is done. I am really only looking for a JQuery plugin or an alternative that will accomplish the outcome in the above link. (owwwlab.com)
has comment: http://stackoverflow.com/comment/44009140
possible better answer: http://stackoverflow.com/a/27801324
has comment: http://stackoverflow.com/comment/44008947
downvote count: 3
upvote count: 1
type: AnsweredQuestion
tagged with: responsive-design
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27802120
tagged with: javascript
tagged with: jquery
has title: How can I implement a JQuery or CSS3 responsive side menu that pushes the page
favorite count: 0
has answer: http://stackoverflow.com/a/27801324

http://stackoverflow.com/comment/45495337
has text: Could you post your solution as an answer?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27747243

http://stackoverflow.com/q/27752959
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43916867
type: AnsweredQuestion
tagged with: php
linked to: http://stackoverflow.com/q/1197575
has comment: http://stackoverflow.com/comment/43916829
type: Question
has answer: http://stackoverflow.com/a/27753058
accepted answer: http://stackoverflow.com/a/27753058
has comment: http://stackoverflow.com/comment/43917026
has body: I have a php page which has lot's of code of html and javascript inside it.Ihe other page use ajax to send an id to the first page and get the results and put it inside a div element. Now I want to run those returned codes which contains javascript and html codes. How should that be done? This is my ajax request to the first page: $(document).ready(function() { $.ajax({ type: "POST", url: "showing.php", data: "s_id="+s_id+"&amp;submit=true", success: function(msg){ str=$.trim(msg) document.getElementById('tabs-2').innerHTML = str; document.getElementById("ui-id-2").click(); } })
answer count: 1
has title: how to run javascript code that included through ajax process
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0

http://stackoverflow.com/comment/44025389
has text: I don't see any type of *zoom* action being applied to an image in this demo. What exactly do you mean by "zoom"? Also, which version(s) of Internet Explorer are you testing?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27802146

http://stackoverflow.com/q/27735002
answer count: 0
type: UnansweredQuestion
tagged with: android
has title: AJAX GET JSON seems to returns nothing
has body: I am creating an Android application using Intel XDK and for some reason It seems to work on the emulator but on the mobile it seems to fail. Below are the screenshots of what it looks like on the emulator and on the device. Both are using the exact same code and are pointed to the correct database and server. Below is the code I'm using, the PHP and JavaScript code. function getSessionData(callback) { $.ajax({ url: 'http://sm.script47.net/api/v1/modules/sessionData/sessionData.php', "type": "GET", dataType: "json", async: true, success: function (data) { callback(data); }, error: function (xhr, textStatus, error) { alert(xhr.statusText); alert(textStatus); alert(error); }, }); } Then in another file called home.js. window.onload = function () { getSessionData(function (data) { window.token = data.token; window.userID = data.userID; window.username = data.username; window.emailAddress = data.emailAddress; alert(window.userID); getElement("userDetails").innerHTML = "Hello &lt;strong&gt; " + window.username + "&lt;/strong&gt;" }); }; Then to get the session data I'm using the below on a PHP server hosted by namecheap (shared hosting). &lt;?php session_start(); // I added the code below in the comment block to try and make it work. /******************************************************/ header('content-type: application/json; charset=utf-8'); header("access-control-allow-origin: *"); /******************************************************/ $sessionData = array( "token" =&gt; htmlspecialchars(trim($_SESSION['token'])), "userID" =&gt; htmlspecialchars(trim($_SESSION['userID'])), "username" =&gt; htmlspecialchars(trim($_SESSION['username'])), "emailAddress" =&gt; htmlspecialchars(trim($_SESSION['emailAddress'])) ); echo json_encode($sessionData, JSON_PRETTY_PRINT); I don't know why it won't work or what is causing it to not work which is why I'm not sure what the fix is. I've talked to the namecheap customer support and they said AJAX requests should work, and they do as…
tagged with: php
score: 2
upvote count: 3
tagged with: http://stackoverflow.com/tag/json
downvote count: 1
type: Question
tagged with: javascript
tagged with: ajax
favorite count: 0

http://stackoverflow.com/q/27689015
has answer: http://stackoverflow.com/a/27690091
has title: child_process.fork - process.send does not return message
tagged with: node.js
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/27690091
has body: I am running this script with node child_process.fork api. That is my express application script, from where I start my application: /** * Module dependencies. */ var express = require('express') , routes = require('./routes') , http = require('http') , path = require('path'); var app = express(); //database connection var connection = require('express-myconnection'); var mysql = require('mysql'); //all environments app.set('port', process.env.PORT || 3000); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.favicon()); app.use(express.logger('dev')); app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(express.static(path.join(__dirname, 'public'))); //development only if ('development' == app.get('env')) { app.use(express.errorHandler()); } app.use( connection(mysql,{ host: 'localhost', user: 'root', password : '', port : 3306, //port mysql database:'test-db' },'pool') ); //routes //app.get('/', routes.index); app.get('/', routes.list); app.use(app.router); //run script var cp = require('child_process'); var child = cp.fork('dataGrabber/pusherMysql'); child.on('message', function(m) { // Receive results from child process console.log('received: ' + m); }); http.createServer(app).listen(app.get('port'), function(){ console.log('Express server listening on port ' + app.get('port') + ' http://localhost:' + app.get('port')); }); That`s the part where I run my script: //run script var cp = require('child_process'); var child = cp.fork('dataGrabber/pusherAPI'); child.on('message', function(m) { // Receive results from child process console.log('received: ' + m); }); As you can see I load my script and want to receive a message from the child. That is my pusherAPI.js script: var mysql = require('mysql'); var Pusher = require('pusher-client'); /** * connect with mysql db */ var connection = mysql.createConnection({ host : 'localhost', user : 'root', database : 'test-db', port : '3306', password : '' }); connection.…
answer count: 1
tagged with: javascript
tagged with: dom-events
score: 0
tagged with: process

http://stackoverflow.com/comment/43865283
comment on: http://stackoverflow.com/q/27726618
has text: The code as posted seems to be missing a `})` somewhere.
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/45127591
type: Answer
answers question: http://stackoverflow.com/q/27691137
has body: You can use RunSequence(), see this example /* jquery.js */ /* velocity.js */ /* velocity.ui.js */ var $element1 = $("div").eq(0), $element2 = $("div").eq(1), $element3 = $("div").eq(2); var mySequence = [ { e: $element1, p: { translateX: "+=100" } }, { e: $element2, p: { translateX: "+=100" }, options: { sequenceQueue: false } }, { e: $element3, p: { translateY: "+=100" } } ]; $.Velocity.RunSequence(mySequence);
score: 0

mysql
tags question: http://stackoverflow.com/q/27762824
tags question: http://stackoverflow.com/q/27790099
tags question: http://stackoverflow.com/q/27649397
tags question: http://stackoverflow.com/q/27728465
tags question: http://stackoverflow.com/q/27707775
tags question: http://stackoverflow.com/q/27665129
tags question: http://stackoverflow.com/q/27665902
tags question: http://stackoverflow.com/q/27723894
tag name: mysql
tags question: http://stackoverflow.com/q/27653503
tags question: http://stackoverflow.com/q/27732141
tags question: http://stackoverflow.com/q/27771197
tags question: http://stackoverflow.com/q/27658316
tags question: http://stackoverflow.com/q/27770769
tags question: http://stackoverflow.com/q/27764529
tags question: http://stackoverflow.com/q/27764648
tags question: http://stackoverflow.com/q/27794428
tags question: http://stackoverflow.com/q/27684676
tags question: http://stackoverflow.com/q/27672014
tags question: http://stackoverflow.com/q/27684788
tags question: http://stackoverflow.com/q/27741836
tags question: http://stackoverflow.com/q/27713229
tags question: http://stackoverflow.com/q/27665067
tags question: http://stackoverflow.com/q/27731393
tags question: http://stackoverflow.com/q/27762527
tags question: http://stackoverflow.com/q/27737161
tags question: http://stackoverflow.com/q/27640753
tags question: http://stackoverflow.com/q/27664474
tags question: http://stackoverflow.com/q/27764224
tags question: http://stackoverflow.com/q/27778953
tags question: http://stackoverflow.com/q/27652564
tags question: http://stackoverflow.com/q/27660283
type: Tag
tags question: http://stackoverflow.com/q/27731776
tags question: http://stackoverflow.com/q/27699710
tags question: http://stackoverflow.com/q/27703222
tags question: http://stackoverflow.com/q/27739723
tags question: http://stackoverflow.com/q/27689199
tags question: http://stackoverflow.com/q/27731258
tags question: http://stackoverflow.com/q/27734531
tags question: http://stackoverflow.com/q/27746512
tags question: http://stackoverflow.com/q/27706337
tags question: http://stackoverflow.com/q/27690847
tags question: http://stackoverflow.com/q/27667213
tags question: http://stackoverflow.com/q/27733556
tags question: http://stackoverflow.com/q/27735858
tags question: http://stackoverflow.com/q/27762602
tags question: http://stackoverflow.com/q/27676904
tags question: http://stackoverflow.com/q/27782774
tags question: http://stackoverflow.com/q/27670431
tags question: http://stackoverflow.com/q/27731375
tags question: http://stackoverflow.com/q/27799464
tags question: http://stackoverflow.com/q/27714666
tags question: http://stackoverflow.com/q/27773633
tags question: http://stackoverflow.com/q/27736634

http://stackoverflow.com/comment/43930301
score: 3
type: Comment
type: QuestionComment
has text: `document.write` returns `undefined`. And better avoid it, see the warning in the [spec](http://www.w3.org/TR/html5/webappapis.html#document.write%28%29).
comment on: http://stackoverflow.com/q/27759660

http://stackoverflow.com/a/27671460
score: 1
answers question: http://stackoverflow.com/q/27671406
upvote count: 1
has comment: http://stackoverflow.com/comment/43757890
has body: There is a way. I usually achieve this with jquery using: $(window).width() //to get window width $(window).height() // to get window height $('#id').width(val) // to change the width accordingly For positioning I use a display:absolute in css changing $('#id').css('left',$(window).width*percentage); //as an example usually for the top property you have to consider other elements unless you just want it on top All of this code must run under a $(window).resize(function(){ //to get new window dimensions var windowwidth = $(window).width(); var windowheight = $(window).height(); //resizing code });
downvote count: 0
type: Answer

http://stackoverflow.com/q/27751327
has title: Undefined is not a function error formatting date in JS
answer count: 1
favorite count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
tagged with: date
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27751365
has body: I got an undefiend error passing my date value into formatDate function, why? How to ceate an instance in my case? function formatDate(date) { if (date) { var hours = date.getHours(); var minutes = date.getMinutes(); var format = hours &lt; 12 ? 'am' : 'pm'; hours = hours % 12; hours = hours ? hours : 12; // making 0 a 12 minutes = minutes &lt; 10 ? '0' + minutes : minutes; var time = hours + ':' + minutes + ' ' + format; var output = date.getMonth() + 1 + "/" + date.getDate() + "/" + date.getFullYear() + " " + time; console.log(output); alert(output); } } &lt;input type="datetime-local" onblur="formatDate(this.value)" /&gt;

http://stackoverflow.com/q/27716301
tagged with: sdk
type: Question
has answer: http://stackoverflow.com/a/27716322
possible better answer: http://stackoverflow.com/a/27716411
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27716411
score: 0
has title: how to create javascript effect automatically shut elament?
answer count: 2
has comment: http://stackoverflow.com/comment/43844636
accepted answer: http://stackoverflow.com/a/27716322
has body: ... I want to ask about use of effects, so I have a few buttons and each button if pressed will display the HTML element &lt;div&gt; and I've made the code $(document).ready(function(){ $('#label').click(function(){ $('#menu1').toggle("speed"); }); $('#label2').click(function(){ $('#menu2').fadeToggle("speed"); }); $('#label3').click(function(){ $('#menu3').slideToggle("speed"); }); }); I would like if one of the menu is clicked element from another menu closed. I ask for guidance and what's the solution?
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery

onfocus
tag name: onfocus
type: Tag
tags question: http://stackoverflow.com/q/27751409

http://stackoverflow.com/comment/43707301
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27644328
type: Comment
has text: I would highly encourage you to go through webbrowser control in winforms(visual studio).

http://stackoverflow.com/q/27764128
score: 6
type: Question
type: AnsweredQuestion
tagged with: callstack
has title: Does CasperJs then() wait on emitted events in the previous function?
has body: I am just curious how CasperJS handles events with regards to the call stack. Let's say we have some code: casper.on('foo', function() { this.wait(60000); this.echo('foo'); }); casper.start('http://www.stackoverflow.com', function() { this.echo('start'); this.emit('foo'); }); casper.then(function() { this.echo('done'); }); casper.run(); I know that then() will wait check against 3 flags: pendingWait, loadInProgress, and navigationRequested. Printing out the call stack shows the emit call to be in the function start(), so will start() not be considered finished until the event is finished? I.e. will then() wait until the event has finished I tested this with wait of 60 seconds, and I did get the output: start foo done Though I was not sure if exceeding a certain timeout would trigger the next then().
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27766234
favorite count: 0
tagged with: events
upvote count: 6
tagged with: casperjs
linked to: http://stackoverflow.com/q/11604611
accepted answer: http://stackoverflow.com/a/27766234

http://stackoverflow.com/comment/44007212
type: Comment
comment on: http://stackoverflow.com/a/27799366
score: 0
type: AnswerComment
has text: Was about to mention is not an array, but if you do want an array use [.serializeArray()](http://api.jquery.com/serializearray/)

http://stackoverflow.com/a/27697001
has body: This has been answered: What is the maximum length of a URL in different browsers? The JS will operate until out of memory, but IE tops out at around 2K I believe. Please don't do that btw...
upvote count: 1
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27696957
score: 0

http://stackoverflow.com/a/53437751
score: 1
answers question: http://stackoverflow.com/q/27774699
downvote count: 0
type: Answer
upvote count: 1
has body: There's a hack I've seen around, basically it translates points to and from center in a wrapper for scaling/rotating. Fiddle: http://jsfiddle.net/ywu45fpd/ Functions to translate points fabric.Object.prototype.setOriginToCenter = function () { this._originalOriginX = this.originX; this._originalOriginY = this.originY; var center = this.getCenterPoint(); this.set({ originX: 'center', originY: 'center', left: center.x, top: center.y }); }; fabric.Object.prototype.setCenterToOrigin = function () { var originPoint = this.translateToOriginPoint( this.getCenterPoint(), this._originalOriginX, this._originalOriginY); this.set({ originX: this._originalOriginX, originY: this._originalOriginY, left: originPoint.x, top: originPoint.y }); }; New method on canvas: fabric.util.object.extend(fabric.Canvas.prototype, { _scale: function(e, target, value) { var scale = value, needsOriginRestore = false; if ((target.originX !== 'center' || target.originY !== 'center') &amp;&amp; target.centeredRotation) { target.setOriginToCenter(target); needsOriginRestore = true; } target.animate({ scaleX: scale, scaleY: scale }, { onChange: canvas.renderAll.bind(canvas), easing: fabric.util.ease.easeOutQuad, onComplete: function() { if (needsOriginRestore) { target.setCenterToOrigin(target); } target.setCoords(); }, }) canvas.renderAll(); }, }); See mouse:up on fiddle for usage (basically canvas._scale(e, target, 2)) The same wrapper can be applied for rotating.

http://stackoverflow.com/comment/43945712
has text: Check for async: false for ajax requests
score: 0
comment on: http://stackoverflow.com/q/27767550
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43896030
has text: I know, but it looked like he wants to modify `data` before it's passed to the second `.done` callback.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27742578
type: AnswerComment

http://stackoverflow.com/q/27742336
upvote count: 3
has answer: http://stackoverflow.com/a/27742738
downvote count: 1
has answer: http://stackoverflow.com/a/27742469
type: Question
possible better answer: http://stackoverflow.com/a/27742738
has answer: http://stackoverflow.com/a/27742400
tagged with: javascript
has title: Passing an element id from PHP to Javascript
has comment: http://stackoverflow.com/comment/43895839
favorite count: 0
accepted answer: http://stackoverflow.com/a/27742400
linked to: http://stackoverflow.com/q/23740548
tagged with: php
has body: I have some data from my mysql database. I am showing that data in table using foreach loop like below foreach($students as $row):?> <i id="expand<?php echo $row['student_id'];?>" class="myclass fa fa-plus-square"> <?php echo $i; $i++;?> <?php echo $row['roll'];?> <img src="<?php echo $this->crud_model->get_image_url('student',$row['student_id']);?>" class="img-circle" width="50" /> <?php echo $row['name'];?> <?php echo $row['address'];?> <?php echo $row['phone'];?> I have also a click event function in Javascript like below $('#expand').click(function(){ $('#dev').toggleClass('hidden'); }); This is I want to hide and show on clicked event. Please note that this row contains data of student whose student id is $row['student_id'] <tr id="dev<?php echo $row['student_id'];?>" class="hidden"> Phone Number is <?php echo $row['phone'];?> I want to pass element id from php to javascipt so that when clicked on id expand it will execute some function like showing or hiding Thanks.
answer count: 4
type: AnsweredQuestion
tagged with: foreach
score: 2
has answer: http://stackoverflow.com/a/27742410
duplicate of: http://stackoverflow.com/q/23740548

http://stackoverflow.com/comment/43888946
score: 2
has text: You can have a single function named `attack(id)`, when user clicks button1, call the function by passing the appropriate `id`, `attack(1)`. Let the code inside the `attack` function create a `monster` and add it to the global array, `array.push(monster)`. Having said this, please post the relevant code, what you have tried, so that it can be corrected and improved..
comment on: http://stackoverflow.com/q/27739040
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27655266
has comment: http://stackoverflow.com/comment/52933604
downvote count: 0
has comment: http://stackoverflow.com/comment/45856237
has comment: http://stackoverflow.com/comment/45855986
has body: There currently is NO API methods for this. I will update my answer when any major updates to their SDK have been published. A work around is schedule a local push notification within Apples/Googles allowance and alter it thereafter when necessary. Conversely, Another way you could do it but will be code heavy; but create a push notification class on Parse Backend. Have pointers to users and create a few columns, one specifically will be a Parse Date with the proposed notification time. Update when necessary through the users device actions that way your not locked down to the one notification method set in stone. Everything is handled via cloud.
type: Answer
has comment: http://stackoverflow.com/comment/45856258
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27641312
answers question: http://stackoverflow.com/q/27641312
has comment: http://stackoverflow.com/comment/45855472
has comment: http://stackoverflow.com/comment/45856401
type: AcceptedAnswer

http://stackoverflow.com/comment/43826801
type: Comment
type: QuestionComment
has text: I'm not sure. The code I saw used GET to retrieve the contents of the BLOB, and then POST to upload to the server.
comment on: http://stackoverflow.com/q/27707322
score: 0

http://stackoverflow.com/a/27719443
has comment: http://stackoverflow.com/comment/43882765
has comment: http://stackoverflow.com/comment/43879932
has comment: http://stackoverflow.com/comment/43882656
type: Answer
has comment: http://stackoverflow.com/comment/43854869
has comment: http://stackoverflow.com/comment/43880391
has comment: http://stackoverflow.com/comment/43855733
upvote count: 3
has comment: http://stackoverflow.com/comment/43854068
has comment: http://stackoverflow.com/comment/43870085
accepted answer of: http://stackoverflow.com/q/27709394
answers question: http://stackoverflow.com/q/27709394
has body: The module object in your case isn't Game, it contains Game. Try: System.import('Game').then(function ({Game}) { game = new Game(); });
score: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/43762112
type: QuestionComment
comment on: http://stackoverflow.com/q/27673452
score: 0
has text: Thanks, this looks promising (no pun intended)
type: Comment

google-chrome-extension
tags question: http://stackoverflow.com/q/27727429
tags question: http://stackoverflow.com/q/27665917
tags question: http://stackoverflow.com/q/27761682
tags question: http://stackoverflow.com/q/27665677
tags question: http://stackoverflow.com/q/27749833
tag name: google-chrome-extension
tags question: http://stackoverflow.com/q/27764949
tags question: http://stackoverflow.com/q/27770393
tags question: http://stackoverflow.com/q/27792825
tags question: http://stackoverflow.com/q/27773816
tags question: http://stackoverflow.com/q/27768291
tags question: http://stackoverflow.com/q/27785052
tags question: http://stackoverflow.com/q/27671119
tags question: http://stackoverflow.com/q/27695709
tags question: http://stackoverflow.com/q/27768321
tags question: http://stackoverflow.com/q/27747290
tags question: http://stackoverflow.com/q/27774534
tags question: http://stackoverflow.com/q/27761646
tags question: http://stackoverflow.com/q/27770677
tags question: http://stackoverflow.com/q/27712860
type: Tag
tags question: http://stackoverflow.com/q/27787661
tags question: http://stackoverflow.com/q/27651040
tags question: http://stackoverflow.com/q/27716513
tags question: http://stackoverflow.com/q/27645834
tags question: http://stackoverflow.com/q/27653017
tags question: http://stackoverflow.com/q/27758575
tags question: http://stackoverflow.com/q/27756743
tags question: http://stackoverflow.com/q/27757113
tags question: http://stackoverflow.com/q/27745812
tags question: http://stackoverflow.com/q/27669590
tags question: http://stackoverflow.com/q/27776677
tags question: http://stackoverflow.com/q/27726799
tags question: http://stackoverflow.com/q/27763066
tags question: http://stackoverflow.com/q/27786730
tags question: http://stackoverflow.com/q/27785153
tags question: http://stackoverflow.com/q/27666344
tags question: http://stackoverflow.com/q/27758435
tags question: http://stackoverflow.com/q/27641278
tags question: http://stackoverflow.com/q/27675561
tags question: http://stackoverflow.com/q/27677583
tags question: http://stackoverflow.com/q/27760346

http://stackoverflow.com/comment/43841343
type: QuestionComment
score: 3
has text: Your simple code !-== the actual code. Your real code is ASYNCHRONOUS. You can not return from an asynchronous method. Basically you ordered a delivery pizza and you are eating it before it got to your house. It is not possible.
comment on: http://stackoverflow.com/q/27714600
type: Comment

http://stackoverflow.com/comment/43800020
score: 0
type: Comment
has text: I have updated my question and provided how I am updating the widget information.
comment on: http://stackoverflow.com/a/27693253
type: AnswerComment

http://stackoverflow.com/q/27783144
answer count: 4
score: 14
downvote count: 0
has answer: http://stackoverflow.com/a/27783371
favorite count: 0
tagged with: angularjs
type: Question
has body: I want to disable copy paste in a textarea using angularJs. I tried to do so with ng-paste, like so: Controller: angular.module('inputExample', []) .controller('ExampleController', ['$scope', function($scope) { $scope.val = '1'; $scope.past = function() { console.log("d"); $scope.val =" "; } }]); HTML: &lt;input ng-paste="past()" ng-model="val" ng-pattern="/^\d+$/" name="anim" class="my-input" /&gt; Input box has old data ( the initial paste data). Blocking paste works the second time around, that is if I paste the data into input box, the data will be present, but on a second paste the data won't paste, but the old data value is not removed.
has answer: http://stackoverflow.com/a/37025929
upvote count: 14
has title: Disable Cut, Copy and Paste function for textbox using AngularJs
has answer: http://stackoverflow.com/a/27783409
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27783611
has comment: http://stackoverflow.com/comment/43976303

http://stackoverflow.com/comment/43835919
has text: Ok , yeah you're right the above would be in global space. I typically wrap my code too, just was confused bc the above seemed to imply the wrapper object was necessary to decorate the function. Anyway, I'll give you an upvote as this is an alternative.
type: AnswerComment
comment on: http://stackoverflow.com/a/27700619
score: 0
type: Comment

css
tags question: http://stackoverflow.com/q/27728734
tags question: http://stackoverflow.com/q/27707157
tags question: http://stackoverflow.com/q/27679604
tags question: http://stackoverflow.com/q/27717257
tags question: http://stackoverflow.com/q/27652297
tags question: http://stackoverflow.com/q/27785357
tags question: http://stackoverflow.com/q/27668552
tags question: http://stackoverflow.com/q/27785225
tags question: http://stackoverflow.com/q/27716469
tags question: http://stackoverflow.com/q/27766694
tags question: http://stackoverflow.com/q/27723190
tags question: http://stackoverflow.com/q/27765855
tags question: http://stackoverflow.com/q/27734535
tags question: http://stackoverflow.com/q/27716081
tags question: http://stackoverflow.com/q/27653695
tags question: http://stackoverflow.com/q/27676879
tags question: http://stackoverflow.com/q/27650526
tags question: http://stackoverflow.com/q/27648895
tags question: http://stackoverflow.com/q/27758204
tags question: http://stackoverflow.com/q/27799900
tags question: http://stackoverflow.com/q/27724252
tags question: http://stackoverflow.com/q/27758112
tags question: http://stackoverflow.com/q/27702271
tags question: http://stackoverflow.com/q/27769273
tags question: http://stackoverflow.com/q/27801852
tags question: http://stackoverflow.com/q/27644919
tags question: http://stackoverflow.com/q/27715048
tags question: http://stackoverflow.com/q/27749788
tags question: http://stackoverflow.com/q/27740801
tags question: http://stackoverflow.com/q/27670829
tags question: http://stackoverflow.com/q/27737688
tags question: http://stackoverflow.com/q/27798816
tags question: http://stackoverflow.com/q/27645043
tags question: http://stackoverflow.com/q/27651614
tags question: http://stackoverflow.com/q/27786512
tags question: http://stackoverflow.com/q/27762142
tags question: http://stackoverflow.com/q/27732244
tags question: http://stackoverflow.com/q/27728736
tags question: http://stackoverflow.com/q/27694062
tags question: http://stackoverflow.com/q/27750378
tags question: http://stackoverflow.com/q/27792000
tags question: http://stackoverflow.com/q/27769929
tags question: http://stackoverflow.com/q/27789732
tags question: http://stackoverflow.com/q/27791980
tags question: http://stackoverflow.com/q/27735942
tags question: http://stackoverflow.com/q/27761829
tags question: http://stackoverflow.com/q/27726357
tags question: http://stackoverflow.com/q/27696917
tags question: http://stackoverflow.com/q/27642278
tags question: http://stackoverflow.com/q/27779021
tags question: http://stackoverflow.com/q/27674069
tags question: http://stackoverflow.com/q/27720750
tags question: http://stackoverflow.com/q/27724238
tags question: http://stackoverflow.com/q/27788493
tags question: http://stackoverflow.com/q/27731812
tags question: http://stackoverflow.com/q/27711059
tags question: http://stackoverflow.com/q/27746941
tags question: http://stackoverflow.com/q/27675968
tags question: http://stackoverflow.com/q/27743649
tags question: http://stackoverflow.com/q/27796008
tags question: http://stackoverflow.com/q/27725383
tags question: http://stackoverflow.com/q/27799281
tags question: http://stackoverflow.com/q/27704406
tags question: http://stackoverflow.com/q/27727993
tags question: http://stackoverflow.com/q/27709714
tags question: http://stackoverflow.com/q/27714541
tags question: http://stackoverflow.com/q/27656375
tags question: http://stackoverflow.com/q/27696201
tags question: http://stackoverflow.com/q/27662098
tags question: http://stackoverflow.com/q/27664988
tags question: http://stackoverflow.com/q/27729492
tags question: http://stackoverflow.com/q/27797434
tags question: http://stackoverflow.com/q/27721801
tags question: http://stackoverflow.com/q/27674758
tags question: http://stackoverflow.com/q/27782975
tags question: http://stackoverflow.com/q/27728132
tags question: http://stackoverflow.com/q/27658259
tags question: http://stackoverflow.com/q/27687714
tags question: http://stackoverflow.com/q/27670193
tags question: http://stackoverflow.com/q/27737453

json2html
tags question: http://stackoverflow.com/q/27695321
tag name: json2html
type: Tag

http://stackoverflow.com/q/27753785
tagged with: backspace
has comment: http://stackoverflow.com/comment/43918592
has title: Holding Down Backspace not Triggering Keyup
tagged with: http://stackoverflow.com/tag/html
tagged with: events
has comment: http://stackoverflow.com/comment/43918616
answer count: 0
type: UnansweredQuestion
has body: I'm trying to write text from an input to a div on keyup with javascript and jquery by checking if the current value of the input is the same as the previous value of the input. This works fine except when you hold down the backspace key until all of the text is gone from the input. In this case it doesn't update the variables that I'm using for some reason. This happens in all browsers and only if all of the text is deleted, also only if the backspace key is used (instead of another key) I'm pretty new at javascript so any tips are appreciated :) javascript: fsa = (function() { var inputId = ""; var sigId = ""; function resetOnFocus() { inputId = document.activeElement.id; sigId = "sig-" + document.activeElement.id; } function getText() { lastentry = $("#" + inputId).val(); } function writeText() { if ($("#" + inputId).val() != lastentry) { document.getElementById(sigId).innerHTML = 'current entry :' + $("#" + inputId).val() + '&lt;/br&gt;last entry: ' + lastentry; } } return { resetOnFocus: resetOnFocus, getText: getText, writeText: writeText } })(); //call the functions //clear variables on focus $('input').focus(function() { fsa.resetOnFocus(); }); //get input value on key press $('input').keydown(function() { fsa.getText(); }); //prints input value on keyup if input value is new $('input').keyup(function() { fsa.writeText(); }); and html: &lt;input id="first-name" class="i1" /&gt; &lt;div id="sig-first-name" class="o1" /&gt;&lt;/div&gt; &lt;input id="last-name" class="i2" /&gt; &lt;div id="sig-last-name" class="o2" /&gt;&lt;/div&gt;
upvote count: 1
has comment: http://stackoverflow.com/comment/43918389
has comment: http://stackoverflow.com/comment/43918654
score: 1
type: Question
has comment: http://stackoverflow.com/comment/43935435
has comment: http://stackoverflow.com/comment/43918777
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/27670147
has title: how to load all options in selector without select
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43755285
upvote count: 1
has answer: http://stackoverflow.com/a/27670704
type: Question
has comment: http://stackoverflow.com/comment/43756098
downvote count: 0
tagged with: javascript
has body: When I'm adding an options for a new product, there is a selector that must be used to select the options I need. But all the available options are required and must be visible without use of a selector. How can I add to form each option by option_id, without using a selector? HTML.file <?php echo $ms_options_add; ?> <?php foreach($options as $option) { ?> <option value="<?php echo $option['option_id']?>"><?php echo $option['name']; ?> <?php } ?> JS.file // add $('body').delegate(".select_option", "change", function() { $(this).children(':selected').attr('disabled', 'disabled'); var option_id = $(this).children(':selected').val(); var select = this; $.get($('base').attr('href') + 'index.php?route=seller/account-product/jxRenderOptionValues&option_id=' + option_id, function(data) { var lastRow = $(select).parents('.ms-options').find('.option:last input:last').attr('name'); if (typeof lastRow == "undefined") { var newRowNum = 1; } else { var newRowNum = parseInt(lastRow.match(/[0-9]+/g).shift()) + 1; } var data = $(data); data.find('input,select').attr('name', function(i,name) { if (name) return name.replace('product_option[0]','product_option[' + newRowNum + ']'); }); $('div.options').append(data); }); $(this).val(0); }); pls hlp my attempt html.file <?php foreach($options as $option) { ?> <div id="<?php echo $option['option_id']?>"> <?php echo addoption($option['option_id'])?> <?php } ?> js.file $(function() { function addoption(optionid) { var option_id = optionid; $.get($('base').attr('href') + 'index.php?route=seller/account-product/jxRenderOptionValues&option_id=' + option_id, function(data) { $('div'."optionid").append(data); }); }); }); but i've got this message Fatal error: Call to undefined function addoption() in /home/moidomki/public_html/catalog/view/theme/default/template/multiseller/account-product-form-options.tpl on line 9 looks like it's can't see my function?
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: html-select
has comment: http://stackoverflow.com/comment/43757148

http://stackoverflow.com/q/27692556
has answer: http://stackoverflow.com/a/27692744
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27692603
has answer: http://stackoverflow.com/a/27692603
tagged with: javascript
score: 0
has title: Write an equation into Javascript
accepted answer: http://stackoverflow.com/a/27692744
has comment: http://stackoverflow.com/comment/43798286
has comment: http://stackoverflow.com/comment/43798130
has body: I need an equation that give the earth tilt of the current day. Max Tilt is 23.45 on 22 of June, min is -23.45 on 22 December. I've found this equation which should works but I can't write it into javascript. δ=sin-1(sin(23.45°)sin(360365(d-81))) d is the number of the day (1-365). Source : http://pveducation.org/pvcdrom/properties-of-sunlight/declination-angle My try : Math.pow(Math.sin(Math.sin(23.45) * (Math.sin((360/365) * (356 - 81)))), -1) which gives -1.3140077301935487, whereas -23.45 is expected. Any ideas what's wrong on my conversion ?
type: AnsweredQuestion
tagged with: math

http://stackoverflow.com/q/27761445
has body: I am aware that you can only request access to the browser's microphone in google chrome (and other browser's as far as I know) with either https or http. I have a node server and am using Annyang which works fine when I am connected to wifi as usual (requests access to microphone, does its thing after the user accepts). My problem is that my application is meant to be used with a drone which means that I will be connected to the drone's wifi (which doesn't connect to the internet). I didn't think this would be a problem because I downloaded the annyang.min.js file and I don't need any internet connection for any other parts of my app. However, whenever I connect to the drone and fire up the server it will repeatedly ask for permission to use the microphone no matter how many times I press accept (unless I click deny at which point the app obviously stops working). The server is still using http and the page isn't continually reloading or anything (which would cause it to ask again) as far as I know. I don't have any other tabs open that are trying to use the microphone. Is there any reason why this problem might be occurring and what would be the best way to fix it? I have a hunch that the problem is caused by the lack of internet connection but I can't find any information on why that would cause a problem. Has anybody experienced this issue (or a similar one before) and if so how did you fix it? TL;DR: my speech recognition code works when I am not connected to the drone's wifi and stops working after I connect to it. All the code can be found on github. Let me know if I can clarify anything.
answer count: 1
tagged with: ar.drone
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27866591
favorite count: 0
has comment: http://stackoverflow.com/comment/44112540
has comment: http://stackoverflow.com/comment/44094733
linked to: http://stackoverflow.com/q/25149645
has comment: http://stackoverflow.com/comment/44116675
tagged with: annyang
has comment: http://stackoverflow.com/comment/44093287
has comment: http://stackoverflow.com/comment/44093788
tagged with: node.js
type: AnsweredQuestion
upvote count: 2
score: 0
linked to: http://stackoverflow.com/q/14318319
downvote count: 2
has title: Microphone permission without internet connection
has answer: http://stackoverflow.com/a/27866591
type: Question
has comment: http://stackoverflow.com/comment/44058108
has comment: http://stackoverflow.com/comment/44093726

http://stackoverflow.com/a/27792542
downvote count: 1
answers question: http://stackoverflow.com/q/27792084
upvote count: 0
has body: &lt;img src="tick1.gif" alt="tick1" onClick="setimagename('My New Title');" /&gt; or bind click event in script.
score: -1
type: Answer

http://stackoverflow.com/q/27663731
downvote count: 1
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/43743389
answer count: 1
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/43743289
has comment: http://stackoverflow.com/comment/43743318
favorite count: 0
has comment: http://stackoverflow.com/comment/43743360
has body: I know this subject has already been covered but I didn't find something as specific as my problem and the solutions I found didn't work for me (or i couldn't manage to make it work). I basically want to scroll to the top of the next element (a 100% height element) if I scroll down and if I scroll up from that element I would like it to scroll back to the top of the page. I currently have this : var currDiv = 1; $(window).scroll(function(event) { if (currDiv == 1) { $('html, body').animate({ scrollTop:$('div.container').offset().top }, 'slow'); currDiv = 2; } else if (currDiv == 2) { $('html, body').animate({ scrollTop:$('div.albums').offset().top }, 'slow'); currDiv = 1; } }); I know it doesn't have the "up" and "down" events yet and that it is wrong on different levels, but it is a first attempt to cycle between them... The problem is that it triggers itself and it keeps cycling back between both elements... Any help would be greatly appreciated. http://jsfiddle.net/644eghbw/1/ Here is a jsfiddle demonstrating the problem
has comment: http://stackoverflow.com/comment/43746096
has comment: http://stackoverflow.com/comment/43743335
has answer: http://stackoverflow.com/a/27663884
has comment: http://stackoverflow.com/comment/43743423
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43743258
has comment: http://stackoverflow.com/comment/43743306
accepted answer: http://stackoverflow.com/a/27663884
has title: scrollTop() function infinite loop
tagged with: scroll

http://stackoverflow.com/q/27691231
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27691297
tagged with: javascript
tagged with: jquery
score: 0
has body: I am trying to wrap the bootstrap datepicker with an angular directive in addition to the common datepicker this datepicker contains a different dateformat for display and different date format for the ng-model. and getting an error of : Error: [$rootScope:inprog] $digest already in progress my code is pasted below: app.directive('ngDatePicker', function () { return {//this datePicker will show the date in the wanted format and save it (ng-model) with the default format of yy-mm-dd template: "&lt;span&gt;&lt;input id='displayDate' class={{class}} type='text'/&gt;&lt;input id='hiddenDate' type='text' style='display:none'/&gt;&lt;/span&gt;", require: 'ngModel', replace: true, scope: { ngModel: '=', class: '@' }, link: function (scope, element, attrs, ngModelCtrl) { // set date pickers - this datePicker var displayInput = element.find('#displayDate'); var hiddenInput = element.find('#hiddenDate'); var options = {}; options.minDate = new Date(); options.format = "yyyy-MM-dd"; options.autoclose = 'true'; displayInput.datepicker(options); displayInput.datepicker().on('changeDate', function () { //update the ng-model var changedDate = displayInput.datepicker("getDate"); var newDate = converDateToDefault(changedDate); if (scope.ngModel != newDate) { scope.$apply(function () { hiddenInput.val = newDate; scope.ngModel = newDate; }); } }); scope.$watch("ngModel", function (newVal) { if (typeof newVal !== undefined &amp;&amp; newVal != null &amp;&amp; newVal != "") { displayInput.datepicker('destroy'); var option = {}; option.format = "yyyy-MM-dd"; displayInput.datepicker(option); var convertedVal = converDateToDefault(displayInput.datepicker("getDate")); if (convertedVal != "Invalid date" &amp;&amp; newVal != convertedVal) { displayInput.datepicker("setDate", convertDate(newVal)); hiddenInput.val = newVal; } } }, true); } }; }); Thanks
has answer: http://stackoverflow.com/a/27721736
tagged with: angularjs
tagged with: datepicker
has title: wrapping bootstrap datepicker as a directive
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27721736
has answer: http://stackoverflow.com/a/27691297

http://stackoverflow.com/comment/43826535
score: 0
has text: You are trying to use the XMLHttpRequest to load a blob??? Why? What is the blob?
comment on: http://stackoverflow.com/q/27707322
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/56975390
type: Comment
has text: @Stephan, i am in a similar situation as you are. I have tons of thirdy party plugins and do not want to spread them across stylesheet and javascript directory in the vendor folder. Have you fond a solution yet?
comment on: http://stackoverflow.com/a/27664918
type: AnswerComment
score: 0

http://stackoverflow.com/a/27715494
accepted answer of: http://stackoverflow.com/q/27711305
type: Answer
answers question: http://stackoverflow.com/q/27711305
downvote count: 0
score: 1
has body: Looks like you are mixing concepts. First let's see the define() definition (suppose the file is headerDropdown.js): define('headerDropdown',['jquery', 'bootstrap']),function(jquery, bootstrap){ var $menu = $(".menu"); var $dropdown = $menu.find("ul"); $menu.on("click", function () { $dropdown.toggle("fast"); }); }; Require.js does not recommend to define a module expliciting their name ('headerDropdown'); you can get the name based on the filename. That's because require has a tool for optimization of the javascript in production: you can concatenate and minimize the output JS. The optimizer uses the filename to define the module name. Please, avoid defining with name. If you look at the code, you are requiring ['jquery'] but inside the module definition you're using the global jQuery variable. That's OK because jQuery define their module as a global variable, but the convention is to receive in the function the jquery reference: define('headerDropdown',['jquery', 'bootstrap']),function($, bootstrap) You are defining a module that manipulates DOM directly, which goes against the DOM update procedure of knockout. In your case, you are using a data-bing="headerDropwodn" so the headerDropdown is a bindingHandler rather than a simple module. Please check: http://knockoutjs.com/documentation/custom-bindings.html You can load on require as you pointed on the question. You just need to change your codes: Load in your HTML an app.js script (for example). This app.js requires knockout and your headerDropdown bindingHandler. In the function declaration you define the ko.applyBindings and that's all. Greetings!
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/43751701
score: 1
has text: Your parentheses and braces aren't matching up. Please post correct JS, it's hard to tell what you're trying to do.
comment on: http://stackoverflow.com/q/27668486
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27714060
favorite count: 0
has comment: http://stackoverflow.com/comment/43840804
has comment: http://stackoverflow.com/comment/43840812
has answer: http://stackoverflow.com/a/27717435
accepted answer: http://stackoverflow.com/a/27717435
tagged with: node.js
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/43840492
has body: I am reading in a binary file file using a jQuery ajax get request, where I receive the file (in my case a zip file) back as a string. Once I perform some actions in-browser on the file (not modifying file), I need to transmit it back to a server endpoint (in this case, nodejs using express 3), also via a ajax. I'm attempting to do this via the following POST request, which is where I believe I am having my issues, due to needing to encode my string using encodeURIComponent: var fd = new FormData(); fd.append("filedata", encodeURIComponent(data), "filedata"); // data is my binary string fd.append("filename", $('#url-input').val().split('/').slice(-1)[0]); $.ajax({ type: "POST", url: 'endpoint', data: fd, processData: false, contentType: false, success: function() { alert('save successful'); } }); The endpoint contains this code, where it stores the data as a buffer in mongodb: app.post('/endpoint', function(req, res) { var newData = {}; newData.file = new Mongo.Binary(new Buffer(decodeURIComponent(req.body.filedata), "binary")); newData.name = req.body.filename; newData.date = moment().format('MMMM Do YYYY, h:mm:ss a'); database.insert(newData, {safe: true}, function() { console.log('inserted new data'); }); }); This appears to all work as planned, however, when I retrieve the file later, it is slightly mangled. When I compare it to the original in a hex editor, that values are close but not exact, here is an example of portions of two files: Original file: 01 02 54 03 08 5D 08 5D 66 18 61 66 19 1B 67 1C 03 66 01 02 7A 85 14 80 7E 7F 81 82 85 85 80 80 85 5D 80 5D 14 80 14 80 89 8A 81 82 80 80 80 80 80 5D 80 5D 67 66 03 03 6D 6C 11 64 01 02 2E 37 57 85 57 80 85 57 80 57 57 8C 54 85 8C 8C 85 85 80 57 80 57 7A 80 14 80 8C 57 85 57 1A 8C 57 85 57 8C 57 85 18 1B 6D 1C 3E 30 15 57 37 37 6C 66 54 24 57 34 15 57 15 2E 01 2E 02 57 37 54 2C 2D 76 2E 74 77 68 6B 68 68 71 71 74 74 A7 A7 A7 A7 19 19 66 71 19 1A 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00…
has comment: http://stackoverflow.com/comment/43841019
type: Question
upvote count: 2
has title: encodeURIComponent data mangling on binary string
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/43840464
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/43827725
type: QuestionComment
has text: you'll have to give a bit more info on the "imagine" bit for those of us that aren't mind readers.
type: Comment
comment on: http://stackoverflow.com/q/27707679
score: 0

http://stackoverflow.com/comment/43808365
comment on: http://stackoverflow.com/a/27697512
type: Comment
has text: Hey thank you, but I need to build my own one. And the previous answer was fine for me to handle it. But you changed it, can you please add them again? Thanks again:)
score: 0
type: AnswerComment

http://stackoverflow.com/a/27652717
accepted answer of: http://stackoverflow.com/q/27652323
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43731019
has body: Your question is not entirely clear. The first (hidden) snippit below will set the background to the image that is stored in an array at the same index as the selected option and then show a different select box as you asked. But I get the feeling the second (showing) snippet is what you really need. To better help you, please edit your question to include answers to the below questions: Should the timer begin changing the backgrounds as soon as the page loads? What should happen when the first select box is changed what should happen when the second select box is changed? are we talking about the page body's background or some other div, or does each event control the background for a different div? Are all of the pictures pulled from the same array or does each event have a different pool of source inmages? $(document).ready(function(){ var header = $('body'); function SelectElement(valueToSelect) { var element = document.getElementById('test'); element.value = '1'; } $('#test').change(function() { // I did this with 4 images for testing, add as many as you like in yours var backgrounds = ['url(http://stylonica.com/wp-content/uploads/2014/03/Nature___Seasons___Spring__038259_.jpg)' , 'url(http://hd.wallpaperswide.com/thumbs/summer_holiday-t2.jpg)' , 'url(http://www.grandfather.com/wp-content/uploads/2012/08/fall-road.jpg)' , 'url(http://hooptricks.org/wp-content/uploads/2014/01/road-winter.jpg)']; // get index of selected option // -1 is to account for the disabled fist option acting as a placeholder var cur = $(this)[0].selectedIndex -1; // set the image to the background header.css('background-image', backgrounds[cur]); //hide the first select and show the second $('#fisrtSelDiv').hide(); $('#secondSelDiv').show(); }); /* // I commented the below out as it doesnt appear to be related to your question // if you need the select to begin a timer that changes the backgrounds peridically // please edit your question with more detail var current = 0; function nextBack…
has comment: http://stackoverflow.com/comment/43740910
answers question: http://stackoverflow.com/q/27652323
type: AcceptedAnswer

http://stackoverflow.com/a/27793326
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27793022
score: 1
answers question: http://stackoverflow.com/q/27793022
upvote count: 1
has body: It's possible. If you don't want to depend on any libraries you could do it like this: document.getElementById('X').appendChild(document.getElementById('C')); The trick here is that an HTML element can exist in at most one place in the tree, but the DOM handles this for us. Since you're telling it to make C a child of X, but C is already a child of B, the DOM knows to make C stop being a child of B. This all gets handled as a single action, so the page only has to reflow once, and that's good for performance.

http://stackoverflow.com/q/27707775
linked to: http://stackoverflow.com/q/13840429
type: Question
has comment: http://stackoverflow.com/comment/43827394
tagged with: function
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43827482
answer count: 1
has comment: http://stackoverflow.com/comment/43827340
favorite count: 0
linked to: http://stackoverflow.com/q/5227132
has answer: http://stackoverflow.com/a/27707816
score: -3
has comment: http://stackoverflow.com/comment/43827350
tagged with: php
accepted answer: http://stackoverflow.com/a/27707816
has title: Execut a php function with javascript
type: AnsweredQuestion
tagged with: call
has body: i need to make a page that have a button , when i press that button , a javascript function call a php function who run a mysql_query and print on page the results! How can i run php function from javascript .
downvote count: 3
has comment: http://stackoverflow.com/comment/43827355
tagged with: mysql

http://stackoverflow.com/a/27785226
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/43981422
accepted answer of: http://stackoverflow.com/q/27782749
has comment: http://stackoverflow.com/comment/43980889
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/27782749
type: AcceptedAnswer
has body: location.href will only change the URL of the current window. In order to open a new tab or window, its better to use window.open. I tested it in Safari specifically (and Chrome) and it is working in both browsers. CLICK ME The way you had it written, somepage.html will open in a new tab and the current page will redirect to google. If you want it that way just switch the URLs around like so: CLICK ME A side note, I found out that Safari allows user to handle how they want windows opening, whether it be a new window or a tab, and unfortunately we do not have any control over that.

http://stackoverflow.com/a/27657548
type: Answer
has body: You could use Polymer data binding as following: .... Then in the view:
answers question: http://stackoverflow.com/q/27642788
has comment: http://stackoverflow.com/comment/43766154
score: 0

http://stackoverflow.com/q/27683626
tagged with: oop
has answer: http://stackoverflow.com/a/31413065
has body: I've been doing a lot of HTML and CSS and now I'm doing a JS tutorial. I ran into this problem though. I don't know how to access the prototype. Instructions: Create a class named Animal with two properties, name and numLegs. The Animal constructor should have two arguments whose values are assigned to name and numLegs. Next, change the prototype of Animal and add a method sayName that prints to the console "Hi my name is [name]", where [name] is the value of name. Click "Stuck? Get a hint!" for examples of how to create a class and how to add a method to an object's prototype. Finally, we have provided the last two lines to test your constructor and sayName method. Don't change these! Here is my code: // create your Animal class here function Animal(name, numLegs)={ this.name=name; this.numLegs=numLegs; this.sayName=function(){ console.log("Hi, my name is "+this.name); } } // create the sayName method for Animal // provided code to test above constructor and method var penguin = new Animal("Captain Cook", 2); penguin.sayName(); I get a syntax error. What gives?
has answer: http://stackoverflow.com/a/27683641
has answer: http://stackoverflow.com/a/30869481
tagged with: prototype
type: Question
has comment: http://stackoverflow.com/comment/43781775
has comment: http://stackoverflow.com/comment/43785133
tagged with: javascript
score: 0
answer count: 3
has title: How to change the prototype of "animal" and add method "sayName" to print statement
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/16063394
tagged with: object
has comment: http://stackoverflow.com/comment/43801765

http://stackoverflow.com/a/27692190
has body: You can only store strings in SessionStorage. Stringify your object before calling setItem() From MDN: Storage.setItem Parameters key name A DOMString containing the name of the key you want to create/update. key value A DOMString containing the value you want to give the key you are creating/updating.
score: 2
upvote count: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27692043
type: Answer

http://stackoverflow.com/q/27742281
type: AnsweredQuestion
has body: I want to overwrite the prototype of a Backbone model using underscore.js. This is my code: _.extend(TableView.prototype, { el: $("#" + this.id + "_div"), }); In summary, I want that by default the model is attached to a html element with an id equal to the model's id plus "_div". The model's id is TableView's attribute id, and I try to access the model using this. The problem is that I get the error: "this is undefined". Why? PS: I know that the correct way is to extend the model in a new one. I want to overwrite the original one because Backbone's extend() method seems to be not like class inheritance, and my_new_object instanceof TheOldModel return false. Anyway, I get the same error with TableView.extend() too. PPS: I'm extending some Splunk views.
tagged with: underscore.js
score: 1
has comment: http://stackoverflow.com/comment/43896033
upvote count: 1
has answer: http://stackoverflow.com/a/27742680
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/27742680
has title: Javascript: Overwriting the prototype of a Backbone model
favorite count: 0
tagged with: backbone.js
tagged with: splunk

http://stackoverflow.com/q/27653017
has title: Calling javascript function within Chrome.tabs.Query
type: AnsweredQuestion
has body: i am getting the following error while calling the given javascript code "Error in response to tabs.query: ReferenceError: printTabs is not defined" Could some one help me out of this. var tabinator = { fillBody: function() { chrome.tabs.query( {}, function(tabs) { for(var i=0; i&lt;tabs.length; i++) { printTabs(tabs[i].title,tabs[i].id); } } ); }, printTabs:function(x,y,z){ console.log(x+y+z); } }; // --- Execution starts here --- document.addEventListener( 'DOMContentLoaded', function () { tabinator.fillBody(); } );
tagged with: google-chrome
type: Question
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27653045
score: 0
tagged with: google-chrome-extension
has answer: http://stackoverflow.com/a/27653045

http://stackoverflow.com/comment/43943916
comment on: http://stackoverflow.com/q/27766696
has text: forgot to add: The channel streams perfectly through rtmpdump.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27795037
upvote count: 7
accepted answer of: http://stackoverflow.com/q/27794439
score: 7
answers question: http://stackoverflow.com/q/27794439
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You could simply switch the limits and multiply the value by -1: &lt;input type="range" min="-8" max='13' value="1" step="1" id="slider" &gt; $('#slider').change(function(){ var val = -+($(this).val()); console.log(val); }); If you'll need the value to be submitted, copy it to a hidden field, and use that on server-side instead of the original. A live demo at jsFiddle.

http://stackoverflow.com/q/27739278
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/27750526
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/27750526
type: AnsweredQuestion
score: 3
has title: HTML select dropdown menu with max-height of 100% and size automatic?
has body: A dropdown menu made using an HTML select tag has 152 options, but this large number forces some options off the webpage view on most monitors if I make the size 152. I set the max-height of the select to 100% guessing that would limit the size to the maximum number that can fit in the div. However, for reasons I do not understand, it still displays all 152 options with some below the screen view. ... Are there ways to have select tags display as many options as they can fit onto the screen ( 100% height ) listed out, but force scrolling to get to any options that would be displayed below the screen ( past 100% height ) ?
upvote count: 3
type: Question
possible better answer: http://stackoverflow.com/a/27739382
has answer: http://stackoverflow.com/a/27739382

http://stackoverflow.com/q/27663125
tagged with: callback
has body: i saw a tutorial in tympanus and i did some changes to look more like a billboard but something is wrong and i don't know what it is! and it's really makes me crazy that where the hell is problem! the first time that you run it's exactly that i want but when time passes it's getting ugly!i did this modification: $(function() { $('#ad_1 &gt; img').each(function(i,e){ rotate($(this),500,3000,i); }); function rotate(elem1,speed,timeout,i){ elem1.animate({'marginLeft':'18px','width':'0px'},speed,function(){ var other; if(elem1.parent().attr('id') == 'ad_1') other = $('#ad_2').children('img').eq(i); else other = $('#ad_1').children('img').eq(i); other.animate({'marginLeft':'0px','width':'35px'},speed,function(){ var f = function() { rotate(other,speed,timeout,i) }; setTimeout(f,timeout+i*100); }); }); }}); all the rest is just like the tympanus thank you!!
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43752096
has comment: http://stackoverflow.com/comment/43742837
tagged with: css
favorite count: 0
score: -1
type: Question
answer count: 2
downvote count: 1
has answer: http://stackoverflow.com/a/27671667
accepted answer: http://stackoverflow.com/a/27671667
has answer: http://stackoverflow.com/a/27663184
upvote count: 0
possible better answer: http://stackoverflow.com/a/27663184
tagged with: slideshow
tagged with: javascript
tagged with: jquery
has title: create billboard slideshow with jquery

http://stackoverflow.com/comment/44006953
type: QuestionComment
comment on: http://stackoverflow.com/q/27797216
score: 0
has text: @arman1991 check my updated line of my code i just added that line and it does display those numbers but the problem is it does not display data
type: Comment

http://stackoverflow.com/comment/43946246
type: Comment
type: QuestionComment
has text: `iframe.contentDocument.getElementById("name1").value = ...` ??? Just wondering, why this question has been tagged with jQuery?
comment on: http://stackoverflow.com/q/27767782
score: 0

http://stackoverflow.com/a/27701237
type: Answer
has comment: http://stackoverflow.com/comment/43815319
answers question: http://stackoverflow.com/q/27701192
has comment: http://stackoverflow.com/comment/43815259
score: 0
has body: Read about page breaks in css. They could lead you into the right path. http://css-tricks.com/almanac/properties/p/page-break/ also read this answer https://stackoverflow.com/a/8712756/406659 &lt;style type="text/css"&gt; table { page-break-inside:auto } tr { page-break-inside:avoid; page-break-after:auto } &lt;/style&gt;

http://stackoverflow.com/q/27659087
has answer: http://stackoverflow.com/a/27659176
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27659191
has answer: http://stackoverflow.com/a/27659327
accepted answer: http://stackoverflow.com/a/27659327
tagged with: math
has answer: http://stackoverflow.com/a/27659123
type: Question
score: 0
has comment: http://stackoverflow.com/comment/43734387
has title: Check if an array element/item is undefined
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/43733906
has body: How do I add to z only if y exists without adding a zero instead? var x=[-1,2,44,6]; var y=[33,2,1]; //a shorter array where y[3] does not exist var z=[]; var i=x.length; while(i--){ z[i]=x[i]+y[i]; } When I know that all the x's exist but i do not know if there is a y for each x. Also the problem may include more arrays of varying undetermined sizes (not just x and y, say t, u, v, w named arrays that may or may not have same lengths) How would I loop through adding all arrays together without changing the loop, creating NaN or adding any zeros? Can this be done inline?
answer count: 4
possible better answer: http://stackoverflow.com/a/27659123

http://stackoverflow.com/q/27691887
tagged with: javascript
tagged with: scope
answer count: 3
accepted answer: http://stackoverflow.com/a/27692004
has title: Counter value changes within loop when assigned to a new variable
favorite count: 0
upvote count: 2
has body: I'm learning JS. Why does logging funcs2[1](); log 4 and funcs[1](); logs 5? Note that this is not a duplicate of this question. I know that funcs[1](); logs 5 (and not 1) because the function called is bound to the current value of i, which is 5 when the loop terminates. But that's not my question. I want to know why funcs2[1](); log 4 and not 5. var funcs = []; for (var i = 0; i &lt; 5; i++) { funcs.push(function () { return i; }); } console.log(funcs[1]()); 5 var funcs2 = []; for (var i = 0; i &lt; 5; i++) { var x = i; funcs2.push(function () { return x; }); } console.log(funcs2[1]()); 4
linked to: http://stackoverflow.com/q/750486
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27692004
possible better answer: http://stackoverflow.com/a/27691986
downvote count: 1
has answer: http://stackoverflow.com/a/27691986
type: Question
has answer: http://stackoverflow.com/a/27692570

http://stackoverflow.com/a/27668966
score: 3
answers question: http://stackoverflow.com/q/27664518
has comment: http://stackoverflow.com/comment/43759773
upvote count: 3
has body: Either use a global variable, or put the values into cache. To declare a global variable, declare the variable outside of a function: var id = ""; var minutes = ""; function doGet(e) { id = e.parameter.id; minutes = e.parameter.min; var html = . . . . . HTML HERE; onRun(id, minutes); return HtmlService.createHtmlOutput(html).setSandboxMode(HtmlService.SandboxMode.IFRAME); } Or put the values into Cache: function doGet(e) { var id = e.parameter.id; var minutes = e.parameter.min; if (!!id) {cache.put('theid', id, 4000);}; if (!!minutes) {cache.put('min', minutes, 4000);}; var html = . . . . . HTML HERE; onRun(id, minutes); return HtmlService.createHtmlOutput(html).setSandboxMode(HtmlService.SandboxMode.IFRAME); } Then you can retrieve the values from cache, or use the global variable anywhere in your code. So, you don't need to pass anything from the HTML to the .gs code. I don't see anything calling the onRun() function within the doGet() function. You can call another function from the doGet() function, as long as it's before the return. return stops the function at that point. function doGet(e) { var id = e.parameter.id; var minutes = e.parameter.min; var html = . . . . . HTML HERE; onRun(id, minutes); return HtmlService.createHtmlOutput(html).setSandboxMode(HtmlService.SandboxMode.IFRAME); } You can't have: return HtmlService.createHtmlOutput(html).setSandboxMode(HtmlService.SandboxMode.IFRAME); onRun(id, minutes); You can also trigger script to run from an HTML Script tag with window.onload = function() {code};: &lt;script&gt; window.onload = function() { console.log("This onload did run"); code here; }; &lt;/script&gt; To pass multiple variables, just separate them by a comma: function doGet(e) { code here; onRun(id, minutes); } function onRun(argId, argMinutes) { Logger.log('argId: ' + argId); Logger.log('argMinutes: ' + argMinutes); };
has comment: http://stackoverflow.com/comment/43760059
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43762625

http://stackoverflow.com/a/27733526
score: 0
answers question: http://stackoverflow.com/q/27733233
type: Answer
has body: you can not have variable rowHeight because ngGrid uses the fixed rowHeight to do virtual scrolling. you will need to hack into ngGrid style to fix this follow this way to make a scrollbar in cell to view the whole address columnDefs: [ { field:'address', displayName:'Address', } ] overwrite ngGrid style in your own style : .ngCellText { overflow: auto; text-overflow: auto; }
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/55505439

http://stackoverflow.com/comment/44258754
comment on: http://stackoverflow.com/q/27786048
has text: @AaronHarding Something very similar. I have the solution working how I wish, except for this minor issue in Chrome. Have you done any similar work?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27671138
has comment: http://stackoverflow.com/comment/43757015
score: 0
answers question: http://stackoverflow.com/q/27671117
type: Answer
has body: Just add the other object you want to be enabled? &lt;script type="text/JavaScript"&gt; function enableName(ctrl, txtId) { el1 = document.getElementsByName("n_to_lend") el2 = document.getElementsByName("repair") if (ctrl.checked){ el1.removeAttr('disabled'); el2.removeAttr('disabled'); } else $('#' + txtId).attr('disabled', 'disabled'); } &lt;/script&gt; and try adding the 'enabled' rather than removing 'disabled'

http://stackoverflow.com/q/27641133
has comment: http://stackoverflow.com/comment/43701035
downvote count: 5
tagged with: javascript
score: -4
possible better answer: http://stackoverflow.com/a/27652305
has comment: http://stackoverflow.com/comment/43701523
accepted answer: http://stackoverflow.com/a/27652449
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43700968
has comment: http://stackoverflow.com/comment/43701062
favorite count: 0
has comment: http://stackoverflow.com/comment/43701469
has comment: http://stackoverflow.com/comment/43700979
type: Question
answer count: 2
upvote count: 1
tagged with: regex
has title: Regexp to match any group of string within an address
has answer: http://stackoverflow.com/a/27652449
has answer: http://stackoverflow.com/a/27652305
has body: For example if I have this address; 820 10th Avenue New York, New York 10019 I want to match the following in regexp; 820 10th Ave 820 10th Avenue 820 10th Avenue New York the above is the only expected format my code so far var re = /(^\d*\D*\w*)/i; var str = '820 10th Avenue New York, New York 10019'; it should work like this; if(re.test('820 10th Avenue')) console.log('pass'); // pass if(re.test('820 10th Ave')) console.log('pass'); // pass if(re.test('820 10th')) console.log('pass'); // pass if(!re.test('820 9th Ave')) console.log('fail'); // fail if(!re.test('820')) console.log('fail'); // fail

http://stackoverflow.com/comment/43746340
type: QuestionComment
comment on: http://stackoverflow.com/q/27665598
has text: or `placeholderclick(\\'"+$(option).val()+"\\')'`
score: 0
type: Comment

http://stackoverflow.com/comment/43982476
has text: That syntax is a *native JavaScript Unicode escape sequence*. It's odd that you're ending up with that string at all. What *exactly* does the JSON look like? It would have to have two `\` characters before the "u" in order for your JavaScript code to end up with that string.
comment on: http://stackoverflow.com/q/27786056
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/27759622
answers question: http://stackoverflow.com/q/27759593
has body: You're not actually using promises here. Parse lets you use callbacks or promises; your choice. To use promises, do the following: query.find().then(function() { console.log("success!"); }, function() { console.log("error"); }); Now, to execute stuff after the promise is complete, you can just execute it inside the promise callback inside the then() call. So far this would be exactly the same as regular callbacks. To actually make good use of promises is when you chain them, like this: query.find().then(function() { console.log("success!"); return new Parse.Query(Obj).get("sOmE_oBjEcT"); }, function() { console.log("error"); }).then(function() { console.log("success on second callback!"); }, function() { console.log("error on second callback"); });
has comment: http://stackoverflow.com/comment/43931876
downvote count: 3
upvote count: 5
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/43930983

http://stackoverflow.com/q/27695409
has comment: http://stackoverflow.com/comment/43804133
has comment: http://stackoverflow.com/comment/43804320
upvote count: 1
tagged with: css
has title: keep div visible while scrolling only if second div is in view
type: AnsweredQuestion
tagged with: visible
score: 1
accepted answer: http://stackoverflow.com/a/27711964
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43804178
has body: I have the following (simplified) HTML code: ..stuff... Charts for d/m/y ...various charts... ...more stuff... So, #charts-title is not at the top of the page, nor #charts at the bottom, they are somewhere in the middle of the page. Now, when the user scrolls down, #charts-title goes out of the screen and then I'm seeing charts with no date information. I want to keep #charts-title visible only if #charts is in view. Thanks for any help, Hector.
linked to: http://stackoverflow.com/q/1030043
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/27711964
favorite count: 0

http://stackoverflow.com/a/27719188
has body: do you mean something like reset the number? http://jsfiddle.net/Lgwow5pt/2/ $('#content').on('click', '.remove', function () { $(this).parent().remove(); $('span').each(function(i, item){ item.lastChild.textContent = i+1; });
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27719061
score: 2
answers question: http://stackoverflow.com/q/27719061
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27798845
tagged with: local-storage
has comment: http://stackoverflow.com/comment/44006349
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has answer: http://stackoverflow.com/a/27800800
answer count: 1
downvote count: 0
tagged with: jquery
has body: I have 4 pages like A,B,C and D. A have fruits names, B have flowers names .4 Pages flow like this &lt;-- A --&gt;C --&gt;D B --&gt;C When i went to C through A,C have fruits names with check box,and When I Went to C through B,C have flowers names with check box.C have book Button.When we Click book button data go to D page. What we need is When i go to (A-->C).We select 3 fruits .Next back to B and got C.We Select 2 flowers Then Click on BookOrder We need to Show totla 5 items.In D page My problem is only how to show Last selected items.. We tried The following: in Page C function imagebackRedriect( ) { var myStuffArray =[]; var itemName; $('input:checked').each(function () { $this = $(this); checkboxidforvalidation=this.id; itemName= $(this).closest('tr').children('td:eq(2)').text(); myStuffArray.push([itemName]); localStorage["myStuffLocalArray"] = JSON.stringify(myStuffArray); sessionStorage.setItem("forAllGridItems", myStuffArray); }); TempItems = JSON.parse(localStorage["myStuffLocalArray"]); var GetallElements += sessionStorage.getItem("forAllGridItems"); } We tried When we select checkbox Data Add to JSON or Session, but when we leave and come back to C Data Will be removed. Please guide me
favorite count: 0
has comment: http://stackoverflow.com/comment/44006582
has comment: http://stackoverflow.com/comment/44009559
type: UnansweredQuestion
has title: how to store items in local Storage in jqueryMoblie
tagged with: cordova
score: 1
upvote count: 1

http://stackoverflow.com/q/27701347
score: 1
type: Question
has title: Morris.js area graph customization
accepted answer: http://stackoverflow.com/a/27884626
tagged with: javascript
tagged with: dom
has answer: http://stackoverflow.com/a/27884626
has body: i need a graph something like this can anyone help me by providing working example on fiddle ? my current code is: initCharts: function() { if (Morris.EventEmitter) { // Use Morris.Area instead of Morris.Line dashboardMainChart = Morris.Area({ element: 'sales_statistics', padding: 15, // behaveLikeLine: false, gridEnabled: true, // gridLineColor: false, axes: true, fillOpacity: 0.3, data: [{ period: '2011 Q1', profit: 0 }, { period: '2011 Q2', profit: 20 }, { period: '2011 Q3', profit: 50 }, { period: '2011 Q4', profit: 40 }, { period: '2011 Q4', profit: 60 }], lineColors: ['#91C120'], xkey: 'period', ykeys: ['profit'], labels: ['Profit'], xLabels:['week'], pointSize: 5, pointFillColors: ['#FFF'], lineWidth: 3, hideHover: 'auto', resize: true }); } } the first problem is i want to use graph target element by class not id because i want to use it multiple times on a single page second i cant find a way to place days like the image above on xLabels third i want grids similar with the image
upvote count: 1
answer count: 1
tagged with: morris.js
tagged with: jquery
favorite count: 0
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
downvote count: 0

http://stackoverflow.com/q/27780187
has comment: http://stackoverflow.com/comment/44004772
has answer: http://stackoverflow.com/a/27780220
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27780220
answer count: 2
tagged with: javascript
has body: I am trying to extend a method to the String prototype. I want this method to manipulate the string value but I am not sure how do access it. this the current object context seems to refer to the string object, but not the actual string value. String.prototype.test = function() { console.log(this)} function () { console.log(this) } 'lol'.test() VM192:2 String {0: "l", 1: "o", 2: "l", length: 3, has: function, contains: function, escapeRegExp: function, camelize: function… } How do I access the string value instead of the string object?
score: 0
accepted answer: http://stackoverflow.com/a/27780221
has answer: http://stackoverflow.com/a/27780221
has title: JavaScript: How can I access the string value of a String object?
type: Question

http://stackoverflow.com/comment/43821427
comment on: http://stackoverflow.com/q/27704708
has text: show this => http://stackoverflow.com/questions/8340719/regex-to-remove-non-letter-characters-but-keep-accented-letters
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27762140
has comment: http://stackoverflow.com/comment/43935534
score: 0
has comment: http://stackoverflow.com/comment/43935532
has comment: http://stackoverflow.com/comment/43935511
has comment: http://stackoverflow.com/comment/43935501
has comment: http://stackoverflow.com/comment/43935578
has body: Basically what I am trying to do is to search for a string in my array This used to be my code: var arr1 = ['23456', '34567', '45678', '56789', '6789T', '789TJ', '89TJQ', '9TJQK', 'TJQKA']; var arr2 = ['98TJQ']; var arr3 = ['89TJQ']; if (!('containsU' in Array.prototype)) Array.prototype.containsU = function(arr, startIndex) { for (i in arr) { if (arr.hasOwnProperty(i) &amp;&amp; ''.indexOf.call(this, arr[i], startIndex) === -1) return false; } return true; }; if (!('containsArrayU' in Array.prototype)) //contains array unordered Array.prototype.containsArrayU = function(arr, startIndex) { for (i in this) { if (this.hasOwnProperty(i) &amp;&amp; arr.containsU(this[i])) return true; } return false; }; I am looking for any element of arr1 that is part of arr2 or arr3, example: arr1 = ['222','333','444','555','666','777','888','999','TTT','JJJ','QQQ','KKK','AAA']; arr2 = ['9229']; arr3 = ['9299']; alert(arr2.containsArrayU(arr1)); //this should be false alert(arr3.containsArrayU(arr1)); //this should be true (contains '999')
has comment: http://stackoverflow.com/comment/43935518
has comment: http://stackoverflow.com/comment/43935742
has comment: http://stackoverflow.com/comment/43935562
has comment: http://stackoverflow.com/comment/43935709
has comment: http://stackoverflow.com/comment/43935688
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43935667
has comment: http://stackoverflow.com/comment/43935724
has comment: http://stackoverflow.com/comment/43935734
has comment: http://stackoverflow.com/comment/43935585
has answer: http://stackoverflow.com/a/27762806
tagged with: contains
has title: How to check if an array contains a string in a different order?
has comment: http://stackoverflow.com/comment/43935607
answer count: 1
tagged with: arrays
accepted answer: http://stackoverflow.com/a/27762806
has comment: http://stackoverflow.com/comment/43935716
tagged with: javascript
has comment: http://stackoverflow.com/comment/43935596
has comment: http://stackoverflow.com/comment/43935512

http://stackoverflow.com/q/27643582
tagged with: createjs
has answer: http://stackoverflow.com/a/27649947
upvote count: 2
type: UnansweredQuestion
tagged with: animation
tagged with: sprite
has comment: http://stackoverflow.com/comment/43716948
has comment: http://stackoverflow.com/comment/43711012
type: Question
has body: I've checked this forum/the internet/google forwards and backwards for my particular question, but to no avail. I get examples that come close to mine - which I try to impart into my own example, but nothing doing. Please help! Again I apologize if this has been answered and I just overlooked, if so please throw me a link - otherwise here is my code: All I'm trying to do is animate a single sprite image of a jumping Mega Man. Thanks, and Happy Holidays! NOTE: Here the sprite I'm using HERE IS MY: JsFiddle var stage, canvas, bmpA, data, megaman, spriteSheet; function Main() { canvas = document.getElementById('canvas'); stage = new createjs.Stage(canvas); container = new createjs.Container(); megaman = new Image(); megaman.src = "megaman__jump.png"; var bmpA = new createjs.Bitmap(megaman); data = new createjs.SpriteSheet({ images: [bmpA], frames: { width: 79, height: 139, count: 7 }, animations: { jump: [0, 6, "jump"] } }); spriteSheet = new createjs.BitmapAnimation(data); spriteSheet.gotoAndPlay("jump"); createjs.Ticker.setFPS(30); createjs.Ticker.addEventListener("tick", update); } function update(event) { stage.addChild(spriteSheet); stage.update(); } &lt;/script&gt; &lt;/head&gt; &lt;body onload = "Main();"&gt; &lt;canvas id = "canvas" width = "780" height = "300" style = "border: 1px solid #000;"&gt;&lt;/canvas&gt; &lt;/body&gt; &lt;/html&gt; [1]: http://i.imgur.com/Q1OQM.png
score: 2
downvote count: 0
answer count: 1
has title: CreateJS - Can't get my spritesheet to animate
tagged with: javascript
has comment: http://stackoverflow.com/comment/43706233
favorite count: 0

http://stackoverflow.com/q/27751170
favorite count: 0
accepted answer: http://stackoverflow.com/a/27915535
upvote count: 1
type: AnsweredQuestion
has title: Modify parent component state with key value
type: Question
tagged with: reactjs
has answer: http://stackoverflow.com/a/27915535
downvote count: 0
tagged with: javascript
answer count: 1
score: 1
has body: I have a child component in react, I would like to modify the parent component by calling on a function and giving both the key and value. Ideally it would go something like this var FirstView = React.createClass({ handleStateChange: function(key, value) { this.setState({ key: value }); }. render: function() { return ( <SecondView onStateChange={this.handleStateChange} /> ) } }); var SecondView = React.createClass({ handleClick: function() { this.props.onStateChange('theParent', 'isNowChanged'); }, render: function() { return ( Stack Overflow ); } }) I'm not entirely sure whether this is the best way to go about this but I would like to pass in a key and a value like above. Unfortunately react doesn't want to play ball and the state of the parent doesn't seem to change. Is there a sensible way to go about this? Thank you!

http://stackoverflow.com/a/27699818
has body: Function declaration are processed in the compilation phase. So the first declaration of collatz is compiled, then the second definition is compiled replacing the first definition, then once compilation is complete the code is executed and the ifs are processed. Basically the code is processed like this: var x=10; function collatz(n) {return n+2;} function collatz(n) {return 2*n;} while (x&lt;2000) { if (x%2==0) {} if (x%2==1) {} x=collatz(x); document.write(x, ","); } This feature of the language is also known as "hoisting". To avoid hoisting use a function expression: collatz = function() {/*...*/} instead of a function declaration: function collatz() {/*...*/}
downvote count: 0
answers question: http://stackoverflow.com/q/27699747
score: 1
upvote count: 1
type: Answer

mongodb
tags question: http://stackoverflow.com/q/27651069
tags question: http://stackoverflow.com/q/27664423
tags question: http://stackoverflow.com/q/27770769
tags question: http://stackoverflow.com/q/27799780
tags question: http://stackoverflow.com/q/27689543
tags question: http://stackoverflow.com/q/27762315
tags question: http://stackoverflow.com/q/27702795
tags question: http://stackoverflow.com/q/27711901
tags question: http://stackoverflow.com/q/27771633
tags question: http://stackoverflow.com/q/27757172
tags question: http://stackoverflow.com/q/27750223
tags question: http://stackoverflow.com/q/27691313
tags question: http://stackoverflow.com/q/27683931
tags question: http://stackoverflow.com/q/27782142
tags question: http://stackoverflow.com/q/27670672
tags question: http://stackoverflow.com/q/27779188
tags question: http://stackoverflow.com/q/27758106
tags question: http://stackoverflow.com/q/27736061
tags question: http://stackoverflow.com/q/27668316
tags question: http://stackoverflow.com/q/27746988
tag name: mongodb
tags question: http://stackoverflow.com/q/27716398
tags question: http://stackoverflow.com/q/27719918
tags question: http://stackoverflow.com/q/27773496
tags question: http://stackoverflow.com/q/27662019
tags question: http://stackoverflow.com/q/27793242
tags question: http://stackoverflow.com/q/27769919
tags question: http://stackoverflow.com/q/27684819
tags question: http://stackoverflow.com/q/27745112
tags question: http://stackoverflow.com/q/27760538
tags question: http://stackoverflow.com/q/27789256
tags question: http://stackoverflow.com/q/27679415
tags question: http://stackoverflow.com/q/27670996
type: Tag
tags question: http://stackoverflow.com/q/27682055
tags question: http://stackoverflow.com/q/27732587
tags question: http://stackoverflow.com/q/27737388
tags question: http://stackoverflow.com/q/27710949
tags question: http://stackoverflow.com/q/27745310
tags question: http://stackoverflow.com/q/27752657
tags question: http://stackoverflow.com/q/27715005
tags question: http://stackoverflow.com/q/27756670
tags question: http://stackoverflow.com/q/27769638
tags question: http://stackoverflow.com/q/27759880
tags question: http://stackoverflow.com/q/27769338
tags question: http://stackoverflow.com/q/27663163
tags question: http://stackoverflow.com/q/27800257
tags question: http://stackoverflow.com/q/27769750
tags question: http://stackoverflow.com/q/27693904
tags question: http://stackoverflow.com/q/27800362
tags question: http://stackoverflow.com/q/27799496
tags question: http://stackoverflow.com/q/27763520
tags question: http://stackoverflow.com/q/27733221
tags question: http://stackoverflow.com/q/27662729
tags question: http://stackoverflow.com/q/27756543
tags question: http://stackoverflow.com/q/27648177
tags question: http://stackoverflow.com/q/27708284
tags question: http://stackoverflow.com/q/27658774
tags question: http://stackoverflow.com/q/27695652
tags question: http://stackoverflow.com/q/27763228
tags question: http://stackoverflow.com/q/27783575

http://stackoverflow.com/comment/43978780
type: Comment
has text: I have no idea what stuff you now come up with to still have yet another response??? And by the way, a reference is a pointer to a location in memory.
score: 1
comment on: http://stackoverflow.com/a/27784403
type: AnswerComment

http://stackoverflow.com/q/27712004
has comment: http://stackoverflow.com/comment/43836433
tagged with: angularjs-ng-repeat
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43836484
has body: I have two game configuration in my DB, I would like to display the number of case of the two games with Angular. Game.create({ name : 'Iphone 5S', info : '', price : 2, cases : 25 }, { name : 'Iphone 4', info : '', price : 5, cases : 20 }); I make this : //game.cases = 25, already is ok O My function getTimes: $scope.getTimes=function(n){ return new Array(n); }; Why I have only one button for each game? I would like 25 button for the game1 and 20 for the game2.
has comment: http://stackoverflow.com/comment/43836255
upvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27712250
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/43836181
accepted answer: http://stackoverflow.com/a/27712250
has title: ng-repeat in ng-repeat, not correct display
has comment: http://stackoverflow.com/comment/43836330
tagged with: javascript
has comment: http://stackoverflow.com/comment/43836226
tagged with: express
has comment: http://stackoverflow.com/comment/43836286
answer count: 1
downvote count: 0

http://stackoverflow.com/q/27770402
score: 1
has answer: http://stackoverflow.com/a/27771130
has body: I have an array that contains objects for cards in a template to loop through. If it detects that there isn't anything in the local datastore it will create an array that contains object. Otherwise it retrieves it from the local datastore. Pressing a button will bring you to another view that shares the same controller. There is a text box and if you press the submit button it will splice it to the array. I also have a watch function updating the local datastore if change is detected. The problem is after adding something to the array ng-repeat won't update. It will if I refresh the page only because the local datastore loads. Any ideas? Code: controllers.js .controller('NotesCtrl', function($scope, localStorageService) { if (!localStorageService.get("agendaNotes")) { $scope.notes = [{ title: "Civil War Notes" }, { title: "Types of Bacon" }]; //If it exists retrieve it from keystore. } else { $scope.notes = localStorageService.get("agendaNotes"); } $scope.addNote = function(title) { $scope.notes.splice(0, 0, { title: title }) }; $scope.$watch("notes", function(newVal, oldVal) { if (newVal !== null && angular.isDefined(newVal) && newVal !== oldVal) { localStorageService.add("agendaNotes", angular.toJson(newVal)); } }, true); }) tab.notes.html Add Notecard {{note.title}} {{note.content}} new-note.html Note Title: Note Description: Add Note I have tried the $scope.$apply(function(){}) method and it returns an error in console: Error: [$rootScope:inprog] $apply already in progress Any help is appreciated. Thanks
tagged with: ionic-framework
type: Question
possible better answer: http://stackoverflow.com/a/27770705
answer count: 2
has answer: http://stackoverflow.com/a/27770705
has comment: http://stackoverflow.com/comment/43952062
tagged with: arrays
tagged with: javascript
linked to: http://stackoverflow.com/q/14453216
accepted answer: http://stackoverflow.com/a/27771130
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has title: Ng-Repeat not updating after array update
favorite count: 0
tagged with: angularjs
upvote count: 1
has comment: http://stackoverflow.com/comment/43952948
type: AnsweredQuestion

http://stackoverflow.com/comment/43980641
type: QuestionComment
has text: @Seebiscuit Yes, I've researched it and will likely use it in the future. Is there a feature of Marionette that would help in this situation?
comment on: http://stackoverflow.com/q/27768670
score: 0
type: Comment

http://stackoverflow.com/comment/43897356
score: 1
comment on: http://stackoverflow.com/q/27713660
has text: See http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf for several operators that control fill and stroke style, that includes gradients, patterns, and assignment via colorspace. Example of such handling at https://github.com/mozilla/pdf.js/blob/master/src/core/evaluator.js#L758
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43767076
score: 2
has text: See http://security.stackexchange.com/a/8269. In essence, the fundamental difference is that the Browser issues the requests *on behalf of the browsing user* (typically using cookies), that's effectively letting JavaScript manipulate the user's account on another websites.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27676255

http://stackoverflow.com/comment/43868157
score: 0
type: Comment
has text: Yes, and I finally realize why my code didn't work. Unlike you, I specified each button's properties separately, so when I added the no-vote it didn't have any dimensions. Setting its width and height solved it. Thanks a lot for your help.
comment on: http://stackoverflow.com/a/27727871
type: AnswerComment

http://stackoverflow.com/comment/43826794
score: 0
type: Comment
type: QuestionComment
has text: @apsillers `async: false` is there in the `ajax`.
comment on: http://stackoverflow.com/q/27707209

http://stackoverflow.com/comment/43764708
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27674789
has text: How about cut and paste...? What are you trying to accomplish exactly?

http://stackoverflow.com/comment/43853677
type: AnswerComment
has text: That simple, thank you! One question left: Where should I put the module.exports in app.js?
type: Comment
comment on: http://stackoverflow.com/a/27720232
score: 0

http://stackoverflow.com/q/27686693
linked to: http://stackoverflow.com/q/822452
has answer: http://stackoverflow.com/a/27686813
accepted answer: http://stackoverflow.com/a/27686813
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2255291
has body: I am using imperavi redactor for my project. I have a requirement where by i need the plain text from the textarea instead of the content with HTML tags. I did not find any such option in the API. Is there a way out our i will have to do it manually?
type: Question
answer count: 1
tagged with: javascript
score: 0
has title: Getting Plain Text from Imperavi Redactor

http://stackoverflow.com/comment/43824063
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27704796
has text: Thank you very much. That is basically what I'm currently doing. Just didn't feel like that was by durandal design?
type: Comment

http://stackoverflow.com/a/27754224
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27753706
has comment: http://stackoverflow.com/comment/43931531
type: Answer
has comment: http://stackoverflow.com/comment/43926254
has comment: http://stackoverflow.com/comment/43931020
has comment: http://stackoverflow.com/comment/43931260
has comment: http://stackoverflow.com/comment/43931586
has body: I propose a different output structure. Your structure seems convenient at first glance, but in further processing it will prove unnecessarily difficult to handle. I would suggest this generic structure: [ { key: "group 1", items: [{ key: "group 1.1", items: [ {}, {}, {} ] }, { key: "group 1.2", items: [ {}, {} ] }] }, { key: "group 2", items: [{ key: "group 2.1", items: [ {}, {}, [}, {} ] }, { key: "group 2.2", items: [ {} ] }] } ] You can create a structure like this relatively easily: var grouped = Enumerable.From(input).GroupBy("$.firstName", "", function(key, e) { return { key: key, items: e.GroupBy("$.lastName", "", function (key, e) { return { key: key, items: e.ToArray() }; }).ToArray() }; }).ToArray(); when applied to this input: var input = [{ firstName: "Sam", lastName: "Smith" }, { firstName: "Sam", lastName: "Doe" }, { firstName: "Sam", lastName: "Doe" }, { firstName: "Sam", lastName: "Joe" },{ firstName: "John", lastName: "Joe" }]; results in [ { "key": "Sam", "items": [ { "key": "Smith", "items": [ { "firstName": "Sam", "lastName": "Smith" } ] }, { "key": "Doe", "items": [ { "firstName": "Sam", "lastName": "Doe" }, { "firstName": "Sam", "lastName": "Doe" } ] }, { "key": "Joe", "items": [ { "firstName": "Sam", "lastName": "Joe" } ] } ] }, { "key": "John", "items": [ { "key": "Joe", "items": [ { "firstName": "John", "lastName": "Joe" } ] } ] } ] Edit: To allow dynamically configurable grouping and ordering, a more advanced approach must be taken: // Enumerable, definition =&gt; Enumerable function applyOrder(items, definition) { var i, prop, prefix, suffix, orderFunc; if (!items) return; if (!definition) return items; for (i = 0; i &lt; definition.length; i++) { // definition[i] is either "propertyName" or "propertyName DESC" prop = (definition[i] + " ").split(" "); prefix = i === 0 ? "OrderBy" : "ThenBy"; suffix = prop[1].toUpperCase() === "DESC" ? "Descending" : ""; orderFunc = prefix + suffix; items = items[orderFunc]("$." + prop[0]); } return items;…
upvote count: 2
has comment: http://stackoverflow.com/comment/43922978
has comment: http://stackoverflow.com/comment/43930687
has comment: http://stackoverflow.com/comment/43931332
has comment: http://stackoverflow.com/comment/43931288
has comment: http://stackoverflow.com/comment/43929209
has comment: http://stackoverflow.com/comment/43923528
accepted answer of: http://stackoverflow.com/q/27753706
score: 2

http://stackoverflow.com/comment/43988606
score: 0
type: Comment
type: QuestionComment
has text: what the hell.... now it's working... i recached the page and it works
comment on: http://stackoverflow.com/q/27789190

http://stackoverflow.com/comment/43709704
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27642691
has text: lang switching come dynamically or with postback and page reloading?

http://stackoverflow.com/q/27706760
has comment: http://stackoverflow.com/comment/43825414
tagged with: ajax
accepted answer: http://stackoverflow.com/a/27707626
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27707626
type: Question
has title: Getting response from AJAX call - accepting callbacks
has comment: http://stackoverflow.com/comment/43825474
tagged with: javascript
has body: I read about AJAX and getting calls from it and Im trying to restructure code, to get work. Working on functions that accept callbacks. I created code, but still variable error is not working outside the AJAX. $('.login').submit(function(e) { e.preventDefault(); var error = 0; var email = $email.val(); // function that makes a request and returns a promise: function testAjax() { return $.ajax({ url: 'MY URL', data: { 'email': email }, type: 'POST', }); } // function that expects a promise as an argument: function displayData(x) { x.success(function(realData) { if (realData == 1) { createErrTult("Błąd! taki email już istnieje w bazie!", $email) //THAT VARIABLE IS STILL NOT WORKING OUTSIDE AJAX error++; } }); } // get a promise from testAjax: var promise = testAjax(); // give a promise to other function: displayData(promise); if (error!=0)return; self.find('[type=submit]').attr('disabled', 'disabled'); self.children().fadeOut(300,function(){ $(this).remove() }) $(' sign in welcome to A.Movie You have successfully signed in! ').appendTo(self) .hide().delay(300).fadeIn(); }); How I can fix that problem? Thought that did that code correct.
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/27694223
has comment: http://stackoverflow.com/comment/43805317
has comment: http://stackoverflow.com/comment/43802317
has title: making a parameter in one page appear in another page
has comment: http://stackoverflow.com/comment/43804626
score: 1
has comment: http://stackoverflow.com/comment/43801825
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43802172
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43805358
has comment: http://stackoverflow.com/comment/43802327
favorite count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/43802232
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43804754
upvote count: 1
has comment: http://stackoverflow.com/comment/43804792
has comment: http://stackoverflow.com/comment/43804567
has body: I've two pages as shown in screen shots: HTML Angelic Angry Anxious Assertive Bored Confident Cranky Depressed Dissapointed Distrustful Embarrassed Emotional Evil Excited Exhusted flirtatious forgetful 'Javascript` HTML ( Notes page ): Date: Flow: Period Ends Today! Note: Medicine: Symptoms: Moods Intercourse Weight: Temparature: My problem is: If Assertive mood is selected and is saved, then it ( Assertive, i.e., the name of the selected mood ) should appear beside Moods in notes page. How can I do it? Above javascript isn't working.
has comment: http://stackoverflow.com/comment/43804975

http://stackoverflow.com/comment/43898230
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27743383
has text: ***sigh*** Another ask-and-run. @ Freshtea: When asking for help, *stick around* for a few minutes to answer questions like nnnnnn's above.

http://stackoverflow.com/a/38098773
answers question: http://stackoverflow.com/q/27741546
type: Answer
has body: I have faced the similar problem in FF on middle click. The following script fixed me the issue and it works fine in FF as well. $(document).on('click', $(".content"), function(e) { if(e.button==1) { e.preventDefault(); return false; } })
score: 0

http://stackoverflow.com/comment/43759677
type: AnswerComment
type: Comment
has text: And calling `toString` on the buffer?
score: 2
comment on: http://stackoverflow.com/a/27672464

http://stackoverflow.com/a/27651427
score: 1
has body: If you're using jQuery to attach to the event, then do e.preventDefault(); JQuery normalizes the event object so this method is available on all browsers (otherwise older IE's don't have it). Here's the documentation for preventDefault(). If that doesn't help, then try attaching a click handler on the &lt;a&gt; itself and call preventDefault() from that.
has comment: http://stackoverflow.com/comment/43720696
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/43720701
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27651389
answers question: http://stackoverflow.com/q/27651389

http://stackoverflow.com/comment/43891448
score: 1
has text: I don't think AJAX can submit files directly, so you will probably need to use FormData: https://developer.mozilla.org/en-US/docs/Web/API/FormData .. Perhaps THIS may be useful to you?: https://www.new-bamboo.co.uk/blog/2012/01/10/ridiculously-simple-ajax-uploads-with-formdata/ It provides a basic example to upload any kind of file through AJAX. Also, you can prevent the default event of the submit button.
comment on: http://stackoverflow.com/q/27740085
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27666953
tagged with: console
score: 0
tagged with: netbeans
has comment: http://stackoverflow.com/comment/43749908
has title: NetBeans Console doesn't show strings
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43748888
tagged with: output
tagged with: logging
has body: I am using that function to log some data console.log("DoWin(), inputHistory=%s", inputHistory) In chrome console it show the result correctly but in Netbeans Console it show it like that DoWin(), inputHistory=%s I tried all other stuff like %o, %d all same doesn't replace with the value but in chrome console it works fine How can I change that?
type: Question
tagged with: javascript

http://stackoverflow.com/q/27769119
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 3
has body: I have a custom element, called x-foo. I would like to extend it, and create an x-foo-extended element, but it doesn't works. I get this error: Uncaught NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-foo-extended'. The tag name specified in 'extends' is a custom element name. Use inheritance instead. var xFooExtendedProto = Object.create(xFoo.prototype); xFooExtendedProto.someCustomFunc = function() { // ... }; xFooExtended = document.registerElement('x-foo-extended', { prototype: xFooExtendedProto, extends: 'x-foo' });
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28775685
accepted answer: http://stackoverflow.com/a/28775685
has title: How to extend an existing custom element?
tagged with: custom-element
type: AnsweredQuestion
score: 3
downvote count: 0
type: Question

http://stackoverflow.com/comment/75062358
score: 174
has text: Use `eslint-disable-next-line`:
type: Comment
comment on: http://stackoverflow.com/q/27732209
type: QuestionComment

http://stackoverflow.com/q/27678234
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I have an element called jobfilter, which I want to add a class to depending on the viewport width, ie. when I resize my browser to &lt;1000px, I want to add the class .hidden to .jobfilter. Now, I managed to get it half-working with the help of this link: $(window).width() not the same as media query. Using this: function checkPosition() { if (window.matchMedia('(max-width: 767px)').matches) { //... } else { //... } } Here's my JSFiddle: http://jsfiddle.net/ck55Lf01/10/. If you resize the browser and refresh the page, the jobfilter hides, but I'd like that to happen dynamically, not on the refresh of the page, thank you for your help!
answer count: 5
has comment: http://stackoverflow.com/comment/43770852
has answer: http://stackoverflow.com/a/27678291
has answer: http://stackoverflow.com/a/27678311
has answer: http://stackoverflow.com/a/27678305
linked to: http://stackoverflow.com/q/19291873
has answer: http://stackoverflow.com/a/27678265
type: AnsweredQuestion
upvote count: 5
accepted answer: http://stackoverflow.com/a/27678291
possible better answer: http://stackoverflow.com/a/27678617
has title: Dynamically add class on browser resize (viewport width)
has answer: http://stackoverflow.com/a/27678617
type: Question
score: 5
downvote count: 0

http://stackoverflow.com/q/27693332
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43799838
has answer: http://stackoverflow.com/a/45888947
has answer: http://stackoverflow.com/a/27693399
answer count: 5
has body: I am trying to do an off-canvas sidebar and I am using the .toggleClass function to make it active or not. When it is active I would like the button (.btn) to say "hide" and when it is not say "show". I have already tried to do an if statement and it has failed. I have also looked at other stackoverflow questions with no success. Can anybody help with how to detect a class has been toggled or not? $(document).ready(function () { $('[data-toggle="offcanvas"]').click(function () { $('.row-offcanvas').toggleClass('active'); // if active "hide" $('.btn').html("HIDE"); // if not active "show" $('.btn').html("SHOW"); }); });
upvote count: 6
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27693369
has answer: http://stackoverflow.com/a/27693452
type: Question
has title: Detecting class toggle in jQuery
tagged with: javascript
score: 6
possible better answer: http://stackoverflow.com/a/27693374
accepted answer: http://stackoverflow.com/a/27693369
has answer: http://stackoverflow.com/a/27693374
downvote count: 0

http://stackoverflow.com/comment/43713396
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27647763
has text: Should update question with that comment along with your current code and what should happen at perimter of container

http://stackoverflow.com/comment/43896614
type: QuestionComment
has text: Please be more specific. Show your 'event_start_date', and the values you are getting / expecting.
comment on: http://stackoverflow.com/q/27742911
score: 0
type: Comment

http://stackoverflow.com/comment/43885735
score: 0
type: Comment
type: QuestionComment
has text: Tried that, still no response from the Roku.
comment on: http://stackoverflow.com/q/27736909

http://stackoverflow.com/a/27765132
downvote count: 0
has comment: http://stackoverflow.com/comment/43941022
has body: Looks like, when you get to listing out the users in your table, you're not looping over the existing assignments. What you have only writes to the first assignment column, regardless of what assignment the user submitted. So, below are a few tweaks of your existing code. First I added two lines to your assignments header row, marked with comments. The first creates an assignments array (for later use), and the second loads that array with the existing assignments. Then, when looping over the users, for each user I added a loop over the existing assignments array. This accomplishes two things, 1) it puts aligns the assignments to the appropriate column, and 2) it gives you the assignment id you need to check if the user submitted the assignment. (I also used prepared statements for added security.) NOTE: I'm guessing that your "userassignment" table has a field named "a_id" that gets set along with "userid" when a user submits an assignment. &lt;table id="blacklistgrid"&gt; &lt;tr id="Row1"&gt; &lt;td class="space"&gt;&amp;nbsp;&lt;/td&gt; &lt;?php $query=mysqli_query($mysqli, "SELECT assignment,a_id FROM assignments WHERE groupid=0"); $assignments = array(); // create empty assignments array while ($row=mysqli_fetch_array($query)){ echo'&lt;td class="columnname" id="'.$row['a_id'].'" contenteditable="true"&gt;'.$row['assignment'].'&lt;/td&gt;'; $assignments[$row['a_id']] = $row['assignment']; // add assignment to array } ?&gt; &lt;script&gt; $('.columnname').keyup(function() { delay(function(){ var text= $('.columnname').text(); var id= $('.columnname').attr('id') $.ajax({ type:"post", url:"updateassignment.php", data:{text:text, id:id}, success:function(data){ console.log('success bro!'); } }); }, 500 ); }); var delay = (function(){ var timer = 0; return function(callback, ms){ clearTimeout (timer); timer = setTimeout(callback, ms); }; })(); &lt;/script&gt; &lt;/tr&gt; &lt;?php $query=mysqli_query($mysqli, "SELECT name,memberid_fk FROM groupsort INNER JOIN members…
has comment: http://stackoverflow.com/comment/43940960
has comment: http://stackoverflow.com/comment/43941089
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43941068
score: 1
has comment: http://stackoverflow.com/comment/43940910
has comment: http://stackoverflow.com/comment/43941428
has comment: http://stackoverflow.com/comment/43941481
has comment: http://stackoverflow.com/comment/43941461
has comment: http://stackoverflow.com/comment/43940985
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27764224
has comment: http://stackoverflow.com/comment/43941246
has comment: http://stackoverflow.com/comment/43941525
answers question: http://stackoverflow.com/q/27764224
has comment: http://stackoverflow.com/comment/43941587
has comment: http://stackoverflow.com/comment/43941188
has comment: http://stackoverflow.com/comment/43941326

http://stackoverflow.com/a/27781861
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27781298
type: Answer
answers question: http://stackoverflow.com/q/27781298
has comment: http://stackoverflow.com/comment/43973994
has comment: http://stackoverflow.com/comment/43974184
upvote count: 2
has comment: http://stackoverflow.com/comment/43974012
has comment: http://stackoverflow.com/comment/43974244
has comment: http://stackoverflow.com/comment/43974085
has body: Since the source and target data nodes both have a property selected that determines the visibility of the associated DOM node, just use that property instead of looking for the CSS classes. d3.selectAll(".link") .attr("class", function(d) { return d.source.selected &amp;&amp; d.target.selected ? "visible" : "hidden"; });

http://stackoverflow.com/q/27800128
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/27800230
answer count: 5
has answer: http://stackoverflow.com/a/27800266
has answer: http://stackoverflow.com/a/27800345
has answer: http://stackoverflow.com/a/27801084
has title: Javascript greatest sum of triple digits
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44008711
type: Question
has answer: http://stackoverflow.com/a/27800230
tagged with: algorithm
has comment: http://stackoverflow.com/comment/44008850
has answer: http://stackoverflow.com/a/27800253
has body: I want to write a function, in javascript, that calculates the greatest sum of 3 consecutive numbers of a given positive number. So for example 124999012 would calculate 27. I already wrote a function that calculates the sum of the digits of a number: function sumDigits(n) { var str = n.toString(); var result = 0; for(var i = 0; i &lt; str.length; i++) { result = result + parseInt(str.charAt(i)); } return result; }
score: 0
upvote count: 1
accepted answer: http://stackoverflow.com/a/27800345
downvote count: 1

http://stackoverflow.com/comment/43794469
score: 0
type: QuestionComment
type: Comment
has text: check you include jquery .. sometimes simple things make more problems :)
comment on: http://stackoverflow.com/q/27690542

http://stackoverflow.com/q/27737872
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43893005
tagged with: css
has comment: http://stackoverflow.com/comment/43893536
score: 1
has comment: http://stackoverflow.com/comment/43891344
has body: How do I add a timepicker field in my rails app? I am using this addon As directed in the documentation, I first included this in my gemfile: gem 'bootstrap-timepicker-rails-addon' Then, I ran bundle install and included the bootstrap-timepicker in my JS and CSS files, so that my app/assets/javascripts/application.js looks like: // //= require jquery //= require jquery_ujs //= require turbolinks //= require bootstrap-timepicker //= require_tree . and my app/assets/stylesheets/application.css.scss looks like: * *= require bootstrap-timepicker *= require_tree . *= require_self */ Finally in my views, I included this: &lt;script&gt; $(function() { $('#timepicker').timepicker(); }); &lt;/script&gt; and the following in one of my form fields: &lt;div class="field"&gt; &lt;%= label_tag ("Time of Travel ") %&gt;&lt;br&gt; &lt;%= text_field_tag :dot, nil, :id =&gt; "timepicker" %&gt; &lt;/div&gt; After all this, I still am not able to get my form properly display the time field. Where am I going wrong?
upvote count: 1
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/27741363
type: Question
has comment: http://stackoverflow.com/comment/43890944
has comment: http://stackoverflow.com/comment/43891977
tagged with: javascript
has title: How to add a timepicker field in my rails 4 app?
has answer: http://stackoverflow.com/a/47598155
has comment: http://stackoverflow.com/comment/43891876
has comment: http://stackoverflow.com/comment/43893048
has comment: http://stackoverflow.com/comment/43890144
answer count: 3
tagged with: ruby-on-rails-4
has comment: http://stackoverflow.com/comment/43891667
downvote count: 0
has answer: http://stackoverflow.com/a/27740716

http://stackoverflow.com/comment/43742289
comment on: http://stackoverflow.com/q/27663149
has text: Is it possible to run on key up instead or not?
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/43898312
type: Comment
comment on: http://stackoverflow.com/q/27742951
score: 0
has text: @Barmar That simple? How so?
type: QuestionComment

http://stackoverflow.com/q/27713660
has title: pdf.js: Get the text colour
has answer: http://stackoverflow.com/a/76652478
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43875178
has answer: http://stackoverflow.com/a/27909703
type: Question
possible better answer: http://stackoverflow.com/a/27832005
has answer: http://stackoverflow.com/a/65663033
upvote count: 15
has comment: http://stackoverflow.com/comment/44164263
has body: I have a simple pdf file, containing the words "Hello world", each in a different colour. I'm loading the PDF, like this: PDFJS.getDocument('test.pdf').then( onPDF ); function onPDF( pdf ) { pdf.getPage( 1 ).then( onPage ); } function onPage( page ) { page.getTextContent().then( onText ); } function onText( text ) { console.log( JSON.stringify( text ) ); } And I get a JSON output like this: { "items" : [{ "str" : "Hello ", "dir" : "ltr", "width" : 29.592, "height" : 12, "transform" : [12, 0, 0, 12, 56.8, 774.1], "fontName" : "g_font_1" }, { "str" : "world", "dir" : "ltr", "width" : 27.983999999999998, "height" : 12, "transform" : [12, 0, 0, 12, 86.5, 774.1], "fontName" : "g_font_1" } ], "styles" : { "g_font_1" : { "fontFamily" : "serif", "ascent" : 0.891, "descent" : 0.216 } } } However, I've not been able to find a way to determine the colour of each word. When I render it, it renders properly, so I know the information is in there somewhere. Is there somewhere I can access this?
has answer: http://stackoverflow.com/a/27832005
has comment: http://stackoverflow.com/comment/44164794
has comment: http://stackoverflow.com/comment/43897356
has comment: http://stackoverflow.com/comment/44039598
downvote count: 0
tagged with: javascript
answer count: 6
score: 15
accepted answer: http://stackoverflow.com/a/27909703
tagged with: pdf.js
has answer: http://stackoverflow.com/a/76653397
favorite count: 0
has answer: http://stackoverflow.com/a/77056561
has comment: http://stackoverflow.com/comment/43859645

http://stackoverflow.com/comment/43730771
score: 0
comment on: http://stackoverflow.com/q/27657497
has text: Use `id` for 1 element not `class`.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27709784
has title: Why is $.get() not working properly
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/43831476
has comment: http://stackoverflow.com/comment/43831502
downvote count: 1
has answer: http://stackoverflow.com/a/27710363
tagged with: jquery
has answer: http://stackoverflow.com/a/27710305
favorite count: 0
has comment: http://stackoverflow.com/comment/43831517
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43832522
tagged with: php
has answer: http://stackoverflow.com/a/27709866
has body: I'm trying to retrieve a line of code from a php file. My code is as follows: $( document ).ready(function() { alert("1"); $.get('http://myurl.com/toolbox/myPHP.php?store_id=4649b4a8a802c3&amp;couponShow=checkout', function(data) { alert(data); alert("2"); }); }); window.onload = function() { if (window.jQuery) { // jQuery is loaded alert("Yeah!"); } else { // jQuery is not loaded alert("Doesn't Work"); } } "1" and "Yeah!" are alerted properly, so jQuery is loading, but I can't get inside the get function. Visiting the url inside returns exactly what's expected. Is there something wrong with what I'm doing here? What steps could I take to find the problem?
has comment: http://stackoverflow.com/comment/43831748
type: Question
has comment: http://stackoverflow.com/comment/43831566
tagged with: javascript
has comment: http://stackoverflow.com/comment/43831582
score: 0

http://stackoverflow.com/comment/43877285
type: QuestionComment
has text: If you try the Fiddle I have in my post, the source is a BLOB URL. (blob://). The source is generated using window.URL.createObjectURL(mediaStream);
comment on: http://stackoverflow.com/q/27707322
score: 0
type: Comment

http://stackoverflow.com/a/27683960
type: Answer
accepted answer of: http://stackoverflow.com/q/27653704
has body: Thanks for the help friends,here is my solution index.php Agent info Student info data.php <?php include 'db.php';?> ID Subject Description Unit Semester <?php //print_r('tabname'); echo $_POST['tabname']; if($_POST['tabname']) { $val=$_POST['tabname']; echo $val; }else{echo "nothing";} ?> <?php $table_name = $_REQUEST['tabname']; $SQLSELECT = "SELECT * FROM $table_name "; $result_set = mysql_query($SQLSELECT, $conn); while($row = mysql_fetch_array($result_set)) { ?> <?php echo $row['SUBJ_ID']; ?> <?php echo $row['SUBJ_CODE']; ?> <?php echo $row['SUBJ_DESCRIPTION']; ?> <?php echo $row['UNIT']; ?> <?php echo $row['SEMESTER']; ?> <?php } ?>
answers question: http://stackoverflow.com/q/27653704
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/43900693
type: QuestionComment
comment on: http://stackoverflow.com/q/27744779
has text: What type is `allItemsSelected`? if it is an object use third argument in your [watch as `true` for object equality](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$watch), if it is an array use [`watchCollection`](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$watchCollection)
score: 0
type: Comment

http://stackoverflow.com/q/27694711
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: sockets
tagged with: node.js
score: 2
has title: Should I close a proxy connection after receiving a 304?
tagged with: http
type: Question
has body: I have a http request/response question. Let's say I have a proxy server that just forwards the client's requests to a third party server, and third party server's responses back to the client: var http = require('http'); var url = require('url'); http.createServer(function (req, res) { var opts = { hostname : 'www.example.com', port : 80, path : req.url, method : req.method, headers : req.headers }; opts.headers.host = opts.host; var proxyReq = http.request(opts, function (proxyResponse) { res.writeHead(proxyResponse.statusCode, proxyResponse.headers); proxyResponse.pipe(res); }); req.pipe(proxyReq); }).listen(3000); Let's say the client is cache-aware, (like a browser) and it passed a if-modified-since or if-none-match (or whatever) header that caused the third party server to respond with a 304 status code. Now, technically, the server shouldn't send a body and the client doesn't care about the response body after receiving a 304. Would it make any sense, (and would it save any bandwidth/resources) by doing this in the proxy response handler for servers that erroneously send a response body with a 304: var proxyReq = http.request(opts, function (proxyResponse) { // Terminate the request, and respond with empty body. if (proxyResponse.statusCode === 304) { proxyResponse.connection.end(); return res.end(); } /* ... */ Or is it bad to terminate sockets like that? I'm not quite familiar whether calling .end() on the socket messes with the http keep-alive connections, or has any effect on performance. Thank you for your help!
tagged with: javascript
has answer: http://stackoverflow.com/a/27695243
tagged with: proxy
upvote count: 2

http://stackoverflow.com/q/27653441
tagged with: jquery
has comment: http://stackoverflow.com/comment/43786945
has comment: http://stackoverflow.com/comment/43762062
tagged with: http://stackoverflow.com/tag/html
has body: I am showing image at my html page which is taken from DRUPAL side (by using ajax request) $.ajax({ url: URL + AUTH, type: 'post', data: addItemObject(validateObject(refreshObject({"_lawyer_id":"462"})),'key','lawyerlogo'), error: function(XMLHttpRequest, textStatus, errorThrown) { devconsole(errorThrown); navigator.notification.alert('Error saving data. Please try again.', null, 'Server Error', 'Ok'); }, success: function (data) { myalert(JSON.stringify(data["url_full"])); document.getElementById("lawyer_logo").src=data["url_full_mobile"]; } }); I am getting the Image URL in this format http://URL/sites/default/files/styles/thumbnail/public/Jellyfish.jpg?itok=W2h3AytQ I am removing the "?itok=W2h3AytQ" from URL and assigning to 'src' but it is not showing the image how could i show the image.
tagged with: drupal
has comment: http://stackoverflow.com/comment/43955964
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43727907
has comment: http://stackoverflow.com/comment/43726297
type: Question
has title: getting image from Drupal and showing in html page using javascript
tagged with: drupal-7
has comment: http://stackoverflow.com/comment/43794078
tagged with: javascript
has comment: http://stackoverflow.com/comment/43784542
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27710157

http://stackoverflow.com/comment/43792910
type: Comment
score: 0
type: AnswerComment
has text: unfortunately no , the problem is, i defined a parent controller in line 1 , and some field can access to controller and some field can't. you have an idea ?
comment on: http://stackoverflow.com/a/27689265

http://stackoverflow.com/comment/43889681
comment on: http://stackoverflow.com/q/27739443
has text: the string comes from an external source (from a client) which I have no control of.
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/27676255
has comment: http://stackoverflow.com/comment/43767076
has comment: http://stackoverflow.com/comment/43772511
type: UnansweredQuestion
tagged with: php
answer count: 0
has title: loading cross-domain resources: PHP vs JavaScript
type: Question
tagged with: javascript
score: 0
tagged with: cross-domain
has body: In PHP, there’s the nifty loadHTMLFile function. With it, a script run local fetches any external resources just fine. Of course it does, since it’s just downloading a file, browser-like, non-interactive. When I try a JavaScript implementation, jQuery.get(), for instance, will nag about cross-domain boundaries. Of course it does, it respects the same-origin policy. I’m not sure why this is so. True, I want to GET a specific resource to examine its contents experimentally. But I don’t want to access its actual live DOM, let alone manipulate it. I just want the plain text of the HTML file the remote server responds to my request. What’s the fundamental distinction? Are these use cases incomparable? Can JavaScript get (i.e. download) the static contents of an external resource (w/o CORS or other server-side mechanisms)?

http://stackoverflow.com/a/27691194
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27663194
answers question: http://stackoverflow.com/q/27663194
type: Answer
score: 2
upvote count: 2
has body: Just change the url so that instead of 'large', it ends with 't500x500'

http://stackoverflow.com/q/27761690
has answer: http://stackoverflow.com/a/27761798
has comment: http://stackoverflow.com/comment/43935015
tagged with: regex
has answer: http://stackoverflow.com/a/27778894
has comment: http://stackoverflow.com/comment/43935213
favorite count: 0
has comment: http://stackoverflow.com/comment/43934698
has comment: http://stackoverflow.com/comment/43935227
upvote count: 1
tagged with: php
has body: So I'm trying to get the video id from a vimeo url using a regex. Based on this: Get video id from Vimeo url The following regex should do the trick: if (preg_match("/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/", $videoLink, $id)) { $videoId = $id[3]; } But it isn't working, and I can't for the life of me work out why. Is there a difference between regex in Javascript and PHP/am I misusing preg_match? I've looked around on Stack Overflow for a while and just can't find a working regex for getting the video id from a vimeo url/embed. There are plenty of regex out there for it, but none show their implementation.
tagged with: video
accepted answer: http://stackoverflow.com/a/27761798
type: AnsweredQuestion
tagged with: vimeo
score: 1
has comment: http://stackoverflow.com/comment/43934635
linked to: http://stackoverflow.com/q/13286785
type: Question
has answer: http://stackoverflow.com/a/27786873
downvote count: 0
tagged with: javascript
has title: How to get video id from vimeo url/embed?
answer count: 3
possible better answer: http://stackoverflow.com/a/27786873

http://stackoverflow.com/a/27771305
type: Answer
answers question: http://stackoverflow.com/q/27771298
has comment: http://stackoverflow.com/comment/43953821
score: 1
has comment: http://stackoverflow.com/comment/43953728
upvote count: 2
type: AcceptedAnswer
has body: getElementsByClassName returns an array, since you can have multiple elements with the same class name. You can pick them by document.getElementsByClassName("ytp-button ytp-button-prev")[index]
downvote count: 1
accepted answer of: http://stackoverflow.com/q/27771298

http://stackoverflow.com/comment/43958640
score: 0
type: AnswerComment
has text: there are lots of form with this class="sp-right" . so i don't want to change all classes . Any idea ? –
comment on: http://stackoverflow.com/a/27770240
type: Comment

purescript
type: Tag
tags question: http://stackoverflow.com/q/27671920
tag name: purescript

http://stackoverflow.com/q/27734569
answer count: 1
has title: Android & Javascript - From two functions to one
score: 0
has answer: http://stackoverflow.com/a/27755838
tagged with: javascript
has body: MainActivity.java public String URI = null; @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == 0 &amp;&amp; resultCode == RESULT_OK) { Uri pickedImage = data.getData(); URI = pickedImage.toString(); } } public String GetURI() { return URI; } WebAppInterface.java @JavascriptInterface public void GetPicture() { Intent galleryIntent = new Intent(Intent.ACTION_PICK); galleryIntent.setType("image/*"); ((MainActivity) mContext).startActivityForResult(galleryIntent, 0); } @JavascriptInterface public String GetURI() { return getRealPathFromURI(mContext, Uri.parse(((MainActivity) mContext).GetURI())); } I'm using the following Javascript functions function GetPicture() { Android.GetPicture(); } function loadImage() { document.getElementById("img").src = Android.GetURI(); } The first one is used to get the picture and store the full path in a string. The second function is used to obtain the the full path from the string. Currently this is working because I'm first calling GetPicture and then loadImage. But I want to "merge" the functions. So the Javascript would be: function loadImage() { document.getElementById("img").src = Android.GetPicture(); } So I changed the code from WebAppInterface.java to this: @JavascriptInterface public String GetPicture() { Intent galleryIntent = new Intent(Intent.ACTION_PICK); galleryIntent.setType("image/*"); ((MainActivity) mContext).startActivityForResult(galleryIntent, 0); return ((MainActivity) mContext).GetURI(); } But it's not working. I think I know why because GetURI is being called before the string URI has been set. So how do I fix this problem? If somebody knows a better title please let me know.
type: UnansweredQuestion
type: Question
tagged with: android
tagged with: android-gallery

http://stackoverflow.com/comment/43769469
has text: seems no one knows! :(
comment on: http://stackoverflow.com/q/27664376
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27695557
has answer: http://stackoverflow.com/a/32411078
has title: Cayley: How do insert vertices and edges into graph using Cayley-Gremlin code?
tagged with: javascript
answer count: 2
downvote count: 0
has body: So being new to Go and Cayley I am struggling with inserting data into the graph. I am running a gremlin console on the command line with this command: cayley repl --db="bolt" --dbpath=../../database/database1 --query_lang="gremlin" I know cayley uses a different variant of Gremlin. This page (https://github.com/google/cayley/wiki) states that it uses 'Cayley-Gremlin' instead of 'Tinkerpop-Gremlin'. I would think that for the most part the API would remain the same, but that doesn't seem to be the case. This documentation states that the graph object has an addVertex method available. However, when I try to use the method in the Cayley repl I get an error: cayley&gt; g.addVertex("test") Error: TypeError: 'addVertex' is not a function ----------- 1 Results Elapsed time: 0.102239 ms Why is the method not available on the graph? Is the API different? Is there another method of inserting nodes/edges into graphs using 'Cayley-Gremlin'? Thanks in advance!
favorite count: 0
tagged with: go
has answer: http://stackoverflow.com/a/27707530
accepted answer: http://stackoverflow.com/a/27707530
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/32411078
upvote count: 2
tagged with: graph-databases
tagged with: cayley
tagged with: gremlin
type: Question

http://stackoverflow.com/q/27763023
has answer: http://stackoverflow.com/a/27763099
has answer: http://stackoverflow.com/a/27763046
has title: Reading a line with javascript
answer count: 3
has answer: http://stackoverflow.com/a/27763047
accepted answer: http://stackoverflow.com/a/27763047
tagged with: javascript
tagged with: string
score: 0
possible better answer: http://stackoverflow.com/a/27763046
type: AnsweredQuestion
has body: I know it is a basic question, but unfortunately I couldn't find the answer. A link to the answer would be more than enough. I have a html file like this: &lt;html&gt; &lt;head&gt; &lt;title&gt;A&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form action="" method="POST"&gt; &lt;p&gt;Question: &amp;#x34;&amp;#x38;&amp;#xA0;&lt;/p&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; How can I read the string between &lt;p&gt; and &lt;/p&gt;?
type: Question

http://stackoverflow.com/a/27724812
answers question: http://stackoverflow.com/q/27724738
type: Answer
upvote count: 1
score: 1
has body: Hard to test since all the references in the fiddle are broken, but try this: var table = new Handsontable($("#example1"), { data: data, minRows: 5, minCols: 6, minSpareRows: 1, currentRowClassName: 'currentRow', currentColClassName: 'currentCol', autoWrapRow: true, rowHeaders: true, colHeaders: true }); table.render(); Source: http://handsontable.com/demo/understanding_reference.html
downvote count: 0
has comment: http://stackoverflow.com/comment/43874571

http://stackoverflow.com/a/27709063
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/27696845
type: Answer
answers question: http://stackoverflow.com/q/27696845
has body: SOLUTION: $('#testimo_slider').on('slide.bs.carousel', function (event) { var slideIndex = $(event.relatedTarget).index(); console.log($(event.relatedTarget).index()); $('.testimonial_holder').each(function(i,val){ if (i == slideIndex) { $(val).removeClass('hide_testimo'); } else { $(val).addClass('hide_testimo'); } }) });

http://stackoverflow.com/q/27786073
favorite count: 0
has answer: http://stackoverflow.com/a/27786373
tagged with: http://stackoverflow.com/tag/html
has title: How to search a range in html table using jquery?
accepted answer: http://stackoverflow.com/a/27786373
type: AnsweredQuestion
has body: I have a table structure like this: City | %age | Year NY | 57% - 95% | 2011 NY | 30% - 65% | 2012 FL | 50% - 60% | 2012 AL | 10% - 50% | 2014 I am able to search in the text using this code: jQuery('#tblSearch tr td.td5:containsNoCase(\'' + jQuery('#txtSearch').val() + '\')').parent().show(); jQuery.expr[":"].containsNoCase = function (el, i, m) { var search = m[3]; if (!search) return false; return eval("/" + search + "/i").test($(el).text()); }; But I do not have any idea how can I search ranges like if user want to search for 60% then How can I get first three result? Thanks in advance! Please refer if possible duplicate. Thanks.
score: 1
linked to: http://stackoverflow.com/q/14718561
upvote count: 1
possible better answer: http://stackoverflow.com/a/27786729
has comment: http://stackoverflow.com/comment/43982278
type: Question
has answer: http://stackoverflow.com/a/27786729
has comment: http://stackoverflow.com/comment/43982230
tagged with: javascript
has comment: http://stackoverflow.com/comment/43982181
answer count: 3
has answer: http://stackoverflow.com/a/27786454
has comment: http://stackoverflow.com/comment/43982254
downvote count: 0
tagged with: jquery

http://stackoverflow.com/comment/43784756
has text: And I got this: ``` [ { "@type": "d", "@version": 0, "value": [ "getVertexInstance", "save", "getGraph", "propertyKeys", "vertices", "fromStream", "hashCode", "wait", "readExternal", "type", "toStream", "connectionClass", "isDetached" ... ] } ] ```
type: Comment
comment on: http://stackoverflow.com/a/27657903
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43757258
type: Comment
type: QuestionComment
has text: What exactly does this number represent?
score: 0
comment on: http://stackoverflow.com/q/27671242

http://stackoverflow.com/q/27658181
has body: How i can do sorting based on price & distance for an list of hotels by using javaScript for the below html script. And i'm new to javaScript, i know by using onclick() on the button sort by price & sort by distance i can do. But i don't know how to write the javascript function to do sorting for the same. 1211 20 23 10 1010 50 124 60 sort by price sort by distance
has answer: http://stackoverflow.com/a/27658249
tagged with: javascript
tagged with: jquery
tagged with: sorting
favorite count: 0
type: Question
possible better answer: http://stackoverflow.com/a/27658249
has answer: http://stackoverflow.com/a/27658524
has title: How to sort the list of hotels based on the "PRICE" & "DISTANCE" using javascript.?
score: -1
downvote count: 2
answer count: 3
upvote count: 1
accepted answer: http://stackoverflow.com/a/27658524
has answer: http://stackoverflow.com/a/27659220
type: AnsweredQuestion

http://stackoverflow.com/a/27672493
has body: A bad workaround is to return an html document like the one below for Chrome and Safari, instead of the redirect after the post: In this way the second page is fetched from cache.
answers question: http://stackoverflow.com/q/27663792
score: 0
type: Answer

http://stackoverflow.com/comment/43773494
type: Comment
score: 0
has text: http://jsfiddle.net/bontp6jk/5/
type: QuestionComment
comment on: http://stackoverflow.com/q/27679414

http://stackoverflow.com/comment/44139677
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27832618
has text: I'm still getting the same "not a function" error. I suppose it's worth noting that I had to remove `//= require jquery_ujs` from my application.js because I was getting a "file not found" error for it after I deleted the jquery-rails gem; but I don't know if that would cause any problems.
score: 0

http://stackoverflow.com/q/27689904
tagged with: javascript
has comment: http://stackoverflow.com/comment/43794076
score: 0
tagged with: android
has comment: http://stackoverflow.com/comment/43796660
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43794010
has body: Hi I am developing android application for that I am using request.js by using the below files how to get the json array and by using this json array I can parse the json object then i will use the server response in clent. Can any help me. package.json { "name": "node-chat", "version": "0.0.1", "main": "app.js", "dependencies": { "express" : "~4.0.0", "mysql" : "~2.5.3", "connect": "~2.14.4", "request": "2.36.0" } } app.js /** * Module dependencies. */ var express = require('express'); var connect = require('connect'); var app = express(); var port = process.env.PORT || 8080; // Configuration app.use(express.static(__dirname + '/public')); app.use(connect.logger('dev')); app.use(connect.json()); app.use(connect.urlencoded()); // Routes require('./routes/routes.js')(app); app.listen(port); console.log('The App runs on port ' + port); request.js var request = require('request'); var mysql = require('mysql'); var connection = mysql.createConnection( { host : 'localhost', user : 'root', password : '', database : 'chat', } ); connection.connect(); exports.login = function(name,mobno,reg_id,callback) { var data = { name : name, mobno : mobno, reg_id : reg_id }; var que = "SELECT * from users WHERE mobno =" + mobno; var query = connection.query(que, function(err, rows) { if(rows.length == 0){ var query = connection.query("INSERT INTO users set ? ",data, function(err, rows) { callback({'response':"Sucessfully Registered"}); }); }else { callback({'response':"User already Registered"}); } }); } exports.getuser = function(mobno,callback) { var query = connection.query("SELECT * from users", function(err, rows) { if(rows.length == 0){ callback({'response':"No Users Registered"}); }else { callback(removeUser(rows, mobno)); } }); } exports.removeuser = function(mobno,callback) { var que = "DELETE FROM users WHERE mobno =" + mobno; var query = connection.query(que, function(err, rows) { if(!err){ callback({'response':"Removed Sucessfully"}); }else{ callback({'response':"Error"});…
has comment: http://stackoverflow.com/comment/43793704
has title: how to get json response using js file
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/43793751

http://stackoverflow.com/comment/43703617
type: QuestionComment
score: 2
has text: you don't need it. at all. you don't even need classes in JS, and in fact, there are many other, arguably better, paradigms for app construction. apply/call/bind eliminates the need for homogeneity, and with soft-object, you can modify anything to suit your needs without pre-decorating it or inheriting special cases.
comment on: http://stackoverflow.com/q/27642239
type: Comment

http://stackoverflow.com/comment/43833693
comment on: http://stackoverflow.com/q/27710874
type: Comment
type: QuestionComment
has text: Likely related to default browser CSS if you aren't using a CSS normalizer or reset. Impossible to determine much without seeing a demo that replicates problem
score: 0

http://stackoverflow.com/comment/43961029
has text: @BhushanKawadkar: i change selector and add new mirror But this not work: http://jsfiddle.net/ba3kr57e/4/
score: 1
comment on: http://stackoverflow.com/q/27775037
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27795907
tagged with: asp.net
has comment: http://stackoverflow.com/comment/44000594
type: UnansweredQuestion
has title: when i reload my popup window, a copy of window is opened in new tab automatically
has comment: http://stackoverflow.com/comment/44001683
answer count: 0
has body: i am very new to asp.net and javascript. my page abcd.aspx page had a button named popup. when i click my button, is show popup window(popup.aspx). in popup window there is dropdownlist. when selection of dropdownlist changed, popup.aspx get reloading. my problem is when reloading popup, copy of popup window is opened in new tab automatically. please any one explain me to avoid this. and also when i close my popup window, how to reload my parent page automatically. function open_popup() { var getUserid; getUserid = document.getElementById('l_userid').innerText; var i = "toolbar:no;dialogheight:540px;dialogwidth:750px;status:no;center:yes;resizable:no"; window.showModalDialog("popup.aspx?userid=" + getUserid, 'vallaban', i); } ----popup.aspx------ <asp:Panel ID="tab2" runat="server" > name : <asp:ListBox ID="update_lb_name" runat="server" AutoPostBack="true" OnSelectedIndexChanged="fvt_OnSelectedIndexChanged"></asp:ListBox> Customer Code : <asp:ListBox ID="update_lb_customer_code" runat="server" SelectionMode="Multiple" /> <asp:Button ID="Update_btn" runat="server" Text="update" />
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/a/27673560
upvote count: 1
has comment: http://stackoverflow.com/comment/43762341
has comment: http://stackoverflow.com/comment/43762242
has comment: http://stackoverflow.com/comment/43762197
type: Answer
has body: If I understand correctly, you are trying to get the id of the element you highlighted in the inspector. That would be the string after id= in the highlighted tag; or "salestagecode_c" to be specific. To select that element using jQuery, you would use $('#salestagecode_c')
has comment: http://stackoverflow.com/comment/43762254
answers question: http://stackoverflow.com/q/27673447
downvote count: 0
has comment: http://stackoverflow.com/comment/43762268
has comment: http://stackoverflow.com/comment/43762138
score: 1
has comment: http://stackoverflow.com/comment/43762309
has comment: http://stackoverflow.com/comment/43762178
has comment: http://stackoverflow.com/comment/43762123

http://stackoverflow.com/a/27726073
type: AcceptedAnswer
upvote count: 6
accepted answer of: http://stackoverflow.com/q/27725424
has comment: http://stackoverflow.com/comment/43864368
type: Answer
downvote count: 0
has body: Your usage of ContentService is correct, the code works exactly as is. Here is a link to my copy of your code published as a web app: https://script.google.com/macros/s/AKfycbzx2L643LHw0oQAq1jBmKQh2ju_znGfmdj78dUypj36iF-s91w/exec The problem you are running into is related to Authorization or Authentication, if the published script is not authorized, an HTML error message is returned. To check if that is your issue, simply access the published URL directly in your browser. If you see JSON displayed, then Authorization is not the problem. If you see the "Authorization is required to perform that action" error message, open your published script and choose "doGet" from the Run menu, then follow the authorization prompts. More likely, the problem is related to how your script is published. In order to access your published script from another script, it must be published with the "Who has access to the app" setting as "Anyone, Even anonymous". If you use any other value, Google returns an HTML login page instead of your JSON response, and you get the error you are seeing. This happens because requests sent from Google Apps Script via URLFetchApp are not authenticated, they don't carry the credentials of the user running the code with them, and come in as anonymous requests. If you don't allow "Anyone, even anonymous" in your publishing settings, Google redirects non-authenticated requests to the Google login page.
score: 6
has comment: http://stackoverflow.com/comment/48361742
answers question: http://stackoverflow.com/q/27725424

http://stackoverflow.com/q/27694570
downvote count: 0
accepted answer: http://stackoverflow.com/a/27827488
favorite count: 0
has comment: http://stackoverflow.com/comment/48651498
answer count: 4
score: 14
has answer: http://stackoverflow.com/a/27805532
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43803379
upvote count: 14
has body: According to the documentation, to get a single attribute by name you can use .getAttribute() on a WebElement: var myElement = element(by.id('myId')); expect(myElement.getAttribute('myAttr')).toEqual('myValue'); But how can I get all of the attributes that an element has? There is no information about this use case/functionality in the Protractor API.
has answer: http://stackoverflow.com/a/27827488
type: Question
tagged with: protractor
tagged with: api
possible better answer: http://stackoverflow.com/a/27698180
has answer: http://stackoverflow.com/a/27698180
tagged with: javascript
tagged with: end-to-end
has answer: http://stackoverflow.com/a/27824315
has comment: http://stackoverflow.com/comment/43804193
linked to: http://stackoverflow.com/q/21681897
has title: Get all element attributes using protractor
has comment: http://stackoverflow.com/comment/48657740

http://stackoverflow.com/comment/43789838
type: QuestionComment
comment on: http://stackoverflow.com/q/27688120
score: 4
has text: Note that you aren't asking about a jQuery method, you are talking about the [standard JavaScript string `.split()` method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split).
type: Comment

http://stackoverflow.com/a/27767368
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27766994
score: 4
downvote count: 0
has body: If you need selenium for web-scraping, strictly speaking, you would still need need javascript and css files since they can take a significant part in the page load and rendering. For example, several parts of a page can be loaded with additional ajax calls, or inserted via a custom javascript logic. Also, if you want only HTML part of a page, why do you need to involve a real browser? If you still want to prevent js and css files from loading, you can configure certain permissions in Firefox through tweaking FirefoxProfile preferences, see: Do not want images to load and CSS to render on Firefox in Selenium WebDriver tests with Python FirefoxDriver: how to disable javascript,css and make sendKeys type instantly?
answers question: http://stackoverflow.com/q/27766994
type: Answer
upvote count: 4

http://stackoverflow.com/q/27668060
has answer: http://stackoverflow.com/a/27668321
has comment: http://stackoverflow.com/comment/43751245
type: Question
type: AnsweredQuestion
has body: Can anyone explain me how the deffered part works in this code?. (function() { var getPosition = function (options) { var deferred = $.Deferred(); navigator.geolocation.getCurrentPosition( deferred.resolve, deferred.reject, options); return deferred.promise(); }; var lookupCountry = function (position) { var deferred = $.Deferred(); var latlng = new google.maps.LatLng( position.coords.latitude, position.coords.longitude); var geoCoder = new google.maps.Geocoder(); geoCoder.geocode({ location: latlng }, deferred.resolve); return deferred.promise(); }; var displayResults = function (results, status) { $("body").append("&lt;div&gt;").text(results[0].formatted_address); }; $(function () { $.when(getPosition()) .pipe(lookupCountry) .then(displayResults); }); }()); I have a couple of questions on how the above code works.. $(function () { $.when(getPosition()) .pipe(lookupCountry) .then(displayResults); }); How does the above code without passing options still work?. What does the pipe method do and how is the position passed to lookupCountry() method?. What will happen if deferred.reject is being triggered in getPosition function?
has title: How does Deferred pass values?
has comment: http://stackoverflow.com/comment/43750860
accepted answer: http://stackoverflow.com/a/27668321
has comment: http://stackoverflow.com/comment/43751295
answer count: 1
has comment: http://stackoverflow.com/comment/43751169
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43750923
tagged with: google-maps-api-3
score: 0
has comment: http://stackoverflow.com/comment/43750743

http://stackoverflow.com/a/27793057
answers question: http://stackoverflow.com/q/27683200
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2
has body: We can use the below script to fix this issue which will not override any Google translator added features. It will select the elements based on the class and set the link of all the children elements to the parent link "href" value, $(document).ready(function () { $(".menu-item-text").on("click", function (event) { location.href = $(this).parent().parent().attr("href"); }); });
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27683200

http://stackoverflow.com/q/27676576
has body: I want the cursor to jump to the next input field when pressing enter. If I remove the "select"-tag from the code below it works. But I need it to work with the "select"-tag. What is wrong with my javascript? This script automatically jumps to the next input field when the current field's maxlength has been reached. Zugang Abgang Bruchware Lagerort löschen
accepted answer: http://stackoverflow.com/a/27676698
has answer: http://stackoverflow.com/a/27676627
upvote count: 2
tagged with: input
possible better answer: http://stackoverflow.com/a/27676627
score: 2
type: AnsweredQuestion
has title: How to jump to next form input field
tagged with: forms
has answer: http://stackoverflow.com/a/27676698
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/43943829
comment on: http://stackoverflow.com/a/27766657
has text: This will cause a parse error. `$var="Academic "Calendar" for Semester";` - OP stated that quoted values are in DB.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27727993
tagged with: javascript
score: 0
has title: Can't affect divs with javascript when using node.js?
tagged with: css
tagged with: stylus
accepted answer: http://stackoverflow.com/a/27728026
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27728026
type: Question
tagged with: pug
has body: I'm probably doing something obviously wrong but I'm using node.js and I have a javascript file linked properly (alert("hello"); works). But I can't affect anything with the DOM. Simple example: jade: doctype html html head link(rel='stylesheet', href='/stylesheets/styles.css') script(src='/javascripts/script.js') body block index_block div#divClassName stylus: #divClassName background-color red width 200px height 200px js: alert("hello"); var div = document.getElementById("divClassName"); div.style.backgroundColor = "green"; The box remains red. Why? Thanks.
answer count: 1

http://stackoverflow.com/comment/43989131
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27746629
has text: @user4413288: You forgot to include jQuery in the jsFiddle, the error console is saying that `$` is undefined.

http://stackoverflow.com/comment/43766446
comment on: http://stackoverflow.com/q/27675840
score: 1
has text: Yes http://jsfiddle.net/uj8ox3o1/ this is the jfiddle link.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43722380
score: 0
type: Comment
has text: @slicedtoad In browser, yes. In serverside, e.g. NodeJS, it would be very soon :)
comment on: http://stackoverflow.com/a/27652584
type: AnswerComment

http://stackoverflow.com/comment/43803888
comment on: http://stackoverflow.com/q/27695212
score: 0
type: QuestionComment
type: Comment
has text: Then what is your question?

http://stackoverflow.com/comment/43911168
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27749878
has text: Thank you, that does answer the question the only issue is order ( or lack thereof ) in an object. Please see my note above.
score: 0

http://stackoverflow.com/q/27766858
tagged with: node.js
has body: I'm using Express 4.0 and I'm trying to create a routing that show all users from all countries in Homepage. Switching Country I wish to show all users from that Country. There are also 2 kind of Users (Teachers and Students) and I wish to do the same in there as well. On the Teachers page I wish to show all teachers and based on the (previous or not) selected Country I wish to see Teachers from that Country... I'm having several issues doing this: 1) The Homepage works fine, the homepage with /:countryCode works fine, /teachers and /students do not load anymore... If I put /:countryCode below everything the other pages load... (?!?). 2) Do I also have to create routings like: /:countryCode/teachers? Or there is a way to store the country code somewhere...? 3) In the Menu as well it seems like I have to create 2 different menu, one normal and one with country code extensions... At the moment my routing is something like that: app.get('/', homeController.index); app.get('/:countryCode', homeController.indexByCountry); app.get('/teachers', userController.getTeachers); app.get('/students', userController.getStudents); I'm using the param :countryCode to query Users from that Country. There is a better way to create all that? Any Best Practice? Online I don't see anything similar to this but I think it should be quite popular to have something like that. I hope you can help.
type: Question
has comment: http://stackoverflow.com/comment/43944326
tagged with: javascript
tagged with: express
tagged with: routes
has comment: http://stackoverflow.com/comment/43944408
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27767978
has comment: http://stackoverflow.com/comment/43944342
has title: Expressjs dynamic routing issues
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43944374

http://stackoverflow.com/a/27710843
has comment: http://stackoverflow.com/comment/43853876
accepted answer of: http://stackoverflow.com/q/27710409
answers question: http://stackoverflow.com/q/27710409
has comment: http://stackoverflow.com/comment/43833636
score: 0
has comment: http://stackoverflow.com/comment/43856777
has comment: http://stackoverflow.com/comment/43856721
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43856640
has comment: http://stackoverflow.com/comment/43833733
has body: What about drawing the svg to the canvas, and then use the .toDataURL to get as PNG image? --Update-- For a quick test, i run the below in the console from your live demo: var canvas = document.createElement('canvas'); var ctx = canvas.getContext('2d'); var svgDoc = document.getElementById('mymap').getSVGDocument(); var svg = new Blob([svgDoc.lastChild.outerHTML], {type: 'image/svg+xml;charset=utf-8'}); var img = new Image(); img.onload = function(){ ctx.drawImage(img,0,0); }; img.src = url you should see the url, which has the image draw, at this time just call the .toDataURL you should get the base64 image data
has comment: http://stackoverflow.com/comment/43856351
type: Answer
has comment: http://stackoverflow.com/comment/43855766
has comment: http://stackoverflow.com/comment/43835185

http://stackoverflow.com/comment/43711493
type: QuestionComment
has text: use a `try/catch` block
score: 2
comment on: http://stackoverflow.com/q/27646870
type: Comment

http://stackoverflow.com/comment/43847827
type: QuestionComment
has text: consider adding a jsfiddle to your question
comment on: http://stackoverflow.com/q/27646335
score: 0
type: Comment

http://stackoverflow.com/q/27728219
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/27728323
has answer: http://stackoverflow.com/a/27728386
downvote count: 1
type: Question
upvote count: 4
tagged with: javascript
answer count: 6
tagged with: date
possible better answer: http://stackoverflow.com/a/27728242
has title: How to insert today's date into a URL?
has answer: http://stackoverflow.com/a/27728242
tagged with: url
has body: I have a url that change every day based on today's date, for example: http://www.newspaper.com/edition/20141227.html where 20141227 is in the format YYYYMMDD. Can I include the date using JavaScript? If possible, how would I do that?
has answer: http://stackoverflow.com/a/27728323
has comment: http://stackoverflow.com/comment/43868385
favorite count: 0
has answer: http://stackoverflow.com/a/27730126
has answer: http://stackoverflow.com/a/27728402
has answer: http://stackoverflow.com/a/27772752

http://stackoverflow.com/comment/43954149
type: AnswerComment
comment on: http://stackoverflow.com/a/27763019
type: Comment
score: 1
has text: I've just seen updating your comment, this is solution! thanks very much :D array_shift

http://stackoverflow.com/q/27698467
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43810745
favorite count: 0
answer count: 2
has body: I'm making a single-page application with HTML, CSS and Javascript (no jQuery or similar). This application is made of many UI pages that can change via Javascript. The user experience is fine using the mouse on computers, but not so nice with touchscreens (mobile, etc.). There are many buttons with a CSS hover graphic effect. If I change page tapping one button on a touch screen, the pointer stays there triggering the CSS hover of next elements appearing in the same position when the page is "changed". This effect is very annoying, but I can't figure out how to fix it. The code is very simple: CSS button { background-color: #XXXXXX; } button:hover { background-color: #ZZZZZZ; } HTML &lt;button onclick="changepage()"&gt;&lt;/button&gt;
tagged with: css
has answer: http://stackoverflow.com/a/27704508
has answer: http://stackoverflow.com/a/27699040
score: 4
upvote count: 4
tagged with: mobile
linked to: http://stackoverflow.com/q/11381673
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has title: css :hover, touch-screen and single page applications
type: Question

http://stackoverflow.com/comment/43786827
score: 0
has text: @Barmar I cannot use hide and show in this circumstance.
type: QuestionComment
comment on: http://stackoverflow.com/q/27686426
type: Comment

http://stackoverflow.com/a/27701664
has comment: http://stackoverflow.com/comment/43824186
has body: You can make a custom filter with an id parameter. That filter will take the item, verify if it has the good id, and the verify if it's active or not. My original example was in this Plunker http://plnkr.co/edit/FSwzndyjRxJIymehsZIg?p=preview Hope it helps! If it isn't exactly what you wanted to do, please ask, I'll try to answer further :) [EDIT] OK, after reading your comments, how about this: Hi ! Item id:{{item.id}} is active! Amount of steps in this test: {{ item.steps }} Test description: {{ item.description }} Then you get the output you want: Item id:2 is active! Amount of steps in this test: 4 Test description: Ipsum Item id:3 is active! Amount of steps in this test: 5 Test description: Lorem Ipsum The Plunker is http://plnkr.co/edit/nBYeeZ2Uw0EFihAhNYpl?p
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/43817600
accepted answer of: http://stackoverflow.com/q/27698448
answers question: http://stackoverflow.com/q/27698448
score: 1
has comment: http://stackoverflow.com/comment/43840375
has comment: http://stackoverflow.com/comment/43892907
has comment: http://stackoverflow.com/comment/43840180
downvote count: 0
has comment: http://stackoverflow.com/comment/43926820
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43825367

http://stackoverflow.com/a/27734314
has body: forEach has its own context. Use one of the 3 ways to bind the new context such as: events[name].forEach(function(fn) { fn.apply(this, args); }.bind(this)); You can also pass (as the 2 arg to forEach) the context. The arguments to the callback are (value, index, originalArray, context); events[name].forEach(function(fn) { fn.apply(this, args); },this);
has comment: http://stackoverflow.com/comment/43880271
answers question: http://stackoverflow.com/q/27734273
has comment: http://stackoverflow.com/comment/43880338
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27734273
has comment: http://stackoverflow.com/comment/43880344
score: 3
type: Answer
has comment: http://stackoverflow.com/comment/43880077
upvote count: 3

http://stackoverflow.com/q/27754992
has comment: http://stackoverflow.com/comment/43920790
has answer: http://stackoverflow.com/a/27768503
tagged with: jquery-validate
has title: Error: jQuery jquery.min.js?_=1420285687057:4 Uncaught TypeError: undefined is not a function
has comment: http://stackoverflow.com/comment/43924270
has comment: http://stackoverflow.com/comment/43920911
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43921652
has comment: http://stackoverflow.com/comment/43920848
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/43920803
has comment: http://stackoverflow.com/comment/43920873
tagged with: html5-history
type: UnansweredQuestion
has body: I have problem with jquery validate plugn and history API, when i click few times i have error jquery.min.js?_=1420288991396:4 Uncaught TypeError: undefined is not a function, when I comment a fragment with validate, script works fine. How concat this script. In file script.js i have: $(document).ready(function(){ $("#loginForm").validate({ rules: { username: { required: true, minlength: 2 }, password: { required: true, minlength: 5 }, }, messages: { username: { required: "Please enter a username", minlength: "Your username must consist of at least 2 characters" }, password: { required: "Please provide a password", minlength: "Your password must be at least 5 characters long" }, }, submitHandler: function() { var username=$("#usernameLogin").val(); var password=$("#passwordLogin").val(); var dataString = 'username='+username+'&password='+password+'&tag=login'; if($.trim(username).length>0 && $.trim(password).length>0){ $.ajax({ type: "POST", url: "include/help4meApi.php", data: dataString, cache: false, success: function(data){ if(data){ if($("#rememberMe:checked").val()){ checkCookie(username); } window.location.href = "index.php"; } else{ $("#error").html(" Wrong password or username! "); console.log("Wrong password or username!"); } } }); } return false; } }); // validate signup form on keyup and submit $("#signupForm").validate({ rules: { firstname: { required: true, minlength: 3 }, lastname: "required", username: { required: true, minlength: 2 }, password: { required: true, minlength: 5 }, confirm_password: { required: true, minlength: 5, equalTo: "#password" }, email: { required: true, email: true } }, messages: { firstname: { required: "Please enter your firstname", minlength: "Your firstname must consist of at least 3 characters" }, lastname: "Please enter your lastname", username: { required: "Please enter a username", minlength: "Your username must consist of at least 2 characters" }, password: { required: "Please provide a password", minlength: "Your pass…
upvote count: 1
downvote count: 1
type: Question

http://stackoverflow.com/comment/43865787
comment on: http://stackoverflow.com/q/27726725
score: 0
type: Comment
type: QuestionComment
has text: @Dave Gillhespy just define a function that you call on page load and on window resize.

http://stackoverflow.com/a/27769777
has comment: http://stackoverflow.com/comment/43950471
answers question: http://stackoverflow.com/q/27769623
has comment: http://stackoverflow.com/comment/43950565
has comment: http://stackoverflow.com/comment/43950557
has comment: http://stackoverflow.com/comment/43950434
has body: Looking at your code the $username and $pid variables are not being passed to either coach-home.php or coach-player.php, thus when you try to write to the database the parameter $_GET['username'] or $_GET['pid'] is set (because you have provided an input field in your form), but it has no value! and thus there is no player that exists with an empty pid or username. Also note that in the form you have specified the method as post, but in the php you are referencing the get hash. If you submit by post you access variables with $_POST, submit with get you access with $_GET. My suggestion is to use the session hash to store the username and pid of the user. When the user logs in: $_SESSION['username'] = 'jonnysmith' $_SESSION['pid'] = '45' This will mean when you initiate the database query you will just reference the session value instead of the get value for the parameter. Delete your input field for username/pid in the form. Call session_start(); in your config.php file to enable the session hash. Call session_destroy(); when the user logs out to clear the session hash. Also you will need to logout and log back in for the changes to take effect and the value of username/pid to be stored in the session hash. Happy hunting!
score: 0
type: Answer

http://stackoverflow.com/a/27671073
answers question: http://stackoverflow.com/q/27670473
score: 0
type: Answer
has body: I think you can try the same points and just add the radius of the earth :http://rbrundritt.wordpress.com/2008/10/14/conversion-between-spherical-and-cartesian-coordinates-systems/.

http://stackoverflow.com/q/27731756
has title: Accessing "this" from event in prototype
tagged with: hammer.js
has answer: http://stackoverflow.com/a/27731873
has comment: http://stackoverflow.com/comment/43874909
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27732011
possible better answer: http://stackoverflow.com/a/27731873
has body: Consider the following code... using Hammer.js but I think it might be a generic Javascript question: var drawLayer = new DrawLayer(document.getElementById('canvasContainer')); function DrawLayer(targetElement) { this.foo = "bar"; this.gestureDetection = new Hammer.Manager(targetElement); this.gestureDetection.add(new Hammer.Pan({ direction : Hammer.DIRECTION_ALL, threshold : 0 })); this.gestureDetection.add(new Hammer.Press({ time : 0, threshold : 5 })); this.gestureDetection.on("press", this.drawBegin); this.gestureDetection.on("panmove", this.drawMove); this.gestureDetection.on("panend pressup", this.drawEnd); this.drawBegin("INIT TEST"); } DrawLayer.prototype.drawBegin = function (gestureData) { console.log(typeof(this.foo)); console.log("DRAW BEGIN!"); } DrawLayer.prototype.drawMove = function (gestureData) { console.log(this.foo); console.log("DRAW MOVE!"); } DrawLayer.prototype.drawEnd = function (gestureData) { console.log(this.foo); console.log("DRAW END!"); } When I run it at first, I get this, as expected: string DRAW BEGIN! But then when actually processing the gestures (i.e. when the drawing stuff is called via events), I get: undefined DRAW BEGIN! More to this point- it seems that when processing any of those drawBegin/etc. methods, "this" is undefined, as though it lost scope somehow? I would love both a solution and an explanation. Thanks!
score: 1
upvote count: 1
type: Question
tagged with: closures
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27732011
tagged with: scope
answer count: 2
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/27699959
score: 0
has body: function deleteNode() { var node; node = document.getElementById("sliders"); node.removeChild(node.childNodes[1]); } This will work as your firstchild is not li but the text
has comment: http://stackoverflow.com/comment/43813185
type: Answer
answers question: http://stackoverflow.com/q/27699887

nodelist
type: Tag
tags question: http://stackoverflow.com/q/27777984
tag name: nodelist

http://stackoverflow.com/q/27791762
has answer: http://stackoverflow.com/a/27791959
has comment: http://stackoverflow.com/comment/43993251
has title: jquery adding a mail link
has comment: http://stackoverflow.com/comment/43994661
type: Question
answer count: 2
has body: I'm trying to finish up a contact section of a personal page where I have the URL for each of my social media / contact pages as text in the div. When users click on it, it goes to the stated link. But naturally for my email address, I want them to go their mail app. Thus I wrote this jquery: $(".contact-info").click(function() { var link = $(this).text(); if (link == "foo@bar.com") { link = "mailto:" + link; } window.location.href = link; }); Along with this html and css if it helps: foo@bar.com .contact-info { width: 40%; height: 50px; display: inline-block; padding: 0px 10px; margin-bottom: 10px; margin-top: 10px; margin-right: 40px; margin-left: 20px; cursor: pointer; } It works fine for the direct links, but the mail case always gives me a 404 Error. Would someone be able to tell me what I'm doing wrong here? UPDATE: "contact-info" is the class I apply to each of my divs representing a mode of contact i.e. Facebook, LinkedIn, and email.
has comment: http://stackoverflow.com/comment/43993213
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43993341
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43993290
has comment: http://stackoverflow.com/comment/43993377
has answer: http://stackoverflow.com/a/27791800
type: UnansweredQuestion
score: 0

http://stackoverflow.com/q/27796588
has comment: http://stackoverflow.com/comment/44002007
favorite count: 0
duplicate of: http://stackoverflow.com/q/203198
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44001834
has answer: http://stackoverflow.com/a/27796642
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44001889
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/44001816
has answer: http://stackoverflow.com/a/27797080
has body: After appending a div onclick is not working. Please help me. jQuery(document).ready(function() { jQuery(".chack").click(function(){ jQuery( "#pc_form" ).append(' apply '); }); jQuery(".apply").click(function(){ alert(); }); }); apply here click
has comment: http://stackoverflow.com/comment/44001912
has title: append div on click not working
downvote count: 3
type: Question
linked to: http://stackoverflow.com/q/203198
score: -2
has answer: http://stackoverflow.com/a/27796613
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/27723430
downvote count: 0
type: Answer
upvote count: 6
has body: You do not perform interpolation ({{...}}) for the scope properties passed in, the properties of the scope passed in as argument will automatically get evaluated against the scope. Otherwise it will result only in parse error. So just do:- data-ng-click="hideDtls(one , two)" also you have syntax error in your function declaration. $scope.hideDtls = function(one , two){ // more logic here } Side note: Inline styles are bad, use css classes instead, and check your console for any errors.
accepted answer of: http://stackoverflow.com/q/27723410
score: 6
answers question: http://stackoverflow.com/q/27723410
type: AcceptedAnswer

http://stackoverflow.com/a/27709553
has comment: http://stackoverflow.com/comment/43860789
has body: As per your comment, you want to show the transition between image changes, then use jquery and do this in sequence: Animate opacity to 0 (fadeOut), change the image, animate the opacity to 1 (fadeIn) or write your own animation logic to do the same without jquery. Solution using jquery: var $slide = $(document.images.slide); function slideit() { //fadeout the last image. $slide.fadeOut(function () { document.images.slide.src = eval("image" + step + ".src"); //after changing the image, fadeIn the new image. $slide.fadeIn(function () { if (step &lt; 2) step++; else step = 1; //everything is done... now run the timer for next slide. setTimeout(slideit, 5500); }); }) } jsfiddle: http://jsfiddle.net/vaf84vLd/
answers question: http://stackoverflow.com/q/27699021
has comment: http://stackoverflow.com/comment/43860943
has comment: http://stackoverflow.com/comment/43859947
score: 0
has comment: http://stackoverflow.com/comment/43860846
type: Answer
has comment: http://stackoverflow.com/comment/43861710

http://stackoverflow.com/q/27727959
tagged with: forms
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27727975
has answer: http://stackoverflow.com/a/27728166
score: 0
tagged with: ruby-on-rails-4
has body: I am not very good with JQuery but I am trying to learn. I am rendering number of "Milestone" number fields based on how many "Events" are defined in the database. So for 2 events there will be 2 number fields. What I am having trouble doing is hiding all the fields and only displaying one based on the selection in the "Event" select field. Here are the code snippets: &lt;div&gt; &lt;%= f.label "Event" %&gt; &lt;%= f.select(:event, options_for_select(get_events),{}, { :class =&gt; 'form-control', :id =&gt; 'event'})%&gt; &lt;%if any_errors(@attendance_policy, :event) != nil%&gt; &lt;%= any_errors(@attendance_policy, :event) %&gt; &lt;%end%&gt; &lt;/div&gt; ..... &lt;% Event.all.each do |event| %&gt; &lt;div id='&lt;%=event.event_name%&gt;' &gt; &lt;%= f.label "Absence Milestone(Make dynamic with selected event)"+event.event_name %&gt; &lt;%= f.number_field :absence_milestone, in: 0..event.absence_max.to_i, class: 'form-control' %&gt; &lt;%if any_errors(@attendance_policy, :absence_milestone) != nil%&gt; &lt;%= any_errors(@attendance_policy, :absence_milestone) %&gt; &lt;%end%&gt; &lt;/div&gt; &lt;%end%&gt; Heres my pitiful attempt at JQuery: $(document).ready(function() { $("select#event").bind("change", function() { var selected = $("select#event").text(); $("div#"+selected).show(); }) }) I understand I have to capture all the divs but I dont know how honestly... You cannot pass ruby arguments to JQuery... The hide them all, Capture text from event selector and only show one which id matches what is selected in the selector.. UPDATE Working code: Ruby portion not much changed other than me setting class of the div as 'wipe'. &lt;% Event.all.each do |event| %&gt; &lt;div id="&lt;%= event.event_name%&gt;" class="wipe"&gt; &lt;%= f.label "Absence Milestone" %&gt; &lt;%= f.number_field :absence_milestone, in: 0..event.absence_max.to_i, class: 'form-control' %&gt; &lt;%if any_errors(@attendance_policy, :absence_milestone) != nil%&gt; &lt;%= any_errors(@attendance_policy…
has answer: http://stackoverflow.com/a/27727975
tagged with: http://stackoverflow.com/tag/html
has title: JQuery How to hide/show dynamic number of divs all with unique id
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27728166

rtmp
tag name: rtmp
tags question: http://stackoverflow.com/q/27766696
tags question: http://stackoverflow.com/q/27747565
type: Tag

http://stackoverflow.com/a/27668108
answers question: http://stackoverflow.com/q/27668074
has comment: http://stackoverflow.com/comment/43751049
has comment: http://stackoverflow.com/comment/43751046
downvote count: 0
has comment: http://stackoverflow.com/comment/43750828
type: Answer
has body: That's what .change() method without passing a handler does, triggering a change event. You should compare the values and trigger the event conditionally. The change event is not fired when you change the value of an input programmatically. So as you are triggering the event manually (by using the change method), you should check the values yourself before triggering the event.
score: 1
has comment: http://stackoverflow.com/comment/43750868
upvote count: 1

calendar
tags question: http://stackoverflow.com/q/27664894
tags question: http://stackoverflow.com/q/27711124
tags question: http://stackoverflow.com/q/27736759
tags question: http://stackoverflow.com/q/27669019
tag name: calendar
tags question: http://stackoverflow.com/q/27756704
tags question: http://stackoverflow.com/q/27740180
type: Tag
tags question: http://stackoverflow.com/q/27671225

http://stackoverflow.com/comment/43890484
has text: Why? What benefit does it have other than looking interesting? -- none
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27739811
type: Comment

http://stackoverflow.com/q/27744531
tagged with: koa
tagged with: javascript
tagged with: express
answer count: 3
has answer: http://stackoverflow.com/a/27744745
downvote count: 0
favorite count: 0
type: UnansweredQuestion
score: 6
upvote count: 6
tagged with: node.js
has answer: http://stackoverflow.com/a/27745818
tagged with: http://stackoverflow.com/tag/json
has body: I build a RESTful api with node.js and express / koa. I want to filter the JSON data input - for security reasons as well to have only the needed business specific properties. After filtering the business-specific validation takes place. How can I throw away unwanted JSON / JS object properties - i.e. properties not in my database schema as well as empty properties? Define Schema &amp; filter according to this? Using e.g. https://github.com/alank64/json-schema-filter Any configurable filtering available?
type: Question
has answer: http://stackoverflow.com/a/31104845
has title: How to filter JSON objects according to "schema"

http://stackoverflow.com/q/27800315
accepted answer: http://stackoverflow.com/a/27800467
downvote count: 0
tagged with: javascript
tagged with: callback
upvote count: 3
has comment: http://stackoverflow.com/comment/44009280
favorite count: 0
has answer: http://stackoverflow.com/a/27800995
has title: Run callback with all arguments
type: AnsweredQuestion
score: 3
has body: How can I run a callback function with all of its arguments when I don't know how many arguments are supplied. Take the following example: function tryMe (param1, param2) { alert(param1 + " and " + param2); } function callbackTester (callback) { callback (arguments[1], arguments[2]); } callbackTester (tryMe, "hello", "goodbye"); callbackTester (tryMe, "hello", "goodbye", "seeYouLater"); How can I run the callback from the callbackTester() function so that it will automatically call all of its arguments? Fiddle : http://jsfiddle.net/qj1rs29q/
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27800995
has answer: http://stackoverflow.com/a/27800467

angular-amd
tag name: angular-amd
type: Tag
tags question: http://stackoverflow.com/q/27642408

http://stackoverflow.com/q/27772323
has answer: http://stackoverflow.com/a/27772342
type: Question
has comment: http://stackoverflow.com/comment/43955599
has answer: http://stackoverflow.com/a/27772359
tagged with: javascript
score: 0
answer count: 3
has title: Anonymous functions - my perennial undertaker
possible better answer: http://stackoverflow.com/a/27772342
has answer: http://stackoverflow.com/a/27772351
has comment: http://stackoverflow.com/comment/43956197
has body: I have used anonymous functions with Java and now with JavaScript, and I still don't understand one thing. With JavaScript, we might have the following code: doSomething('omg',function(mark){ console.log(mark); }); function doSomething(printthis,callback){ console.log(printthis); callback(); } so we pass 'omg' and an anonymous function to the doSomething function. However, where does the parameter/argument 'mark' come from? How do we pass this anonymous function the mark parameter? I swear I have seen this done time and time again, but I don't know where the mark parameter comes from. Where?
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27772359

http://stackoverflow.com/comment/43827674
has text: Not clear at all. What are you trying to do?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27707753

ajax
tags question: http://stackoverflow.com/q/27701792
tags question: http://stackoverflow.com/q/27798264
tags question: http://stackoverflow.com/q/27706596
tags question: http://stackoverflow.com/q/27669397
tags question: http://stackoverflow.com/q/27698308
tags question: http://stackoverflow.com/q/27802396
tags question: http://stackoverflow.com/q/27730150
tags question: http://stackoverflow.com/q/27725141
tags question: http://stackoverflow.com/q/27714716
tags question: http://stackoverflow.com/q/27779668
tags question: http://stackoverflow.com/q/27764648
tags question: http://stackoverflow.com/q/27721100
tags question: http://stackoverflow.com/q/27767550
tags question: http://stackoverflow.com/q/27774544
tags question: http://stackoverflow.com/q/27653704
tags question: http://stackoverflow.com/q/27795167
tags question: http://stackoverflow.com/q/27752737
tags question: http://stackoverflow.com/q/27653531
tags question: http://stackoverflow.com/q/27668677
tags question: http://stackoverflow.com/q/27735535
tags question: http://stackoverflow.com/q/27648131
tags question: http://stackoverflow.com/q/27688830
tags question: http://stackoverflow.com/q/27640872
tags question: http://stackoverflow.com/q/27644683
tags question: http://stackoverflow.com/q/27676052
tags question: http://stackoverflow.com/q/27724814
tags question: http://stackoverflow.com/q/27785453
tags question: http://stackoverflow.com/q/27781948
tags question: http://stackoverflow.com/q/27763428
tags question: http://stackoverflow.com/q/27753393
tags question: http://stackoverflow.com/q/27677351
tags question: http://stackoverflow.com/q/27743465
tags question: http://stackoverflow.com/q/27741640
tags question: http://stackoverflow.com/q/27733498
tags question: http://stackoverflow.com/q/27767766
tags question: http://stackoverflow.com/q/27682084
tags question: http://stackoverflow.com/q/27740631
tags question: http://stackoverflow.com/q/27660283
tags question: http://stackoverflow.com/q/27760693
tags question: http://stackoverflow.com/q/27668073
tags question: http://stackoverflow.com/q/27799915
tags question: http://stackoverflow.com/q/27728667
type: Tag
tags question: http://stackoverflow.com/q/27649487
tags question: http://stackoverflow.com/q/27770968
tags question: http://stackoverflow.com/q/27791953
tags question: http://stackoverflow.com/q/27699425
tags question: http://stackoverflow.com/q/27732858
tags question: http://stackoverflow.com/q/27709963
tags question: http://stackoverflow.com/q/27641131
tags question: http://stackoverflow.com/q/27763919
tags question: http://stackoverflow.com/q/27737961
tags question: http://stackoverflow.com/q/27746142
tags question: http://stackoverflow.com/q/27758155
tags question: http://stackoverflow.com/q/27792145
tags question: http://stackoverflow.com/q/27695909
tags question: http://stackoverflow.com/q/27665067
tags question: http://stackoverflow.com/q/27797142
tags question: http://stackoverflow.com/q/27716986
tags question: http://stackoverflow.com/q/27693066
tags question: http://stackoverflow.com/q/27785991
tags question: http://stackoverflow.com/q/27792335
tags question: http://stackoverflow.com/q/27682755
tags question: http://stackoverflow.com/q/27759958
tags question: http://stackoverflow.com/q/27788562
tags question: http://stackoverflow.com/q/27759168
tags question: http://stackoverflow.com/q/27733843
tags question: http://stackoverflow.com/q/27713754
tags question: http://stackoverflow.com/q/27707787
tags question: http://stackoverflow.com/q/27758209
tags question: http://stackoverflow.com/q/27670623
tags question: http://stackoverflow.com/q/27685953
tags question: http://stackoverflow.com/q/27735104
tags question: http://stackoverflow.com/q/27783768
tags question: http://stackoverflow.com/q/27798899
tags question: http://stackoverflow.com/q/27759380
tags question: http://stackoverflow.com/q/27773000
tags question: http://stackoverflow.com/q/27762526
tags question: http://stackoverflow.com/q/27710787
tags question: http://stackoverflow.com/q/27747061

http://stackoverflow.com/comment/43734511
has text: Why are you passing an array as the `url` argument to `require`? The function expects it to be a single URL.
score: 0
comment on: http://stackoverflow.com/q/27659371
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27688633
accepted answer: http://stackoverflow.com/a/27688811
has comment: http://stackoverflow.com/comment/43790665
upvote count: 1
type: AnsweredQuestion
has title: Save Canvas as Image Internet Explorer
linked to: http://stackoverflow.com/q/15931341
has answer: http://stackoverflow.com/a/27688811
type: Question
has body: I've built a couple of web resources to add signature functionality to a Microsoft Dynamics CRM 2011 form one bit built in silverlight as a file uploader etc. and the other in javascript and HTML to do the signature on the screen and save as an image but the code only works in google chrome. I've done some reading around looked on endless amounts of stackoverflow threads but can't find any answers. Is there anyway in which I can somehow either save the canvas image in IE, the way the current solution already works in chrome Open up a new window so the canvas image appears and can be right clicked and saved I've tried doing both of the above already but had no luck. It has to be in javascript also Choose Color Eraser Download
tagged with: canvas
has comment: http://stackoverflow.com/comment/43790687
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
tagged with: todataurl
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27789783
has comment: http://stackoverflow.com/comment/43990452
linked to: http://stackoverflow.com/q/1041399
tagged with: javascript
has title: Detect DIV Only Background Image Click
has comment: http://stackoverflow.com/comment/43989855
score: 0
has comment: http://stackoverflow.com/comment/43994230
upvote count: 1
has body: When using the CSS3 Background-size contain and background center in a div how can I differentiate in JavaScript whether the div or the actual image was clicked? Please see the question in jsfiddle EDIT As indicated in the comment section, please notice that I'm sticking to this approach because the CSS3 styling of the div makes my life so easy because it properly aligns and centers the image in the div. Nevertheless, any other code that achieves the same result is welcome.
favorite count: 0
answer count: 0
type: UnansweredQuestion
tagged with: css
downvote count: 1
has comment: http://stackoverflow.com/comment/43989728
type: Question

storage
tag name: storage
tags question: http://stackoverflow.com/q/27646203
type: Tag

http://stackoverflow.com/a/27671931
answers question: http://stackoverflow.com/q/27671922
has body: Because charcopy is not a copy, it is a reference to the original. You need to clone it with slice() var charcopy = chars.slice(0);
score: 0
type: Answer

http://stackoverflow.com/comment/43865190
has text: `Server Side` | `Client Side` two different Sides!, pretty simple
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27726573
score: 1

http://stackoverflow.com/comment/43867757
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27727855
has text: Yes , I will create a fiddle and post it. Thank you .

http://stackoverflow.com/q/27759809
type: Question
possible better answer: http://stackoverflow.com/a/27759890
has answer: http://stackoverflow.com/a/27759890
tagged with: arrays
accepted answer: http://stackoverflow.com/a/27759925
tagged with: javascript
tagged with: jquery
has body: Goal: 1) Create a string using the ID attributes of several elements. 2) Push that string to an array. 3) Check to see if the string in the array forms a particular word -- in this case, "idaho". Problem: I can only seem to verify that a particular character is in the array. If I use more than one character in the "value" of "$.inArray", it returns false. Question: How can I verify that the string in the array forms the word "idaho" instead of just verifying that the string contains an "i" or "d" or "a", etc.? This FIDDLE works, but only because it's looking for an "i" instead of "idaho". I've done a lot of research on this, but can't get it to work. Thanks for helping a noob! var piecesArray = []; var ids = $('.pieces').map(function() { piecesArray.push(this.id); }); piecesArray = piecesArray.join(''); if ($.inArray('i', piecesArray) !==-1){ alert(piecesArray); }
has comment: http://stackoverflow.com/comment/43930689
downvote count: 0
favorite count: 0
has title: Find string using JQuery.inArray()
has answer: http://stackoverflow.com/a/27759930
answer count: 5
has comment: http://stackoverflow.com/comment/43930742
upvote count: 1
has answer: http://stackoverflow.com/a/27759925
has answer: http://stackoverflow.com/a/27760007
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27759913
score: 1

http://stackoverflow.com/q/27773979
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27774063
tagged with: regex
has comment: http://stackoverflow.com/comment/43959300
has comment: http://stackoverflow.com/comment/43959475
score: 3
downvote count: 0
has body: I wanted to change all the simple quotes ("…") of a string to smart quotes (“…”): str.replace(/"/g,'“'); But then I realized that, in order to do it, I have to match the opening and closing quote, something like this: str.replace(/REGEX_FOR_OPENING_QUOTES/g,'“'); str.replace(/REGEX_FOR_CLOSING)_QUOTES/g,'”'); What regex should I use in this case?
has comment: http://stackoverflow.com/comment/43958813
type: Question
has comment: http://stackoverflow.com/comment/43959030
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/27778674
answer count: 3
has title: Matching opening and closing quote in JavaScript (simple quotes)
has comment: http://stackoverflow.com/comment/43958676
has comment: http://stackoverflow.com/comment/43959614
favorite count: 0
linked to: http://stackoverflow.com/q/2202811
has answer: http://stackoverflow.com/a/27774207

http://stackoverflow.com/comment/43990195
has text: @caleb.breckon, thats a broken link. Also, I basically redid all of the alerts to check if they were outside its if statement. http://jsfiddle.net/alienc/f6oq1sf1/9/ That is a jsfiddle of the thing and If you check that box and type a string or ANY number into the input field, it goes through.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27783852
type: Comment

http://stackoverflow.com/q/27708509
score: 0
answer count: 2
has title: Updating multiple id in Javascript
has comment: http://stackoverflow.com/comment/43828886
tagged with: drop-down-menu
tagged with: jquery
has comment: http://stackoverflow.com/comment/43828878
has comment: http://stackoverflow.com/comment/43828895
tagged with: http://stackoverflow.com/tag/html
has body: I'm update few text in a page using based on dropdown selection ID, but only the first element ID changes. Using different ID's work but was hoping there is an easier solution. I am using twitter-bootstrap-3 for my dropdown menu. Here's the HTML: San Jose Silicon Valley New York City Paris Silicon Valley Tokyo Now we'll talk about and javascript document.getElementById("SelectName").innerHTML = "San Francisco"; $('#myCitylist li').on('click', function(){ document.getElementById("SelectName").innerHTML = $(this).text(); }); document.getElementById("SelectName").innerHTML = "San Francisco"; Here's the code : http://jsfiddle.net/ub1g7fw6/
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
has answer: http://stackoverflow.com/a/27708637
accepted answer: http://stackoverflow.com/a/27708637
possible better answer: http://stackoverflow.com/a/27709046
has answer: http://stackoverflow.com/a/27709046
type: Question
has comment: http://stackoverflow.com/comment/43828813
tagged with: javascript

http://stackoverflow.com/comment/43849624
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27718961
has text: Not sure about `result[j] + dataRows[i][j] || dataRows[i][j];`. If the interim total comes to zero (i.e. `result[j] + dataRows[i][j] == 0`), you'll assign `dataRows[i][j]`.
score: 0

http://stackoverflow.com/a/27767354
upvote count: 1
has comment: http://stackoverflow.com/comment/43945244
downvote count: 0
has comment: http://stackoverflow.com/comment/43945419
has body: In IE, document.getElementsByName(...)[0] is interpreted as document.getElementById(...), the document.getElementsByName function Gets a collection of objects based on the value of the NAME or ID attribute. So, short answer, it just won't work. I'd recommend changing all name="something" attributes into class="something" attributes, and then use: document.getElementsByClassName(something) Example: var ifr = document.getElementsByClassName("frame1")[0]; // ^^ this code will get vvthis iframe &lt;iframe class="frame1" src=""&gt;&lt;/iframe&gt;
has comment: http://stackoverflow.com/comment/43945320
has comment: http://stackoverflow.com/comment/43945606
accepted answer of: http://stackoverflow.com/q/27767243
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27767243
type: Answer
has comment: http://stackoverflow.com/comment/43945976
has comment: http://stackoverflow.com/comment/43945739
has comment: http://stackoverflow.com/comment/43945888
score: 1

http://stackoverflow.com/comment/49209704
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27649658
type: QuestionComment
has text: You have included ng-resource twice

http://stackoverflow.com/q/27759280
tagged with: css
favorite count: 0
upvote count: 2
tagged with: twitter-bootstrap
has body: I have this form to manage an article. In 'action', I select article and choose either approve, archive, or delete. from the select box. Then I click the accept button. HTML: Archive approve Delete Article 1 Article 2 Article 3 Article 4 delete Are you sure? Delete Cancel I've added a bootstrap confirm modal bootstrap like this : $('button[name="remove_levels"]').on('click', function (e) { var $form = $(this).closest('form'); e.preventDefault(); $('#confirm').modal({ backdrop: 'static', keyboard: false }) .one('click', '#delete', function (e) { $form.trigger('submit'); }); }); This worked for the accept button, but Only after I choose delete and select an article from the list, I need to show the confirm modal box. How can I create this behaviour using jQuery and a bootstrap modal box? JSFIDDLE DEMO
has answer: http://stackoverflow.com/a/27759712
downvote count: 1
type: AnsweredQuestion
score: 1
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27759712
possible better answer: http://stackoverflow.com/a/27760535
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27760535
has comment: http://stackoverflow.com/comment/43930357
has comment: http://stackoverflow.com/comment/43930448
has title: show confirm delete box from select box

http://stackoverflow.com/comment/43813332
score: 0
has text: yes I'm expecting pg3..
comment on: http://stackoverflow.com/q/27683990
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27737720
has comment: http://stackoverflow.com/comment/43886845
has title: Dynamically change the font size by jQuery
has answer: http://stackoverflow.com/a/27737901
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/15649244
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43886895
tagged with: css
has body: I have data coming in JSON format and I need to render the data on the Web browser. There will be many div containers where I need to render the text also. All the div containers may be of different dimensions. The text that goes inside this div container will also be dynamic. I need to set the font size in such a way that, the text should be big enough occupying as much as possible space inside the div container and also text should not be clipped. The challenge here is the text length. If it is a bigger text, then the font size should automatically reduce so that it will still fit inside the div container without data being clipped. Please let me know if there is any way of achieving this.
score: 2
has answer: http://stackoverflow.com/a/27737845
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/43714615
has text: you need to wrap this part in a block that runs after dom loads, the snippet loads fast but your page loads slower and the button is not found by javascript when the script executes
comment on: http://stackoverflow.com/a/27648594
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43808306
has text: This is the sad reality of the accumulation of rounding errors. Also, see https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing because the 1+1px borders at each size also added to the 10% width/height.
comment on: http://stackoverflow.com/q/27697547
score: 2
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27708301
has body: I'm trying to use the angular-spinner directive in my app. Since I'm using typescript, I wanted to create a definition file for it. (I know there's one from definitelyTyped, however it's not available using bower anymore and I don't want to use another package manager) Client/support/angular-spinner.d.ts interface ISpinnerService { spin(key: string): void; stop(key: string): void; } Client/_references.ts /// &lt;reference path="../bower_components/dt-angular/angular.d.ts" /&gt; /// &lt;reference path="../bower_components/dt-angular/angular-route.d.ts" /&gt; /// &lt;reference path="../bower_components/dt-jquery/jquery.d.ts" /&gt; /// &lt;reference path="../bower_components/dt-angular-ui-bootstrap/angular-ui-bootstrap.d.ts" /&gt; /// &lt;reference path="support/angular-spinner.d.ts" /&gt; Client/app/app.ts /// &lt;reference path="../_references.ts" /&gt; module App { var dependencies = [ "ngRoute", "ui.bootstrap", "angularSpinner", ]; ... Controller /// &lt;reference path="../../_references.ts" /&gt; ... constructor(spinnerService: ISpinnerService) { ... } When I run grunt-tsng, the following error occurs: Warning: Error: Can't resolve dependency for controller XXX with name ISpinnerService Use --force to continue. Did I missed something?
tagged with: bower
has comment: http://stackoverflow.com/comment/43847664
type: AnsweredQuestion
tagged with: typescript
has answer: http://stackoverflow.com/a/27714019
has comment: http://stackoverflow.com/comment/43840148
type: Question
has comment: http://stackoverflow.com/comment/43835445
tagged with: javascript
tagged with: gruntjs
score: 0
answer count: 1
has title: Typescript definition file not being recognized?
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27714019

http://stackoverflow.com/comment/95136794
comment on: http://stackoverflow.com/a/27736383
type: Comment
has text: @AufgeschissenerKunde The issue isn't whether the async option is used explicitly or not. The warning only appears when you request synchronous AJAX. I never see the warning from my `$.ajax` calls.
score: 1
type: AnswerComment

http://stackoverflow.com/q/27740692
has title: request stalled for a long time occasionally in chrome
type: UnansweredQuestion
tagged with: google-chrome
has answer: http://stackoverflow.com/a/70180892
type: Question
tagged with: network-programming
score: 73
upvote count: 73
tagged with: javascript
has answer: http://stackoverflow.com/a/29732252
has comment: http://stackoverflow.com/comment/47516138
has comment: http://stackoverflow.com/comment/47488547
answer count: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/49717553
has comment: http://stackoverflow.com/comment/49693993
has answer: http://stackoverflow.com/a/30772776
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47703906
has comment: http://stackoverflow.com/comment/58776771
has body: Ajax request occasionally stalled for a long time in chrome. I finally managed to reproduced it and save all related data necessary to post here if anyone could help me out. The timeline from Chrome Dev Tool shows the request stalled for 42.62s as the following screen capture shows: and within the chrome://net-internals/#events (for the events log please head to the end) page I found the most time is cost by two events: +HTTP_TRANSACTION_READ_HEADERS [dt=21301] +HTTP_TRANSACTION_READ_HEADERS [dt=21304] both get ERR_CONNECTION_RESET. I think the error is the reason why the request stalled for so long. Any one could explain the errors? FOLLOWING IS THE EVENTS LOG FOR THE REQUEST, I also export the full events as json you can get from here then restore within the Chrome chrome://net-internals/#events page. note the request url is internal so maybe cant access from public network: 193486: URL_REQUEST http://qa.tieba.baidu.com/release/getReleaseHistory?projectId=fum1.0.593 Start Time: 2015-01-02 17:51:05.323 t= 1 [st= 0] +REQUEST_ALIVE [dt=42741] t= 1 [st= 0] URL_REQUEST_DELEGATE [dt=0] t= 1 [st= 0] +URL_REQUEST_START_JOB [dt=42740] --&gt; load_flags = 339804160 (BYPASS_DATA_REDUCTION_PROXY | MAYBE_USER_GESTURE | REPORT_RAW_HEADERS | VERIFY_EV_CERT) --&gt; method = "GET" --&gt; priority = "LOW" --&gt; url = "http://qa.tieba.baidu.com/release/getReleaseHistory?projectId=fum1.0.593" t= 2 [st= 1] URL_REQUEST_DELEGATE [dt=0] t= 2 [st= 1] HTTP_CACHE_GET_BACKEND [dt=0] t= 2 [st= 1] HTTP_CACHE_OPEN_ENTRY [dt=0] t= 2 [st= 1] HTTP_CACHE_ADD_TO_ENTRY [dt=0] t= 2 [st= 1] HTTP_CACHE_READ_INFO [dt=0] t= 2 [st= 1] URL_REQUEST_DELEGATE [dt=0] t= 2 [st= 1] +HTTP_STREAM_REQUEST [dt=2] t= 4 [st= 3] HTTP_STREAM_REQUEST_BOUND_TO_JOB --&gt; source_dependency = 193488 (HTTP_STREAM_JOB) t= 4 [st= 3] -HTTP_STREAM_REQUEST t= 4 [st= 3] +HTTP_TRANSACTION_SEND_REQUEST [dt=0] t= 4 [st= 3] HTTP_TRANSACTION_SEND_REQUEST_HEADERS --&gt; GET /release/getReleaseHistory?projectId=fum1.0.593 HTTP/1.1 Host: …
has comment: http://stackoverflow.com/comment/47544901

http://stackoverflow.com/comment/43762718
comment on: http://stackoverflow.com/a/27673844
type: AnswerComment
score: 0
type: Comment
has text: $.each(min_chats, function(index,value) { alert(index+value); });

http://stackoverflow.com/a/27718843
type: Answer
has comment: http://stackoverflow.com/comment/43849326
score: 2
type: AcceptedAnswer
has body: To access the classes containing a specific text at the beggining: $("[class^=cd]") and To access the classes containing a specific text at the end: $("[class$=cd]")
accepted answer of: http://stackoverflow.com/q/27718802
downvote count: 0
has comment: http://stackoverflow.com/comment/43849734
answers question: http://stackoverflow.com/q/27718802
upvote count: 2

http://stackoverflow.com/comment/43935009
score: 1
comment on: http://stackoverflow.com/q/27761829
type: QuestionComment
has text: If you used CSS transitions and media queries all you would need to do is toggle a class on your nav. Let the media queries determine what to show/hide
type: Comment

http://stackoverflow.com/q/27682680
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43789257
answer count: 1
tagged with: backbone.js
tagged with: requirejs
has answer: http://stackoverflow.com/a/27685591
tagged with: underscore.js
type: UnansweredQuestion
has title: ajaxPrefilter with Backbone
type: Question
has body: I develop a project using backbone, underscore, require .js and REST API. I've got error Cross-Origin Request Blocked The Same Origin Policy disallows reading the remote resource at... NOTE : I've configured Access-Control-Allow in server side already. Still, the error still appear. I found a solution, using ajaxPrefilter, then here I've tried in my project : router.js : start: function() { Backbone.history.start({pushState: true}); }, initialize: function() { $.ajaxPrefilter( function( options, originalOptions, jqXHR ) { options.url = options.url; }); } Here is my backbone view : var _wl = new MyModel(); _wl.save(_item,{ success: function(res) { console.log(res); } }); I still got `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://example.com/api/MyWebs. This can be fixed by moving the resource to the same domain or enabling CORS. Could any one tell me what did I wrong here? Any helps and ideas would be appreciated.

http://stackoverflow.com/q/27665598
has comment: http://stackoverflow.com/comment/43746338
tagged with: javascript
tagged with: jquery
has title: onclick method not working jquery
has comment: http://stackoverflow.com/comment/43746340
has answer: http://stackoverflow.com/a/27665619
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43746339
type: AnsweredQuestion
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/43746402
has comment: http://stackoverflow.com/comment/43746349
type: Question
has comment: http://stackoverflow.com/comment/43746366
accepted answer: http://stackoverflow.com/a/27665619
has comment: http://stackoverflow.com/comment/43746336
score: 0
has comment: http://stackoverflow.com/comment/43746374
has body: i am trying to append a anchor tag when user select's an option from select and its appending the anchor tag properly when user select's any option from select. code for appending anchor tag: $(function () { //others codes ...... $('#anchor_placeholder').append( "&lt;a class='btn btn-info btn-xs' onClick='placeholderclick("+$(option).val()+")'&gt;" + $(option).val() + "&lt;/a&gt;" ); }); function placeholderclick(value) { alert(value); } now when i click on a appended anchor link its does not show me any alert message, but if i remove the parameters of placeholderclick("+$(option).val()+") from the append function above then its showing me alert... i am wondering how can i alert the parameter value (parameter values comes from append method) please suggest or help me to solve this issue, sorry for my bad english, thanks in advance.
answer count: 1

http://stackoverflow.com/comment/43871722
has text: @Mouser. Ok, Thanks once agiain :)
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27704708

http://stackoverflow.com/comment/44846648
type: AnswerComment
type: Comment
has text: For the JS interop call, take a look on the skyscanner article on my OP. http://pastebin.com/25P8ugnS As you can see on the pastbin, the Javascript code created by dart2js is optimized to be executed faster than "regular" JS. But I don't know if I can still have interaction between iOS/dart2js code and Android/dart2js code.
comment on: http://stackoverflow.com/a/27735075
score: 0

http://stackoverflow.com/q/27688609
has comment: http://stackoverflow.com/comment/43790588
accepted answer: http://stackoverflow.com/a/27688783
has answer: http://stackoverflow.com/a/27688653
has comment: http://stackoverflow.com/comment/43790692
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27688653
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27688783
tagged with: javascript
has title: How to delay the load of an tag in javascript/html
score: 0
has body: I have a problem that some link we show is separeted from the rest of the page itself, so the link showes up immediatly as you open the page but the page takes 2-3 seconds to load, I'm trying to delay the link (in this example it's google) so it will show up a few seconds after the page is loaded. am I getting close? Delay export link
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27723498
downvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27723850
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43859362
type: AnsweredQuestion
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/43859296
tagged with: dom
accepted answer: http://stackoverflow.com/a/27723850
type: Question
tagged with: angularjs-directive
has title: Angular Directive DOM manipulation behavior
tagged with: javascript
has comment: http://stackoverflow.com/comment/43859551
has body: I'm having some unexpected behavior with DOM manipulation in a directive. I have two icons and would like icons, a phone and email and would like to show their contents when hovered over. Which should be simple enough but I'm having trouble traversing the DOM to reach the child elements. Here's my Directive: app.directive('contact', function () { return { restrict: 'E', scope: { email:'@', phone: '@', extension: '@' }, link: function (scope, element, attrs) { var el = element; var kids = $(el).children(); var emailChild = $(kids[0]); var email = emailChild.context.children[0]; element.children().bind('mouseenter', function() { console.log(this); console.log(emailChild.context.children[0]); console.log(email); }); }, template: '&lt;div class="contact_methods"&gt;' + '&lt;div ng-if="email" class="email" href="#"&gt;' + '&lt;div class="contact_info_email more_info" style="display:none;"&gt;&lt;a ng-href="mailto:{{email}}"&gt;{{email}}&lt;/a&gt;&lt;/div&gt;' + '&lt;/div&gt;&amp;nbsp;&amp;nbsp;' + '&lt;div ng-if="phone" class="phone" href="#"&gt; ' + '&lt;div class="contact_info_phone more_info"&gt;{{phone}} ext.{{extension}}&lt;/div&gt;' + '&lt;/div&gt;' + '&lt;/div&gt;' } }); Here is the unexpected behavior: console.log(this); console.log(emailChild.context.children[0]); console.log(email); These evaluate to: &lt;div class=​"contact_methods"&gt;​…​&lt;/div&gt;​ &lt;div ng-if=​"email" class=​"email ng-scope" href=​"#"&gt;​…​&lt;/div&gt;​ undefined email outputs undefined; however, it's contents are the line above it? Also I am unable to drill down into it like element.children().children()? The hover stops working.

http://stackoverflow.com/comment/43737903
type: QuestionComment
has text: Use any search engine, like google.com.
comment on: http://stackoverflow.com/q/27660905
score: 0
type: Comment

http://stackoverflow.com/a/44098664
upvote count: 8
answers question: http://stackoverflow.com/q/27641731
has body: As the time passes you should embrace a more functional approach in which you should avoid data mutations and write small, single responsibility functions. With the ECMAScript 6 standard, you can enjoy functional programming paradigm in JavaScript with the provided map, filter and reduce methods. You don't need another lodash, underscore or what else to do most basic things. Down below I have included some proposed solutions to this problem in order to show how this problem can be solved using different language features: Using ES6 map: const replace = predicate =&gt; replacement =&gt; element =&gt; predicate(element) ? replacement : element const arr = [ { id: 1, name: "Person 1" }, { id:2, name:"Person 2" } ]; const predicate = element =&gt; element.id === 1 const replacement = { id: 100, name: 'New object.' } const result = arr.map(replace (predicate) (replacement)) console.log(result) Recursive version - equivalent of mapping: Requires destructuring and array spread. const replace = predicate =&gt; replacement =&gt; { const traverse = ([head, ...tail]) =&gt; head ? [predicate(head) ? replacement : head, ...tail] : [] return traverse } const arr = [ { id: 1, name: "Person 1" }, { id:2, name:"Person 2" } ]; const predicate = element =&gt; element.id === 1 const replacement = { id: 100, name: 'New object.' } const result = replace (predicate) (replacement) (arr) console.log(result) When the final array's order is not important you can use an object as a HashMap data structure. Very handy if you already have keyed collection as an object - otherwise you have to change your representation first. Requires object rest spread, computed property names and Object.entries. const replace = key =&gt; ({id, ...values}) =&gt; hashMap =&gt; ({ ...hashMap, //original HashMap [key]: undefined, //delete the replaced value [id]: values //assign replacement }) // HashMap &lt;-&gt; array conversion const toHashMapById = array =&gt; array.reduce( (acc, { id, ...values }) =&gt; ({ ...a…
score: 8
type: Answer
downvote count: 0

http://stackoverflow.com/comment/43836226
comment on: http://stackoverflow.com/q/27712004
score: 0
type: Comment
type: QuestionComment
has text: Already is ok in the console :/ When i put an alert in my getTimes function i have 25 to. :/

http://stackoverflow.com/comment/44006488
has text: With out looking at the code, I'm not 100% sure all of the statements here are correct. In general the idea behind hot deployments is to keep the server from restarting. However in order to do this your container needs to provide a mechanism by which to do this. With OpenShift it looks like the container to do that for a node.js application is supervisor. Thus making it a requirement for hot deployments to work.
comment on: http://stackoverflow.com/a/27794863
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43849791
score: 0
type: Comment
has text: I guess this answer is closer to what I anticipated. On the other hand the Hellhound's answer below seems to be closer the idiomatic javascript that most people are used to. Therefore potentially more helpful. Leaving that as accepted answer...
comment on: http://stackoverflow.com/a/27719067
type: AnswerComment

http://stackoverflow.com/a/27757255
has comment: http://stackoverflow.com/comment/43925603
type: Answer
has comment: http://stackoverflow.com/comment/43940971
has comment: http://stackoverflow.com/comment/43925356
answers question: http://stackoverflow.com/q/27757113
has body: Here's the problem: "content_scripts": [ { "matches": ["&lt;all_urls&gt;"], "js": ["jquery.js","login.js"] } ] A content_script is run in the context of the web page, not your pop up window. I'm guessing that this login.js script overrides the pop-up's. So if you get rid of this section, it should work.
score: 0

http://stackoverflow.com/comment/43770410
type: Comment
comment on: http://stackoverflow.com/a/27678040
type: AnswerComment
has text: That's a better option. How 'bout adding a Stack Snippet to keep the demo on-site (not that *also* linking to regex101's excellent explanation isn't great).
score: 0

http://stackoverflow.com/q/27677911
favorite count: 0
has title: PHP file upload - Not checking the file size
has answer: http://stackoverflow.com/a/27678247
upvote count: 2
tagged with: php
accepted answer: http://stackoverflow.com/a/27678247
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27678448
downvote count: 3
has answer: http://stackoverflow.com/a/27678448
has comment: http://stackoverflow.com/comment/43770230
type: Question
has comment: http://stackoverflow.com/comment/43770367
has comment: http://stackoverflow.com/comment/43770467
has comment: http://stackoverflow.com/comment/43770220
has comment: http://stackoverflow.com/comment/43770486
has comment: http://stackoverflow.com/comment/43770674
has comment: http://stackoverflow.com/comment/43779947
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/43770406
has comment: http://stackoverflow.com/comment/43771383
answer count: 2
has comment: http://stackoverflow.com/comment/43797386
has comment: http://stackoverflow.com/comment/43770333
has comment: http://stackoverflow.com/comment/43770361
has body: I'm trying to make a file upload form from two days but cant seem to get this to work. My code is checking the extension of the file but not checking the file size. I googled, tried different methods but unable to get this to work. Can someone help? Here's the code - <?php if(isset($_POST['carsubmit'])) { foreach($_POST as $key=>$val) ${$key}=addslashes($val); $allowed_filetypes = array('.jpg','.gif','.bmp','.png'); $max_filesize = 2097152; $upload_path = "resumes/"; $filename = $_FILES['attachresume']['name']; $file_tmp =$_FILES['attachresume']['tmp_name']; $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); $cardupcheck = "select * from `careers` where `email` = '$email'"; $cardupresult = mysql_query($cardupcheck); if(mysql_num_rows($cardupresult)==1) { ?> <?php } else { if(!in_array($ext,$allowed_filetypes)){ ?> <?php } else if($file_tmp > $max_filesize){ ?> <?php } else { move_uploaded_file($file_tmp,"resumes/".$filename); $carquery = "INSERT INTO `careers` (`name`, `email`, `phone`, `aoi`, `qual`, `resume`) VALUES ('$name', '$email', '$phone', '$aoi', '$qual', '$filename')"; $carresult = mysql_query($carquery); if($carresult) { ?> <?php } else { ?> <?php } } } } ?>

http://stackoverflow.com/comment/43989279
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27789611
has text: if you are planing in using that routes functionality some other places then you should create a module to contain a named function to perform the operation that way you can call the function simply invoking the module from any place in your app

http://stackoverflow.com/q/27713302
has answer: http://stackoverflow.com/a/27714095
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27714095
has title: Scroll body to first item in array from A-Z toggle
score: 0
has body: I have an A-Z toggle. I'm generating an alphabetized ul of data from a REST API. When I click on the A-Z toggle, I want the body to scroll to the first occurrence of a list item that matches the A-Z toggle character that was clicked. I've tried something similar the following: HTML: A Afoo Amoar Apoo JS: foo = ['Afoo', 'Amoar', 'Apoo']; // this is generated elsewhere in prod code $('a').on('click', function () { var alpha = $(this).text(); var res = []; for (var i=0, len=foo.length; i<len; i++) { if (foo[i].indexOf(alpha) === 0) { res.push(foo[i]); return res; } } $('body').animate({scrollTop: $("#" + res[0] + "").position().top + 24}, 650); }); I think the problem stems from where my return res; is and possibly how I'm calling $('#' +res[0]+ '') but I'm not entirely sure were to start troubleshooting that. Here's a jsfiddle Thanks for any help
has comment: http://stackoverflow.com/comment/43839209
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43839086
answer count: 1

http://stackoverflow.com/comment/51510016
comment on: http://stackoverflow.com/q/27789732
score: 0
type: Comment
type: QuestionComment
has text: Why not get the parent of the div you clicked on with $(element).parent() ?

http://stackoverflow.com/comment/43984416
has text: Added an example that uses TABLE (per-OP's-request) and a fix that prevents `null||undefined` issues: http://jsfiddle.net/n8nu6mo4/7/
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27786373
type: AnswerComment

http://stackoverflow.com/comment/43705224
comment on: http://stackoverflow.com/a/27642647
score: 0
type: Comment
has text: Check this one http://www.bootply.com/ORKO1x7JNj - I've added another z-index to .ui-draggable selector
type: AnswerComment

http://stackoverflow.com/comment/43918793
comment on: http://stackoverflow.com/q/27753848
type: Comment
type: QuestionComment
has text: I want absolutely no access to www. URLs. If the URL contains www., I want everyone to be redirected to non www. without loading the app. No exceptions at all. Same goes for https:// vs http://
score: 0

http://stackoverflow.com/q/27701055
downvote count: 0
has comment: http://stackoverflow.com/comment/43815383
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43825920
has comment: http://stackoverflow.com/comment/43815477
answer count: 0
score: 1
has body: So this is my pseudo code : var anotherFunction = function () { //do stuff 1 } scope.$watch("myFunction",function (){ eval("scope.myFunction = anoterFunction"); } scope.myFunction = function () { //do stuff 1 }; What is happening is that immediately after the eval the myFunction equals to anotherFunction, but right after the scope of that watch, the value goes back to its initial one! Any help here? It only happens sometimes tough, its kind of random, sometimes the value gets replaces sometimes it doesnt. Any idea why is angular behaving this way?
upvote count: 1
type: Question
tagged with: javascript
has title: AngularJS watcher changes the value of my function back to its original

http://stackoverflow.com/q/27658160
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27659311
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43733121
type: AnsweredQuestion
has body: I was tried to add forms using jQuery and it succeeded. This time I'm trying to show and hide some buttons(#remove_form, #add_form) but always not working:( my jQuery codes(referred this question's answer): $(document).ready(function(){ var index_num = 1; var max_num = 7; $("#add_form").click(function(e){ e.preventDefault(); if(index_num < max_num){ index_num++; $("#event").each(function(){ $(this).clone().insertAfter(this).attr("id","event" + index_num); $("#add_form" + index_num).css("display","none"); $("#remove_form" + index_num).css("display","inline"); }); } }); $("#remove_form" + index_num).click(function(e){ e.preventDefault(); $(this).parent(".row collapse").remove(); index_num--; }); }); +) I did not wrote "#add_form" button's css code. just this: #remove_form{ display: none; } HTML codes: example example example example example example +) HTML codes after clicking '#add_form' button: ... ... ... ... ... ... ... How can I solve this problem?
has comment: http://stackoverflow.com/comment/43732084
has answer: http://stackoverflow.com/a/27659311
tagged with: javascript
linked to: http://stackoverflow.com/q/19578111
type: Question
has comment: http://stackoverflow.com/comment/43732120
score: 0
has comment: http://stackoverflow.com/comment/43732445
has comment: http://stackoverflow.com/comment/43732800
has title: jQuery - failed show/hide buttons
answer count: 1

forms
tags question: http://stackoverflow.com/q/27647062
tags question: http://stackoverflow.com/q/27802823
tags question: http://stackoverflow.com/q/27802771
tags question: http://stackoverflow.com/q/27645578
tags question: http://stackoverflow.com/q/27727959
tags question: http://stackoverflow.com/q/27740641
tags question: http://stackoverflow.com/q/27687927
tags question: http://stackoverflow.com/q/27728753
tags question: http://stackoverflow.com/q/27743486
tags question: http://stackoverflow.com/q/27702866
tags question: http://stackoverflow.com/q/27741480
tags question: http://stackoverflow.com/q/27779916
type: Tag
tags question: http://stackoverflow.com/q/27668332
tags question: http://stackoverflow.com/q/27670798
tags question: http://stackoverflow.com/q/27801316
tags question: http://stackoverflow.com/q/27753054
tags question: http://stackoverflow.com/q/27748097
tags question: http://stackoverflow.com/q/27678487
tags question: http://stackoverflow.com/q/27660729
tags question: http://stackoverflow.com/q/27736316
tags question: http://stackoverflow.com/q/27784646
tags question: http://stackoverflow.com/q/27677575
tags question: http://stackoverflow.com/q/27691663
tags question: http://stackoverflow.com/q/27670017
tags question: http://stackoverflow.com/q/27790442
tags question: http://stackoverflow.com/q/27772009
tags question: http://stackoverflow.com/q/27690230
tags question: http://stackoverflow.com/q/27802453
tags question: http://stackoverflow.com/q/27693055
tags question: http://stackoverflow.com/q/27713745
tags question: http://stackoverflow.com/q/27738495
tags question: http://stackoverflow.com/q/27742999
tags question: http://stackoverflow.com/q/27727464
tags question: http://stackoverflow.com/q/27690223
tags question: http://stackoverflow.com/q/27676576
tags question: http://stackoverflow.com/q/27725011
tags question: http://stackoverflow.com/q/27710273
tags question: http://stackoverflow.com/q/27759499
tags question: http://stackoverflow.com/q/27708469
tags question: http://stackoverflow.com/q/27790795
tags question: http://stackoverflow.com/q/27744823
tags question: http://stackoverflow.com/q/27695538
tags question: http://stackoverflow.com/q/27712461
tags question: http://stackoverflow.com/q/27739811
tags question: http://stackoverflow.com/q/27701787
tags question: http://stackoverflow.com/q/27673479
tags question: http://stackoverflow.com/q/27800065
tags question: http://stackoverflow.com/q/27744470
tags question: http://stackoverflow.com/q/27666503
tags question: http://stackoverflow.com/q/27651847
tags question: http://stackoverflow.com/q/27785480
tags question: http://stackoverflow.com/q/27749305
tags question: http://stackoverflow.com/q/27652948
tags question: http://stackoverflow.com/q/27676912
tags question: http://stackoverflow.com/q/27686162
tags question: http://stackoverflow.com/q/27739801
tags question: http://stackoverflow.com/q/27718983
tags question: http://stackoverflow.com/q/27768133
tags question: http://stackoverflow.com/q/27680544
tags question: http://stackoverflow.com/q/27701620
tags question: http://stackoverflow.com/q/27697585
tags question: http://stackoverflow.com/q/27760480
tags question: http://stackoverflow.com/q/27640872
tags question: http://stackoverflow.com/q/27773568
tags question: http://stackoverflow.com/q/27754740
tags question: http://stackoverflow.com/q/27792887
tags question: http://stackoverflow.com/q/27755644
tags question: http://stackoverflow.com/q/27790374
tags question: http://stackoverflow.com/q/27693154
tags question: http://stackoverflow.com/q/27750780
tags question: http://stackoverflow.com/q/27707015
tags question: http://stackoverflow.com/q/27695606
tag name: forms
tags question: http://stackoverflow.com/q/27793522
tags question: http://stackoverflow.com/q/27714186
tags question: http://stackoverflow.com/q/27746009
tags question: http://stackoverflow.com/q/27693146
tags question: http://stackoverflow.com/q/27704828
tags question: http://stackoverflow.com/q/27669701

http://stackoverflow.com/comment/43935839
score: 0
type: QuestionComment
has text: check this answer: [jQuery Chosen not firing onchange event when value is changed through JS](http://stackoverflow.com/a/11166015/4381432)
type: Comment
comment on: http://stackoverflow.com/q/27759349

http://stackoverflow.com/q/27797337
type: AnsweredQuestion
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27797441
has comment: http://stackoverflow.com/comment/44003432
type: Question
has answer: http://stackoverflow.com/a/27797495
has comment: http://stackoverflow.com/comment/44003381
has answer: http://stackoverflow.com/a/27797652
has comment: http://stackoverflow.com/comment/44003625
score: 0
has title: Javascript Concatenate FirstName, LastName and Code
has body: I am trying to concatenate the first letter of both names onto the randomly generated code. var firstname = prompt("Please enter your first name."); var lastname = prompt ("Please enter your last name."); if (amountCorrect &gt;= 4){ alert("Your login Code for the store is: " + str(firstname,1,1) + str(lastname,1,1) + (generateCode())); // Do the generateCode function } else{ alert("You have not passed on this occasion. You will now be taken back to the homepage."); window.history.go(-1); // Go back a step } } function generateCode(){ var text = ""; var possible = "0123456789"; for( var i=0; i &lt; 4; i++ ){ text += possible.charAt(Math.floor(Math.random() * possible.length)); } return text; }
answer count: 3
accepted answer: http://stackoverflow.com/a/27797495
has answer: http://stackoverflow.com/a/27797441
tagged with: concatenation

http://stackoverflow.com/q/27757824
has title: Nodejs - prevent socket.io from dropping the frame rates
has comment: http://stackoverflow.com/comment/43926330
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43926699
has comment: http://stackoverflow.com/comment/43927005
tagged with: animation
has body: I'm trying to program some animations in html5 canvas. I need the animations to be reproduced on any other client connected to my server. So what I do is I send the function to be called and the arguments as a string and call eval() on the client side. That way the animation logic needs to be done only on one canvas, while the function calls that actually render things are executed by all clients. However, my frame rates drop drastically when I do this. I use socket.emit() to send signals to the server which in turn calls socket.broadcast.emit() to send the string to all clients. This is the rendering loop : var rf = function() { // clear background context.fillStyle = "#000"; context.fillRect(0, 0, width, height); socket.emit('action', 'clearScreen', "{}"); // mouse position to head towards var cx = (mousex - width / 2) + (width / 2), cy = (mousey - height / 2) + (height / 2); // update all stars var sat = Floor(Z * 500); // Z range 0.01 -&gt; 0.5 if (sat &gt; 100) sat = 100; for (var i=0; i&lt;units; i++) { var n = stars[i], // the star xx = n.x / n.z, // star position yy = n.y / n.z, e = (1.0 / n.z + 1) * 2; // size i.e. z if (n.px !== 0) { // hsl colour from a sine wave context.strokeStyle = "hsl(" + ((cycle * i) % 360) + "," + sat + "%,80%)"; context.lineWidth = e; context.beginPath(); socket.emit('action', 'context.beginPath', "{}"); context.moveTo(xx + cx, yy + cy); socket.emit('action', 'context.moveTo', "{\"a\": [" + (xx + cx) + "," + (yy + cy) + "]}"); context.lineTo(n.px + cx, n.py + cy); socket.emit('action', 'context.lineTo', "{\"a\": [" + (n.px + cx) + "," + (n.py + cy) + "]}"); context.stroke(); socket.emit('action', 'context.stroke', "{}"); } // update star position values with new settings n.px = xx; n.py = yy; n.z -= Z; // reset when star is out of the view field if (n.z &lt; Z || n.px &gt; width || n.py &gt; height) { // reset star resetstar(n); } } // colour cycle sinewave rotation cycle += 0.01; requestAnimFrame(rf); }; requestAnimFrame(rf); The…
tagged with: node.js
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27759048
has answer: http://stackoverflow.com/a/27759048
has comment: http://stackoverflow.com/comment/43926549
type: Question
has comment: http://stackoverflow.com/comment/43926672
answer count: 2
has answer: http://stackoverflow.com/a/27759757
tagged with: javascript
has comment: http://stackoverflow.com/comment/43926738
score: 0
accepted answer: http://stackoverflow.com/a/27759757
has comment: http://stackoverflow.com/comment/43926645

http://stackoverflow.com/a/27709617
has comment: http://stackoverflow.com/comment/43831117
score: 3
upvote count: 3
downvote count: 0
has body: Your syntax is incorrect for document.getElementByname . The correct function name is getElementsByName. It also returns a nodelist so your code should more appropriately be: function ClearFields() { document.getElementsByName("name")[0].value = ""; document.getElementsByName("bod")[0].value = ""; document.getElementsByName("ddn")[0].value = ""; document.getElementsByName("ssn")[0].value = ""; document.getElementsByName("gen")[0].value = ""; } You should only have one element with the ID of bn. I would also move away from using onclick, etc in your HTML and instead use a more modern technique: document.getElementById('bn').addEventListener('click', ClearFields , false); Hope that helps!
type: Answer
answers question: http://stackoverflow.com/q/27709330

http://stackoverflow.com/comment/43719133
score: 2
comment on: http://stackoverflow.com/q/27650979
type: Comment
type: QuestionComment
has text: Short answer is yes. Long answer is you should read [this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Values,_variables,_and_literals#Variable_scope), and [this](http://stackoverflow.com/a/500459/2782135), to get to know all you need about scopes in JavaScript.

http://stackoverflow.com/q/27669081
possible better answer: http://stackoverflow.com/a/27669104
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27669104
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/27669209
type: Question
has title: Regular Expression that matches any string of characters up to "/" Javascript
tagged with: javascript
has comment: http://stackoverflow.com/comment/43753046
has body: I have a Javascript function that loops through href navigation and matches it to the url location. If the two match then an "active" class is added. This works great, except for when someone goes to a page like "services/service1". How would I add the logic to look a string like "services/service1" or "blog/post1" and trim to just "services/" and "blog/"? Here is my current function scope.$on("$routeChangeSuccess", function (event, current, previous) { var location = current.$$route.originalPath; var selectionhref = element.children().find('a'); //Searches for match of routepath url and href, removes siblings active, adds active (function(){ element.children().each(function(index){ console.log(location); if($(selectionhref[index]).attr('href') == location){ $(this).siblings().removeClass('active'); $(this).addClass('active'); }; }); })() }); //routeChangeSuccess
answer count: 2
has comment: http://stackoverflow.com/comment/43752888
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27669209
tagged with: angularjs
tagged with: regex

http://stackoverflow.com/q/27655374
linked to: http://stackoverflow.com/q/27655470
has comment: http://stackoverflow.com/comment/44023192
tagged with: css
has comment: http://stackoverflow.com/comment/43783908
has comment: http://stackoverflow.com/comment/43754776
has answer: http://stackoverflow.com/a/28012845
has comment: http://stackoverflow.com/comment/44330640
type: Question
linked to: http://stackoverflow.com/q/25760079
has comment: http://stackoverflow.com/comment/44348502
tagged with: internet-explorer
upvote count: 9
has title: Sub-menu is hidden behind PDF type object ( issue in Internet explorer)
tagged with: javascript
linked to: http://stackoverflow.com/q/12911428
has comment: http://stackoverflow.com/comment/44033930
has comment: http://stackoverflow.com/comment/43727639
has comment: http://stackoverflow.com/comment/43730732
score: 9
has comment: http://stackoverflow.com/comment/44023013
has body: I have a object type tag in the page, which is used to show a pdf file. Everything is working fine, but in Internet Explorer my sub-menu is getting hidden behind the object tag. var objectTag = $('&lt;object&gt;&lt;/object&gt;') .attr({ data: sourceURL + '#nameddest=self&amp;page=1&amp;view=FitV' || '', type: mimeType || '' }) .css({ width: '100%', height: '100%', zindex:'1' }); Please find red highlighted area. I have tried many things. Please don't suggest z-index thing.
has comment: http://stackoverflow.com/comment/43728438
downvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43727178
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27801174
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44010997
downvote count: 0
has body: I have the following situation: I have a Javascript website where the user need to enter a username and a password and then the site make a ajax call to the Webserver. On the other site I have a Webserver running PHP which gets the parameters and checks if the username and password is right. Now my Problem: How to secure this process e.g: how to secure it if the website does not use https and the user submits his username and password? Is there any algorithm which can do this?
score: 1
favorite count: 0
type: Question
tagged with: javascript
upvote count: 1
has answer: http://stackoverflow.com/a/27801504
answer count: 1
accepted answer: http://stackoverflow.com/a/27801504
has comment: http://stackoverflow.com/comment/44011066
tagged with: jquery
has comment: http://stackoverflow.com/comment/44011034
tagged with: ajax
has title: How to secure my login credentials within an ajax call?

http://stackoverflow.com/q/27640622
linked to: http://stackoverflow.com/q/17759735
answer count: 1
linked to: http://stackoverflow.com/q/8155153
tagged with: javascript
linked to: http://stackoverflow.com/q/8173548
has comment: http://stackoverflow.com/comment/43702652
has title: Rails regex won't work, but Javascript regex does
tagged with: regex
has comment: http://stackoverflow.com/comment/43699969
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43700193
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/43702271
type: Question
linked to: http://stackoverflow.com/q/5978510
has answer: http://stackoverflow.com/a/27640715
has body: I've read this question and changed my rails model code accordingly: Regular expressions with validations in RoR 4 Here's my regex for my datetime in rails: /\A((19[7-9][0-9])|(2[0-9][0-9][0-9]))\/((0[1-9])|(1[0-2]))\/(([0-2][0-9])|(3[0-1]))\s(([0-1][0-9])|(2[0-4]))\:([0-5][0-9])\z/ This regex below works in javascript, though: /^((19[7-9][0-9])|(2[0-9][0-9][0-9]))\/((0[1-9])|(1[0-2]))\/(([0-2][0-9])|(3[0-1]))\s(([0-1][0-9])|(2[0-4]))\:([0-5][0-9])$/ I'm trying to pass a datetime string to them both, but I can't understand why it keeps failing. Here's the string: 2014/12/02 11:06 I thought my model code might be helpful: validates :start, presence: true, format: { :with =&gt; /\A((19[7-9][0-9])|(2[0-9][0-9][0-9]))\/((0[1-9])|(1[0-2]))\/(([0-2][0-9])|(3[0-1]))\s(([0-1][0-9])|(2[0-4]))\:([0-5][0-9])\Z/, :message =&gt; "must be in this format: YYYY/MM/DD HH:MM" } validates :finish, presence: true, format: { :with =&gt; /\A((19[7-9][0-9])|(2[0-9][0-9][0-9]))\/((0[1-9])|(1[0-2]))\/(([0-2][0-9])|(3[0-1]))\s(([0-1][0-9])|(2[0-4]))\:([0-5][0-9])\Z/, :message =&gt; "must be in this format: YYYY/MM/DD HH:MM" } Edit: I figured out what the issue is, but I still don't know how to fix it... For some reason when I submit my form the date 2014/12/24 16:19 is being cut down to just 2014. This then fails validation and throws the error. Can anyone help me figure this out?
accepted answer: http://stackoverflow.com/a/27640715
score: 0
has comment: http://stackoverflow.com/comment/43700068

http://stackoverflow.com/comment/43777651
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27681374
has text: Yes, I checked with firebug and it gets populated. the get(1) is a method of the account service. the 1 is the key.

datepicker
tags question: http://stackoverflow.com/q/27683983
tags question: http://stackoverflow.com/q/27721133
tags question: http://stackoverflow.com/q/27691231
tags question: http://stackoverflow.com/q/27687644
tags question: http://stackoverflow.com/q/27684385
tags question: http://stackoverflow.com/q/27703745
tags question: http://stackoverflow.com/q/27775457
tags question: http://stackoverflow.com/q/27801813
tag name: datepicker
tags question: http://stackoverflow.com/q/27736937
type: Tag
tags question: http://stackoverflow.com/q/27683731
tags question: http://stackoverflow.com/q/27798224
tags question: http://stackoverflow.com/q/27780504
tags question: http://stackoverflow.com/q/27655410
tags question: http://stackoverflow.com/q/27799271
tags question: http://stackoverflow.com/q/27798682
tags question: http://stackoverflow.com/q/27782606
tags question: http://stackoverflow.com/q/27655561
tags question: http://stackoverflow.com/q/27758379
tags question: http://stackoverflow.com/q/27725333
tags question: http://stackoverflow.com/q/27773322
tags question: http://stackoverflow.com/q/27758274
tags question: http://stackoverflow.com/q/27741007

http://stackoverflow.com/a/27785713
score: 1
has body: You should use a regular expression with a wildcard in your replace call: $(this).text().replace(/coords=".*"/gi, 'coords="..."'); This will work with both an empty and a set coords attribute.
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27785518
downvote count: 0

http://stackoverflow.com/comment/43917683
type: AnswerComment
comment on: http://stackoverflow.com/a/27753433
score: 0
type: Comment
has text: Where is '/' . Your are taking \

http://stackoverflow.com/comment/43824534
score: 0
has text: This is much better, but: hundreds of SO users have explained me the meaning of "not working", still I don't know what it exactly means. Can you please explain too ...
comment on: http://stackoverflow.com/q/27705759
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27735239
has comment: http://stackoverflow.com/comment/43903929
accepted answer of: http://stackoverflow.com/q/27734661
type: Answer
has comment: http://stackoverflow.com/comment/43882650
has body: I think I'm going to try a different approach to this problem. I also think it'll be quicker than some of the solutions proposed (though we'd need of course to test it and benchmark it). First off, why don't we take advantage of the hash oriented nature of javascript arrays and objects? We could create an object containing the relations (in order to create a kind of a map) and store in a new array those relationships that hasn't been stored yet. With this approach there's no problem about objects either, we just request for an identifier or hash or whatever for every object. This identifier must make the relationship between them possible. UPDATE The script now controls the possibility of repeated elements f.e [[a,b],[a,b]] The script now controls the possibility of elements with the same object repeated f.e [[a,a],[a,a][a,a]] would return [a,a] The code: var temp = {}, massive_arr = [['a','b'],['a','c'],['a','d'], ['b','a'],['b','c'],['b','d'],['c','a'],['c','b'],['c','d']], final_arr = [], i = 0, id1, id2; for( ; i &lt; massive_arr.length; i++ ) { id0 = objectIdentifier(massive_arr[i][0]);// Identifier of first object id1 = objectIdentifier(massive_arr[i][1]);// Identifier of second object if(!temp[id0]) {// If the attribute doesn't exist in the temporary object, we create it. temp[id0] = {}; temp[id0][id1] = 1; } else {// if it exists, we add the new key. temp[id0][id1] = 1; } if( id0 === id1 &amp;&amp; !temp[id0][id1+"_bis"] ) {// Especial case [a,a] temp[id0][id1+"_bis"] = 1; final_arr.push(massive_arr[i]); continue;// Jump to next iteration } if (!temp[id1]) {// Store element and mark it as stored. temp[id1] = {}; temp[id1][id0] = 1; final_arr.push(massive_arr[i]); continue;// Jump to next iteration } if (!temp[id1][id0]) {// Store element and mark it as stored. temp[id1][id0] = 1; final_arr.push(massive_arr[i]); } } console.log(final_arr); function objectIdentifier(obj) { return obj;// You must return a valid identifier for the object. For instance, obj.id or…
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43889984
has comment: http://stackoverflow.com/comment/43884868
has comment: http://stackoverflow.com/comment/43903808
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27734661
has comment: http://stackoverflow.com/comment/43883245

http://stackoverflow.com/q/27768679
has comment: http://stackoverflow.com/comment/43948044
answer count: 1
favorite count: 0
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/43948060
has answer: http://stackoverflow.com/a/27768722
type: Question
has body: I have a 1 page profile and split it into 3 parts. My code does not seem to work properly. When I click "next" from the first page, it goes fine to the second page. But I cannot seem to return to the page page by clicking previous. Likewise I cannot seem to go to the third page and from the third page to previous page(page 2). Any idea why? $('#page1').show(); $('#page2').hide(); $('#page3').hide(); $(document).on('click', '#last', function() { $('#page3').show(); $('#page1').hide(); $('#page2').hide(); $('#profile-prev').show(); }); $(document).on('click', '#prev1', function() { $('#page1').show(); $('#page2').hide(); $('#page3').hide(); $('#prev1').hide(); $('#profile-next').show(); }); page 1 page 2 page 3 Previous | Next
has title: Click does not work after setting the setting the id in span inside the div
upvote count: 0
score: -2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27802014
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27802152
has title: Writing a switch that checks $(this) #id as case
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has body: So I have a menu bar which is basically a set of blocks inside a div. I want to write a jquery script that changes the class of the surrounding 2 blocks in the menu when you hover over a specific one. I figured I'd do a switch statement that checks $(this) id and then changes the surrounding class. I also want to change the class back once I'm not hovering over again (like it does with the original I'm hovering over. adding fiddle for this to make sense $(document).ready(function() { $(".kontakt").hover( function() { $(".kontakt").width("30%"); $(".kontakt").css("margin-left", "35%"); $(".kontakt").append("mobitel:031-535-919"); $(".kontakt").append(" stacionarni tel.:01-3664-515 "); $(".kontakt").append(" email:sustersic_miha@hotmail.com "); $(".kontakt").append(" Visoko 19 1292 Ig Slovenija"); }, function() { $(".kontakt").empty(); $(".kontakt").width("10%"); $(".kontakt").css("margin-left", "45%"); $(".kontakt").append(" Kontakt "); }); $(".menubutton").hover( function() { $(this).addClass("activatedmenubutton"); switch(true){ case $(this.attr('id') === "iz"): $("#1").addClass("activatedmenubutton"); $("#2").addCLass("activatedmenubutton"); break } }, function (){ $(this).removeClass("activatedmenubutton"); }); }); body{ margin:0; font-family:verdana; background-image:url("images/background_test.jpg"); background-size:cover; } .topmenu { width:90%; margin:auto; background-color:#3366ff; border-radius:0px 0px 10px 10px; text-align:center; opacity:0.7; } .menubutton { margin-top:5px; margin-bottom:5px; display:inline-block; background-color:#ffffff; font-weight:bolder; padding:2px; } .activatedmenubutton { background-color:#cccccc; } .menubreak { background-color:#ffffff; display:inline-block; padding:2px; } .kontaktlabel { font-weight:bolder; } .kontaktlabelbox { background-color:#ffffff; margin-top:6px; margin-bottom:5px; } .content{ } .kontakt{ position:absolute; bottom:0; width:10%; margin-left:45%; background-color:#3366ff; border-radius: 5px 5px 0px 0px; text…
accepted answer: http://stackoverflow.com/a/27802152
upvote count: 1
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/27802075
has answer: http://stackoverflow.com/a/27802141
has answer: http://stackoverflow.com/a/27802075
tagged with: switch-statement

http://stackoverflow.com/comment/43812293
has text: @lollipopwizardkid create a [fiddle](http://www.jsfiddle.net) with your code
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27699377

http://stackoverflow.com/comment/44050708
type: QuestionComment
comment on: http://stackoverflow.com/q/27781625
has text: @SandyGood Your code works perfect! Thank you so much... Now if there was any way to set it up to get it to iterate through the named folder and all subfolders inside of it too, I would be forever in your debt. :) But, if not, it's okay. I really do appreciate your help. It works great!
score: 0
type: Comment

http://stackoverflow.com/q/27697909
type: Question
answer count: 2
tagged with: counter
tagged with: javascript
score: 0
has title: Adding Javascript Counter to my Images
possible better answer: http://stackoverflow.com/a/27701663
has comment: http://stackoverflow.com/comment/43810415
has comment: http://stackoverflow.com/comment/43809918
has comment: http://stackoverflow.com/comment/43810230
accepted answer: http://stackoverflow.com/a/27698742
tagged with: instafeedjs
has body: I'm trying to add a JavaScript counter to the images I'm pulling in through an instagram API. The hope is by adding a counter I can give the images a unique ID, allowing me to manipulate them into a slider. I've just started learning about counters and any help would be greatly appreciated! Here's the page I'm working on with the images: http://carabinercoffee.com/instagram.html Below is the code I'm using with the instafeed.js plugin. I think there might be a way to use the template section to work in something but that's just a guess. &lt;script type="text/javascript"&gt; var userFeed = new Instafeed({ get: 'user', userId: xxxxxxx, accessToken: 'xxxxxxxxx', limit: 24, resolution: 'low_resolution', template: '&lt;a href="{{link}}"&gt;&lt;img src="{{image}}"/&gt;&lt;/a&gt;', useHttp: true , }); userFeed.run(); &lt;/script&gt;
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27701663
has comment: http://stackoverflow.com/comment/43810331
has answer: http://stackoverflow.com/a/27698742

http://stackoverflow.com/q/27718097
has answer: http://stackoverflow.com/a/27719082
downvote count: 1
has title: How to convert JavaScript(UnityScript) to C# and implement a low pass filter?
has comment: http://stackoverflow.com/comment/43847977
has comment: http://stackoverflow.com/comment/43847998
favorite count: 0
has answer: http://stackoverflow.com/a/27718161
type: AnsweredQuestion
tagged with: unityscript
type: Question
possible better answer: http://stackoverflow.com/a/27718161
tagged with: c#
has body: I've been trying to implement a low-pass filter code sample that I found In the Unity Manual into my game but I am having some issues. Here is the original JavaScript sample found in the Unity Manual: var AccelerometerUpdateInterval : float = 1.0 / 60.0; var LowPassKernelWidthInSeconds : float = 1.0; private var LowPassFilterFactor : float = AccelerometerUpdateInterval / LowPassKernelWidthInSeconds; // tweakable private var lowPassValue : Vector3 = Vector3.zero; function Start () { lowPassValue = Input.acceleration; } function LowPassFilterAccelerometer() : Vector3 { lowPassValue = Mathf.Lerp(lowPassValue, Input.acceleration, LowPassFilterFactor); return lowPassValue; } Here is my conversion to C#: float AccelerometerUpdateInterval = 1.0f / 60.0f; float LowPassKernelWidthInSeconds = 1.0f; private float LowPassFilterFactor = AccelerometerUpdateInterval / LowPassKernelWidthInSeconds; // tweakable private Vector3 lowPassValue = Vector3.zero; void Start () { lowPassValue = Input.acceleration; } Vector3 LowPassFilterAccelerometer () { lowPassValue = Mathf.Lerp(lowPassValue, Input.acceleration, LowPassFilterFactor); return lowPassValue; } My original code to move my character using the accelerometer was this(no low pass filter): float speed = 30.0f; Vector2 dir; private float accel; void Start () { accel = Input.acceleration.x; } // Update is called once per frame void Update () { accel = Mathf.MoveTowards (accel, Input.acceleration.x, speed * Time.deltaTime); dir = new Vector3(accel, 0); // move the object at the velocity defined in speed: transform.Translate(dir * speed * Time.deltaTime, 0); } This is my attempt to implement the low pass filter to reduce the noise/jerkiness: float AccelerometerUpdateInterval = 1.0f / 60.0f; float LowPassKernelWidthInSeconds = 1.0f; private float LowPassFilterFactor; private Vector3 lowPassValue = Vector3.zero; public float speed = 30.0f; void Start () { lowPassValue = Input.acceleration; LowPassFilterFactor = AccelerometerUpdateInterval…
accepted answer: http://stackoverflow.com/a/27719082
tagged with: javascript
tagged with: lowpass-filter
score: 0
answer count: 2
upvote count: 1

http://stackoverflow.com/q/27682320
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43780196
linked to: http://stackoverflow.com/q/9773664
has comment: http://stackoverflow.com/comment/43779291
has title: Assign Iframe content to only authorized website
has comment: http://stackoverflow.com/comment/43779452
score: 1
favorite count: 0
type: Question
tagged with: php
has comment: http://stackoverflow.com/comment/43779821
tagged with: iframe
has comment: http://stackoverflow.com/comment/43779340
tagged with: wordpress
upvote count: 1
tagged with: google-analytics
has body: I have a website in which i have a paypal set up, After getting the amount the i will give an embedding code to other websites to use my iframe. Is there a way to generate unique code for every website? also i will have to check that only authorised websites are using my iframe.
answer count: 0
downvote count: 0

http://stackoverflow.com/q/27728753
type: Question
upvote count: 4
answer count: 2
has title: Return statement executes before ajax response
tagged with: javascript
tagged with: jquery
score: 4
has body: I am making an ajax call on submit button click event to check field validations server side. When I get a validation fail, ajax response gives the proper error message, returns false, and stops the form to submit to the action url. But when I get a response of 'success', the form is still not submitting to the action url script. Is this the case when return statement executes before ajax response? And also why is the form not getting submitted? Here is the code: &lt;input type="submit" onclick="return validate();" name="submit" value="Proceed" /&gt; &lt;script type="text/javascript"&gt; var flag=false; function validate(){ $.ajax({ type:"POST", url:"../chk.php", data:datastring, cache: false, success: function (result) { if(result.toString() == "success" ){ flag=true; } else{ $('#error').css('display', 'block'); $('#error').css('color','red'); $('#error').text(result.toString()); flag=false; } } }); return flag; } &lt;/script&gt;
possible better answer: http://stackoverflow.com/a/27728758
downvote count: 0
favorite count: 0
tagged with: ajax
tagged with: php
has answer: http://stackoverflow.com/a/27728758
type: AnsweredQuestion
tagged with: forms
has answer: http://stackoverflow.com/a/27728771
accepted answer: http://stackoverflow.com/a/27728771

http://stackoverflow.com/a/27655036
has body: It will work but it's not a good idea to send cookies to server with every request that are useless (to server). Instead use localStorage. But if you wan't to set/remove cookies from client you can use a library from mozilla (MDN). you can set a cookie like this: docCookies.setItem(name, value[, end[, path[, domain[, secure]]]]) remove a cookie: docCookies.removeItem(name[, path[, domain]]) get value: docCookies.getItem(name)
answers question: http://stackoverflow.com/q/27654944
score: 0
type: Answer

http://stackoverflow.com/comment/43877887
comment on: http://stackoverflow.com/q/27732858
type: Comment
type: QuestionComment
has text: you are using id post for a a lot of div in your post partial.and create.js.erb code was prepending it was before last post of your page instead of first page.Now you wrapped your partial call inside the div with id post so it picking the upper div and prepending post before it.But it will cause issue when you again post a new one it will append it between the last one you have posted and outer div with id post.
score: 0

http://stackoverflow.com/q/27755115
upvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/43920889
has answer: http://stackoverflow.com/a/27755174
accepted answer: http://stackoverflow.com/a/27755174
tagged with: javascript
has body: var item = $('.card'); var pageLoaded = false; var waypoints = item.waypoint(function(direction) { if($('.content').css('display') !== 'block'){ console.log('yes it did fire here'); $(this).addClass("animated doneAnimated" + (pageLoaded ? " fadeInUp" : "")); } }, { offset: '90%' }); pageLoaded = true; Above code worked in jquery, but I switching to zepto. I don't know why $(this) in zepto is something else. How to write in pure js to make the code work?
tagged with: jquery
downvote count: 6
answer count: 1
score: -6
has title: write $(this) of Jquery in pure javascript
favorite count: 0
tagged with: zepto
type: AnsweredQuestion

http://stackoverflow.com/q/27753628
score: 0
has title: Json - Date not showing in correct format
has body: When i fetch date from the db it is in following format :- {5/13/2002 12:00:00 AM} When i pass this as Json, i bind it to textbox &amp; it shows me like this :- /Date(1021228200000)/ How to display date in any correct format? Extending this question I want to bind the date to html5 datepicker, How to do this?
has answer: http://stackoverflow.com/a/27753684
has answer: http://stackoverflow.com/a/27767442
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/206384
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: date
answer count: 2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/43934692
comment on: http://stackoverflow.com/q/27761646
score: 0
type: Comment
has text: The extension is to hide any 'a' html element that has "foobar" in the text. I added the manifest I have been using.
type: QuestionComment

http://stackoverflow.com/comment/43946402
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27767593
has text: The menu works but the 2 buttons(`b1` and `b2`) don't !

http://stackoverflow.com/q/27673420
has answer: http://stackoverflow.com/a/27673757
accepted answer: http://stackoverflow.com/a/27673757
favorite count: 0
has body: Codepen link to see in action Suppose I have this markup: Clone me And this JavaScript to handle the cloning $('button').click(function() { var d = $('div'); var counter = d.length; var newCounter = new Number(counter + 1); var cloned = $('.wrapper-' + counter).clone().attr('class', 'wrapper-' + newCounter).fadeIn('slow'); //Finding items that need to have different ID cloned.find('.name-input').attr('id', '#name-' + newCounter); //Cloning $('.wrapper-' + counter).after(cloned); }); As you can see, ID counter of the input with class.name-input changes along with the wrapper's counter. But if I want to change the name of it, and also all the IDs and names of 4 lower inputs, I have to manually insert and duplicate the same code: cloned.find('.name-input').attr('id', '#name-' + newCounter); And imagine I have 25 of them. So my question is: Is it possible to insert something like this: cloned.find('input').attr('id', $(this).attr('id') + '-' + newCounter); I mean so as browser automatically would parse the names and IDs of the elements and add the the counter variable to them. Surely in this given example $(this) will refer to the element that fired the event - button, but maybe this approach is kinda possible?
type: Question
has comment: http://stackoverflow.com/comment/43761790
tagged with: javascript
upvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/43761796
tagged with: jquery
has title: When cloning an item, is it possible to change ALL the inputs attributes and IDs as this;
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/a/27739009
has body: Actual problem is you are trying to add click event on row which does not exists when page load.They will load after the execution of script.So the solution for this problem is remove click event from window.load and add it in the script after data population code. You can also use .on() event of jquery which will work in any case.
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27738965
type: Answer
upvote count: 1

http://stackoverflow.com/comment/43752310
type: AnswerComment
has text: I've updated the router.js file with your recommendation and updated the code in the question.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27664266

http://stackoverflow.com/comment/43917408
type: Comment
score: 0
type: AnswerComment
has text: Thanks! The php file output: 1: 'its the third day of the month', 2: 'its the second day of the month', 3: 'its the first day of the month' but all I get is day 3 (I'm in Australia) and ', a single apostrophe, almost like the data is not feeding correctly? So what i get is: 3 '
comment on: http://stackoverflow.com/a/27752910

http://stackoverflow.com/q/27731776
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27732044
has title: How to show data inside conditional statement in angularjs
upvote count: 1
has body: I am using angularjs template to show data from mysql.I facing problem from to show original fetched data inside a conditional statement.I think i am missing the correct syntax!Any help will be great. Here is my code : {{data.tran_type == 'payment' ? 'Pyament To ' : 'data.tran_type'}}
has comment: http://stackoverflow.com/comment/43874918
type: Question
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27732044
tagged with: mysql
has comment: http://stackoverflow.com/comment/43875379
has comment: http://stackoverflow.com/comment/43875593
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43875405
tagged with: javascript

http://stackoverflow.com/comment/43827220
type: Comment
score: 1
has text: Yes, for APIs that use service provider (application) level credentials the preferred approach would be to communicate with the API using server side code. For third party APIs that require end user credentials (ex: post to Twitter) the preferred approach would be to have the user submit these credentials directly to the API. OAuth v2 uses this method where the user submits their credentials in exchange for an authorization code. This authorization code is handed to the application which exchanges it for an access token, which is then valid for API requests on behalf of the end user.
comment on: http://stackoverflow.com/a/27693798
type: AnswerComment

http://stackoverflow.com/q/27750631
score: 0
has answer: http://stackoverflow.com/a/27750672
has body: I am trying to create a simple todo app that posts new items and appends to the DOM and removes the item when it is clicked on. I am able to get todo-items to append to the page but they are not being removed when they get clicked on. I beleive it has something to do with my onclick event handler as it is not selecting the "li" properly. Any thoughts? heres the code: Post Items
answer count: 1
has title: Trouble selecting a "li" item with jQuery tag
accepted answer: http://stackoverflow.com/a/27750672
linked to: http://stackoverflow.com/q/203198
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
duplicate of: http://stackoverflow.com/q/203198
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27802736
tagged with: javascript
has title: Screenshot of multiple HTML pages using PhantomJS
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/27803516
favorite count: 0
type: UnansweredQuestion
tagged with: phantomjs
has body: So as everyone has mentioned in this github issue, the viewport size function in phantomJS doesn't behave as a lot of people expected. I am trying to take screenshots of a web app for an iPad. The site has a position:fixed; footer and header. When I take a screenshot I only want to be able to see what would be viewable on the screen when you first load the page, so i've used the following code to clip the page to the size I want. page.clipRect = { top: 0, left: 0, width: 1024, height: 768 }; Because the site has a position: fixed; header and footer when I do this and take a screenshot, the footer is missing when the content on the page forces a scroll. (Its right at the bottom of the page) In the replies, one solution would be to load the page you would like to take a screenshot of into an object with the height and width you of your preference, and then take a screenshot of the object instead. All the code snippets with this implemented, assume you have a single URL that you would like to take a screenshot of. I would like to take screenshots of multiple html files. I am not fluent in Javascript at all and I'm really struggling to merge these solutions into my code. This solution takes a single webpage and converts it into multiple images of differnet sizes using a json file. While this solution is more along the lines that i'm looking for but again, just a single web page. Please note that iframe doesn't work and the iframe code would need to be replaced with an object with a data attribute with a value of the html page to be loaded. And a final solution, which is more complete than the others, but again is just a single URL I have been using the following code in the past, and its worked perfectly with web apps built to specific dimensions, but this one has been built slightly differently which is why the screenshots are being a nightmare. var system = require('system'); var dest = system.args[1]; var files = system.args[2].split(','); function takeScreenshot(des…
score: 3
tagged with: screenshot
upvote count: 3
type: Question

http://stackoverflow.com/a/27781484
downvote count: 0
answers question: http://stackoverflow.com/q/27781427
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27781427
has body: You can use the ternary operator inside a binding: &lt;button&gt;{{action === "someValue" ? "Primary" : "Alternate"}}&lt;/button&gt;
score: 3
type: AcceptedAnswer

http://stackoverflow.com/q/27780447
score: 0
tagged with: highcharts
tagged with: javascript
has comment: http://stackoverflow.com/comment/43970863
has body: Hi I am trying to customize high stock chart column for making it x-axis date driven rather than data driven. Currently as mentioned in Filldle Link rangeSelector: { selected: 0, inputEnabled: true }, Do we need to add something here? I want my x-axis to be like this example Example link xAxis: { tickInterval: 24 * 3600 * 1000, type: 'datetime', labels: { style: { fontFamily: 'Tahoma' }, rotation: -45, } }, We see that from and to date are data driven and X-Axis adjust accordingly. I want a scenario like if I want to show data for thirty days, than i can set x-axis to 5 days interval and likewise other configurable depending on number of days I want to show. Also is there a way to set initial from and to date on your own rather than data driven. Is it necessary to pass x axis as epoch time cant be pass simple date Also wanted to know: Is Licensee for high stock charts and high chart different? If we buy licensee for high chart can we use high stock charts too?
has comment: http://stackoverflow.com/comment/44041964
has title: Customize X-Axis for high stock chart
answer count: 0
has comment: http://stackoverflow.com/comment/43970926
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43974186
type: Question
tagged with: graph
tagged with: charts

http://stackoverflow.com/a/27684262
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27683983
type: Answer
has comment: http://stackoverflow.com/comment/43787755
has body: use onSelect method. onSelect Type: Function() A callback function when a date is selected. The function receives the date text and date picker instance as parameters. As @Learner has mentioned in comment with fiddle link. And to redirect use window.location.href with full url. window.location.href= 'http://www.google.com'
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/27683983

http://stackoverflow.com/a/27757594
answers question: http://stackoverflow.com/q/27757040
type: Answer
has body: See comments in code below for fixes: var since = function(date) { var elapsed, interval, intervals, parts, tense; date = Date.parse(date); intervals = [['day', 1], ['hour', 24], ['minute', 60], ['second', 60]]; elapsed = (new Date).getTime() - date; // "elapsed" is in milliseconds when it was in days (Rational) in the // Ruby version. Fix: elapsed = elapsed / 1000 / 3600 / 24; tense = elapsed &gt; 0 ? 'since' : 'until'; interval = 1.0; parts = intervals.map(function(item) { var number; interval /= item[1]; // You mixed "number" with "elapsed", and calculated them in // the wrong order. Fix: number = Math.floor(elapsed / interval); elapsed = elapsed % interval; return number + " " + item[0] + (number !== 1 ? 's' : ''); }); return console.log(parts.join(', ') + " " + tense); }; since('Sep 27 19:01:41 2014 MST'); 97 days, 15 hours, 33 minutes, 21 seconds since
accepted answer of: http://stackoverflow.com/q/27757040
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43929134
has comment: http://stackoverflow.com/comment/43925856
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/43886970
has text: Your code calls `nude.load()`, which isn't defined in the code shown in your question. Assuming it ends up in the `loadImageById()` method, that method doesn't actually test whether the specified element exists. Are you sure you have the correct element id?
comment on: http://stackoverflow.com/q/27737788
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28242841
score: 0
has body: I think you can white out the two dummy points by using options like: var options = { colors: ['#ffffff', '#ffffff', '#c69c6e'], };
type: Answer
answers question: http://stackoverflow.com/q/27802921

http://stackoverflow.com/comment/43801906
score: 1
type: Comment
type: QuestionComment
has text: If your renaming IDs I think you've misunderstood the concept of an ID. Perhaps you want `title` or a custom `data` attribute instead.
comment on: http://stackoverflow.com/q/27694212

http://stackoverflow.com/q/27678873
has title: Executing a function after animate settimeout
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43772368
has comment: http://stackoverflow.com/comment/43772343
possible better answer: http://stackoverflow.com/a/27678940
has comment: http://stackoverflow.com/comment/43772294
has comment: http://stackoverflow.com/comment/43772388
has answer: http://stackoverflow.com/a/27678940
has answer: http://stackoverflow.com/a/27678943
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43772399
has comment: http://stackoverflow.com/comment/43772424
has comment: http://stackoverflow.com/comment/43772418
type: Question
answer count: 2
tagged with: jquery-animate
accepted answer: http://stackoverflow.com/a/27678943
tagged with: javascript
tagged with: jquery
has body: Found this on stack overflow the other day http://codepen.io/anon/pen/LERrGG. I think this is a great pen that could be really useful. The only problem is that there is no ability to call a function after the timer runs out. I was trying to implement this with no success. How do I edit the code so that it becomes a useful timer i.e. it 'runs out'? (function animate() { theta += 0.5; theta %= 360; var x = Math.sin(theta * Math.PI / 180) * radius; var y = Math.cos(theta * Math.PI / 180) * -radius; var d = 'M0,0 v' + -radius + 'A' + radius + ',' + radius + ' 1 ' + ((theta &gt; 180) ? 1 : 0) + ',1 ' + x + ',' + y + 'z'; timer.setAttribute('d', d); setTimeout(animate, t) })();

http://stackoverflow.com/a/27695985
answers question: http://stackoverflow.com/q/27695921
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27695921
has body: Write the PHP ID you want as a parameter to your JS function: &lt;li class="answersList" onclick="clickFunc('&lt;?php $myId ?&gt;')"&gt; And then the onclick function clickFunc(id) { console.log(id); //should see ID here }
type: Answer
upvote count: 3
score: 3

http://stackoverflow.com/comment/43897577
type: Comment
comment on: http://stackoverflow.com/q/27742654
type: QuestionComment
has text: The orderID:0 is an example. In this case, I need POST information in that format (equal to orderID 0 format).
score: 0

http://stackoverflow.com/comment/43970453
comment on: http://stackoverflow.com/q/27780302
has text: so you want to, for example remove product with an id of 3 etc from the array? you'd want splice()
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27776743
has body: This is my fiddle http://jsfiddle.net/foucpgkL/ &lt;input type="text" value=""/&gt; I need to have my textbox containing same value as given i.e 000 not 0 Also I have requirement to allow user to edit only first digit.i.e user should only input like 100,200,500 and not like 123,110 etc. How can I achieve this using jquery. I am using Angular Js so angular directive could be best option.
has comment: http://stackoverflow.com/comment/43964045
type: Question
score: 0
has comment: http://stackoverflow.com/comment/43964360
has answer: http://stackoverflow.com/a/27776832
has comment: http://stackoverflow.com/comment/43964227
tagged with: jquery
has title: Allow user only to change first digit
has comment: http://stackoverflow.com/comment/43964055
tagged with: angularjs
has answer: http://stackoverflow.com/a/27777860
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43964479
answer count: 4
has answer: http://stackoverflow.com/a/27777017
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43964169
has answer: http://stackoverflow.com/a/27776910
tagged with: javascript

http://stackoverflow.com/comment/43925235
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27756579
has text: Ah, and there's no way around it?

http://stackoverflow.com/comment/43885295
type: QuestionComment
comment on: http://stackoverflow.com/q/27701259
has text: The backend api returning async data is not public.
score: 0
type: Comment

http://stackoverflow.com/a/27688842
downvote count: 0
has body: Started working after changing colvis script to - var excludeColumns = []; $(dtTable.fnSettings().aoColumns).each(function(){ if(this.nTh.style.display == 'none') { excludeColumns.push(this.idx); } }); var colvis = new $.fn.dataTable.ColVis(dtTable,{ exclude: excludeColumns, }); Basically provided array to "exclude" option
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27686381
answers question: http://stackoverflow.com/q/27686381
type: AcceptedAnswer

http://stackoverflow.com/q/27694729
possible better answer: http://stackoverflow.com/a/27694975
downvote count: 0
has answer: http://stackoverflow.com/a/27694975
has title: AngularJS: Pass object from directive to controller
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
score: 3
upvote count: 3
has answer: http://stackoverflow.com/a/27695019
has body: In my directive, I'm instantiating an object. I'd like to pass this object to the scope of the controller I associate with the directive. How do I do that? Please keep in mind this is an isolated code for you to understand the issue. In the actual issue it won't help to instantiate that object inside of the controller. I know that the scope object in the directive is for passing values that are specified in the HTML, I wrote it that way to help you understand what I'm trying to do. angular.module('test', []) .controller('test', ['$scope', function($scope) { alert($scope.obj); //Needs to contain {value: 'bla'} }]) .directive('pTest', ['$compile', function($compile) { var object = {value: 'bla'}; return { scope: { obj: object //how can I do that? }, controller: 'test' }; }]);
type: Question
accepted answer: http://stackoverflow.com/a/27695019
answer count: 2
tagged with: javascript

http://stackoverflow.com/q/27694776
has answer: http://stackoverflow.com/a/27694967
has comment: http://stackoverflow.com/comment/43803147
has comment: http://stackoverflow.com/comment/43802912
has title: Change style class by changing scoped variable value
tagged with: css
has answer: http://stackoverflow.com/a/27695510
has body: I have a button inside an xpages div and I am trying to compute the style class of that button based on a scoped variable. Initially, the scoped variable's value is 'blue' and the background color of the button inside the div is blue as well. When I click on a second button, I set the value of the scoped variable to 'green' and do a partial refresh of the div. Now, I would expect the button to turn green, but the class is not being changed. Here is the SSJS for computing the style class: if(sessionScope.sTest == 'green'){ return 'btn-success'; } else{ return 'btn-primary'; } So, my question is, is a style class recalculated during a partial refresh or would I have to resort to either JQuery or Dojo in order to change the style class. Any help would be highly appreciated!
type: AnsweredQuestion
type: Question
answer count: 2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27695510
tagged with: xpages
score: 0
possible better answer: http://stackoverflow.com/a/27694967

http://stackoverflow.com/comment/59442216
comment on: http://stackoverflow.com/a/27749631
score: 0
type: AnswerComment
has text: The change was visibility of the XHR. When moved it out the function it was visible for the on click function. Please see: http://www.w3schools.com/js/js_scope.asp
type: Comment

http://stackoverflow.com/q/27716274
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43844590
has comment: http://stackoverflow.com/comment/43844647
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43844564
type: UnansweredQuestion
has title: Jquery Post with JSON Response working
tagged with: php
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/27716338
has body: I Have a jQuery Post to a PHP page with generates a JSON Response. It successfully generates JSON because I have it display the whole response. But on the .each I cannot get it to alert. Any Ideas Appreciated. Thank You. The JSON looks like: [{"Part_Field":"Part_Note:3","Part_Value":"ValueofPart"},{"Part_Field":"Ft_In:3","Part_Value":"12"}, ... jQuery: $.post('/scripts/update_detail.php' , field_id + "=" + value, function(data){ var d = document.getElementById("displayjson"); d.innerHTML = data; $.each( data, function( key, value ) { alert( value.Part_Field ); }); });

responsive-design
tags question: http://stackoverflow.com/q/27677449
tags question: http://stackoverflow.com/q/27709724
tags question: http://stackoverflow.com/q/27679577
tags question: http://stackoverflow.com/q/27697547
tags question: http://stackoverflow.com/q/27784191
tags question: http://stackoverflow.com/q/27707770
tags question: http://stackoverflow.com/q/27761829
tags question: http://stackoverflow.com/q/27800121
tags question: http://stackoverflow.com/q/27783637
tags question: http://stackoverflow.com/q/27771692
tags question: http://stackoverflow.com/q/27737776
tag name: responsive-design
type: Tag
tags question: http://stackoverflow.com/q/27714194

http://stackoverflow.com/q/27734780
answer count: 1
has answer: http://stackoverflow.com/a/27734935
has title: How filter date properly with angular js by month and year
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/19876116
has body: In my data base dates are arranged like below (dd/mm/yy) Date ----------- 10/12/2014 22/10/2014 14/12/2015 I am using angularjs template and trying to sort the date field as(sorting using both month and year number) below: Date ----------- 14/12/2015 10/12/2014 22/10/2014 But it is sorting ascending as Date ----------- 10/12/2014 14/12/2015 22/10/2014 descending as Date ---------- 22/10/2014 14/12/2015 10/12/2014 Here is my code &lt;div class="row"&gt; &lt;div class="col-md-12" ng-show="filteredItems &gt; 0"&gt; &lt;table class="table table-striped table-bordered"&gt; &lt;thead&gt; &lt;th&gt;Date&amp;nbsp;&lt;a ng-click="sort_by('time_stamp');"&gt;&lt;i class="glyphicon glyphicon-sort"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/th&gt; &lt;th&gt;Reference number&amp;nbsp;&lt;a ng-click="sort_by('tran_id');"&gt;&lt;i class="glyphicon glyphicon-sort"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/th&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr ng-repeat="data in filtered = (list | filter:search | orderBy : predicate :reverse) | startFrom:(currentPage-1)*entryLimit | limitTo:entryLimit"&gt; &lt;td&gt;{{data.time_stamp}}&lt;/td&gt; &lt;td&gt;{{data.tran_id}}&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; controller.js var app = angular.module('myApp', ['ui.bootstrap']); app.filter('startFrom', function() { return function(input, start) { if(input) { start = +start; //parse to int return input.slice(start); } return []; } }); app.controller('customersCrtl', function ($scope, $http, $timeout) { $http.get('ajax/getCustomers.php').success(function(data){ $scope.list = data; $scope.currentPage = 1; //current page $scope.entryLimit = 5; //max no of items to display in a page $scope.filteredItems = $scope.list.length; //Initially for no filter $scope.totalItems = $scope.list.length; }); $scope.setPage = function(pageNo) { $scope.currentPage = pageNo; }; $scope.filter = function() { $timeout(function() { $scope.filteredItems = $scope.filtered.length; }, 10); }; $scope.sort_by = function(predicate) …
score: 2
downvote count: 0
type: Question
tagged with: javascript
tagged with: sorting
tagged with: date
upvote count: 2
has comment: http://stackoverflow.com/comment/43887443

http://stackoverflow.com/comment/43885990
comment on: http://stackoverflow.com/q/27737286
type: Comment
type: QuestionComment
has text: The real question is why on earth would you do something like this, `e-button` is not a valid element, nor is `color` a valid attribute. What reasons could you possibly have for this, and changing the prototype of the native `HTMLElement` just makes it even worse ?
score: 0

http://stackoverflow.com/comment/43916307
has text: Thanks. If I send only values like `123456` and inject them at the server side, instead sending objects like `{ "_id" : "123456" }` for `$match` it will be safer, correct?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27738360
type: Comment

twitter-bootstrap
tags question: http://stackoverflow.com/q/27701864
tags question: http://stackoverflow.com/q/27692776
tags question: http://stackoverflow.com/q/27741007
tags question: http://stackoverflow.com/q/27656782
tags question: http://stackoverflow.com/q/27716565
tags question: http://stackoverflow.com/q/27679788
tags question: http://stackoverflow.com/q/27700630
tags question: http://stackoverflow.com/q/27755499
tags question: http://stackoverflow.com/q/27737209
tags question: http://stackoverflow.com/q/27685863
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/27745323
tags question: http://stackoverflow.com/q/27777123
tags question: http://stackoverflow.com/q/27775457
tags question: http://stackoverflow.com/q/27664727
tags question: http://stackoverflow.com/q/27754126
tags question: http://stackoverflow.com/q/27656449
tags question: http://stackoverflow.com/q/27670590
tags question: http://stackoverflow.com/q/27657661
tags question: http://stackoverflow.com/q/27681615
tags question: http://stackoverflow.com/q/27792818
tags question: http://stackoverflow.com/q/27692049
tags question: http://stackoverflow.com/q/27648587
tags question: http://stackoverflow.com/q/27777291
tags question: http://stackoverflow.com/q/27675968
tags question: http://stackoverflow.com/q/27772737
tags question: http://stackoverflow.com/q/27798029
tags question: http://stackoverflow.com/q/27792795
tags question: http://stackoverflow.com/q/27709437
tags question: http://stackoverflow.com/q/27714541
tags question: http://stackoverflow.com/q/27736492
tags question: http://stackoverflow.com/q/27662445
tags question: http://stackoverflow.com/q/27766900
tags question: http://stackoverflow.com/q/27684385
tags question: http://stackoverflow.com/q/27755506
tags question: http://stackoverflow.com/q/27743576
tags question: http://stackoverflow.com/q/27798214
tags question: http://stackoverflow.com/q/27791940
tags question: http://stackoverflow.com/q/27696743
tags question: http://stackoverflow.com/q/27789744
tags question: http://stackoverflow.com/q/27693868
tags question: http://stackoverflow.com/q/27751377
tags question: http://stackoverflow.com/q/27734576
tags question: http://stackoverflow.com/q/27746482
tags question: http://stackoverflow.com/q/27790064
tags question: http://stackoverflow.com/q/27656197
tags question: http://stackoverflow.com/q/27721400
tags question: http://stackoverflow.com/q/27769912
tags question: http://stackoverflow.com/q/27642553
tags question: http://stackoverflow.com/q/27643608
tags question: http://stackoverflow.com/q/27701655
tags question: http://stackoverflow.com/q/27742767
tags question: http://stackoverflow.com/q/27734158
tags question: http://stackoverflow.com/q/27699059
tags question: http://stackoverflow.com/q/27759280
tags question: http://stackoverflow.com/q/27737872
tags question: http://stackoverflow.com/q/27695291
tags question: http://stackoverflow.com/q/27743168
tags question: http://stackoverflow.com/q/27651955
tags question: http://stackoverflow.com/q/27738306
tags question: http://stackoverflow.com/q/27647796
tags question: http://stackoverflow.com/q/27661612
tags question: http://stackoverflow.com/q/27759415
tags question: http://stackoverflow.com/q/27665598
tags question: http://stackoverflow.com/q/27708579
tags question: http://stackoverflow.com/q/27696713
tags question: http://stackoverflow.com/q/27793269
tags question: http://stackoverflow.com/q/27750616
tags question: http://stackoverflow.com/q/27800367
tags question: http://stackoverflow.com/q/27800409
tags question: http://stackoverflow.com/q/27716446
tags question: http://stackoverflow.com/q/27659230
tags question: http://stackoverflow.com/q/27754220
tags question: http://stackoverflow.com/q/27741640
tags question: http://stackoverflow.com/q/27666283
tags question: http://stackoverflow.com/q/27795104
type: Tag
tags question: http://stackoverflow.com/q/27752210
tags question: http://stackoverflow.com/q/27779470
tags question: http://stackoverflow.com/q/27778956

http://stackoverflow.com/comment/44015088
comment on: http://stackoverflow.com/q/27802669
type: Comment
type: QuestionComment
has text: You seem to be setting the `style` (instead of an `attr`) `marker-end` style on `g`s instead of on `line`, `path`, `polyline` or `polygon` elements. I am surprised that it works at all.
score: 0

http://stackoverflow.com/comment/43843981
score: 0
type: AnswerComment
has text: @user4269367 Try adding the call below the javascript itself or at the end of the page.
type: Comment
comment on: http://stackoverflow.com/a/27715951

http://stackoverflow.com/a/27790587
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/101009885
has body: You "style" XML using Extensible Stylesheet Language Transformations (XSLT). XSLT parses XML into HTML using stylesheets. You can then use standard CSS to format the display of the resulting HTML. For the sample XML you cited, this stylesheet: &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt; &lt;xsl:output method="html"/&gt; &lt;xsl:template match="/"&gt; &lt;html&gt; &lt;body&gt; &lt;xsl:for-each select="note"&gt; &lt;p&gt; &lt;xsl:value-of select="body"/&gt; &lt;/p&gt; &lt;/xsl:for-each&gt; &lt;/body&gt; &lt;/html&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; would give you a properly formed HTML document that just listed the note body. EG: Don't forget me this weekend! from your example. Use XSLTProcessor() to run XSLT in a Greasemonkey script, like so: // ==UserScript== // @name _XML renderer / styler // @description stylesheet for xml results // @include http://YOUR_SERVER.COM/YOUR_PATH/*.xml // @include http://www.w3schools.com/xml/note.xml // @grant none // ==/UserScript== //-- Warning, multiline str is new in JS. Only Firefox supports at the moment. var xsl_str = `&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt; &lt;xsl:output method="html"/&gt; &lt;xsl:template match="/"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;My super new note format!&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;style type="text/css"&gt; body { padding: 0 2em; } .noteCtr { border: 1px solid gray; border-radius: 1ex; padding: 0; background: #FAFAFA; } .messPeople { font-size: 1em; margin: 1ex 1em; } .messHeading { background: lightcyan; margin: 0 1.6ex; } .messHeading::after { content: ":"; } .noteCtr &gt; p { background: white; padding: 1em; margin: 0 1em 1.5ex 1em; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;xsl:for-each select="note"&gt; &lt;div class="noteCtr"&gt; &l…
has comment: http://stackoverflow.com/comment/101011536
type: Answer
has comment: http://stackoverflow.com/comment/46829286
has comment: http://stackoverflow.com/comment/101011140
accepted answer of: http://stackoverflow.com/q/27785947
answers question: http://stackoverflow.com/q/27785947
has comment: http://stackoverflow.com/comment/101007889
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/101011391

http://stackoverflow.com/comment/43739186
comment on: http://stackoverflow.com/a/27661684
score: 1
type: AnswerComment
type: Comment
has text: The real question is, why is `false == 0` in non-strict comparison

http://stackoverflow.com/a/27732526
score: 1
has comment: http://stackoverflow.com/comment/43886148
has comment: http://stackoverflow.com/comment/43889715
accepted answer of: http://stackoverflow.com/q/27729956
has comment: http://stackoverflow.com/comment/43891904
has comment: http://stackoverflow.com/comment/43890752
has comment: http://stackoverflow.com/comment/43918500
has comment: http://stackoverflow.com/comment/43892089
has body: Presuming at the moment that you just want the ng-repeat logic, this may be what you are looking for: {{$index}} MenuNum: {{topMenu.MenuNum}} MenuItems {{$index}} ItemNum: {{submenu1.ItemNum}} ItemDesc: {{submenu1.ItemDesc}} ActionCode: {{submenu1.ActionCode}} ActionInst: {{submenu1.ActionInst}} If you then want a relatively easy way to do the menu opening/closing, you would probably want to put all this into an Angular accordion. I can probably help you with that if you want.
has comment: http://stackoverflow.com/comment/43892632
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/43892114
has comment: http://stackoverflow.com/comment/43889574
answers question: http://stackoverflow.com/q/27729956
downvote count: 0

http://stackoverflow.com/q/27714085
tagged with: android
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43854959
tagged with: meteor
favorite count: 0
has comment: http://stackoverflow.com/comment/44028233
upvote count: 2
has answer: http://stackoverflow.com/a/28050935
has comment: http://stackoverflow.com/comment/43859543
tagged with: css
has comment: http://stackoverflow.com/comment/43860631
has title: METEOR Accounts UI sign in button isn't showing up in Mobile App wrapper
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44043699
has answer: http://stackoverflow.com/a/44154774
has comment: http://stackoverflow.com/comment/43859128
type: Question
accepted answer: http://stackoverflow.com/a/28050935
answer count: 2
possible better answer: http://stackoverflow.com/a/44154774
has body: I created my project and deployed it at jott.meteor.com and I am trying to port it to Android using "Building Mobile Apps." When I do so, the Sign In button in the top right doesn't show up which uses the Accounts-UI package. See these screenshots! Jott {{> loginButtons}} {{> textGoesHere}} It's ugly, I'm working on that, but this is the HTML for where the {{> loginButtons}} is. I did change some of the CSS for the popup, but I'm not sure if that would affect it. If you need anymore info, let me know. Thanks!
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43872839
has comment: http://stackoverflow.com/comment/43860671
has comment: http://stackoverflow.com/comment/43857675
has comment: http://stackoverflow.com/comment/43863783

http://stackoverflow.com/comment/43777549
score: 0
type: QuestionComment
type: Comment
has text: Please do not down vote the question. I am new to the site and will learn and try to ask a more through question next time. The information provided so far has helped me so much, i would like to come back to this if i get stuck.
comment on: http://stackoverflow.com/q/27680537

http://stackoverflow.com/a/27690211
has comment: http://stackoverflow.com/comment/43793857
has body: Create a geometry. Add a vertice for each point, and create a face. For instance: var geometry = new THREE.Geometry(); geometry.vertices.push(new THREE.Vector3(0,0,0)); geometry.vertices.push(new THREE.Vector3(1,1,0)); geometry.vertices.push(new THREE.Vector3(1,-1,0)); geometry.faces.push( new THREE.Face3( 0, 1, 2 ) ); geometry.dynamic = true; var shapeMesh = new THREE.Mesh(geometry, material); scene.add(shapeMesh); Everytime you change the geometry, be sure to let three.js know: geometry.verticesNeedUpdate = true; geometry.elementsNeedUpdate = true;
upvote count: 4
answers question: http://stackoverflow.com/q/27689557
score: 4
has comment: http://stackoverflow.com/comment/43794123
has comment: http://stackoverflow.com/comment/43794499
has comment: http://stackoverflow.com/comment/43793661
has comment: http://stackoverflow.com/comment/43794432
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43793723

http://stackoverflow.com/a/27738106
has body: The jqXHR object is the third argument to the callback function: jQuery.getJSON('foo.bar', function(data, textStatus, jqXHR) { if (data.foobar) { jqXHR.done(hello); } alert('calback done'); }).done(hi);
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27738050
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27738050
score: 1
type: Answer

http://stackoverflow.com/q/27756603
possible better answer: http://stackoverflow.com/a/27757634
tagged with: javascript
has answer: http://stackoverflow.com/a/27757781
upvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/27757634
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27756671
accepted answer: http://stackoverflow.com/a/27756671
has title: finding p tag between two div tags
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43924217
has comment: http://stackoverflow.com/comment/43936218
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/43924280
type: Question
has body: I want to find out tag between two different divs using jQuery. For example Header Two some text some text 1 some text So I want to find the p with "some text 1". (the text could be anything.) Can anyone tell me how can I do this ?
has comment: http://stackoverflow.com/comment/43923959

http://stackoverflow.com/q/27781268
has comment: http://stackoverflow.com/comment/43972803
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/43972395
upvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43972487
type: AnsweredQuestion
has body: html: ... i want to remove the if data-ng-if="!price" Does anyone know the correct way of doing this?
has comment: http://stackoverflow.com/comment/43972909
has answer: http://stackoverflow.com/a/27781624
accepted answer: http://stackoverflow.com/a/27781624
downvote count: 1
type: Question
has title: adding removing html tag link on a ng-if function

http://stackoverflow.com/comment/43893033
has text: @JLRishe—there are no declared variables in the OP.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27740870
type: Comment

http://stackoverflow.com/q/27751412
tagged with: canvas
has title: How can I improve this requestAnimationFrame drawing? (Low FPS, around 20)
has comment: http://stackoverflow.com/comment/43915136
has comment: http://stackoverflow.com/comment/43914633
answer count: 0
tagged with: frame-rate
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43915625
has body: The problem lies whenever the program does the animation at a very fast rate, it becomes extremely lagging. I have been trying all I can to improve this code below... But I can not think of anything useful... I know some of you might say: "Draw less" or something like that, but that just is not possible. This basically draws a small rectangle with rounded corners and makes it larger each frame until it reaches a specific size seen in the if statements. Full code if needed: https://github.com/GunZi200/Memory-Colour/blob/master/SourceCode.js function turnEvent(AnX, AnY) { var lengd = rects.length; eventDone = false, one30 = 18, one40 = 18, one301 = false, one401 = false; for (var i = 0; i &lt; lengd; i += 1) { // Indentifying rectangle in use, so we can access the color, and position. if (collides([rects[i]], AnX, AnY)) { var rightBox = rects[i]; var rectangle = rects2[i]; } } rounded_rect(rectangle.x, rectangle.y, 90, 110, 10, 'black', 'black'); function render() { ctx.beginPath(); ctx.fillStyle = rightBox.color; ctx.moveTo((rectangle.x + 42 - one40) * Xf, (rectangle.y + 32 - one30) * Yf); ctx.lineTo((rectangle.x + 48 + one40) * Xf, (rectangle.y + 32 - one30) * Yf); ctx.quadraticCurveTo((rectangle.x + 58 + one30) * Xf, (rectangle.y + 32 - one30) * Yf, (rectangle.x + 58 + one30) * Xf, (rectangle.y + 42 - one40) * Yf); ctx.lineTo((rectangle.x + 58 + one30) * Xf, (rectangle.y + 68 + one40) * Yf); ctx.quadraticCurveTo((rectangle.x + 58 + one30) * Xf, (rectangle.y + 78 + one30) * Yf, (rectangle.x + 48 + one40) * Xf, (rectangle.y + 78 + one30) * Yf); ctx.lineTo((rectangle.x + 42 - one40) * Xf, (rectangle.y + 78 + one30) * Yf); ctx.quadraticCurveTo((rectangle.x + 32 - one30) * Xf, (rectangle.y + 78 + one30) * Yf, (rectangle.x + 32 - one30) * Xf, (rectangle.y + 68 + one40) * Yf); ctx.lineTo((rectangle.x + 32 - one30) * Xf, (rectangle.y + 42 - one40) * Yf); ctx.quadraticCurveTo((rectangle.x + 32 - one30) * Xf, (rectangle.y + 32 - one30) * Yf, (rectangle.x + 42 - one40) * Xf, …
type: Question
has comment: http://stackoverflow.com/comment/43921252
tagged with: requestanimationframe
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43917510

http://stackoverflow.com/comment/43750123
comment on: http://stackoverflow.com/a/27667504
type: Comment
has text: But how is this giving match from a dynamic numbered bracket?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43726851
has text: If its svg, couldn't you just put css pointer-events: none on the bits you don't want to be clickable ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27650885

http://stackoverflow.com/comment/43975236
score: 0
has text: Probably not expected behavior.
comment on: http://stackoverflow.com/q/27708614
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27762978
has title: jQuery: Remove class of elements on user click if it's a match with the class of the clicked element
tagged with: javascript
has answer: http://stackoverflow.com/a/27763044
tagged with: dom
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/27763044
has body: I'm a new web dev (student) trying to make a variation of a Tic Tac Toe game (basically a bigger version of Tic-Tac-Toe with more grids!) using jQuery/JavaScript and am having trouble with the last bit of functionality. Basically, it's a 3x3 grid of 3x3 grids. When a player selects a square on one of the individual small grids, the location of that little square on the individual grid corresponds to the big grid that the next player has to play on. Essentially, the next player is limited in where they can place their marker, and I want a class of 'inactive' to be added to all of the squares that the player can't select. I want to remove that class on the squares that the player can select. Each turn, different squares have the inactive class removed (depending on where the player can play). My attempted solution/logic was this: Each square has three classes, two numbers and 'square' (the latter for styling reasons). One number corresponds to the position where it is on it's individual 9x9 grid (1 to 9), the second number corresponds to what position its grid is on the bigger 9x9 grid orientation (also 1 to 9). So the little square on the top-left position of the grid located in the top left position of the big 9x9 grid would have the classes '1,' (its position within its small 9x9 grid) 'square,' and '1' (its grid's position within the bigger 9x9 orientation). The second square beside it would have classes '2 square 1.' The squares on the grid beside it would all have '2' as their last number class. On a player click, I basically want jQuery to put an 'Inactive' class on every square, to return the first number class of the clicked square (the number corresponding to its position within the small 9x9 grid) and remove the 'Inactive' class on the squares that have their second number class matching with the clicked square's returned first number class. So when a player places an X or O on a square: 1) Add inactive to every square on the gameboard so the next player ca…
tagged with: regex
type: AnsweredQuestion
tagged with: frontend
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/q/27668659
linked to: http://stackoverflow.com/q/19568041
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43751989
has answer: http://stackoverflow.com/a/27668697
answer count: 1
favorite count: 0
has title: .focus() - how to put the curser at end of content using contentEditable div
tagged with: contenteditable
upvote count: 2
accepted answer: http://stackoverflow.com/a/27668697
has body: Afternoon, I have a content editible div which, after appending some images too after uploaded, I wish to be focused the user can continue typing without having to click back into the div. To my surprise, .focus(); Works, but puts the curser at the start of the text, any way to put the curser at the end? JSFiddle: http://jsfiddle.net/mxtasnbL/ Backup code: &lt;div class="textarea" contenteditable="true"&gt;&lt;/div&gt; var div = $(".textarea"); div.append('Some text before an image &lt;br&gt;&lt;img class="temp_added_image" src="http://www.deshow.net/d/file/car/2010-10/seat-electric-car-879-2.jpg"&gt;&lt;br&gt;&lt;br&gt;'); div.focus();
type: AnsweredQuestion
score: 2
type: Question

http://stackoverflow.com/comment/44002345
type: QuestionComment
comment on: http://stackoverflow.com/q/27796719
has text: Thats what I was thinking
score: 0
type: Comment

http://stackoverflow.com/q/27708614
has answer: http://stackoverflow.com/a/78199877
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/27938312
has comment: http://stackoverflow.com/comment/43829757
upvote count: 33
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43975236
tagged with: google-chrome
has title: Chrome "Drop workspace folder here"
has body: While developing some JavaScript using Chrome 38.0.2125.122 m Developer Tools, I clicked on an error in the JavaScript console and was met with the following message: Drop workspace folder here Why isn't Chrome taking me to the offending line on the offending file, as usual? What is a workspace folder? What am I expected to do?
has comment: http://stackoverflow.com/comment/44190224
downvote count: 0
tagged with: google-chrome-devtools
score: 33
type: Question
has answer: http://stackoverflow.com/a/35344996

http://stackoverflow.com/q/27786048
tagged with: javascript
has comment: http://stackoverflow.com/comment/44054877
has comment: http://stackoverflow.com/comment/44259348
has comment: http://stackoverflow.com/comment/113039010
tagged with: http://stackoverflow.com/tag/html
has title: Why Is My Contenteditable caret Jumping to the End in Chrome?
has answer: http://stackoverflow.com/a/77977815
has comment: http://stackoverflow.com/comment/44054938
favorite count: 0
has answer: http://stackoverflow.com/a/27949928
accepted answer: http://stackoverflow.com/a/27949928
answer count: 9
tagged with: contenteditable
has answer: http://stackoverflow.com/a/27859169
has comment: http://stackoverflow.com/comment/44258665
tagged with: google-chrome
downvote count: 1
has comment: http://stackoverflow.com/comment/44301362
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/44540075
score: 26
has comment: http://stackoverflow.com/comment/44054762
has answer: http://stackoverflow.com/a/63925493
has answer: http://stackoverflow.com/a/27827863
has comment: http://stackoverflow.com/comment/44258754
linked to: http://stackoverflow.com/q/18985261
has comment: http://stackoverflow.com/comment/44054336
upvote count: 27
has comment: http://stackoverflow.com/comment/44054945
has answer: http://stackoverflow.com/a/27842925
has answer: http://stackoverflow.com/a/71169475
has answer: http://stackoverflow.com/a/70837485
has comment: http://stackoverflow.com/comment/44055157
possible better answer: http://stackoverflow.com/a/27859169
has comment: http://stackoverflow.com/comment/44055055
has body: Scenario I have a contenteditable &lt;div&gt; area, and within this area I may have some &lt;span contenteditable="false"&gt;&lt;/span&gt; containing some text. The idea is, these span elements will represent styled text that can not be edited, but may be deleted from the &lt;div contenteditable="true"&gt;&lt;/div&gt; area by pressing the backspace key. Issue The cursor placement is the big issue here. if you delete one of these &lt;span&gt; elements, the cursor jumps to the end of the &lt;div&gt;. More interesting, if you type some text while the cursor is "at the end," the text placement is just fine... Then, if you delete the newly typed text, the cursor jumps back! I have prepared a fiddle which will demonstrate this. I need this to work only in Chrome, and other browsers are either of non-concern for now or have workarounds in place. (Also note the prepared Fiddle is crafted to demonstrate this in Chrome only). Fiddle Fiddle Instruction: Chrome Version 39.0.2171.95 m (64-bit) reproduced in 32-bit as well Click into &lt;div&gt; area Type "123" Backspace "3" Backspace "2" Backspace "1" Related Details Researching this extensively, I have come across various SO question that are similar, but borrowing the associated solutions has not proved to be the silver bullet I am after. I have also found issues for the Chrome project which seem to target (perhaps not in the exact manner) the issue described above, and can be viewed below. Issue 384357: Caret position inside contenteditable region with uneditable nodes Issue 385003: Insert caret style is wrong when reaching the end of a line in a contenteditable element Issue 71598: Caret in wrong position after non-editable element at the end of contentEditable The closest SO solution I have found can be here. The idea in this solution is to place &amp;zwnj; characters after the &lt;span&gt; elements, but if I want to now delete my &lt;span&gt;, I instead delete the &amp;zwnj;... forcing my cursor to jump to the end, offerin…

http://stackoverflow.com/q/27661612
answer count: 2
upvote count: 0
favorite count: 0
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/27661744
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
has body: I don't know javascript and I am very new to this. I am trying to add a bootstrap modal in page load but it's not working for me. Here is the code I've got: × Modal header Body text Close Save changes The error I get is this: [Error] Failed to load resource: the server responded with a status of 404 (Not Found) (bootstrap.js, line 0) [Error] TypeError: undefined is not a function (evaluating '$('#myModal').modal('show')') (anonymous function) (antiquities-of-nubia, line 7) dispatch (jquery.js, line 4641) handle (jquery.js, line 4309) What am I doing wrong? Any help would be greatly appreciated. I hope this is enough information so I don't get negative points. I am not sure how else to ask a question so I don't get marked down.
downvote count: 2
has answer: http://stackoverflow.com/a/27661644
type: Question
accepted answer: http://stackoverflow.com/a/27661744
score: -2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27661644
has title: Launch Bootstrap Modal on page load NOT working

http://stackoverflow.com/comment/43965200
type: QuestionComment
has text: @raina77ow its an object it contains formname as a key, so am passing fname to dc.
comment on: http://stackoverflow.com/q/27777197
score: 0
type: Comment

http://stackoverflow.com/q/27641131
upvote count: 1
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/27641159
has answer: http://stackoverflow.com/a/27641157
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27641156
type: Question
has answer: http://stackoverflow.com/a/27641211
has title: jquery ajax returning query string in address bar
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: i am working on a simple ajax mail, my html looks like this: You Expressed. We Understand. [Welcome to the world of business innovation] You’ll be clarified shortly… and my jquery looks like this: $(function() { $("#submit_btn").click(function(){ var data = { name: $("#name").val(), company: $("#company").val(), designation: $("#designation").val(), phone: $("#phone").val(), email: $("#email").val(), message: $("#message").val() }; // AJAX Code To Submit Form. $.ajax({ type: "POST", url: "mail.php", data: data, cache: false, success: function(result){ $( "#result" ).fadeIn(1000); } }); }); }); the problem is when i click on submit button, it shows all data in address bar instead of sending it to mail.php via POST method. PS: when i use alert() instead of $( "#result" ).fadeIn(1000); it works fine. anyone can help please? thanks.
tagged with: ajax

http://stackoverflow.com/q/27708013
tagged with: google-hangouts
has comment: http://stackoverflow.com/comment/43828179
duplicate of: http://stackoverflow.com/q/17914269
type: Question
tagged with: javascript
has title: Start a Google Hangouts by passing email as parameter in javascript
score: 0
tagged with: email
answer count: 0
has body: I'm trying to start a new Google hangout inside an web application. The facts is that I'm only succeeding by opening a new tab or windows. I'd like to directly start a hangout by passing any email adress as parameter. As anyone an idea? Thank you already. Cedric.
type: UnansweredQuestion
tagged with: web-applications
has comment: http://stackoverflow.com/comment/43828429
linked to: http://stackoverflow.com/q/17914269

http://stackoverflow.com/q/27746647
has answer: http://stackoverflow.com/a/27747284
tagged with: asynchronous
tagged with: node.js
has comment: http://stackoverflow.com/comment/43904665
has comment: http://stackoverflow.com/comment/43904973
score: 0
answer count: 1
has title: .each in Phantom.js with Cheerio - any alternative?
tagged with: phantomjs
tagged with: cheerio
tagged with: javascript
type: UnansweredQuestion
has body: I'm looking for some function that would allow me to reiterate through the div elements scraped by PhantomJs (which uses jQuery-like syntax), but one by one - not all at the same time like .each seems to be doing. So I guess I need it to run syncroniously. At the moment my code looks something like this page.open("https://www.google.com" + expandedurl, function (status) { console.log("opened google knowledge graph ", status); page.evaluate(function () { return document.body.innerHTML; }, function (result) { var $ = cheerio.load(result); $(".kltat").each(function() { var link = $(this); var text = link.text(); launch(text); }); ph.exit(); // Move on to the next one }); }); I need something that would not launch all of the each iterations at the same time. Maybe there's some way of reiterating I could use that would not work asynchroniously - that's what i need...
type: Question

http://stackoverflow.com/comment/43837351
score: 0
type: Comment
type: QuestionComment
has text: Ok, I probably don't get the question. Can you be more specific? What dii you mean with "add size small option"? Do you need to change the size of the modal window?
comment on: http://stackoverflow.com/q/27709559

http://stackoverflow.com/comment/43825567
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27703060
has text: I need to know what you are trying to achieve. Can you explain what a c# web browser is? You mean, you have an web application?

http://stackoverflow.com/q/27759753
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I have a HTML canvas set to the height and width of the window in JavaScript. However, if the window is reshaped, the canvas size stays the same unless the page is refreshed.
has answer: http://stackoverflow.com/a/27759792
score: 1
upvote count: 1
type: Question
tagged with: javascript
has title: Update canvas dimensions as window is reshaped.
tagged with: resize
answer count: 2
tagged with: canvas
tagged with: html5-canvas
downvote count: 0
has answer: http://stackoverflow.com/a/27759861
has comment: http://stackoverflow.com/comment/43930612
favorite count: 0

http://stackoverflow.com/q/27785716
accepted answer: http://stackoverflow.com/a/27785758
tagged with: razor
type: Question
type: AnsweredQuestion
tagged with: asp.net-mvc
answer count: 1
tagged with: javascript
has title: JavaScript Error In View - Loading Order
has comment: http://stackoverflow.com/comment/43981359
score: 0
has answer: http://stackoverflow.com/a/27785758
has body: I have an Index page that loads a script within a Razor @section Scripts I am getting an error on load at Uncaught TypeError: undefined is not a function Here is my script. It is throwing the error at "$("input#autocomplete").autocomplete({" @section scripts { &lt;script type="text/javascript"&gt; var items; $(document).ready(function() { $("input#autocomplete").autocomplete({ source: function(request, response) { $.ajax({.... My question is, does this have anything to do with the where the script section is placed in the view? (it is after the table with the autocomplete input). The layout I am using does include the following in the head: @Scripts.Render("~/bundles/modernizr") @Scripts.Render("~/bundles/jquery")

http://stackoverflow.com/a/27720521
upvote count: 1
has comment: http://stackoverflow.com/comment/43852820
downvote count: 0
answers question: http://stackoverflow.com/q/27720432
type: Answer
has comment: http://stackoverflow.com/comment/43852727
has body: As stated in the comments, $_POST should not be set manually but generated by submitting a form. You can add the values to the URL like this: switch($x[0]){ case 'categorias' : $step = 'categorias'; $pais = $_POST['pais']; $method = 1; ?&gt;&lt;script&gt; window.location.href = "&lt;?php echo $url ?&gt;?step=$step&amp;pais=$pais&amp;method=$method"; &lt;/script&gt;&lt;? break; case 'corredores': $step = 'corredores'; $pais = $_POST['pais']; $method = 1; ?&gt;&lt;script&gt; window.location.href = "&lt;?php echo $url ?&gt;?step=$step&amp;pais=$pais&amp;method=$method"; &lt;/script&gt;&lt;? break; default: //do something ; If you have to use $_POST in the rest of your code you could do something like this at the $url where it is sent. $_POST['pais'] = $_GET['pais']; and so on. Or, replace your $_POST references with $_REQUEST.
score: 1

http://stackoverflow.com/comment/43963168
has text: THIS IS NOT AN AJAX QUESTION.
score: 0
comment on: http://stackoverflow.com/q/27775618
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27674360
has body: You can add the "popup" with jquery, position it under the mouse with css, and animate the element with jquery pretty easily. See the below commented code. As for storing the data, localStorage is probably the quickest/easiest way. Here is a working jsFiddle Note that localStorage is just that, local. As in stored on the physical machine you are using. So if you were to visit this page on your laptop and do some stuff, then visit the page from your desktop, you would not see the changes you made using the laptop. If users need to access the values from different devices, you'll need a backend (server side) solution like using php to connect to a mySql database to store and retrieve the information probly with a little ajax to keep everything asynchronous. If you have this need and dont want to learn php , mySql, and ajax i'd recommend Parse which is basically a super easy to use backend storage API that you can interact with using just javascript. I use parse in several projects and would be lost without it. EDIT: As for the placement of the code in the actual page This page loads jQuery itself in the head tag, then loads the html, then loads the jQuery functions I wrote for you. This works because when the functions are called, jQuery has already been loaded and the elements we want to affect already exist on the page. This page loads jQuery itself in the head tag, then loads the jQuery functions I wrote for you, then loads the html elements we want to affect. This does not work because when the functions are called, the elements we want to affect dont yet exist on the page. This page loads jQuery itself in the head tag, then lists the jQuery functions I wrote for you, then loads the html elements we want to affect. This works because the functions are wraped in $(function(){ PUT CODE HERE }); which tells the page "hey page, I know Im putting this code up here at the top but, I want you to run the code inside it only after the page has fully loaded". $( "#myClickDi…
has comment: http://stackoverflow.com/comment/43766430
answers question: http://stackoverflow.com/q/27673783
has comment: http://stackoverflow.com/comment/43764002
has comment: http://stackoverflow.com/comment/43765876
has comment: http://stackoverflow.com/comment/43767720
has comment: http://stackoverflow.com/comment/43765742
has comment: http://stackoverflow.com/comment/43767583
has comment: http://stackoverflow.com/comment/43767753
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43766733
has comment: http://stackoverflow.com/comment/43767116
score: 0
has comment: http://stackoverflow.com/comment/43766508
type: Answer
has comment: http://stackoverflow.com/comment/43767350
accepted answer of: http://stackoverflow.com/q/27673783

http://stackoverflow.com/comment/43930870
has text: Can you post `ClientService.post` code?
score: 2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27759898

http://stackoverflow.com/q/27756743
has body: Let's say that I have a parent div. And I want to insert/remove content or child divs periodically. The web page resides on client side (it's a chrome extension). Now, how can i achieve this? Example &lt;div class="parent"&gt; &lt;div class="child1"&gt;&lt;/div&gt; &lt;div class="child2"&gt;&lt;/div&gt; &lt;div class="child3"&gt;&lt;/div&gt; &lt;/div&gt; Is there any way that I can write the contents (like ) in a text file and have it injected inside the parent div the next time the user opens chrome and uses my extension. Also If I wanted to remove the child1, I would simply remove the code for child1 in my text file and it will be updated on the client side. Help will be much appreciated.
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43924534
has title: How can I load/refresh divs inside parent div over the internet?
type: Question
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/43924490
has comment: http://stackoverflow.com/comment/43925137
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43972792
has text: visible nodes have a class .visible where visibility:visible - and hidden nodes have a class .hidden where visibility:hidden. I think that is what you meant ? @couchand
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27781298

http://stackoverflow.com/comment/43976415
type: QuestionComment
score: 0
has text: @charlietfl .....edited please review
comment on: http://stackoverflow.com/q/27772568
type: Comment

http://stackoverflow.com/q/27717025
linked to: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/43845999
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/203198
type: Question
has answer: http://stackoverflow.com/a/27717094
has answer: http://stackoverflow.com/a/27717072
score: 0
answer count: 2
tagged with: php
has comment: http://stackoverflow.com/comment/43845962
has comment: http://stackoverflow.com/comment/43847296
has title: how to call click event of dynamically generated content?
has body: I am displaying following data in controller.. <?php $i=0; foreach($this->session->userdata('data') as $item) { //echo " "; print_r($item); echo " "; $query = $this->db->query("SELECT product_name FROM phppos_product WHERE product_id='".$item['product_id']."'"); foreach ($query->result() as $row) { $product_name=$row->product_name; } echo " "; echo " ".$product_name." "; echo " ".$item['quantity']." "; echo " ".$item['unit']." "; echo " ".$item['unit_rate']." "; echo " "; echo " "; $i++; } ?> An in view file on success of ajax... $.post( followurl, {'product_id' : product_id,'quantity':quantity,'unit':unit,'unit_rate':unit_rate}, function(data){ //alert(data) ; $("#cart_details").html(data); $("#quantity").val(''); $("#unit").val(''); $("#unit_rate").val(''); $("#add_to_cart_status").css("visibility", "hidden"); }); $(".remove_from_cart").click(function() { alert("dsasdas"); var array_index = $(this).attr('rownum'); alert(array_index); var followurl ='<?php echo base_url()."index.php/placeorder_ajax/remove_from_cart";?>'; $.ajax({ method: "GET", url: followurl, data : {'array_index':array_index} success: function(data, status){ $("#cart_details").html(data); } }); }); Now I want to call another function on click of remove_from_cart class. But alert is not coming on click of remove_from_cart class. So anybody have any idea?? Note that I am displaying data in controller

http://stackoverflow.com/comment/43816221
has text: What are you expecting `this.form` to do? That's a selector for an element with the name `this` and a class of `form`: `<this class="form">`.
type: Comment
score: 3
type: QuestionComment
comment on: http://stackoverflow.com/q/27701787

http://stackoverflow.com/comment/46453028
type: AnswerComment
score: 0
type: Comment
has text: width:calc() function has problems with IE anyway. You also used position:absolute; on the main section. Anyway, the Bootstrap developers until now unable to solve the issue I posted.
comment on: http://stackoverflow.com/a/29108689

http://stackoverflow.com/q/27770695
has answer: http://stackoverflow.com/a/27776507
has answer: http://stackoverflow.com/a/27775346
score: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27776507
has comment: http://stackoverflow.com/comment/43954261
has comment: http://stackoverflow.com/comment/43952439
favorite count: 0
accepted answer: http://stackoverflow.com/a/27775346
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43954215
tagged with: mathjax
type: AnsweredQuestion
has body: I copied the following MathML code from MathJax and pasted it offline as a one-single HTML file. When I previewed the page, it appeared different from the original MathJax version. This is the HTML file: &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;Maths&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;math xmlns="http://www.w3.org/1998/Math/MathML" display="block"&gt; &lt;msup&gt; &lt;mrow&gt; &lt;mo&gt;(&lt;/mo&gt; &lt;munderover&gt; &lt;mo&gt;&amp;#x2211;&lt;!-- ∑ --&gt;&lt;/mo&gt; &lt;mrow class="MJX-TeXAtom-ORD"&gt; &lt;mi&gt;k&lt;/mi&gt; &lt;mo&gt;=&lt;/mo&gt; &lt;mn&gt;1&lt;/mn&gt; &lt;/mrow&gt; &lt;mi&gt;n&lt;/mi&gt; &lt;/munderover&gt; &lt;msub&gt; &lt;mi&gt;a&lt;/mi&gt; &lt;mi&gt;k&lt;/mi&gt; &lt;/msub&gt; &lt;msub&gt; &lt;mi&gt;b&lt;/mi&gt; &lt;mi&gt;k&lt;/mi&gt; &lt;/msub&gt; &lt;mo&gt;)&lt;/mo&gt; &lt;/mrow&gt; &lt;mrow class="MJX-TeXAtom-ORD"&gt; &lt;mspace width="negativethinmathspace" /&gt; &lt;mspace width="negativethinmathspace" /&gt; &lt;mn&gt;2&lt;/mn&gt; &lt;/mrow&gt; &lt;/msup&gt; &lt;mo&gt;&amp;#x2264;&lt;!-- ≤ --&gt;&lt;/mo&gt; &lt;mrow&gt; &lt;mo&gt;(&lt;/mo&gt; &lt;munderover&gt; &lt;mo&gt;&amp;#x2211;&lt;!-- ∑ --&gt;&lt;/mo&gt; &lt;mrow class="MJX-TeXAtom-ORD"&gt; &lt;mi&gt;k&lt;/mi&gt; &lt;mo&gt;=&lt;/mo&gt; &lt;mn&gt;1&lt;/mn&gt; &lt;/mrow&gt; &lt;mi&gt;n&lt;/mi&gt; &lt;/munderover&gt; &lt;msubsup&gt; &lt;mi&gt;a&lt;/mi&gt; &lt;mi&gt;k&lt;/mi&gt; &lt;mn&gt;2&lt;/mn&gt; &lt;/msubsup&gt; &lt;mo&gt;)&lt;/mo&gt; &lt;/mrow&gt; &lt;mrow&gt; &lt;mo&gt;(&lt;/mo&gt; &lt;munderover&gt; &lt;mo&gt;&amp;#x2211;&lt;!-- ∑ --&gt;&lt;/mo&gt; &lt;mrow class="MJX-TeXAtom-ORD"&gt; &lt;mi&gt;k&lt;/mi&gt; &lt;mo&gt;=&lt;/mo&gt; &lt;mn&gt;1&lt;/mn&gt; &lt;/mrow&gt; &lt;mi&gt;n&lt;/mi&gt; &lt;/munderover&gt; &lt;msubsup&gt; &lt;mi&gt;b&lt;/mi&gt; &lt;mi&gt;k&lt;/mi&gt; &lt;mn&gt;2&lt;/mn…
tagged with: math
type: Question
answer count: 2
tagged with: singlepage
has comment: http://stackoverflow.com/comment/43952899
has title: Why does MathML codes appear different on one-single HTML file, but it worked on Jsfiddle? MathJar for one-single HTML?
tagged with: javascript

http://stackoverflow.com/comment/43965162
score: 0
type: AnswerComment
has text: `These are &ldquo; (“) and &rdquo; (”).` This is bad advice. HTML entities are not converted inside script tag. Use Unicode escape instead `\u201c` for the left quote, `\u201d` for the right quote.
type: Comment
comment on: http://stackoverflow.com/a/27774207

http://stackoverflow.com/a/66687579
score: 0
has body: Before comparing dates, they should be set to 0 hours. This would ensure difference between them is in multiples of 1 day. const isPastDate = (date) => { const specificDate = new Date(date).setHours(0, 0, 0, 0); const today = new Date().setHours(0, 0, 0, 0); return specificDate < today; } console.log(isPastDate("2021-08-10T23:59:00"));
type: Answer
answers question: http://stackoverflow.com/q/27714469

http://stackoverflow.com/comment/121712215
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27641835
has text: @DevMultiTech, you should make yours an answer and it should be the chosen one. function pad(v,s=8){return v.toString(2).padStart(s, '0'); 1. pad(1); /* '00000001' */ 2. pad(1,2); /* '01' */

http://stackoverflow.com/a/28545156
score: 3
has body: I run into this issue by using the grunt watch task. I figured out, that the watch task is calling a jshint:src task But this task is not definied. watch: { src: { files: '&lt;%= jshint.core.src %&gt;', tasks: ['jshint:src', 'qunit', 'concat'] }, test: { files: '&lt;%= jshint.test.src %&gt;', tasks: ['jshint:test', 'qunit'] }, less: { files: 'less/**/*.less', tasks: 'less' } }, I changed this to jshint:core and it is working. watch: { src: { files: '&lt;%= jshint.core.src %&gt;', tasks: ['jshint:core', 'qunit', 'concat'] }, test: { files: '&lt;%= jshint.test.src %&gt;', tasks: ['jshint:test', 'qunit'] }, less: { files: 'less/**/*.less', tasks: 'less' } },
upvote count: 3
answers question: http://stackoverflow.com/q/27778956
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43978816
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27784403
type: Comment
has text: @Mörre: I recommend to read http://en.wikipedia.org/wiki/Evaluation_strategy and learn about the difference between *pass by value* and *pass by reference*.

http://stackoverflow.com/a/27688000
has comment: http://stackoverflow.com/comment/43792389
has body: This should make it recursive. With two solutions. Solution 1: empty test function var boolValue = true; for(var prop in obj) { if(obj.hasOwnProperty(prop) &amp;&amp; typeof obj[prop] === 'object') { boolValue = recursiveIsEmpty(obj[prop]); } else { return false; } } return boolValue ; //test and set empty string recursiveIsEmpty(jsonDataObj['loanDetails']) ? jsonDataObj['loanDetails'] = [] : null; Solution 2 recursive empty function that empties parent obj function recursiveIsEmpty(obj) { var boolValue = true; for(var prop in obj) { if(obj.hasOwnProperty(prop) &amp;&amp; typeof obj[prop] === 'object') { boolValue = recursiveIsEmpty(obj[prop]); if (boolValue) { delete obj[prop]; //an object is empty. Delete from parent; } } else { return false; } } return boolValue; //returns an empty object } recursiveIsEmpty(jsonDataObj['loanDetails']) //returns jsonDataObj['loanDetails'] = []; This checks if obj has a property that is an object. If so load that object and check it's properties. If not return false, because that will be string or number and that confirms the object is not empty.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27687620
has comment: http://stackoverflow.com/comment/43792410
has comment: http://stackoverflow.com/comment/43792673

http://stackoverflow.com/a/27704274
accepted answer of: http://stackoverflow.com/q/27704109
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/43851902
answers question: http://stackoverflow.com/q/27704109
has body: This is because, in the javascript, the char is the code of the caracter (charCodeAt). So this will do the same. Use ord($char) function hashCode($str) { $hash = 0; if (strlen($str) == 0) { return $hash; } for ($i = 0; $i &lt; strlen($str); $i++) { $char = $str[$i]; $hash = (($hash &lt;&lt; 5) - $hash) + ord($char); $hash = $hash &amp; $hash; } return $hash; } If string is ABCD, the output will be this, in both case: 65 2081 64578 2001986 2001986
score: 2

http://stackoverflow.com/comment/44013737
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27792062
has text: Awesome! The remote module can do a lot more, make sure to check out the docs
score: 1

keystroke
type: Tag
tags question: http://stackoverflow.com/q/27672761
tag name: keystroke

http://stackoverflow.com/comment/43825669
type: Comment
comment on: http://stackoverflow.com/q/27706555
has text: You have a lot of code duplication. That's bad ok. `var answers = ['blah'...]; var messages = ['blah'...]; function markAnswers() { var result = answers.reduce(function(result, ans, i){ return result + (document.getElementById('question' + (++i)).value.toUpperCase() === ans); }, 0);; alert("You scored " + result + "/" + answers.length + "! " + messages[result]); }`
score: 0
type: QuestionComment

http://stackoverflow.com/a/27708604
accepted answer of: http://stackoverflow.com/q/27708545
upvote count: 6
answers question: http://stackoverflow.com/q/27708545
downvote count: 1
has comment: http://stackoverflow.com/comment/43829383
has body: var links = $('a[href^="http://www.example.com/?product="]'); // method 1 //links.removeAttr('href'); // method 2 links.click(function(event) { event.preventDefault(); }); Example here: fiddlejs I recommend you to read jQuery Attribute Selectors documentation page.
score: 5
has comment: http://stackoverflow.com/comment/43829791
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43831127
type: Answer

http://stackoverflow.com/q/27778128
tagged with: http://stackoverflow.com/tag/xml
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/798269
tagged with: xslt
has body: When i'm trying to process data out of an xml file I'm facing this problem: I cant find a way to append the data from the for- each statement.I would like to send them as parameters to the js function. Here is sample of the xml: <events> <event> some type 12/24/1999 <participant_name>Mike</participant_name> <participant_name>John</participant_name> . . . and here is the xsl file: <xsl:for-each select="event"> <xsl:variable name="eventType"select="eventType"> </xsl:variable> <xsl:variable name="date" select="date"></xsl:variable> <xsl:value-of select="$eventType" /> <xsl:value-of select="$date" /> <xsl:for-each select="participants/participant"> <xsl:value-of select="participant_name"/> </xsl:for-each> My goal is to create a table when the last column will be a button which sends all the row parameters to js function.The code above is working fine, but I don't seem to find a way to append the participant_name because of its scope. I searched for a solution and didn't find it. hope to find help here, thanks.
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/27778252
tagged with: javascript
has title: How do i transport XSL data out of the scope of the select?
score: 0
linked to: http://stackoverflow.com/q/7711654

http://stackoverflow.com/a/27721185
accepted answer of: http://stackoverflow.com/q/27717443
type: AcceptedAnswer
downvote count: 0
score: 6
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/27717443
has body: This definately looks like a DNS issue, you can access sites via IP but not through the URL. You need to configure your routers DNS settings, personally I would set them to Google's DNS servers 8.8.8.8 (primary) 8.8.4.4 (secondary)

animation
tags question: http://stackoverflow.com/q/27655950
tags question: http://stackoverflow.com/q/27793743
tags question: http://stackoverflow.com/q/27757824
type: Tag
tags question: http://stackoverflow.com/q/27789017
tags question: http://stackoverflow.com/q/27671600
tags question: http://stackoverflow.com/q/27798262
tag name: animation
tags question: http://stackoverflow.com/q/27712910
tags question: http://stackoverflow.com/q/27643582
tags question: http://stackoverflow.com/q/27679975
tags question: http://stackoverflow.com/q/27662406
tags question: http://stackoverflow.com/q/27647763
tags question: http://stackoverflow.com/q/27657613
tags question: http://stackoverflow.com/q/27691137
tags question: http://stackoverflow.com/q/27702100
tags question: http://stackoverflow.com/q/27692443
tags question: http://stackoverflow.com/q/27640320
tags question: http://stackoverflow.com/q/27704974
tags question: http://stackoverflow.com/q/27792310
tags question: http://stackoverflow.com/q/27642278
tags question: http://stackoverflow.com/q/27644085
tags question: http://stackoverflow.com/q/27738471
tags question: http://stackoverflow.com/q/27720520
tags question: http://stackoverflow.com/q/27642185
tags question: http://stackoverflow.com/q/27640556
tags question: http://stackoverflow.com/q/27792909
tags question: http://stackoverflow.com/q/27781807
tags question: http://stackoverflow.com/q/27751434
tags question: http://stackoverflow.com/q/27771692
tags question: http://stackoverflow.com/q/27756515

http://stackoverflow.com/comment/44008648
type: Comment
has text: @Clive i did just that but now i'm getting this error http://errors.angularjs.org/1.3.5/$injector/unpr?p0=PlacesProvider
comment on: http://stackoverflow.com/q/27799529
score: 0
type: QuestionComment

http://stackoverflow.com/q/27769706
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43950431
score: 0
answer count: 2
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has comment: http://stackoverflow.com/comment/43950373
favorite count: 0
accepted answer: http://stackoverflow.com/a/27769939
has title: Looping through Object in jQuery
has body: var obj = { "data": [{ "codice_comparto": "PRO", "descrizione_codice": "Competenze fisse per il personale a tempo indeterminato", "codice_siope": "1101", "descrizione_ente": "", "ricerca": false, "idtable": "000717409-1101", "cod_ente": "000717409", "anno": "2014", "periodo": "12", "codice_gestionale": "1101", "imp_uscite_att": "756", "importo_2013": "37718576", "importo_2014": "32810124", "importo_2015": null }, { "codice_comparto": "PRO", "descrizione_codice": "Straordinario per il personale tempo indeterminato", "codice_siope": "1102", "descrizione_ente": "", "ricerca": false, "idtable": "000720006-1102", "cod_ente": "000720006", "anno": "2014", "periodo": "12", "codice_gestionale": "1102", "imp_uscite_att": "0", "importo_2013": null, "importo_2014": "242532", "importo_2015": null }, { "codice_comparto": "PRO", "descrizione_codice": "Altre competenze ed indennità accessorie per il personale a tempo indeterminato", "codice_siope": "1103", "descrizione_ente": "", "ricerca": false, "idtable": "000720006-1103", "cod_ente": "000720006", "anno": "2014", "periodo": "12", "codice_gestionale": "1103", "imp_uscite_att": "0", "importo_2013": "2262257", "importo_2014": "6227024", "importo_2015": null }], "cosa": false } $.each(obj, function () { $.each(this, function (key, val) { var table = '&lt;tr&gt;' + '&lt;td&gt;' + JSON.stringify(key) + ':' + JSON.stringify(val) + '&lt;/td&gt;' + '&lt;/tr&gt;'; $('#table').append(table); console.log(this); }) }) Here's the output: &lt;table id="table"&gt; &lt;tr&gt; &lt;td&gt;0:{"codice_comparto":"PRO","descrizione_codice":"Competenze fisse per il personale a tempo indeterminato","codice_siope":"1101","descrizione_ente":"","ricerca":false,"idtable":"000717409-1101","cod_ente":"000717409","anno":"2014","periodo":"12","codice_gestionale":"1101","imp_uscite_att":"756","importo_2013":"37718576","importo_2014":"32810124","importo_2015":null}&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;1:{"codice_comparto":"PRO","descrizione_codice":"Straord…
has answer: http://stackoverflow.com/a/27770289
has comment: http://stackoverflow.com/comment/43950407
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27770289
has answer: http://stackoverflow.com/a/27769939
has comment: http://stackoverflow.com/comment/43950314
type: Question

http://stackoverflow.com/a/27711372
upvote count: 1
score: 1
has body: To solve your last question, you can split up your string and iterate: var str = "startBla1end startBla2end startBla3end"; var str_array = str.split(" "); Then iterate over each element of the str_array using your existing code to extract each Bla# substring.
answers question: http://stackoverflow.com/q/27711156
has comment: http://stackoverflow.com/comment/43834842
downvote count: 0
has comment: http://stackoverflow.com/comment/43864490
type: Answer

http://stackoverflow.com/comment/43799006
has text: *I have a feeling that it is going to be something to do with JavaScript.*: Yes. Go with your feeling.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27692887

http://stackoverflow.com/a/27663956
score: 1
has body: You are using the .comment-content selector which is specific to the comments section if you want to select hyperlinks from the post you can try .post-body. Something like this, $('.post-body a').replaceWith(function(){ return $(this).text(); }); It replaces the hyperlink with plain text, if you want to keep the anchor elements and just remove the href attribute try this, $('.post-body a[href]').each(function(){ $(this).removeAttr('href'); });
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27663851
downvote count: 0

http://stackoverflow.com/a/27712928
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27712461
has comment: http://stackoverflow.com/comment/43858033
accepted answer of: http://stackoverflow.com/q/27712461
has comment: http://stackoverflow.com/comment/43863151
has body: If you want to use HTML5 validation, I'm pretty sure you will have to use a real submit input, and not an angular button. In theory, you could use the HTML5 'form' attribute on a standard submit input to achieve this effect. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#attr-form. However, you would want to check browser compatibility carefully. If that doesn't work, I suspect you will have to fall back to putting your submit input inside the form in your markup and then employ "clever" CSS to relocate your button to where you need it on the page.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27790560
answer count: 1
tagged with: file-upload
tagged with: opera-mini
type: UnansweredQuestion
tagged with: php
type: Question
has title: Why are my files not uploaded to Opera Mini?
has comment: http://stackoverflow.com/comment/43990945
has body: I am working on a web-page, which works nicely in most browsers, but not in Opera Mini. Unfortunately I have issues with uploading a file. I have been trying to solve it for hours. I have this javascript: $("body").append('&lt;form id="opera-mini-uploader" method="POST" enctype="multipart/form-data"&gt;&lt;input type="hidden" name="hiddenValues" id="hidden-values" value=""&gt;&lt;input type="file" name="src"&gt;&lt;input type="submit" id="upload-opera-mini" name="upload-opera-mini" value="upload"&gt;&lt;/form&gt;'); $("#opera-mini-uploader").submit(function() { $("#hidden-values").val(JSON.stringify({ "product-title": $("#product-title").val(), "product-description": $("#product-description").val(), "category-id": $("#category-id").val(), "product-price": $("#product-price").val(), "varsity": $("#varsity").val(), "campus-of-varsity": $("#campus-of-varsity").val(), "telephone": $("#telephone").val(), "repeat-telephone": $("#repeat-telephone").val(), "iagree": $("#iagree").prop("checked") })); }); It creates a form with a file input and handles the submit to save other properties on file upload. The properties are saved nicely, but the file is not uploaded... The form appears at the end of the body, when I select a file and try to upload it, it is not successful. I do not see errors, but the file is not uploaded either. My question is: what I am doing the wrong way? How should I implement the file upload to actually have some files on the server? The file upload works for other browsers, but here I have created a separate version for that, because Opera Mini is not able to comply to the fancy features.
tagged with: javascript
has comment: http://stackoverflow.com/comment/43997180
tagged with: post
score: 0
has answer: http://stackoverflow.com/a/27797884

http://stackoverflow.com/a/27741825
type: Answer
has body: just use this code if you want your last element of PackageInfoBox &lt;script type="text/javascript"&gt; $(document).ready(function() { $(".PaymentOptionTitle").on('click',function(){ $(this).closest('.subpayment-title').next().next().slideToggle(); }); }); &lt;/script&gt; DEMO
has comment: http://stackoverflow.com/comment/43895124
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/43894848
has comment: http://stackoverflow.com/comment/43895014
answers question: http://stackoverflow.com/q/27741736
has comment: http://stackoverflow.com/comment/43895214
upvote count: 3
has comment: http://stackoverflow.com/comment/43915414

http://stackoverflow.com/comment/97299889
score: 1
has text: How can we solve the same problem for 3D bezier and line intersection? For example for the points: var p1={ x:0, y:0, z: 1 }; var p2={ x:100, y:0, z: 1 }; var c={ x:0, y:0, z: -5 }; var x1={ x:0, y:0, z: 0 }; var x2={ x:100, y:0, z: 0 };
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27664883

http://stackoverflow.com/q/27698714
type: Question
has comment: http://stackoverflow.com/comment/43817910
tagged with: javascript
has comment: http://stackoverflow.com/comment/43818922
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43818047
tagged with: casperjs
upvote count: 2
type: UnansweredQuestion
has title: casper.open(...) issue when the url doesn't exit
has comment: http://stackoverflow.com/comment/43818591
score: 2
has body: I would like make a sample script allows to check a list of url (pass from a csv file). Foreach urls, the script return if the url return an error (404, 500..) or not. So, after several tries, I almost do that but...I noticed when the URL doesn't exit (example; http://akljdlkzjlkadz.jhjkhkajzhd), my casper.open has no time for get the error (500) before the next casperjs step '.then' begin. I mean : this is my function who contains the two casperjs steps ; function check(line){ this.then(function(){ //step one url = line.split("|"); this.echo("TEST0 : "+url[0]); this.open(url[0]); }); this.then( function (){ //step two if (this.currentHTTPStatus === 404){ this.warn("Error 404"); }else if (this.currentHTTPStatus === 500){ this.warn("Error 500"); }else{ this.echo("TEST1 : "+url[0]); this.echo("TEST2 : "+this.getCurrentUrl()); this.echo("Link OK !"); } }); } And With the several this.echo(..), my terminal shows that : TEST0 : http://www.google.com TEST1 : http://www.google.com TEST2 : http://www.google.com LINK OK! TEST0 : http://www.google.es TEST1 : http://www.google.es TEST2 : http://www.google.es LINK OK! TEST0 : http://www.google.azerty TEST1 : http://www.google.azerty TEST2 : http://www.google.es &lt;----- getCurrentUrl() doesn't return http://www.google.azerty, has no time because this url doesn't exist? LINK OK! I tried several way for fix that..but I don't find and understand why the second .then begin whereas the first .then wasn't finish. casperjs version : 1.1.0-beta3 phantomjs version : 1.9.7 nodejs version : v0.10.25 And the fully code of my script ; var casper = require("casper").create({ pageSettings: { loadImages: false, loadPlugins: false } }); var fs = require('fs'); var csv = casper.cli.get(0); var url; function check(line){ this.then(function(){ url = line.split("|"); this.echo("TEST0 : "+url[0]); this.open(url[0]); }); this.then( function (){ if (this.currentHTTPStatus === 404){ this.warn("Error 404"); }else if (this.currentHTTPStatus === 500){ th…
tagged with: phantomjs
answer count: 0

http://stackoverflow.com/a/27645986
upvote count: 9
type: Answer
downvote count: 0
has body: You can use this directive ng-enter, like this &lt;input type="search" placeholder="Search" ng-enter="search()" ng-model="searchKey"&gt;
score: 9
accepted answer of: http://stackoverflow.com/q/27645855
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27645855

http://stackoverflow.com/q/27709733
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27709771
score: 2
type: Question
tagged with: javascript
has title: Calling function defined on $scope from another function defined on $scope in AngularJS
has body: I have a controller with many functions defined on $scope. Ex: $scope.doSomething = function() { } $scope.doSomethingElse = function(data) { } From my doSomething function, I want to call my doSomethingElse function. Right now, I am calling it in the success function of my HTTP request (yes, it is succeeding). Once the success function triggers, I'm calling the other function like so: angular.scope().doSomethingElse(data); The data variable is passed through as a parameter in the success function. After running, I'm receiving this error: TypeError: undefined is not a function Is there another way to do this?
upvote count: 2
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43831382

http://stackoverflow.com/comment/43777202
type: QuestionComment
score: 1
has text: I don't believe that it would work (though you are free to try it and see if it does or not). What I was saying is simply that there is an extra "angular" folder inserted so that it is possible to install related projects under a common parent (e.g. "angular/routes", "angular/i18n", "angular/loader", etc.). I don't know that angular, specifically, takes advantage of this structure... but other projects often do.
comment on: http://stackoverflow.com/q/27681150
type: Comment

http://stackoverflow.com/comment/43892872
comment on: http://stackoverflow.com/a/27740848
score: 0
type: Comment
has text: thank you my bad that works fine, but i have another question when i add map.fitBounds(bounds); after the for loop in the removeMarker function it stops working, how can i make the map fitBounds after moving a Pin ?
type: AnswerComment

http://stackoverflow.com/a/27754255
accepted answer of: http://stackoverflow.com/q/27754220
score: 1
upvote count: 1
has body: If you take a look in for example Chrome's DevTools console you'll notice an error message like: Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher this either means that jQuery isn't loaded or that Bootstrap's JavaScript is loaded before jQuery. If you take a look in your head section you'll see that the latter is the case. Make sure that js/jquery-1.11.1.min.js occurs before js/bootstrap.min.js. P.S. it might be that the modal still doesn't work after these changes, but you need to fix this first.
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27754220
type: Answer
has comment: http://stackoverflow.com/comment/43920642

http://stackoverflow.com/q/27740138
tagged with: javascript
score: 4
tagged with: ajax
has answer: http://stackoverflow.com/a/47188343
has body: How can I do an ajax call using Framework7? I already know how to do ajax call using jQuery but I don't know how to do it in Framework7. I am using this for calling an API that returns data.
tagged with: html-framework-7
answer count: 4
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27781143
has comment: http://stackoverflow.com/comment/43893257
has comment: http://stackoverflow.com/comment/43891146
has answer: http://stackoverflow.com/a/48073751
type: Question
downvote count: 2
has answer: http://stackoverflow.com/a/55772221
has title: How to do ajax call in an API using Framework7
upvote count: 6

http://stackoverflow.com/q/27663161
has body: I have very much javascript code in my HTML file (1500 lines), and I want to move parts of it to an other js file. I want to make a single file for importing data, and I can find the best way to do it. This is my gameDataImport.js file: function gameImport(gameID){ xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET","../riskmanagment/Data/gameData.xml",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; var numberOfWorkers; var x=xmlDoc.getElementsByTagName("game"); for (i=0;i&lt;x.length;i++) { if(x[i].getAttribute('id') == gameID) { this.gameName = x[i].getElementsByTagName("name")[0].childNodes[0].nodeValue; this.numberOfWorkers = x[i].getElementsByTagName("numberOfWorkers")[0].childNodes[0].nodeValue; this.numberOfWorkersLeft = numberOfWorkers; this.overtimeWorkers = x[i].getElementsByTagName("overtimeWorkers")[0].childNodes[0].nodeValue; this.overtimeWorkersLeft = overtimeWorkers; this.difficulty = x[i].getElementsByTagName("difficulty")[0].childNodes[0].nodeValue; this.budget = x[i].getElementsByTagName("budget")[0].childNodes[0].nodeValue; this.gameTargetMinutes = x[i].getElementsByTagName("targetGameTime")[0].childNodes[0].nodeValue; this.gameTargetDays = x[i].getElementsByTagName("targetDays")[0].childNodes[0].nodeValue; this.gameLanguage = x[i].getElementsByTagName("language")[0].childNodes[0].nodeValue; this.projectDescriptionText = x[i].getElementsByTagName("description")[0].childNodes[0].nodeValue; this.wage = x[i].getElementsByTagName("wage")[0].childNodes[0].nodeValue; this.Owage = x[i].getElementsByTagName("Owage")[0].childNodes[0].nodeValue; this.numberOfRisks = x[i].getElementsByTagName("numberOfRisks")[0].childNodes[0].nodeValue; } } And this how I try to get the data: in head: &lt;script type="text/javascript" src="js/gameDataImport.js"&gt;&lt;/script&gt; in body, inside script tag: numberOfWorkers = gameImport(gameID).numberOfWorkers; but I only get this error: Uncaught TypeError: Cannot read property 'numberOfWorkers' of undefined I have not tri…
has title: Use external JS to import data from XML
accepted answer: http://stackoverflow.com/a/27663299
has comment: http://stackoverflow.com/comment/43745734
tagged with: http://stackoverflow.com/tag/xml
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43742896
tagged with: javascript
has answer: http://stackoverflow.com/a/27663198
score: 0
has answer: http://stackoverflow.com/a/27663299
answer count: 2
tagged with: external-js
has comment: http://stackoverflow.com/comment/43745480
possible better answer: http://stackoverflow.com/a/27663198

http://stackoverflow.com/comment/43722287
type: Comment
has text: Updated with a solution I tried that gives me a undefined is not a function error
comment on: http://stackoverflow.com/a/27652568
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43950955
comment on: http://stackoverflow.com/q/27769935
type: QuestionComment
type: Comment
has text: Sorry It did not work
score: 0

http://stackoverflow.com/comment/43852345
has text: actually i am looking for how to limit the html inside CKEDITOR
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27720326
type: Comment

http://stackoverflow.com/comment/43813482
comment on: http://stackoverflow.com/a/27700129
type: Comment
has text: @HassanAli Answer updated as per DelightedD0D's suggestion. This will make it very easy to add/remove keycodes.
type: AnswerComment
score: 0

http://stackoverflow.com/q/27702715
tagged with: css
upvote count: 1
downvote count: 1
type: Question
has title: Push menu not working properly on default android browser
has comment: http://stackoverflow.com/comment/43817776
tagged with: javascript
tagged with: jquery
score: 0
has body: I have a sliding push menu for mobile which is sliding from left to right. It is working fine on all mobile browsers except the default android browser. I have placed menu icon inside my wrapper. When I clicked on menu icon in default browser the menu icon is not sliding towards right. The sliding menu overlaps the icon. But if I change the position from fixed to absolute it works properly. Please help me to make it compatible with default mobile browser with fixed position. CSS: #primary-menu-toggle { z-index:999 !important; top: 84px; position: fixed; } HTML: navigation items
has answer: http://stackoverflow.com/a/27702870
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/27696456
accepted answer of: http://stackoverflow.com/q/27694990
answers question: http://stackoverflow.com/q/27694990
score: 4
upvote count: 4
has body: This javascript fragment does not work because it is mixing client-side and server-side expressions. Did you try to achieve the same just by testing null values in a dynamic URI expression such below: if (row["uuid"]!=null){ "http://example.com/myfolders/myfiles/" + row["uuid"] } When uuid is null, this expression won't return any value and consequently hyperlinks are not created. Let me know if it helps.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43806199
type: Answer

http://stackoverflow.com/comment/43864613
comment on: http://stackoverflow.com/q/27724428
type: QuestionComment
type: Comment
score: 0
has text: this is what i got:'var skyMaterial = new THREE.MeshPhongMaterial({color: 0x00bfff} ); var object = new THREE.Mesh(new THREE.PlaneBufferGeometry(20000,20000), skyMaterial); object.scale(self.unitSize * 2,self.unitSize * 2,self.unitSize * 2); object.position.y = 150; object.rotation.x = Math.PI / 2; object.receiveShadow = true; object.updateMatrix(); object.matrixAutoUpdate = false;' I get this error now "object.scale is not a function".

http://stackoverflow.com/a/27756176
upvote count: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43923059
downvote count: 0
has body: change the x function call like this, this.start = function(){ alert("starting"); x(this.done.bind(this)); }
accepted answer of: http://stackoverflow.com/q/27756059
answers question: http://stackoverflow.com/q/27756059
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/43923221

http://stackoverflow.com/q/27698096
has comment: http://stackoverflow.com/comment/43809908
has comment: http://stackoverflow.com/comment/43809366
answer count: 0
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/43809549
has comment: http://stackoverflow.com/comment/43809598
type: Question
linked to: http://stackoverflow.com/q/27687644
tagged with: javascript
score: 0
has body: I'm trying to insert an HTML 5 datepicker into a twitter bootstrap dropdown but it won't load the calendar from inside the dropdown menu. Here's a basic example. HTML Pick a Date Today Tomorrow Next Week Select a Date JQuery $('.datepicker').click(function(e) { e.stopPropagation(); $(this).html(' '); });
type: UnansweredQuestion
has title: HTML 5 datepicker in twitter bootstrap dropdown
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43934698
score: 0
has text: What is the exact value of $videoLink? I tried your code with all of the urls shown on the previous example and it captures `11111111`. Here, have a look: http://ideone.com/uTIhu4
type: Comment
comment on: http://stackoverflow.com/q/27761690
type: QuestionComment

http://stackoverflow.com/a/27803827
type: Answer
has body: Change Submit to and taskInformation function to the following function taskInformation() { var subject = document.getElementById("subject").value; var datepicker = document.getElementById("datepicker").value; var inputBox = document.getElementById("inputBox").value; if (document.checkIt[0].checked) { document.getElementById("inProgress").innerHTML = "Subject: " + subject + "\n" + "Due Date: " + datepicker + "\n" + "Description: " +inputBox; } else { document.getElementById("completed").innerHTML = "Subject: " + subject + "\n" + "Due Date: " + datepicker + "\n" + "Description: " +inputBox; } }
answers question: http://stackoverflow.com/q/27802851
score: 0

http://stackoverflow.com/q/27780504
has body: In am using a calendar in bootsrtap datepicker, in that I have displaying only month and year (mm-yyy). I want to disable future months from current month. I have searched a lot but I didn't find an answer. Please help me, I have attached my code below JS : $(document).ready(function () { var cou = $('#rolecount').val(); var c; for (c = 0; c &lt;=cou; c++){ $('#datepicker'+c).datepicker({ format: 'mm-yyyy', endDate: '+0d', viewMode: "months", minViewMode: "months", }); $('#datepicker'+c).datepicker().on('monthSelected', function(ev){ $(this).datepicker('hide'); }); } }); HTML: &lt;div class="input-group date"&gt; &lt;input type="text" id="datepicker&lt;?=$j?&gt;" required name="joindate&lt;?=$j?&gt;" class="date_picker form-control" placeholder="show datepicker" maxlength="100" autocomplete="off"&gt;&lt;span class="input-group-addon" id="basic-addon2"&gt;&lt;i class="fa fa-calendar"&gt;&lt;/i&gt;&lt;/span&gt; &lt;input type="hidden" name="roleid&lt;?=$j?&gt;" value="&lt;?=$str[$j]?&gt;" /&gt; &lt;/div&gt;
tagged with: datepicker
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27781645
accepted answer: http://stackoverflow.com/a/27781645
tagged with: javascript
answer count: 1
downvote count: 0
has title: How to disable future months from current months in bootstrap datepicker
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/61523840
score: 3
type: Comment
comment on: http://stackoverflow.com/a/35015622
type: AnswerComment
has text: @FilipDupanović If your programmers can make a mess within a single line of code, just because eslint is not looking over their shoulders for a single line. There is really something else going wrong at your company... That said, saying what rule you wish to ignore makes it more clear why you put the disable line there in the first place.

http://stackoverflow.com/comment/48609028
has text: This doesn't work properly because in JavaScript `"44" > "143"` is `true` when comparing strings. Also, you're mixing in external state, using the `.attr` setter needlessly, and doing a `"[data-foo='" + min + "']"` lookup when that element is already in memory. See my answer for a better approach
comment on: http://stackoverflow.com/a/27791931
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43707436
comment on: http://stackoverflow.com/q/27644335
type: Comment
type: QuestionComment
has text: There are only html and javascript on client-side. Html doesn't have any trimming functionality. So you have to do it in js. MVC also doesn't have any helpers to generate trimming js.
score: 1

http://stackoverflow.com/a/27650661
answers question: http://stackoverflow.com/q/27644296
type: Answer
score: 1
upvote count: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27644296
type: AcceptedAnswer
has body: There are a few important things to know about cookies and browsers and how they interact across domains. Websites can set cookies for their own website Websites cannot set cookies for a different website Cookies can be set on the response or using things such as JavaScript The first two may seem confusing, especially when some sources say they are possible. It's important to note that they only affect cases where the response is directly setting the cookie using the Set-Cookie header, which allows a website to directly set a cookie. There are some special cases for things like subdomains, but in general you should not expect browsers to respect cookies set on other domains that you don't control. If you were allowed to arbitrarily set cookies on other websites, this would open the door for websites to arbitrarily set and unset cookies you are using, even if they are unrelated. This would include the ability to log someone out across domains in just the response alone, which isn't possible. The third point is important for cases like advertising, as cookies can be set using the Set-Cookie header (or response.set_cookie in Django) or using JavaScript through the document.cookie property. As JavaScript can included from any domain using the src property on &lt;script&gt; tags, any domain can manage cookies on another domain if it is included through JavaScript. This is important to how many analytics services, such as Google Analytics, work becuase it allows them to store unqiue cookies on each website for each user that is being monitored, even though they do not have full control over the response. They also typically use tracking beacons in the form of images to send data back to the external domain and associate it with the stored cookie. The answer you linked to talks about this with images, but explains that it does not actually set the cookie on another domain. The cookie which is being set using the image or frame is stored only on the external domain, and can…

http://stackoverflow.com/comment/43863110
comment on: http://stackoverflow.com/q/27725181
has text: Hi @lukewestby i changed the `checkDispAndExist` for the correct method name `checkDisponible` but the error is still there. [Here](https://github.com/nanotime/OMI/blob/master/app/models/models.js) and [here](https://github.com/nanotime/OMI/blob/master/app/routes/facturas.js) is the complete code of models and the specific route.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27783228
downvote count: 0
type: Answer
score: 2
upvote count: 2
has body: The result of getPosition isn't what you expect after you've moved the first circle, so cache it before the move setTimeout(function(){ var a = circle2.getPosition(), b = circle1.getPosition(); circle1.setPosition(a); circle2.setPosition(b); }, 1000);
answers question: http://stackoverflow.com/q/27783169

http://stackoverflow.com/comment/43953121
has text: I do not see either your script, neither the flot.js file
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27770768
type: AnswerComment

http://stackoverflow.com/comment/43884673
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27713513
has text: Hello @SpikeMF, thanks for your help... I tested it on a galaxy y phone and it worked without problems. So I believe that it was a bug of renderization sequence on xdk Intel. Thx for your help.. have a nice 2015!

http://stackoverflow.com/a/32141121
upvote count: 1
has body: I've been looking around for an example and tried out the above code with the suggested edits but it still failed ... (maybe the mqttws31.js has changed) but I got a working example from here which works just fine when you change the port to 8080! -hope this helps somebody!
answers question: http://stackoverflow.com/q/27740003
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/27720326
has comment: http://stackoverflow.com/comment/43852539
has comment: http://stackoverflow.com/comment/43852274
answers question: http://stackoverflow.com/q/27719498
score: 6
has comment: http://stackoverflow.com/comment/43852194
has comment: http://stackoverflow.com/comment/43852345
has comment: http://stackoverflow.com/comment/43852538
has comment: http://stackoverflow.com/comment/43852368
has comment: http://stackoverflow.com/comment/43852578
has comment: http://stackoverflow.com/comment/43852396
has body: You need to add an id to your textarea, like this: &lt;textarea data-ng-model="editor.value" maxlength="50" id="mytext" data-ck-editor&gt;&lt;/textarea&gt; You need to handle the key events for CKEDITOR: window.onload = function() { CKEDITOR.instances.mytext.on( 'key', function() { var str = CKEDITOR.instances.mytext.getData(); if (str.length &gt; 50) { CKEDITOR.instances.mytext.setData(str.substring(0, 50)); } } ); }; This works, however, note, that the content contains html tags as well, you might want to keep them,
downvote count: 0
type: Answer
upvote count: 6

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/27720178
tags question: http://stackoverflow.com/q/27681939
tags question: http://stackoverflow.com/q/27801661
tags question: http://stackoverflow.com/q/27701316
tags question: http://stackoverflow.com/q/27735831
tags question: http://stackoverflow.com/q/27735713
type: Tag
tags question: http://stackoverflow.com/q/27735242
tags question: http://stackoverflow.com/q/27697457
tags question: http://stackoverflow.com/q/27660811

http://stackoverflow.com/q/27795940
tagged with: template-engine
has title: A JS alternative to Jinja2 that works on a static server with AngularJS
favorite count: 0
tagged with: angularjs
has body: I'm developing the front-end of an application using AngularJS on an "old school" server, by that I mean there is no support for Python, Ruby, Java whatsoever. I only have access to a poor phpMyAdmin db and php, and I won't use them. I'm quite used to the template engine of Django (from which Jinja2 is inspired), and I am a big fan of the block inheritance feature. Unfortunately, AngularJS only provides a regular include instruction that simply allows for blocks of codes to be included in the output file. With Django (Jinja) on the other hand, you can easily do something like Document {% block content %} {% endblock content %} and for every page of your website {% extends "core/skeleton.html" %} {% block content %} This is my content... ...and I don't care about the rest. {% endblock content %} which I found very powerful. With AngularJS only, you would end up with 2 include statements to achieve the same result. Plus the more blocks you want to nest within the page, the more include statements you need to use (actually, every Django block would lead to 2 ìnclude statements in AngularJS). What would be the most appropriate template engine that meets my requirements? Namely: Written in JS so that it can be run on a "static" server With the block inheritance feature Light That does not clash with AngularJS
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27796863
downvote count: 0
score: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44001724
upvote count: 1
answer count: 1

http://stackoverflow.com/q/27797793
accepted answer: http://stackoverflow.com/a/27797854
has answer: http://stackoverflow.com/a/27800030
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44004672
has body: Okay, I hope you don't all facepalm when you see this - I'm still finding my way around javascript. I am putting together an RSVP form for a wedding website. I want the guests to be able to add their names to the RSVP form, but only have as many fields showing as required. To this end, after each name field, there is a link to click, which will, when clicked, show a name field for the next guest. The code below works... but I am sure it can be tidier. I have tried to insert a for() loop into the code in several different ways, I can see that the for() loop increments correctly to the last value - but when it does so, it leaves only the last addEventListener in place. I can only assume, that I should be using a different kind of loop - or a different approach entirely. How should I tidy up the following? &lt;script&gt; function showNextGuest(i) { document.getElementsByTagName(\'fieldset\')[i].style.display = \'block\'; } function initiateShowNextGuest() { document.getElementsByTagName('fieldset')[0].getElementsByTagName('a')[0].addEventListener('click',function(){showNextGuest(1);},false); document.getElementsByTagName('fieldset')[1].getElementsByTagName('a')[0].addEventListener('click',function(){showNextGuest(2);},false); document.getElementsByTagName('fieldset')[2].getElementsByTagName('a')[0].addEventListener('click',function(){showNextGuest(3);},false); document.getElementsByTagName('fieldset')[3].getElementsByTagName('a')[0].addEventListener('click',function(){showNextGuest(4);},false); document.getElementsByTagName('fieldset')[4].getElementsByTagName('a')[0].addEventListener('click',function(){showNextGuest(5);},false); } window.onload = initiateShowNextGuest(); &lt;/script&gt;
possible better answer: http://stackoverflow.com/a/27797837
has answer: http://stackoverflow.com/a/27797854
tagged with: loops
has answer: http://stackoverflow.com/a/27797837
linked to: http://stackoverflow.com/q/750486
type: Question
has comment: http://stackoverflow.com/comment/44004520
tagged with: addeventlistener
tagged with: javascript
has comment: http://stackoverflow.com/comment/44004326
has title: Simplifying a javascript function with repeated similar lines (with a loop?)
score: 0
answer count: 3

http://stackoverflow.com/q/27710585
downvote count: 2
has answer: http://stackoverflow.com/a/27710679
accepted answer: http://stackoverflow.com/a/27711109
has body: I am a beginner in ajax/JS/jQuery. I have an ajax call that checks if a file is available on server. To accomplish this I use setInterval() and clearInterval(). I am having trouble in setting the display property to an html element upon successful ajax call. Any guidance is highly appreciated. Click Me
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27710679
type: Question
has title: Unable to update the visibility of an html block from ajax/jquery/JavaScript containing clearInterval/setInterval
upvote count: 0
score: -2
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/27711109
tagged with: clearinterval
has answer: http://stackoverflow.com/a/27710745
answer count: 3
tagged with: setinterval

http://stackoverflow.com/q/27692132
tagged with: ajax
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/27692195
has body: I've an issue with multiple ajax requests. For example I've a form with a button, and onclick it runs a service which essentially load list of items in a table; for now it should load a single item into a table when I hit the button. However, when I hit the button multiple times, the same item is duplicated when its loaded. How can I prevent while there is still no callback from the first one? current ng service var getItems = function () { var def = $q.defer(); Items.get().then(function (items) { def.resolve(items); }, function (err) { ... }); }; Not sure if this is a solution, but when I write above code like this: var def = false; var getItems = function () { def = $q.defer(); Items.get().then(function (items) { def.resolve(items); }, function (err) { ... }); }; This stops the duplication when I initialize the def = false, not sure if this is the correct approach by resetting the previous/old request to false?
has title: Prevent multiple ajax requests onclick
tagged with: angularjs
upvote count: 1
has comment: http://stackoverflow.com/comment/43797787
type: AnsweredQuestion
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43826629
possible better answer: http://stackoverflow.com/a/27692466
tagged with: javascript
has answer: http://stackoverflow.com/a/27721687
tagged with: http://stackoverflow.com/tag/q
has answer: http://stackoverflow.com/a/27692195
has answer: http://stackoverflow.com/a/27692466
favorite count: 0

http://stackoverflow.com/q/27648001
has comment: http://stackoverflow.com/comment/43713517
has answer: http://stackoverflow.com/a/27648027
score: 0
has body: Happy Holidays to all. I'm trying to execute a function that I have saved in a variable, as I could do this? I tried this. funcVar = 'function (a, b) {c = a + b; alert (c);}'; document.write (funcVar); but has no functionality, I want to use that function that is in the variable at some point.
answer count: 3
has comment: http://stackoverflow.com/comment/43713525
possible better answer: http://stackoverflow.com/a/27648027
accepted answer: http://stackoverflow.com/a/27648016
has title: javascript function into variable
has answer: http://stackoverflow.com/a/27648093
has comment: http://stackoverflow.com/comment/43713518
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43713526
type: Question
has answer: http://stackoverflow.com/a/27648016
tagged with: javascript

http://stackoverflow.com/q/27726614
has answer: http://stackoverflow.com/a/27726859
favorite count: 0
has title: 'Translation from jQuery to JavaScript'
score: 5
possible better answer: http://stackoverflow.com/a/27726859
linked to: http://stackoverflow.com/q/9127498
has answer: http://stackoverflow.com/a/27727044
type: AnsweredQuestion
has body: I'm a noobie that has been learning by his own and messing around with javascript and I stumbled upon that nightmare called 'regular expressions'...I kinda know a little bit about them and I been doing fancy stuff, but I'm stuck and I'd like you clarify this to me: I've been reading and looking for a way to create matches and I tripped on with great answer: How to perform a real time search and filter on a HTML table ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var $rows = $('#table tr'); $('#search').keyup(function() { var val = '^(?=.*\\b' + $.trim($(this).val()).split(/\s+/).join('\\b)(?=.*\\b') + ').*$', reg = RegExp(val, 'i'), text; $rows.show().filter(function() { text = $(this).text().replace(/\s+/g, ' '); return !reg.test(text); }).hide(); }); http://jsfiddle.net/dfsq/7BUmG/1133/ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// I kinda understand what is going on there but could somebody break that down and 'translate it in javascript' for me so I can catch the idea better, I barely can do cool stuff with jquery since I'm still studying javascript, I know certain things about the jqueries but not enough to fully understand what he did there and enough about regular expressions to know that the guy who wrote taht code is a genius &lt;3 this is what i understand and please correct me: var $rows = $('#table tr'); it's the scope, the 'target' in which is gonna be looking for the match pd:that's the first time I see the'$' to declare variables and for what I've looked it sets it as a jQuery object..it's that right? var val = '^(?=.*\\b' + $.trim($(this).val()).split(/\s+/).join('\\b)(?=.*\\b') + ').*$', reg = RegExp(val, 'i'), text; the '$.trim($(this).val()' is equal to $.trim($("#user_input").val()); .......right? reg = RegExp(…
type: Question
upvote count: 5
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27727044
linked to: http://stackoverflow.com/q/1646698
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43865611
has answer: http://stackoverflow.com/a/27726895
tagged with: regex

http://stackoverflow.com/comment/43755708
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27664419
has text: I could call applyMatrix() on the mesh (object3d) instead of the geometry, right? That's what I was expecting, and now I'm scratching my head trying to see the difference.

http://stackoverflow.com/a/27789600
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27786016
has body: The OWF website says it already supports Cesium: A fully functional map widget that is designed to be extensible by other programs for their particular needs, and currently provides Google Earth, OpenLayers, Cesium and WorldWind renderers I work on Cesium, but have never used OWF so I can't speak to the details. There is also a Cesium plugin that provides GWT wrappers for Java developers that may be of interest to you. Patrick
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/27786016
downvote count: 0

http://stackoverflow.com/comment/43818123
comment on: http://stackoverflow.com/a/27676058
has text: You need to make your own implementation of iDatastore to save it filedatastore stores it to %appdata%
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43763522
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27674150
has text: what is the alert message ?
score: 0

http://stackoverflow.com/q/27764446
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43939715
has body: I want to get all data-bind key value pairs as object using eval and bind this object's properties to the same properties from the model object. &lt;div data-bind="innerHTML: text, style: { color: color }"&gt;&lt;/div&gt; Array.prototype.slice.call(document.querySelectorAll('[data-bind]')).forEach(function (el) { var model = { text: 'text', color : 'red' } var boundData = eval('({' + el.getAttribute('data-bind') + '})'); } Final result should be: boundData.text to be equal to the model's property text property boundData.color to be equal to the model's property color property This example gives me Uncaught ReferenceError: text is not defined
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/43939699
has comment: http://stackoverflow.com/comment/43939575
has answer: http://stackoverflow.com/a/27764551
type: Question
has comment: http://stackoverflow.com/comment/43939592
upvote count: 0
score: -2
has title: Bind object's properties with values from other object's properties

http://stackoverflow.com/comment/43940008
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27764498
has text: There is no "null date". A javascript (i.e. ECMAScript) Date object is based on a [*time value*](http://ecma-international.org/ecma-262/5.1/#sec-15.9.1.1), which is a number of milliseconds before or after the epoch (1970-01-01T00:00:00Z). The result of `new Date(value)` (where *value* is optional) will either be a valid Date object or `NaN` (presuming that an error isn't thrown).
score: 0

http://stackoverflow.com/comment/43786939
type: Comment
has text: It worked, not sure why I didn't catch this small mistake. It was some left-over code from the first version of the project which I missed during the transition. Thanks!
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27686530

http://stackoverflow.com/q/27741234
score: 0
has comment: http://stackoverflow.com/comment/43893414
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has body: Ok, so here is my problem: I am making this Tumblr theme, so I can only have one html, which means I can't use the typical method of adding an id to each body. So I thought about it and concluded that I need 5 javascript codes that each checks the url on which I am currently and if I am f.ex. on http://whatchoodo.tumblr.com the li #home will have border-bottom: #6DC176 solid 3px; , color: #6DC176; and font-weight: bold; Basically I have it all thought out, but I don't know a way to check if url = sth . Here's the temporary link to the page if it helps you visualize what I want: http://whatchoodo.tumblr.com
tagged with: css
has comment: http://stackoverflow.com/comment/43894081
answer count: 0
has title: Change CSS of current page title (in navigation menu)
type: Question
has comment: http://stackoverflow.com/comment/43893390
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/43760455
has text: "It doesn't work" + no code = downvote+closevote
comment on: http://stackoverflow.com/q/27672823
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/comment/43743244
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27652768
has text: Down voter mind to explain? And why should it closed? It's technically related :(
score: 0

scope
tags question: http://stackoverflow.com/q/27685156
tags question: http://stackoverflow.com/q/27641524
tags question: http://stackoverflow.com/q/27711227
tags question: http://stackoverflow.com/q/27643829
tags question: http://stackoverflow.com/q/27663522
tags question: http://stackoverflow.com/q/27651598
tags question: http://stackoverflow.com/q/27731756
tags question: http://stackoverflow.com/q/27705942
tags question: http://stackoverflow.com/q/27677745
tag name: scope
tags question: http://stackoverflow.com/q/27730949
tags question: http://stackoverflow.com/q/27800580
type: Tag
tags question: http://stackoverflow.com/q/27691887
tags question: http://stackoverflow.com/q/27797601
tags question: http://stackoverflow.com/q/27652762

http://stackoverflow.com/a/27650777
has body: You can use a mutation observer to listen to DOM changes. This won't react to SMIL changes though, just attribute and element changes. Mutation events may contain multiple DOM changes as they are sent asynchronously.
has comment: http://stackoverflow.com/comment/43718808
type: AcceptedAnswer
downvote count: 0
score: 7
type: Answer
answers question: http://stackoverflow.com/q/27650510
upvote count: 7
accepted answer of: http://stackoverflow.com/q/27650510

http://stackoverflow.com/a/27784301
accepted answer of: http://stackoverflow.com/q/27784242
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27784242
has body: Try comparing with intval. It is possible you are comparing strings with integers. A simple javascript:alert(656 &lt;7); in url box shows false as expected.
type: Answer

http://stackoverflow.com/a/27720903
score: 4
accepted answer of: http://stackoverflow.com/q/27720380
upvote count: 4
has comment: http://stackoverflow.com/comment/43853686
answers question: http://stackoverflow.com/q/27720380
type: AcceptedAnswer
type: Answer
has body: To center the content you can use the text-center class, provided by the Bootstrap. And to achieve the auto focus in the modal, you have to use the modal events and for transferring tab control to the next input you can use a small jQuery code referred from this post : Take focus on next input after key up using Jquery. Check out this fiddle : JSFIDDLE hope this will help you.
downvote count: 0

http://stackoverflow.com/comment/43813708
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27700437
has text: add die after the echo then it will output your text only.

http://stackoverflow.com/a/27800906
type: Answer
has comment: http://stackoverflow.com/comment/44034885
accepted answer of: http://stackoverflow.com/q/27798174
answers question: http://stackoverflow.com/q/27798174
score: 6
upvote count: 7
has comment: http://stackoverflow.com/comment/135378944
downvote count: 1
has comment: http://stackoverflow.com/comment/44011085
has body: Try Postmark.js. It's simpler Or emailjs
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/131108309

object-literal
tag name: object-literal
tags question: http://stackoverflow.com/q/27677021
type: Tag

http://stackoverflow.com/comment/43714609
type: AnswerComment
has text: no way it is null (besides being an empty select) but the question stated "in case the value is null" so I went for that
type: Comment
comment on: http://stackoverflow.com/a/27648561
score: 0

http://stackoverflow.com/comment/43867485
comment on: http://stackoverflow.com/q/27726631
score: 0
type: Comment
type: QuestionComment
has text: So, you doesn't have to draw rect with negative Y, you have to translate the context

http://stackoverflow.com/comment/43969315
comment on: http://stackoverflow.com/a/27779226
score: 0
has text: Your solution is ok.But there is a little difference between `$("#man_cont").show();` and `document.getElementById('man_cont').style.display = 'block';`.It will work because div element normally `blcok` element.But will not work if he set different display style for div element.But Jquery automatically detects it.
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27649438
tagged with: jquery
has title: jQuery user input on button click
answer count: 3
has answer: http://stackoverflow.com/a/27649475
tagged with: http://stackoverflow.com/tag/html
tagged with: submit
has body: I have a an HTML page with an input area and a submit button. I am using jQuery to alert the user of what their input is. (Really I am trying to store that in a variable but that will be trivial once I get this working). Can someone help me understand why it is not working, as well as a solution? Thanks. The HTML form is as follows: Submit Me! The custom jQuery I am using is this: $(document).ready(function() { $("form").submit(function() { alert( grabUserInput )}); }); function grabUserInput() { return $("form").find(".grid-size").val(); }
has answer: http://stackoverflow.com/a/27649471
possible better answer: http://stackoverflow.com/a/27649475
score: 0
has comment: http://stackoverflow.com/comment/43720429
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27649502
accepted answer: http://stackoverflow.com/a/27649471
type: Question
tagged with: button
tagged with: javascript

http://stackoverflow.com/comment/43818121
type: QuestionComment
type: Comment
has text: @Waki I've seen it too, but it didn't worked, maybe I haven't used it correctly, how should I do it ?
comment on: http://stackoverflow.com/q/27702418
score: 0

http://stackoverflow.com/comment/43984148
has text: @BenjaminGruenbaum I do not know if custom void element's are a thing, but in my updated answer the function uses `document.createElement` to check for enclosing, so if it's a registered custom element, it should be able to handle it accordingly :)
comment on: http://stackoverflow.com/a/27787001
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27778501
has comment: http://stackoverflow.com/comment/43967097
has title: Any solution for Angular JS with ng- tags
tagged with: php
tagged with: laravel
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27779672
tagged with: laravel-blade
has answer: http://stackoverflow.com/a/27778664
type: Question
has answer: http://stackoverflow.com/a/27779672
has body: I do love to use AngularJs in my Multiple Pages Laravel Application. Since am using Laravel Blade Template Engine, I don't seem to like the idea of including Angular Tags to cluster my blade templates Example @{{remaining()}} of @{{todos.length}} remaining [ archive ] @{{todo.text}} NB: @{{todo.done}} is a way to tell Blade to ignore the curly braces Is there a way i can use AngularJS without including tags like ng-controller, ng-repeat: The reason why i would like to do without the tags includes: 1. in the future i might decide to use another JS framework such as Emberjs or any other better one so, i have to find all ng- tags in my blade files an remove them I just don't like to tell the world, "Hey am using AngularJS" not that am not proud of it but based on what my clients need and security reasons too. Thanks in advance for your expert response
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43967498
accepted answer: http://stackoverflow.com/a/27778664
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43967134

http://stackoverflow.com/comment/43878119
score: 1
comment on: http://stackoverflow.com/q/27733298
type: Comment
type: QuestionComment
has text: show us some code to make us understand ur problem easily

http://stackoverflow.com/q/27759898
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43931272
has comment: http://stackoverflow.com/comment/43931063
has body: When i execute a scope function and try update the values after execute a service, the data doesn't update. Inside the function, the return of service shows correctly. The code below is my controller code: angular.module('myApp').controller('MyControllerCtrl', function ($scope, $sce, $location, $routeParams, ClientService) { 'use strict'; $scope.returnClient = {}; $scope.row = {id: false}; $scope.rowClient = {name: ''}; $scope.postClient = function () { ClientService.post($scope.rowClient, function (data) { var item = {}; if (data.error) { showError(data.message); } else { showSuccess(data.message); item = { id: data.id, text: $scope.rowClient.name }; $scope.returnClient = item; $scope.row.codClient = item.id; } }); }; }); The service code: angular.module('myApp').service('ClientService', function ClientService($http) { 'use strict'; this.post = function (row, callback) { try { $http.post(getSiteUrl('client/create'), row).success(callback).error(function () { showError('Error.'); }); } catch (errorPost) { showError('Error.'); } }; });
downvote count: 2
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27765967
tagged with: javascript
score: -1
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/43930870
answer count: 2
has title: Scope variable dont update after executive a service inside scope function in AngularJS
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43931015
has answer: http://stackoverflow.com/a/27760228

http://stackoverflow.com/comment/43983217
type: AnswerComment
score: 0
type: Comment
has text: You can counter the potential for undesired recursive-ness by creating an array to store all the previous randomly generated numbers and testing the new `number` against the values in the array. This will prevent duplicates within a single load. Once the array is the size of the number of images, you simply reset the array so the images can continue to cycle through.
comment on: http://stackoverflow.com/a/27786280

http://stackoverflow.com/comment/43982278
has text: Yes table is manually created.
comment on: http://stackoverflow.com/q/27786073
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27713057
has answer: http://stackoverflow.com/a/27713345
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27713345
has comment: http://stackoverflow.com/comment/43838395
favorite count: 0
upvote count: 8
tagged with: http://stackoverflow.com/tag/html
tagged with: events
has comment: http://stackoverflow.com/comment/43838502
has comment: http://stackoverflow.com/comment/102543008
score: 8
possible better answer: http://stackoverflow.com/a/27713116
has answer: http://stackoverflow.com/a/27713116
tagged with: scroll
has comment: http://stackoverflow.com/comment/43838678
has body: Is there an event that is fired when the text inside an &lt;input&gt;-tag is scrolled? I mean when the text inside is to long and you move the input caret to the end of it, etc. There is a scroll event you can catch on the element when that is scrolled in the layout, but that is not what I want. UPDATE: Here is a fiddle to test the events discussed: http://jsfiddle.net/lborgman/L8k5ggnk/3/
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43838347
has title: Event to detect when the text in an is scrolled?
has comment: http://stackoverflow.com/comment/43838563

http://stackoverflow.com/q/27796707
favorite count: 0
possible better answer: http://stackoverflow.com/a/27808254
has answer: http://stackoverflow.com/a/27808254
tagged with: logging
score: -1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27796820
has answer: http://stackoverflow.com/a/27808908
tagged with: java
has comment: http://stackoverflow.com/comment/44002089
downvote count: 1
has body: Currently I am implementing a Java servlet web application. On a html page, users can find a lot of URL links. I would like to record the click logs with time, a user's account name and clicked URL, onto a specific text file on the server. I would like to know how to write a text onto a text file on the server.
type: Question
upvote count: 0
tagged with: javascript
tagged with: servlets
answer count: 3
has answer: http://stackoverflow.com/a/27796820
has title: How to log html link clicks to a text file
has comment: http://stackoverflow.com/comment/44002054

http://stackoverflow.com/comment/94533617
type: Comment
has text: Is there a solution to pass data in memory from localhost/a.html to myhost/b.html?
comment on: http://stackoverflow.com/a/27765893
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43806833
comment on: http://stackoverflow.com/q/27696743
score: 0
type: Comment
type: QuestionComment
has text: Ahh perfect. Oversight on my part.

http://stackoverflow.com/q/27763287
accepted answer: http://stackoverflow.com/a/27763335
has body: i am new in angular js. i already set sorting . when i set dafault setting that time my sorting arrow visible . i want to like default sorting with mange my icon. please help me on this. thanks in advance . JackPot Amount Start Date End Date {{ jackpots1.JackpotAmount }} {{ jackpots1.StartDate }} {{ jackpots1.EndDate }} below is my controller $scope.orderByField = 'StartDate'; $scope.reverseSort = true;
tagged with: angularjs
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43937409
tagged with: javascript
score: 0
has title: i want set default sort in angular js manage with icon
answer count: 1
has answer: http://stackoverflow.com/a/27763335

http://stackoverflow.com/comment/43976617
type: Comment
has text: In your case, yes, because you initialize session on db_connect.php
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27778368

http://stackoverflow.com/a/27657493
type: AcceptedAnswer
downvote count: 1
type: Answer
has body: This should do the trick. Solution 1; clicking on a cell enables edit var table = document.getElementById("myTable"); table.addEventListener('click', function(e) { var target = e.target; //test if clicked element is TD. if (target &amp;&amp; target.tagName &amp;&amp; target.tagName.toLowerCase() == "td") { //make cell editable target.setAttribute('contenteditable', 'true'); //on blur close the editable field and return to normal cell. target.onblur = function(){this.removeAttribute('contenteditable');} } }); Solution 2; clicking on edit enables edit all cells var editBtn = document.getElementById("editbutton") //this is pseudo, change it to reflect your own button var table = document.getElementById("myTable"); editBtn.addEventListener('click', function(e) { var tdList = table.querySelectorAll("td"); //select all td elements for (var i = 0; i &lt; tdList.length; ++i) { //iterate over all cells and set contentEditable to true, allows user input. tdList[i].setAttribute("contentEditable", true); //if you want textArea you can do this (it's commented out) //Choose one of these methods, or the contentEditable or textarea /* var tempNode = document.createElement("textArea"); tempNode.style.height = "100%"; tempNode.style.width = "100%"; tempNode.style.border= "0px solid transparent"; tempNode.value = tdList[0].textContent; tdList[i].innerHTML = "";//wipe content of td tdList[i].appendChild(tempNode); */ } }); Off course the save button can use the same loop to iterate over all the TD. You can access the value of the td/textarea with the following tdList[i].textContent; //contentEditable tdList[i].children[0].value; //textarea. Happy coding.
has comment: http://stackoverflow.com/comment/43742782
answers question: http://stackoverflow.com/q/27657034
accepted answer of: http://stackoverflow.com/q/27657034
score: 0
upvote count: 1

http://stackoverflow.com/a/27851025
upvote count: 13
type: Answer
has body: Implementing a function or library that allows you to chain methods like above is a non-trivial task and requires substantial effort. The main problem with the example above is the constant context changing - it is very difficult to manage the state of the call chain without memory leaks (i.e. saving a reference to all chained functions into a module-level variable -> GC will never free the functions from memory). If you are interested in this kind of programming strategy I highly encourage you to use an existing, established and well-tested library, like Promise or q. I personally recommend the former as it attempts to behave as close as possible to ECMAScript 6's Promise specification. For educational purposes, I recommend you take a look at how the Promise library works internally - I am quite sure you will learn a lot by inspecting its source code and playing around with it.
downvote count: 0
score: 13
answers question: http://stackoverflow.com/q/27709202

http://stackoverflow.com/q/27781447
score: -1
tagged with: http://stackoverflow.com/tag/c
upvote count: 0
answer count: 1
has title: Detection of javascript disable on a browser for a website
tagged with: jquery
favorite count: 0
has body: Sometime ago i disable javascript on my google chrome browser, and think how the website owner will detect if a user is disable javascript on that website, and i search on google and found answer of this question on stackoverflow. Here is the Link : click to show question . After that i wrapped our all content of a page in the class pagecontainer of the body tag something like this : &lt;body class="pagecontainer"&gt; &lt;noscript&gt; &lt;style type="text/css"&gt; .pagecontainer {display:none;} &lt;/style&gt; &lt;div class="noscriptmsg"&gt; You don't have javascript enabled. Good luck with that. &lt;/div&gt; &lt;/noscript&gt; //all page content is here &lt;/body&gt; after that i disable javascript for this page, and tries to run this page, but i could't get the message which is wrapped within noscriptmsg class. So plz help us to give the message which is given in the noscriptmsg class if the user disable the javascript for this page.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/121203
has answer: http://stackoverflow.com/a/27781478
downvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/comment/43777863
has text: when i set a.push("&nbsp ") with one white-space,and split by whitespaces anyway it returns one more index
comment on: http://stackoverflow.com/a/27681497
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27778256
answers question: http://stackoverflow.com/q/27778153
downvote count: 0
has comment: http://stackoverflow.com/comment/43966733
score: 3
has comment: http://stackoverflow.com/comment/43966859
upvote count: 3
has body: Your CSS transitions are fighting with the jQuery animation. Until I hear which you prefer I have turned off the CSS transition. The other fixes are to set the initial position of the elements about to animate and to wait for the panel to leave completely before removing the current-page class. JSFiddle: http://jsfiddle.net/TrueBlueAussie/xoa029jz/8/ function slideToNext() { var currentPage = $('.current-page'); var nextPage = getNextPage(currentPage.attr('id')); currentPage.css('left', '0%').animate({ left: '-100%' }, function () { currentPage.removeClass('current-page'); }); nextPage.css({'display': 'block', 'left': '100%'}).addClass('current-page').animate({ left: '0%' }); } I also cleaned up a few redundant items (chained selectors etc). You are better off just using jQuery animation, initially while you get it working, then adding a plugin (like velocity.js) to make the animations use CSS transitions, rather than try to mix the two.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27778153
type: Answer

http://stackoverflow.com/comment/43877742
has text: This is absolutely incorrect as described in the [AngularJS `$http` documentation](https://docs.angularjs.org/api/ng/service/$http#usage), $http's cache uses `$cacheFactory` not `$templateCache`.
type: AnswerComment
comment on: http://stackoverflow.com/a/27732929
score: 0
type: Comment

http://stackoverflow.com/q/27747333
has answer: http://stackoverflow.com/a/27747472
type: Question
tagged with: http://stackoverflow.com/tag/html
answer count: 2
upvote count: 1
accepted answer: http://stackoverflow.com/a/27747472
has answer: http://stackoverflow.com/a/27747474
has title: HTML5 Canvas: I'm trying to load an image to the canvas
tagged with: canvas
type: AnsweredQuestion
has body: I'm trying to setup a canvas where the user can load a custom image. As far as I can tell everything should be set but for some reason it is not working. Here's my jsfiddle. HTML: &lt;canvas id="image-canvas" width="500" height="500" style="border:1px solid grey"&gt;&lt;/canvas&gt; &lt;input type='file' id='fileInput' /&gt; Javascript: var canvas = document.getElementById('image-canvas'); ctx = canvas.getContext('2d'); // Trigger the imageLoader function when a file has been selected var fileInput = document.getElementById('fileInput'); fileInput.addEventListener('change', imageLoader(), false); function imageLoader() { var reader = new FileReader(); reader.onload = function(event) { img = new Image(); img.onload = function(){ ctx.drawImage(img,0,0); } img.src = reader.result; } reader.readAsDataURL(fileInput.files[0]); }
downvote count: 0
tagged with: javascript
score: 1
possible better answer: http://stackoverflow.com/a/27747474
favorite count: 0

http://stackoverflow.com/a/27714057
answers question: http://stackoverflow.com/q/27712402
score: 5
upvote count: 5
type: Answer
has body: In case you ever need to use back again, the safe cross-browser option was to use history.go(-1);
downvote count: 0

http://stackoverflow.com/a/27691766
answers question: http://stackoverflow.com/q/27691620
type: Answer
has body: You can't see it because they are superposed... =) &lt;svg id="graphic"&gt; &lt;defs&gt; &lt;clipPath id="icon-cp"&gt; &lt;rect x="0" y="0" width="150" height="100" /&gt; &lt;/clipPath&gt; &lt;image id="icon-sprite" width="969" height="293" xlink:href="https://i.sstatic.net/TPx5h.png" /&gt; &lt;g id="icon2" clip-path="url(#icon-cp)"&gt; &lt;use xlink:href="#icon-sprite" transform="translate(-240,0)" /&gt; &lt;/g&gt; &lt;/defs&gt; &lt;!-- ---------------------------------------- Here is the question: the first use element is not displayed. The second one is displayed. (the elements are under this text) Why does it not work? How can a use element be used within nested g elements? (to test it you can comment out the second use element, even tough both use elements have the same attributes no icon is visible anymore) ---------------------------------------- --&gt; &lt;!-- following does not work: --&gt; &lt;g id="testg"&gt; &lt;use xlink:href="#icon2" x="0" y="0" /&gt; &lt;/g&gt; &lt;!-- following works: --&gt; &lt;use xlink:href="#icon2" x="100" y="50" /&gt; &lt;!-- why???? --&gt;
score: 0

http://stackoverflow.com/comment/43856539
score: 1
comment on: http://stackoverflow.com/q/27722349
has text: Could this be part of it? The Less.js browser script currently won’t work if you’re using Chrome and the path to your page starts with “file:///” due to a known Chrome issue. It doesn't look like the issue, but thought I'd throw it out there.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27756604
tagged with: jquery
tagged with: sorting
favorite count: 0
accepted answer: http://stackoverflow.com/a/27756736
has comment: http://stackoverflow.com/comment/43923919
has comment: http://stackoverflow.com/comment/43924118
upvote count: 1
has comment: http://stackoverflow.com/comment/43924138
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27756736
score: 1
tagged with: arrays
downvote count: 0
answer count: 1
has title: Sorting an array of object depending on another array
tagged with: javascript
has body: I have two arrays like these: objects = [Obj1, Obj2, Obj3]; scores = [10,200,15]; with objects[i] corresponding to its score in scores[i]. I need to sort the objects array in a descending order, depending on their relative scores. Any idea how to do that efficiently in jQuery/javascript ? Thank you for your help !

http://stackoverflow.com/comment/43981435
score: 0
comment on: http://stackoverflow.com/q/27785455
has text: @charlietfl whoah, go easy on me, please! :-) But thanks for your comments too.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27800230
has comment: http://stackoverflow.com/comment/44009077
has comment: http://stackoverflow.com/comment/44009482
type: Answer
has body: You would want something like this which uses Array.splice and Math.max function highestNum(n){ var arr = [], nArr = (n+"").split(""); while(nArr.length &gt; 0) arr.push(nArr.splice(0,3).reduce(function(t, c){ return +t + +c }, 0)); return Math.max.apply(null, arr); } What it is doing is, first it converts the number into string and then using Array.splice, you split the array into fragments of 3 elements and then you use Array.reduce to get the sum of those three numbers which you push in another array. And then you use Math.max and Function.apply to get the highest value which you return using the return operator.
answers question: http://stackoverflow.com/q/27800128
score: 0

http://stackoverflow.com/q/27693961
has title: jQuery not showing next drop down list according to condition
downvote count: 2
has comment: http://stackoverflow.com/comment/43802364
has answer: http://stackoverflow.com/a/27697613
answer count: 1
tagged with: drop-down-menu
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43802204
has comment: http://stackoverflow.com/comment/43801167
has body: MY logic is to make a Library Management System in which it first asks for students Class Name, than if Intermediate is selected (which is 1 in database) then show Intermediate Groups else if BS is selected than show BS Department. <?php require '/include/connect.inc.php'; require '/include/core.inc.php'; ?> Class : Select Class : <?php $query="SELECT ClassID,ClassName from class ORDER BY ClassName ASC"; $query_run=mysqli_query($connect,$query) OR die(mysqli_error($connect)); while($catch=mysqli_fetch_array($query_run)) { $ClassName=$catch['ClassName']; $ClassID=$catch['ClassID']; ?> <option value="<?php echo $ClassID;?>"><?php echo $ClassName; ?> <?php } ?> Choose Your Group : Intermediate Group : <?php $query="SELECT DID,DepartmentName from department WHERE ClassID=1 ORDER BY DepartmentName ASC"; $query_run=mysqli_query($connect,$query) OR die(mysqli_error($connect)); while($catch=mysqli_fetch_array($query_run)) { $DepartmentName=$catch['DepartmentName']; $DID=$catch['DID']; ?> <option value="<?php echo $DID;?>"><?php echo $DepartmentName; ?> <?php } ?> Choose Department : BS Department Name <?php $query="SELECT DID,DepartmentName from department WHERE ClassID=2 ORDER BY DepartmentName ASC"; $query_run=mysqli_query($connect,$query) OR die(mysqli_error($connect)); while($catch=mysqli_fetch_array($query_run)) { $DepartmentName=$catch['DepartmentName']; $DID=$catch['DID']; ?> <option value="<?php echo $DID;?>"><?php echo $DepartmentName; ?> <?php } ?> The jQuery.js File $(document).ready(function(){ $('#ChoosedClassID').on('change', function() { $('tr.Department_Options').hide(); $('#tr_' + $(this).val() ).show(); }); }); According to code above, When I select BS,Intermediate, Next Drop Down Meny doesn't appear. What I want is that drop down menu appear and when I select some value from it, it should ask for Student Library Number and then I want to make insert query.
tagged with: php
has comment: http://stackoverflow.com/comment/43808351
upvote count: 0
has comment: http://stackoverflow.com/comment/43802230
has comment: http://stackoverflow.com/comment/43802431
has comment: http://stackoverflow.com/comment/43808455
has comment: http://stackoverflow.com/comment/43801386
type: Question
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/43802489
has comment: http://stackoverflow.com/comment/43802323
tagged with: jquery
has comment: http://stackoverflow.com/comment/43801449

http://stackoverflow.com/comment/43727131
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27655372
has text: @adeneo downloadpaper.html is a html page and i want to show a breadcrumb for that page but the page has to check the path whether it is coming from paper.html(home->paper.html->downloadpaper.html) or industries.html(home->industries.html->downloadpaper.html) and show the breadcrumb accordingly.

http://stackoverflow.com/a/27645076
score: 0
has body: if you use a location header the browser will receive a redirect request and document.location will change (at which point no javascript can run), so, do the redirect, or the javascript. you could try combining a refresh header instead of a location header, or do a javascript redirect after the alert.
answers question: http://stackoverflow.com/q/27645009
type: Answer

http://stackoverflow.com/comment/43934531
comment on: http://stackoverflow.com/a/27759208
has text: You nailed it. I was using the wrong date function.
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/43719856
type: Comment
type: QuestionComment
has text: Yes, I use jQuery. Tried the return false; sentence in the function that manage the div click event and still the tag trigger.
comment on: http://stackoverflow.com/q/27651389
score: 0

http://stackoverflow.com/q/27729730
tagged with: knockout.js
has title: Knockout Components , the template has already been injected into this element, but isn't yet bound
type: Question
tagged with: knockout-3.0
tagged with: javascript
has answer: http://stackoverflow.com/a/27729839
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/27752381
has answer: http://stackoverflow.com/a/27752381
possible better answer: http://stackoverflow.com/a/27729839
has body: From Knockoutjs Docs i don't understand this sentence : the template has already been injected into this element, but isn't yet bound. ko.components.register('my-component', { viewModel: { createViewModel: function(params, componentInfo) { // - 'params' is an object whose key/value pairs are the parameters // passed from the component binding or custom element // - 'componentInfo.element' is the element the component is being // injected into. When createViewModel is called, the template has // already been injected into this element, but isn't yet bound. // Return the desired view model instance, e.g.: return new MyViewModel(params); } }, template: ... });
type: AnsweredQuestion
tagged with: knockout-components

http://stackoverflow.com/q/27687502
has comment: http://stackoverflow.com/comment/43788638
tagged with: confirm
tagged with: javascript
has comment: http://stackoverflow.com/comment/43789372
linked to: http://stackoverflow.com/q/7016658
has comment: http://stackoverflow.com/comment/43823492
has comment: http://stackoverflow.com/comment/43816401
has comment: http://stackoverflow.com/comment/43788593
answer count: 0
has body: I'm working on the front-end part of a project. And the specified UI contains a set of dialogs which have same appearance on it. Functionally speaking, two main of the dialogs behaves just like a MessageBox and ConfirmBox, the same with window.alert and window.confirm. So, I'm trying to hijack the two functions, that when I call window.alert(msg), it shows my custom dialog: Message OK This behaves enough similar to the native window.alert. Now comes the problem. When I'm trying to hijack the window.confirm, I found it seems not possible: window.confirm = function(message) { var $dialog = $('#dialog_confirm'); $dialog.find('.dialog_content').text(message); $dialog.show(); $dialog.find('.btn-yes').click(function() { return true; }); $dialog.find('.btn-no').click(function() { return false; }); // My GOD, I must return true or false immediately here. }; As above, when I try to return the confirm result, because of the single thread/event loop/callback property of javascript, I just cannot work it out. So, is it possible to hijack the confirm function as it was? I'm curious about an opinion, please help.
score: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43788560
has comment: http://stackoverflow.com/comment/43788707
has title: Is it possible to hijack the javascript confirm function?
tagged with: monkeypatching

http://stackoverflow.com/a/27785532
downvote count: 1
has body: Why not use CSS and :hover for this? Transitions in CSS will allow you to animate the element as well. Unless you have requirements to support old browsers this should work nicely and save you any JavaScript headaches and timing issues. For completeness here is a Fiddle showing it in action: http://jsfiddle.net/dPixie/q0tfxvwd/ The relevant parts of the CSS is: #navbar .navbar-nav .menu-item .sub-menu { ... /* no display: none! */ max-height: 0; overflow: hidden; -webkit-transition: max-height 250ms ease-in-out; transition: max-height 250ms ease-in-out; } #navbar .navbar-nav .menu-item:hover .sub-menu { max-height: 1000px; } Where the first part sets up the normal state and the second is during hover. Max-height is used instead of height as it will allow the sub-menu to be any height (just make sure max.height is in pixels and large enough to accommodate any submenu). Why? It's not constructive to help someone fix a problem at any cost. Sometimes it's worth it to rethink the approach. Using JS for menu animation certainly works. But does it add anything to the approach above? With CSS you offload rendering to the graphics card, use the browsers built in hover detection and progress your code towards the new web standards. Unless you have very special needs, such as a client willing to pay for pixel perfect results across legacy clients or very complex animations depending on external events for timing etc, it's generally not worth building these animations in JS. And if you'r not getting payed to make it all the same all the time you should not do it ...
score: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27785225

http://stackoverflow.com/comment/43718363
type: Comment
has text: What is the purpose of this `id: id` ? Why are you updating the `id`, that caused the second issue.
type: AnswerComment
comment on: http://stackoverflow.com/a/27650608
score: 0

http://stackoverflow.com/comment/43874457
has text: Ok, this is better than nothing, but does it mean what i'm trying to do (merge all 3 parts) is impossible? (PS: you forgot to move `var targetid = $(this).attr("id");` as first line of cancelFunction)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27731444

http://stackoverflow.com/a/27713936
type: AcceptedAnswer
has body: To make it attach to certain div, you have to follow these first: Pass the Element at which you want to apply the random hovering div. Therefore, animateDiv() should be animateDiv(element) where variable element is the DOM element at which you want to apply this div. Take that DOM Element in consideration of animation by limiting the value of max-min offset height and weight of .shape.Use this var nh = Math.floor(Math.random() * (maxHeight - minHeight)) + minHeight; Take .shape width and height in account also so that it doesn't go outside the DOM element. By Decreasing the maxHeight/maxWidth by .shape height/width. Your revised makeNewPosition(element) will look like this: function makeNewPosition(element1) { var minHeight = $(element1).offset().top; var maxHeight = $(element1).height() + minHeight - 90; var minWidth = $(element1).offset().left; var maxWidth = $(element1).width() + minWidth - 90; var nh = Math.floor(Math.random() * (maxHeight - minHeight)) + minHeight; var nw = Math.floor(Math.random() * (maxWidth - minWidth)) + minWidth; return [nh, nw]; } Working fiddle P.S. have decreased a speed little bit so the effect looks more pleasant on small div you can set it accordingly
type: Answer
answers question: http://stackoverflow.com/q/27712932
accepted answer of: http://stackoverflow.com/q/27712932
score: 0

http://stackoverflow.com/a/68124696
downvote count: 0
answers question: http://stackoverflow.com/q/27749596
has body: I had a similar problem, when executing bcrypt.compareSync, it did not hash the password of the user who was without bcrypt, the problem was the order in which I had them, which was the following: bcrypt.compareSync (passwordHash, password) I solved it by organizing it, first the password and then the passwordHash, which would look like this: bcrypt.compareSync (password, student.password) I hope it helps someone, good code! &lt;3 @sebasrestrepom
upvote count: 2
has comment: http://stackoverflow.com/comment/130224378
type: Answer
score: 2

http://stackoverflow.com/q/27649594
tagged with: jquery
type: AnsweredQuestion
has body: &lt;script&gt; $(document).click(function() { window.open("http://google.com", "_blank"); }); &lt;/script&gt; With above code, when I click anywhere, the tab will be opened. However, when I click more, the new tab will be opened. So, how to disable above code after click 1 time ?
downvote count: 0
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27649604
type: Question
has title: How to open new tab only 1 time?
upvote count: 1
tagged with: limit
answer count: 1
has answer: http://stackoverflow.com/a/27649604
tagged with: javascript

http://stackoverflow.com/comment/43896111
type: Comment
comment on: http://stackoverflow.com/a/27741574
score: 0
has text: nice use of this in dynamic event handling
type: AnswerComment

http://stackoverflow.com/q/27683290
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27683344
has title: Is tid key reserved with JSON
downvote count: 0
answer count: 1
tagged with: key
favorite count: 0
has comment: http://stackoverflow.com/comment/43781150
accepted answer: http://stackoverflow.com/a/27683344
tagged with: node.js
has comment: http://stackoverflow.com/comment/43781158
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
has body: When I log the json string of a key named tid, it always returns 0. Check the following example. var transaction = {tid:1, type:0, time:126312736}; var transStr = JSON.stringify(transaction); console.log(transStr); The beginning part of that log looks like: {"tid":0," When I change the key to something else like tidd, I get the expected value of 1. My question is why does that happen? Is tid reserved maybe?
upvote count: 1

http://stackoverflow.com/a/27697511
downvote count: 0
answers question: http://stackoverflow.com/q/27693012
type: Answer
has body: I think working code would look like: var data = require("sdk/self").data; var panel = Panel.Panel({ width: 450, height: 300, contentURL: data.url("html/view.html"), contentScriptFile: data.url("js/controller.js"), }); You get the resource uris for a given file via self.data.url(). See the docs on panels for more info.
has comment: http://stackoverflow.com/comment/43823990
upvote count: 1
score: 1

http://stackoverflow.com/q/27664376
accepted answer: http://stackoverflow.com/a/27693464
has body: I just started learning Backbone JS. In below code, iam just trying to call url todos/1 expecting to get json data. Instead iam getting error in console as "Failed to load resource: net::ERR_TOO_MANY_REDIRECTS" I didnt understood why index.jsp keep redirecting many times itself. Could anyone please explain me what went wrong and also solution too test.jsp index.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="org.json.JSONObject" %> <% JSONObject obj = new JSONObject(); obj.put("description", "pick up milk"); obj.put("status", "incomplete"); obj.put("id", 1); response.setContentType("application/json"); out.print(obj); %> MyServlet.java public class MyServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * Default constructor. */ public MyServlet() { // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.sendRedirect("index.jsp"); } } web.xml <?xml version="1.0" encoding="UTF-8"?> MyServlet MyServlet MyServlet /todos/*
has answer: http://stackoverflow.com/a/27693464
score: 2
downvote count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43769469
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/43757097
has title: Failed to load resource: net::ERR_TOO_MANY_REDIRECTS
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: backbone.js

http://stackoverflow.com/q/27770362
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/43951810
has body: some button some button some button I want to select the previous tr.main after clicking a button but cannot figure out how to get to the right previous elemetn using .prev(), .prevAll(), or .prevUntil() $(function() { $('.dropdown-image').click(function() { $(this).parent().parent().parent().prev($("tr:nth-of-type(1)")).children().css('border-bottom-color', '#a3d0dd'); $(this).parent().parent().parent().prevUntil('.main').children().css('border-bottom-color', '#a3d0dd'); }); }); Iv got the first row sorted because it doesnt have a row of tr.emails-detials after it but i need to change the border-bottom-color of the row above, as seen below the blue border is missing from the selected row.
has title: Selecting the secondary preceding element
has comment: http://stackoverflow.com/comment/43951675
has comment: http://stackoverflow.com/comment/43951740
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43951691
has comment: http://stackoverflow.com/comment/43951666
has comment: http://stackoverflow.com/comment/43951842
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43951859
score: 0
has answer: http://stackoverflow.com/a/27770724
upvote count: 1
answer count: 1
favorite count: 0

http://stackoverflow.com/q/27774245
score: 2
upvote count: 2
accepted answer: http://stackoverflow.com/a/27774324
type: Question
type: AnsweredQuestion
has title: text in div displays in safari 8.2, chrome 39, but not in firefox 34. Why?
answer count: 2
tagged with: firefox
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27774324
favorite count: 0
possible better answer: http://stackoverflow.com/a/27774330
has comment: http://stackoverflow.com/comment/43959537
has answer: http://stackoverflow.com/a/27774330
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43959459
has comment: http://stackoverflow.com/comment/43959319
has body: I have a div tag that is placed within the body of my HTML document like this: &lt;div id="content_text"&gt;&lt;/div&gt;​ The contents of the div are later set through javascript like this var content_text = document.getElementById("content_text") content_text.innerText = content where content is a string. additionally, the div is styled like this: #content_text { font-size: 30px; font-family: alexandria_n; position: absolute; top: 280px; left: 100px; z-index: 1; overflow-y: scroll; } the font 'alexandria_n' is loaded from a local folder, with @font-face earlier in the style sheet @font-face { font-family: alexandria_n; src: url("resources/alexandria_n.ttf"); } so the issue is, this displays the 'content' string text in Safari and Chrome with all the corect styling, but displays no text in Firefox. There is not a single trace of the div when the page is opened in Firefox. I opened the browser console while loading the page in Firefox, and got the following error: downloadable font: kern: Kerning pairs are not sorted., table discarded (font-family: "alexandria_n" style:normal weight:normal stretch:normal src index:0) source: file:///.../resources/alexandria_n.ttf however, even after changing the div styling to this (replacing alexandria_n with Arial), the div text still doesn't show up in Firefox: #content_text { font-size: 30px; font-family: Arial; position: absolute; top: 280px; left: 100px; z-index: 1; overflow-y: scroll; } I don't understand enough about the nuances of CSS/HTML to have a good way to debug this. Any help would be much appreciated! :)
tagged with: css
has comment: http://stackoverflow.com/comment/43959520

http://stackoverflow.com/a/27725847
upvote count: 2
answers question: http://stackoverflow.com/q/27645093
has body: Code Snippet: //input data var input=[{ "country": "USA", "visits": 3025 }, { "country": "China", "visits": 1882 }, { "country": "Japan", "visits": 1809 }, { "country": "Germany", "visits": 1322 }, { "country": "UK", "visits": 1122 }, { "country": "France", "visits": 1114 }, { "country": "India", "visits": 984 }, { "country": "Spain", "visits": 711 }, { "country": "Netherlands", "visits": 665 }, { "country": "Russia", "visits": 580 }, { "country": "South Korea", "visits": 443 }, { "country": "Canada", "visits": 441 }]; //your custom colors var colors= ['#FF6600', '#FCD202', '#B0DE09', '#0D8ECF', '#2A0CD0', '#CD0D74', '#CC0000', '#00CC00', '#0000CC', '#DDDDDD', '#999999', '#333333', '#990000'] //inject color attribute with value for (i = 0; i &lt; input.length; i++) {input[i].color = colors[i];} //amCharts initialization code goes here ... ... Output Checkout this JSFiddle to see the solution in action: http://jsfiddle.net/bfbgz0sc/4/
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/a/29559116
answers question: http://stackoverflow.com/q/27663203
downvote count: 1
has comment: http://stackoverflow.com/comment/125452793
has body: The marked library allows you to define your own renderer, which allows you to define the output for paragraphs. You can pass in your own renderer by using: marked.setOptions({ renderer: new MyRenderer(), }); var output = marked('This **text** will be rendered with MyRenderer'); This will require you to define methods for blockquote, html, paragraph and all the other methods that the default marked.Renderer defines. Here is an example: function MyRenderer(options) { this.options = options || {}; } MyRenderer.prototype.paragraph = function(text) { return 'This comes from my own renderer: ' + text + '\n'; }; However, this requires some efforts, so the quickest way to get rid of the paragraphs (&lt;p&gt; tags) is to change the code of the existing Renderer in the marked.js file: Replace: Renderer.prototype.paragraph = function(text) { return '&lt;p&gt;' + text + '&lt;/p&gt;\n'; }; With: Renderer.prototype.paragraph = function(text) { return text + '\n'; };
has comment: http://stackoverflow.com/comment/68462960
type: Answer
has comment: http://stackoverflow.com/comment/47269113
score: 13
has comment: http://stackoverflow.com/comment/52865765
upvote count: 14
has comment: http://stackoverflow.com/comment/47272088

http://stackoverflow.com/a/27678749
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/27678444
has body: The previous solution worked by adding and removing a class on body. There is no pure css solution to changing the src-attribute of the logo, unless you want to have two img tags and toggle between the two. This solution just finds the img-tag we want to change, and changes it src attribute to the new url: document.getElementsByClassName("go-home")[0].getElementsByTagName('img')[0].src = "/images/LOGOWHITE.png"; An alternate solution is to have two img-tags, one for each version, and toggle them. You can keep your current javascript code, but need to add the following css, and change the html a bit: /* Hide white logo on white background */ body.white .logowhite { display: none; } /* Hide black logo on non-white (black) background */ body:not(.white) .logoblack { display: none; } function togglewhite() { if (document.body.classList.contains("white")) { console.log("a"); document.body.classList.remove("white"); } else { console.log("b"); document.body.classList.add("white"); } } /* This is not necessary; it is just for easier viewing what happens */ img { width: 100px; height: 100px; } .logoblack { background: black; } .logowhite { background: gray; } /* This is necessary */ /* Hide white logo on white background */ body.white .logowhite { display: none; } /* Hide black logo on non-white (black) background */ body:not(.white) .logoblack { display: none; }
answers question: http://stackoverflow.com/q/27678444
type: AcceptedAnswer
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/43773285

jsp
tags question: http://stackoverflow.com/q/27732141
tags question: http://stackoverflow.com/q/27699483
tags question: http://stackoverflow.com/q/27684788
tags question: http://stackoverflow.com/q/27773305
tags question: http://stackoverflow.com/q/27665067
tags question: http://stackoverflow.com/q/27718825
tags question: http://stackoverflow.com/q/27683990
tags question: http://stackoverflow.com/q/27701185
tags question: http://stackoverflow.com/q/27664474
tags question: http://stackoverflow.com/q/27730150
tags question: http://stackoverflow.com/q/27764495
tags question: http://stackoverflow.com/q/27661781
type: Tag
tags question: http://stackoverflow.com/q/27702661
tags question: http://stackoverflow.com/q/27716986
tags question: http://stackoverflow.com/q/27657718
tags question: http://stackoverflow.com/q/27721313
tag name: jsp
tags question: http://stackoverflow.com/q/27667213
tags question: http://stackoverflow.com/q/27642662
tags question: http://stackoverflow.com/q/27708095
tags question: http://stackoverflow.com/q/27678442
tags question: http://stackoverflow.com/q/27732055
tags question: http://stackoverflow.com/q/27720327
tags question: http://stackoverflow.com/q/27706367
tags question: http://stackoverflow.com/q/27740525

http://stackoverflow.com/q/27770214
has answer: http://stackoverflow.com/a/27773293
tagged with: google-maps-api-3
score: 0
tagged with: google-maps
answer count: 1
has comment: http://stackoverflow.com/comment/43952156
has body: I'm using the Google Maps Javascript API v.3. Below is the javascript that I've written. The goal is to initialize a map, and then do an address lookup via the Google maps geocoder, use that lat long to re-center the map, and set a marker down. I think I've got most of it working, except that after I recenter the map and place a marker, the page fires another onLoad event which causes the initialize() function to run again and resets all of my variables. After staring at this code for half a day, I'm not sure what is causing the extra onLoad event. What is causing it? I am also new to writing javascript and working with Google maps, so I'm happy for other pointers on code quality. I know that I've tried to scope several variables globally and I'm not sure that I've done it correctly. Here is the code (note: I plan on replacing the setTimeout function eventually, but I still haven't gotten the knack of programming asynch calls yet...I figured I will tackle that next). &lt;script type="text/javascript"&gt; var map; var geocoder; var marker; var latlng; function initialize() { geocoder = new google.maps.Geocoder(); var mapOptions = { center: new google.maps.LatLng(47.606, -122.314), zoom: 12 }; if (this.map == null){ this.map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } } function checkResponse(results, response){ if (response == google.maps.GeocoderStatus.OK) { this.latlng = results[0].geometry.location; this.map.setCenter(results[0].geometry.location); this.marker = new google.maps.marker({ map: map, position: results[0].geometry.location}); } else { alert("Geocode was not successful for the following reason: " + response); } } function searchAddress(){ var address = document.getElementById('address1').value; var state = document.getElementById('state1').value; var zip = document.getElementById('zip1').value; var addressInput = address + ',' + state + ',' + zip; geocoder.geocode( { 'address': addressInput}, function(results, status) { /…
favorite count: 0
has comment: http://stackoverflow.com/comment/43953946
has comment: http://stackoverflow.com/comment/43953976
type: UnansweredQuestion
has title: How do I prevent Google Maps from reinitializing after a geocode lookup?
has comment: http://stackoverflow.com/comment/43954210
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/comment/43903890
has text: In terms of your question with the binding, all i know is that the submit code is how i placed in the original question above
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27746009
score: 0

http://stackoverflow.com/a/27654307
answers question: http://stackoverflow.com/q/27654222
has body: Your needed variable is causing the problem. http://jsfiddle.net/6gkpyhyf/ needed = $(this).text(); Change from needed = $(this).html(); to needed = $(this).text();
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43725178
accepted answer of: http://stackoverflow.com/q/27654222
upvote count: 2

http://stackoverflow.com/q/27735108
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
tagged with: forms
has title: Get form & FormData objects from input element?
type: Question
has answer: http://stackoverflow.com/a/27735128
tagged with: javascript
tagged with: jquery
has body: So I want to fire a Javascript function every time a form 'submit' input is clicked, so I can handle the submission in Javascript. I have the following: $(':submit').click(function(){ var currentForm = $(this)[0].form; event.preventDefault(); //Stop default form submission var formData = new FormData(currentForm); $.ajax({/*Handle form submission here*/}); }); I've tried a few different variations to get the currentForm, but for some reason it's always undefined? Is this not the correct way to get a form object and then convert it to a FormData object in Javascript? I've tried several of the solutions on How to get the form parent of an input?, but none are working. Any ideas?
linked to: http://stackoverflow.com/q/991367
downvote count: 0
answer count: 1
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/27735128

http://stackoverflow.com/comment/43902583
score: 0
comment on: http://stackoverflow.com/q/27745645
type: Comment
type: QuestionComment
has text: Hi anpsmn - do you mean like this - `alert ($('#room_name').text().val());` - But then I am not getting any alert.

http://stackoverflow.com/a/27660118
type: Answer
answers question: http://stackoverflow.com/q/27660002
score: 0
has body: $('#list-a').on('click', '.delete', function() { var listItem = $(this).closest('li'); var ind = listItem.index(); listItem.fadeOut(500, function() { listItem.remove(); }); $('#list-b').find('li').eq(ind).fadeOut(500, function() { $(this).remove(); }); }); http://codepen.io/anon/pen/OPRzKx

http://stackoverflow.com/q/27719851
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/27720125
downvote count: 0
linked to: http://stackoverflow.com/q/5669502
favorite count: 0
has comment: http://stackoverflow.com/comment/43851179
upvote count: 2
type: UnansweredQuestion
score: 2
has body: How to change the position of date picker in text box using JQuery &lt;input type="text" id="Date" name="Date" class='Date'/&gt; Jquery &lt;script type="text/javascript"&gt; (function ($) { $('.Date').datepicker(); $('.Date').datepicker('setDate', 'today'); })(jQuery); &lt;/script&gt; Here how to change the position of date picker down to left side and How to Decrease the height and width in this
has comment: http://stackoverflow.com/comment/43851243
linked to: http://stackoverflow.com/q/662220
type: Question
has comment: http://stackoverflow.com/comment/43851309
tagged with: javascript
tagged with: jquery
has title: How to change the position of date picker in textbox in JQuery

http://stackoverflow.com/q/27793758
type: Question
has title: AngularJS : How to not render an attribute if value is undefined
tagged with: angularjs-interpolate
has answer: http://stackoverflow.com/a/27794167
has comment: http://stackoverflow.com/comment/44019238
answer count: 1
tagged with: javascript
score: 0
tagged with: angularjs
has body: I have a template used in a directive, looking like : &lt;tr&gt; &lt;th ng-repeat="col in tableSpec" st-sort="{{col.sortField}}"&gt;&lt;/th&gt; &lt;/tr&gt; The attribute st-sort should not be render (no attribute at all) when the col.sortField doesn't exists. I've read about the 'allOrNothing' option in the $interpolate witch does what I want but I don't if it is possible to specify this option when using the {{ }} notation. I've read also about the ngAttr and I try to use this notation ng-attr-st_sort="{{col.sortField}}" but without success anymore. Any healp would be greatly appreciated. Jean-Marc
has comment: http://stackoverflow.com/comment/43997265
has comment: http://stackoverflow.com/comment/43996923
type: UnansweredQuestion

http://stackoverflow.com/a/27740930
score: 1
answers question: http://stackoverflow.com/q/27740686
upvote count: 1
type: Answer
downvote count: 0
has body: Add this to your js code: Array.prototype.getElementsFromIndex = function (start, len) { var newArray = [], origArray = this, i = start; while (newArray.length &lt; len) { newArray.push(origArray[i++]); if (i &gt;= origArray.length) i = 0; } return newArray; } You can use it exactly the way you wanted: var myArr = [0,1,2,3,4,5,6,7,8,9]; alert(myArr.getElementsFromIndex(8, 5)); JSFIDDLE DEMO: http://jsfiddle.net/x6oy0krL/1 Maybe some people will say that it is not right to extend objects like Array, documentElement and so on, but the result here is as the OP wanted. I want to say that the original array will not be modified, too.

http://stackoverflow.com/comment/43756142
type: Comment
has text: If you're using jQuery, be consistent about it. `$("#vatis").val(vatis)`.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27669231

http://stackoverflow.com/comment/82251577
comment on: http://stackoverflow.com/a/29224100
score: 0
has text: then run which cmd on the CLI? I run `eslint` in current project folder, but it's not recognized as a command.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43814124
has text: Give the input a name.
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27700632
type: Comment

http://stackoverflow.com/a/27659311
has body: You have to use the id attribute only when you know your item is unique. If you have multiple id="event" then you need to use class="event" instead and $(".event").each instead of $("#event").each. If my assumptions are correct, you are trying to make a copy of event form when you click on #add_form button. Then, it's advised to provide a remove button inside the #event form so that every clone has his own remove button and a single add button outside of the #event element. If you put it that way it's not about Show/Hide rather Add/Remove DOM elements. ... Jquery $('#add_form').click(function(){ event=$("#to_clone").html(); $(this).before(event); }); $(document).on('click', '.remove_form', function(){ $(this).closest(".event").remove(); return false; }); In case you're wondering how to submit those forms you can add a function that translate inputs into json. function getEventsJson() { var json='['; $('.event').each(function() { json=json+'{ "field1": "'+$(this).find('.field1class').val()+'","field2": "'+$(this).find('.field2class').val()+'"},'; }); json=json.replace(/,\s*$/, ""); json=json+']' return json; } Or provide for each event it's own form and submit them one by one. $('.event').each(function() { var form=$(this).find('form'); $.ajax({ type:"POST", url: "/events", data: { 'event' : form.serialize(), }, dataType: 'json', success: function(data) { }, error: function(data){ } }); }
answers question: http://stackoverflow.com/q/27658160
score: 0
accepted answer of: http://stackoverflow.com/q/27658160
type: AcceptedAnswer
type: Answer

websocket
tags question: http://stackoverflow.com/q/27777564
tags question: http://stackoverflow.com/q/27652228
tags question: http://stackoverflow.com/q/27790765
tags question: http://stackoverflow.com/q/27776847
tags question: http://stackoverflow.com/q/27720020
tags question: http://stackoverflow.com/q/27696675
type: Tag
tags question: http://stackoverflow.com/q/27723140
tags question: http://stackoverflow.com/q/27740003
tags question: http://stackoverflow.com/q/27704870
tags question: http://stackoverflow.com/q/27789653
tag name: websocket
tags question: http://stackoverflow.com/q/27797597
tags question: http://stackoverflow.com/q/27686603
tags question: http://stackoverflow.com/q/27662919
tags question: http://stackoverflow.com/q/27732155
tags question: http://stackoverflow.com/q/27699179
tags question: http://stackoverflow.com/q/27733120
tags question: http://stackoverflow.com/q/27655352
tags question: http://stackoverflow.com/q/27794073
tags question: http://stackoverflow.com/q/27730894
tags question: http://stackoverflow.com/q/27642875

http://stackoverflow.com/q/27769012
has title: Multiple Components listening via eventlistener
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43948835
has body: I was wondering why you're not allowed to have multiple similar eventListeners on a single node? I imagine the case where I have multiple partials of the same type that use a single node to communicate with eachother through CustomEvents. But that doesnt seem to be working because they do all share the same EventListener and thus only one of them is able to listen and process the event. Why is that? Thanks! EDIT: little code snippet: I have node.addEventListener("customEvent", this.func, false); and node.addEventListener("customEvent", this.func, false); in two different places and this.func points to the same function but in different contextes and would eventually trigger different things. But the second listener never gets called because for some reason this something seems to assumes that their the same probably because the signature is alike or whatever. EDIT2: I'm basically referring to this. https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener#Multiple_identical_event_listeners
has answer: http://stackoverflow.com/a/27769126
tagged with: events
tagged with: listener
has comment: http://stackoverflow.com/comment/43952635
has answer: http://stackoverflow.com/a/27769268
possible better answer: http://stackoverflow.com/a/27769126
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/27769268
has comment: http://stackoverflow.com/comment/43952457

http://stackoverflow.com/comment/43834630
type: Comment
score: 0
has text: I tried : data: {agenciesId: [agenciesId],ruleId: JSON.stringify ( ruleIDd ) }, but allways request.getParameterValues("agenciesId"); return null
type: AnswerComment
comment on: http://stackoverflow.com/a/27710810

http://stackoverflow.com/comment/43922894
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27756009
score: 0
has text: if you could help in any way i would appreciate

http://stackoverflow.com/a/33321274
has comment: http://stackoverflow.com/comment/64947831
score: 2
upvote count: 3
has body: No one of the previous answers (which all are correct) was suited to my situation: I don't use the async parameter in jQuery.ajax() and I don't include a script tag as part of the content that was being returned like: &lt;div&gt; SOME CONTENT HERE &lt;/div&gt; &lt;script src="/scripts/script.js"&gt;&lt;/script&gt; My situation is that I am calling two AJAX requests consecutively with the aim to update two divs at the same time: function f1() { $.ajax(...); // XMLHTTP request to url_1 and append result to div_1 } function f2() { $.ajax(...); // XMLHTTP request to url_2 and append result to div_2 } function anchor_f1(){ $('a.anchor1').click(function(){ f1(); }) } function anchor_f2(){ $('a.anchor2').click(function(){ f2(); }); } // the listener of anchor 3 the source of problem function anchor_problem(){ $('a.anchor3').click(function(){ f1(); f2(); }); } anchor_f1(); anchor_f2(); anchor_problem(); When I click on a.anchor3, it raises the warning flag.I resolved the issue by replacing f2 invoking by click() function: function anchor_problem(){ $('a.anchor_problem').click(function(){ f1(); $('a.anchor_f2').click(); }); }
downvote count: 1
answers question: http://stackoverflow.com/q/27736186
has comment: http://stackoverflow.com/comment/54451550
has comment: http://stackoverflow.com/comment/69240203
type: Answer

http://stackoverflow.com/comment/43744282
comment on: http://stackoverflow.com/q/27664173
score: 2
has text: Well that is an invalid script, you cannot have both a src attribute and text within the script tags, you have to have one or the other..
type: Comment
type: QuestionComment

onclick
tags question: http://stackoverflow.com/q/27782749
tags question: http://stackoverflow.com/q/27647346
tags question: http://stackoverflow.com/q/27756504
tags question: http://stackoverflow.com/q/27792552
tags question: http://stackoverflow.com/q/27660879
tags question: http://stackoverflow.com/q/27731812
tags question: http://stackoverflow.com/q/27676896
tags question: http://stackoverflow.com/q/27755132
tags question: http://stackoverflow.com/q/27681422
tags question: http://stackoverflow.com/q/27647177
tags question: http://stackoverflow.com/q/27713822
tags question: http://stackoverflow.com/q/27646852
tags question: http://stackoverflow.com/q/27794100
type: Tag
tags question: http://stackoverflow.com/q/27716122
tags question: http://stackoverflow.com/q/27791007
tags question: http://stackoverflow.com/q/27746009
tags question: http://stackoverflow.com/q/27794145
tags question: http://stackoverflow.com/q/27723191
tag name: onclick
tags question: http://stackoverflow.com/q/27772697
tags question: http://stackoverflow.com/q/27695921

http://stackoverflow.com/a/27692744
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27692556
has body: As others have mentioned, Math.sin takes radians as arguments. So you will need to alter your equation to use radians. Also, Javascript has a method for arcsin: Math.asin: Based on the equation from your source, the new result might look like: var result = Math.asin(Math.sin(0.40927971) * Math.sin(0.0172142063 * ( (d - 81) * (Math.Pi/180) )));
answers question: http://stackoverflow.com/q/27692556
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2

http://stackoverflow.com/a/27647356
score: 0
accepted answer of: http://stackoverflow.com/q/27643716
answers question: http://stackoverflow.com/q/27643716
has body: The problem was I was not correctly setting the pushState variable.
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/43875679
has text: @musicfuel I have tried that, I should have said. Sorry. Also doesn't work.. will leave it out though as it's tidier if it isn't needed.
score: 0
comment on: http://stackoverflow.com/q/27732073
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27795506
linked to: http://stackoverflow.com/q/13798313
upvote count: 1
accepted answer: http://stackoverflow.com/a/27795608
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: custom/override error message provided by browser?
tagged with: angularjs
has answer: http://stackoverflow.com/a/27795608
tagged with: http://stackoverflow.com/tag/html
has body: Is there a way to override the error message provided by browser? I have a simple html: &lt;input type="email" name="recipient"&gt; If the email format is incorrect, the browser will show a message like : in Firefox: Please enter a email address. in Chrome: Please include an @ in the email address... I wanna customize this browser provided error message, hope someone can help me on this. Thanks in advance!
type: AnsweredQuestion
type: Question
score: 1
has comment: http://stackoverflow.com/comment/43999918

http://stackoverflow.com/a/27671416
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/27670017
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27670017
has body: Well Its Simple , I Figured that Links act as A Code that wants to be posted to so what acutally happens when You Post it Its Simple Instead of Posting It To http://anime4life.net/ it Posted It To http:// linkthatIinitiallyTypedIntheInput+anime4life.net which caused to have a very long and unsucessful end Well The Solution Is Simple , First AutoRemove The http:// straight as Im TYping Using JsQuery Like This $('input').change( function() { var input = $('input'); input.val( $('input').val().replace(/https?:\/\//gi,'') ); }); And Then That Posts The Form Next in the echo Use This &lt;?PHP echo "https://".$_POST['code'].""; And That Puts It Back For The Display , Well Thankyou All For Trying To Help!
type: Answer

http://stackoverflow.com/comment/44718111
type: AnswerComment
comment on: http://stackoverflow.com/a/27697921
type: Comment
has text: @Brent, what Rob said the problem is - not having sendEmail defined - is the problem, and you can see an example of what sendEmail should be in my article at https://sendgrid.com/blog/send-email-static-websites-using-parse - however if you're still having problems, let me know and I'll jump on a call with you and help you out.
score: 1

http://stackoverflow.com/comment/43936220
score: 0
has text: Where is the javascript that gets the id?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27762526

http://stackoverflow.com/comment/43756511
comment on: http://stackoverflow.com/a/27670868
type: AnswerComment
has text: I've updated my answer to show how to get it out of that, if the object is in a variable named `dataObject`.
score: 0
type: Comment

http://stackoverflow.com/comment/43944454
score: 0
comment on: http://stackoverflow.com/q/27766871
type: Comment
type: QuestionComment
has text: Does it mean it works IE7,8,10? or It does not work at IE

http://stackoverflow.com/q/27668677
has comment: http://stackoverflow.com/comment/43752136
tagged with: php
has answer: http://stackoverflow.com/a/27668914
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27668914
has comment: http://stackoverflow.com/comment/43752179
has title: Getting 500 error on simple form POST via AJAX -- not sure what's wrong?
has comment: http://stackoverflow.com/comment/43752110
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43752362
has body: I don't understand why I'm getting a 500 error on this simple AJAX-based form POST to PHP.... Mind taking a look? It's probably something simple I'm just not catching but I'm scratching my head right now. JS: $form.submit(function(e) { e.preventDefault(); var formData = $form.serialize(); $.ajax({ url: $form.attr('action'), type: 'POST', data: formData }).done(function(res) { console.dir(res); alert('success!'); // update status text $form[0].reset(); // reset the form $form.find('input[type="submit"]').attr('disabled', 'disabled'); }).fail(function(data) { alert('error'); }); }); PHP: if($_SERVER["REQUEST_METHOD"] == "POST") { if( !empty($_POST['captcha']) ) { processForm( $_POST['formName'] ); } else { http_response_code(401); echo "Unauthorized."; } } else { // not valid. ignore http_response_code(400); echo "Bad Request."; } PHP: processForm(): function processForm(string $type) { if ($type == 'contact') { http_response_code(200); echo "contact form"; } if ($type == 'appointmentRequest') { http_response_code(200); echo "appointment form"; } // send the email // return confirmation / failure // die } I'm just getting a 500 error. I am sure the request is pointing to the right location.
score: 0
has comment: http://stackoverflow.com/comment/43752133
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43752076
tagged with: ajax
has comment: http://stackoverflow.com/comment/43752174

http://stackoverflow.com/a/27697421
has body: As shown by the demo below, string.replace(/:/g, ' : ') should do it: var str = 'duufuduiure:0ee938:\ndjiedj\n\r:dhdhhiekd\r\ndjdfd;:'; $('pre.before').text( str ); $('pre.after').text( str.replace(/:/g, ' : ') ); before: after:
upvote count: 1
answers question: http://stackoverflow.com/q/27695764
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/27782809
favorite count: 0
has title: How to select a polygon covered by another polygon using Google Maps API V3
type: UnansweredQuestion
tagged with: polygons
has comment: http://stackoverflow.com/comment/43989287
score: 3
has answer: http://stackoverflow.com/a/27790370
upvote count: 3
has comment: http://stackoverflow.com/comment/43988049
type: Question
tagged with: google-maps
downvote count: 0
tagged with: javascript
tagged with: google-maps-api-3
has body: I am using Overlay Shapes with Google Maps API V3 using Google’s Drawing Manager. I basically allow the user to draw a polygon and save it to a database. They can then edit these polygons at will or create new ones. The issue I am having is that often new polygons will completely cover existing polygons. Then the user cannot select the polygon beneath the latest one. I wondered if anyone had managed to devise a script that enabled a user to cycle through the selection of every polygon in a potential stack under the mouse cursor (or pointer/finger...) The attached image illustrates the predicament. Ideally I'd like something like CTRL+Click to select the polygon beneath the currently selected polygon. No idea how to even approach this and I could not fine any examples in existence. Thanks in advance.
answer count: 1

screenshot
tags question: http://stackoverflow.com/q/27802736
tag name: screenshot
type: Tag

http://stackoverflow.com/comment/43982821
score: 0
type: Comment
has text: @akonsu Thanks for the previous comment, got an idea from it and copied the required js and css files to my projects and done. It works
type: QuestionComment
comment on: http://stackoverflow.com/q/27785280

typeahead
type: Tag
tags question: http://stackoverflow.com/q/27728790
tag name: typeahead

http://stackoverflow.com/a/30380971
has body: This happened to me by having a link to external js outside the head just before the end of the body section. You know, one of these: &lt;script src="http://somesite.net/js/somefile.js"&gt; It did not have anything to do with JQuery. You would probably see the same doing something like this: var script = $("&lt;script&gt;&lt;/script&gt;"); script.attr("src", basepath + "someotherfile.js"); $(document.body).append(script); But I haven't tested that idea.
score: 17
has comment: http://stackoverflow.com/comment/56936069
answers question: http://stackoverflow.com/q/27736186
downvote count: 0
type: Answer
upvote count: 17

http://stackoverflow.com/q/27797492
has comment: http://stackoverflow.com/comment/44003942
has comment: http://stackoverflow.com/comment/44004199
has comment: http://stackoverflow.com/comment/44006261
has answer: http://stackoverflow.com/a/27798854
has body: So i'm trying to show/hide a div class based on what "page" is active (a number that changes). So i have a dynamic number of pages which are indicated by the publication.realpages.length and i have an equal number of main/sub/target divs. I'd like to show the target class at each seperate location depending what page we are o so my html is always my current javascript is publication.on('page', function(page) { var currpage = page.realIndex + 1 var pubpage = publication.realPages.length if (currpage == 1) { (".target").show(); }; }); I've tried with for( i = 0, i >= pubpage, i++); but i don't grasp how i could make each target individually appear after that. currpage = current active page pubpage = total number of pages I'm basically looking for a way to adress the same class but that has different parents. Also a way that i don't have to write currpage === 1, currpage === 2, etc for each page.
type: Question
type: AnsweredQuestion
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27798854
tagged with: css
has title: Showing / hiding same div class nested in different div's with javascript based on changing number

http://stackoverflow.com/comment/43997428
type: AnswerComment
has text: Yep, there's an error message. You have to [put the script after the `textarea`](http://plnkr.co/edit/lQ9bVo7wLyIXpAatyR9L?p=preview), or wrap it in `window.onload` handler.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27793831

http://stackoverflow.com/a/27642570
type: Answer
has body: Arguments to a javascript function are either passed 'by value' in case of primitives, or 'by reference' in case of objects. Your var 'number' is a primitive. In this case, a copy is made of the primitive value, and passed as the argument. Addnumber therefore adds 50 to a copy of number, not to number itself. When you want to change the value of a variable in this way, use an object, then it will work as you initially expected: var number={value:0}; function addnumber(numbertype){ numbertype.value = numbertype.value +50; }
score: 0
answers question: http://stackoverflow.com/q/27641917

http://stackoverflow.com/comment/43712910
type: QuestionComment
has text: Could you add a url parameter to be your referer? referer are usually considered suspect anyway
comment on: http://stackoverflow.com/q/27647613
score: 0
type: Comment

http://stackoverflow.com/q/27652564
has comment: http://stackoverflow.com/comment/43722183
tagged with: javascript
has comment: http://stackoverflow.com/comment/43722319
type: AnsweredQuestion
has title: While loop doesnt want to give me particular variable
has comment: http://stackoverflow.com/comment/43722134
has comment: http://stackoverflow.com/comment/43722579
has comment: http://stackoverflow.com/comment/43722290
type: Question
has answer: http://stackoverflow.com/a/27652851
has comment: http://stackoverflow.com/comment/43722282
has answer: http://stackoverflow.com/a/27652618
tagged with: php
has comment: http://stackoverflow.com/comment/43722273
has comment: http://stackoverflow.com/comment/43722424
has comment: http://stackoverflow.com/comment/43722366
has comment: http://stackoverflow.com/comment/43722301
score: 0
has comment: http://stackoverflow.com/comment/43722177
possible better answer: http://stackoverflow.com/a/27652618
answer count: 2
tagged with: mysql
has comment: http://stackoverflow.com/comment/43722546
has comment: http://stackoverflow.com/comment/43722558
has comment: http://stackoverflow.com/comment/43722157
has comment: http://stackoverflow.com/comment/43722485
has comment: http://stackoverflow.com/comment/43722387
has comment: http://stackoverflow.com/comment/43722358
has comment: http://stackoverflow.com/comment/43722189
accepted answer: http://stackoverflow.com/a/27652851
has comment: http://stackoverflow.com/comment/43722328
has body: I have a while loop that is showing photographs, and under are each one is a link throwing a popup and opening a form. The form is made to send a comment to the photograph. Everything works here but I have a problem with photoid variable. I have been trying for many days but the id of a photo never gets out correctly out of the loop. Its always id of the last photo or of the first.... Could you please help me to do this? People have been helping me with some jquery, ajax scripts, with some hidden input in form but this never worked for me, maybe i am too stupid :( Could you help me please take the id of the photo connected with "comments" link outside of the loop? I am so tired of this....... Please! I tagged it also as java script because i dont know what will be needed to finish this <?php include 'connect.php'; //-----------------HERE BEGINS THE LOOP THROWING OUT PHOTOS-------------------- $allphotos = mysql_query("SELECT * FROM photos ORDER BY id DESC"); while ($numphotos = mysql_fetch_assoc($allphotos)){ $photoinfo = mysql_query('SELECT * FROM photos WHERE link="'.$numphotos['link'].'" '); $fetchinfo = mysql_fetch_assoc($photoinfo); //------------HERE IS PHOTO-------------------------- echo ' '; $photoid = $fetchinfo['id']; //----------------BELOW IS THE ADD COMMENT LINK---------------- echo " komentarze "; //---------------------HERE STARTS THE POPUP ADDING COMMENT FORM------------- echo " "; } //----------------AFTER THE FORM IS SUBMITED THE CODE BELOW SAVES THE COMMENT TO DATABASE BUT THE PHOTOID IS ALWAYS NOT CORRECT--------- if (isset($_POST['send'])){ try{ $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stmt = $pdo->prepare("INSERT INTO comments (comment, photoid, writer, date) VALUES (:comment, :photoid, :writer, :date) "); $stmt->execute(array('comment'=> $_POST['comments'], 'photoid'=> $_POST['photoid'], 'writer'=> $_GLOBALS['nick'], 'date'=> date("Y-m-d"))); } catch(PDOException $e){ echo 'error main.php 1:' . $e->getMessage(); } } ?> …

http://stackoverflow.com/q/27645162
tagged with: jquery
linked to: http://stackoverflow.com/q/4316878
possible better answer: http://stackoverflow.com/a/27645216
duplicate of: http://stackoverflow.com/q/4316878
answer count: 4
has answer: http://stackoverflow.com/a/27645447
upvote count: 13
has answer: http://stackoverflow.com/a/27645216
favorite count: 0
tagged with: operators
has answer: http://stackoverflow.com/a/27645272
has title: Why does `$(document) === $(document)` returns false in jQuery?
score: 13
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27645201
has comment: http://stackoverflow.com/comment/43708674
linked to: http://stackoverflow.com/q/3176962
accepted answer: http://stackoverflow.com/a/27645201
has comment: http://stackoverflow.com/comment/43710281
type: Question
has body: I tried $(document) === $(document) but found the result is false.. Does anyone have ideas about this?
tagged with: comparison-operators
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/43750269
type: QuestionComment
has text: My English is not very good so I drew http://imgur.com/AaxdV3z
comment on: http://stackoverflow.com/q/27667253
score: 0
type: Comment

http://stackoverflow.com/comment/44005258
type: Comment
comment on: http://stackoverflow.com/a/27798168
type: AnswerComment
has text: Renaming `bad_function` would defeat the whole point of monkey patching.
score: 0

http://stackoverflow.com/comment/43745838
has text: As you do not want to have an a tag in the cell but want the whole cell to be a link I think its semantically ok. In the end I would't mind though, but from experience feel that the styling to get the whole cell clickable is much simpler when it is wrapped.
comment on: http://stackoverflow.com/a/27653502
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27782388
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43974947
accepted answer: http://stackoverflow.com/a/27783027
score: 0
possible better answer: http://stackoverflow.com/a/27782638
type: Question
has body: I'm trying to get records from the database using a client side (Javascript) clickable list. The problem is that I want the clickable links to be sourced from the data in the database in the first place (MySQL). I'm having problems passing the data to create the clickable list. I've tried various ideas and hit stumbling blocks to do with client side and server side programming (and briefly looked into JQuery but it appears difficult to do). I've been attempting this with HTML, PHP, Javascript, JQuery (briefly) and MySQL. So I need to SELECT post_id, post_title FROM posts and make post_title clickable in the list but using the associated post_id to find the relevant data in the DB and post this via innerHTML into another element. Any ideas?
tagged with: javascript
tagged with: jquery
answer count: 2
has comment: http://stackoverflow.com/comment/43998614
has answer: http://stackoverflow.com/a/27783027
tagged with: mysqli
tagged with: php
has title: Creating a clickable list from DB and returning relevant DB field data in a web page element
has answer: http://stackoverflow.com/a/27782638

jinja2
tags question: http://stackoverflow.com/q/27770198
type: Tag
tag name: jinja2
tags question: http://stackoverflow.com/q/27759168

datetimepicker
type: Tag
tag name: datetimepicker
tags question: http://stackoverflow.com/q/27656205
tags question: http://stackoverflow.com/q/27695291

http://stackoverflow.com/a/27660822
type: AcceptedAnswer
has body: Change your CSS from the hover state to a class, for iunstance change .sub1:hover to .hovered: .container .hovered &gt; .front { transform: perspective(600px) rotateY(-180deg); } .container .hovered &gt; .back { transform: perspective(600px) rotateY(0deg); } And now, on click, add this class to the element clicked: $(".sub1").click(function() { $(this).addClass ('hovered'); }) fiddle this function in javascript would be function change(element) { element.className = element.className + " hovered"; } provided that you send the element in the function call onclick="change(this)" fiddle - function set only in the first div
type: Answer
has comment: http://stackoverflow.com/comment/43752224
has comment: http://stackoverflow.com/comment/43748581
has comment: http://stackoverflow.com/comment/43753101
accepted answer of: http://stackoverflow.com/q/27656722
has comment: http://stackoverflow.com/comment/43748318
answers question: http://stackoverflow.com/q/27656722
score: 0
has comment: http://stackoverflow.com/comment/43756002

http://stackoverflow.com/q/27776520
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43963558
has title: Dont see the options and cant select
has comment: http://stackoverflow.com/comment/43963657
possible better answer: http://stackoverflow.com/a/27776766
tagged with: javascript
has answer: http://stackoverflow.com/a/27776766
has answer: http://stackoverflow.com/a/27776615
has comment: http://stackoverflow.com/comment/43963559
has comment: http://stackoverflow.com/comment/43963627
has answer: http://stackoverflow.com/a/27776648
favorite count: 0
has comment: http://stackoverflow.com/comment/43963659
answer count: 5
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27776636
tagged with: css
accepted answer: http://stackoverflow.com/a/27776615
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27776596
has body: I have a little box, where I can change language, but it's not working. I don't see any mistake. When I click on this box it does not open, and I can't choose the option. But why? What I want to do? I want to do something like this: If u choose option->EST then its going to index.html and if u choose option->ENG then its going to index_eng.html In HTML I have: EST ENG In CSS I have: #menu4 { position: absolute; right: 0px; } #menu4 ul { text-align: right; } #menu4 a { color: #FFF; font-weight: normal; line-height: 22px; font-size: 16px; font-family: 'futura_bk_btbook'; } #menu4 .selected a { /*text-decoration: underline;*/ } And also I have script for this dropdown menu: $('option').click(function() { var url = $(this).attr('href'); window.location = url; });
upvote count: 2
score: 1

http://stackoverflow.com/a/27648568
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27648541
score: 1
answers question: http://stackoverflow.com/q/27648541
downvote count: 0
type: AcceptedAnswer
has body: Use this keyword scene.add(this.Obj);

getscript
tags question: http://stackoverflow.com/q/27792419
tags question: http://stackoverflow.com/q/27772901
type: Tag
tag name: getscript

http://stackoverflow.com/q/27671346
type: AnsweredQuestion
tagged with: supertest
score: 1
upvote count: 1
has body: I try to unit test my sail.js controller that requires user to be logged in. My current test is: var request = require('supertest'), // I try to use 'superagent', this changes nothing user = request.agent; describe('SomeController', function() { // login user first of all before(function(done) { user(sails.hooks.http.app) .post('/user/login') .send({username: 'hellocat', password: '123456789'}) // request works well by itself, // it does not return error and return normal response. .end(function (err, res) { // then I try to save cookies of logged in user to it agent user(sails.hooks.http.app).saveCookies(res); done(); }); }); // let test something it('must return "ok" when user is logged in or "wtf" if opposite', function(done) { user(sails.hooks.http.app) .get('/user/me') .end(function(err, res) { console.log(res.body); // no need to expect something, user is not logged in ( done(); }); }); }); Before hook works well and my user is logged in at the end of request. But in test it is not. I lift sails application before all the test started to run. Similar tests that is not require authorization work well. I guess the error is probably in cookie saving or wrong understanding of how to use supertest agents. What am I doing wrong?
type: Question
tagged with: sails.js
tagged with: javascript
has answer: http://stackoverflow.com/a/27671587
tagged with: tdd
accepted answer: http://stackoverflow.com/a/27671587
answer count: 1
has title: How to test sail.js controller with user logged in with passport.js
downvote count: 0
favorite count: 0
tagged with: node.js

http://stackoverflow.com/q/27745845
has title: reactjs Unexpected token "/"
has answer: http://stackoverflow.com/a/41397733
type: Question
tagged with: reactjs
has comment: http://stackoverflow.com/comment/43903913
tagged with: javascript
score: 0
answer count: 1
has body: Hello i am trying to render a React component dynamically look: render: function() { return ( {this.props.fields.map(function(field, index){ if (index != 0 &&index%3==0) { return ( ... ) } else{ return ( ... ) } })} ); } but i am getting this error "Parse Error: Line 17: Unexpected token / while parsing file..." the line 17 in my file is There is another way to do this? and is it possible to put all my duplicated code inside a variable? Obs: i am using browserify(7.0.x) and reactfy(0.17.1)
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43903257
has comment: http://stackoverflow.com/comment/43903535

http://stackoverflow.com/q/27717029
upvote count: 1
tagged with: yii
tagged with: javascript
type: UnansweredQuestion
has body: I am a new user to Yii and angular. I tried ng-messages and ng-if in my code below: <?php echo $form->textField($model, 'jobTitle', array('placeholder'=>'JobTitle (eg. Trainee)','ng-model'=>'form.jobTitle','name'=>"jobTitle",'required'=>'required'?> * You did not enter a field <?php echo $form->textField($model,'organizationName',array('placeholder'=>'Company (eg. Microsoft)',"name"=>"Company",'required'=>'required')); ?> * You did not enter a field <?php echo CHtml::submitButton( 'Post Job',array( 'class'=>'btn highlight-btn bigsize')); ?> But when I run this into browser the ng-message div is disappeared and ng-If code is automatically commented. I have seen this in inspect element. like this: *
has comment: http://stackoverflow.com/comment/43853843
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/43851274
score: 1
favorite count: 0
tagged with: angularjs
type: Question
has title: ng-If and ng-message not working in yii
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43854741
tagged with: php

http://stackoverflow.com/q/27740632
downvote count: 0
tagged with: javascript
answer count: 6
tagged with: jquery
score: 4
has comment: http://stackoverflow.com/comment/43898475
linked to: http://stackoverflow.com/q/17484407
has body: I have used ScriptManager.RegisterStartupScript() method in order to show an alert when particular thing happens in back end.It works fine in page load method but not in particular method which is called when a specific button is clicked . I Couldn't find a solution because in another page it works fine in both page load and the method. Script Manager RegisterStartupScript Method ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alert", "alert('msg');", true); HTML <asp:HiddenField runat="server" ClientIDMode="Static" ID="PostBackController"/> SAVE Javascript function btnSave_clientClick() { // code if (some_condition) { $('#PostBackController').val("btn_save"); __doPostBack(); } } Page Load Method protected void Page_Load(object sender, EventArgs e) { if (PostBackController.Value == "btn_save") { uploadDocSave_ServerClick(); } } Method Wish should be called when button Clicked protected void uploadDocSave_ServerClick() { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alert", "alert('msg');", true); }
has title: ScriptManager.RegisterStartupScript() method not working - ASP.NET, C#
tagged with: scriptmanager
has comment: http://stackoverflow.com/comment/43892182
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/43892286
has answer: http://stackoverflow.com/a/27740817
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/46575424
has answer: http://stackoverflow.com/a/38051956
has answer: http://stackoverflow.com/a/27767856
has comment: http://stackoverflow.com/comment/43893233
has comment: http://stackoverflow.com/comment/43893927
has comment: http://stackoverflow.com/comment/43956924
has answer: http://stackoverflow.com/a/46575139
type: Question
upvote count: 4
tagged with: c#
has answer: http://stackoverflow.com/a/42578092

http://stackoverflow.com/q/27757946
accepted answer: http://stackoverflow.com/a/27758108
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43926922
favorite count: 0
possible better answer: http://stackoverflow.com/a/27758074
has answer: http://stackoverflow.com/a/27758074
has body: I've been dealing with that for a few hours and I can't find a solution. I need to call a function just when screen size with is &lt; 1000px (iPad vertical orientation), and comment/deactivate the function when screen size is > 1000px (iPad landscape orientation). I wrote the following code, It works well, but when I rotate the iPad (from vertical to landscape) the function does not being commented as expected. It's been a quite complicated to explain. Hope you can understand my problem. $(window).ready(function(){ if ( $(window).width() &gt; 1000) { /* $( '.head_bar_nav ul:has(li)' ).doubleTapToGo(); */ } else { $( '.head_bar_nav ul:has(li)' ).doubleTapToGo(); } }); $(window).resize(function(){ if ( $(window).width() &gt; 1000) { /* $( '.head_bar_nav ul:has(li)' ).doubleTapToGo(); */ } else { $( '.head_bar_nav ul:has(li)' ).doubleTapToGo(); } }); Have a nice day, bye!
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27758108
score: 1
type: Question
has comment: http://stackoverflow.com/comment/43926716
has comment: http://stackoverflow.com/comment/43927263
tagged with: javascript
tagged with: jquery
has title: Call a JS function only when <1000 px on screen

http://stackoverflow.com/a/27747107
has body: That is because after the first invocation of decreaseQ with a function argument you are calling decreaseQ without any argument by setting it in the timeout.But you expect a callback and you invoke the function decreaseQ() which causes the error. Instead you would just need to pass the function as callback. if (q-- &gt; 0) { $timeout(function() { decreaseQ(callback); //Pass the callback as argument }, 100); } Or use bound function $timeout(angular.bind(null, decreaseQ, callback), 100); or just do not run if there is no callback provided by adding a check. if(angular.isFunction(callback)) { callback(); } Or use the dummy anonymous function (callback||angular.noop)();
type: Answer
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/27747056
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27747056

http://stackoverflow.com/comment/121288656
type: AnswerComment
comment on: http://stackoverflow.com/a/27642444
has text: I like the go lang's approach to inheritance - they just ripped out polymorphism from inheritance and rebranded it as "embedding". The fact that you're using embedding is a private implementation detail instead of publicly exposed relationship information. If you want to achieve polymorphism in go, you have to use interfaces. Inheritance ≠ polymorphism. Inheritance is often overused _because_ people keep trying to use it to achieve polymorphism, not because they actually need to inherit behaviors. People need to know that alternatives solutions exist, such as duck typing, protocols, etc.
type: Comment
score: 0

http://stackoverflow.com/q/27763086
tagged with: datetime
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/43937138
tagged with: recurrence
has answer: http://stackoverflow.com/a/27764331
has comment: http://stackoverflow.com/comment/43937158
type: Question
has comment: http://stackoverflow.com/comment/43937203
has answer: http://stackoverflow.com/a/27763972
has answer: http://stackoverflow.com/a/27763142
linked to: http://stackoverflow.com/q/3224834
accepted answer: http://stackoverflow.com/a/27764331
tagged with: javascript
tagged with: date
has answer: http://stackoverflow.com/a/27770261
possible better answer: http://stackoverflow.com/a/27763833
has title: Calculate the recurring dates between a range of dates in javascript
has answer: http://stackoverflow.com/a/27763833
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43937169
favorite count: 0
has body: How the recurrence actually works is not a question. I want to implement a way to calculate the days between two dates with a specified recurrence interval. That could be weekly, monthly, bi-monthly(which I don't exactly know about) yearly etc. The simplest thing I have done until now is the following which let me count all the days between two dates and then loop through them with an interval of seven days for weekly recurrence. I would be grateful if you can suggest me the better and correct implementation of it. Thanks. //Push in the selected dates in the selected array. for (var i = 1; i &lt; between.length; i += 7) { selected.push(between[i]); console.log(between[i]); }
answer count: 5

http://stackoverflow.com/comment/43870158
type: AnswerComment
has text: thanks Tushar but its not working for me actually i want to show a tooltip message with css effect with my textbox on ajax sucess. CSS is working but i am unable to show the tooltip.
type: Comment
comment on: http://stackoverflow.com/a/27729260
score: 0

http://stackoverflow.com/comment/43804137
score: 0
has text: I've tried this approached except I replaced your write log function by hithead() (if checked) and stopgame() (if unchecked) but it seems to do the hithead() function regardless if I click a radio that is check or unchecked. See edit3 for my interpretation of your approach.
type: Comment
comment on: http://stackoverflow.com/a/27684242
type: AnswerComment

http://stackoverflow.com/q/27801542
tagged with: multithreading
downvote count: 3
tagged with: v8
upvote count: 1
has comment: http://stackoverflow.com/comment/44011972
type: Question
has comment: http://stackoverflow.com/comment/44011928
has comment: http://stackoverflow.com/comment/44011747
tagged with: javascript
has comment: http://stackoverflow.com/comment/44038701
has title: How can run js in v8's none main thread?
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44012982
type: UnansweredQuestion
score: -2
has answer: http://stackoverflow.com/a/27802597
tagged with: c++
has body: In v8 engine,js code can only run in main thread.I aim at running js code in none main thread , in this way CPU-intensive task could not preempt the cpu time of main thread. But i just have no idea how to achieve the goal. OK,i remove the tag of node.js of this question, i don't care the skill of how to take advantage of multicore in node.js.I am writting an implement of thread based on native v8 api.Please don't tell the solution that used in node.js.In fact , i desire someone give me some guide based on v8's c++ api. This link explain why we can't use V8 code in none main thread , in user-defined thread you can only run native c++ code.This is no solution?

http://stackoverflow.com/comment/44011711
comment on: http://stackoverflow.com/q/27801462
has text: Right click on the image and try to use Open in New tab and see if they are in the right path.
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/43911264
type: QuestionComment
comment on: http://stackoverflow.com/q/27749824
score: 0
has text: @agentpx Not really a duplicate, as at the core, this is a question about something else.
type: Comment

http://stackoverflow.com/comment/43719724
comment on: http://stackoverflow.com/q/27651340
type: Comment
type: QuestionComment
has text: Maybe this will help you; http://stackoverflow.com/questions/2655925/how-to-apply-important-using-css
score: 0

http://stackoverflow.com/comment/43798313
type: QuestionComment
has text: Seems fine to me. Can you include any additional information that would help lead to a possible cause of this problem? "It doesn't work" isn't very informative.
score: 0
comment on: http://stackoverflow.com/q/27692600
type: Comment

http://stackoverflow.com/q/27712157
has answer: http://stackoverflow.com/a/27712338
has body: In an application I'm writing, at some point, I want to be able to parse a tag-like string with RegExp so that it is modified, such as: "{b}This is BOLD{/b}".replace(/\{b\}(.*?)\{\/b\}/gi, "00b3f[ $1 00b3d]"); // Returns "00b3f[ This is BOLD 00b3d]" I am able to do this easily, but it gets complicated when a more complex string is passed to the function, for example: "{red} This is RED {red} This also should be red {/red} and this {/red}" .replace(/\{red\}(.*?)\{\/red\}/gi, "00b4f[ $1 00b4d]"); // Returns: // "00b4f[ This is RED {red} This also should be red 00b4d] and this {/red}" // Where the output should be: // "00b4f[ This is RED 00b4f[ This also should be red 00b4d] and this 00b4d]" I would like to solve this problem with a simple RegExp but I can't find a way to do it! I think I could do this with a while-loop but it would get too messy. Any suggestions?
has comment: http://stackoverflow.com/comment/43836624
tagged with: regex
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27712338
score: 0
has title: RegExp Parser for Tag-Like String
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43836475
tagged with: javascript
tagged with: replace
linked to: http://stackoverflow.com/q/1732348
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/43865290
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27726618
has text: Did your console show any errors?
type: QuestionComment

http://stackoverflow.com/q/27784561
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27784612
has body: I've created a list which displays thumbnails and the name of the film next to each one. For each new thumbnail I make this call: $("#thumb").append('&lt;li&gt;&lt;img id="amatx" src='+value+' /&gt;&lt;/li&gt;&lt;p id="titol"&gt;'+titl+'&lt;/p&gt;'); thumb is the divisor in which the thumbnails and titles are listed. value contains the link to the thumbnail while titl contains the title. I get all this information from an API. Now I want to create a listener that when I click a thumbnail or a title it displays the name of the film. This is what I got by now: App.prototype.listenerFilms = function(){ $("#amatx").on('click', function(evt){ }); }; I really don't know how to get the information because all the images and titles got the same id's... can someone help me please?
favorite count: 0
has comment: http://stackoverflow.com/comment/43979901
has comment: http://stackoverflow.com/comment/43979630
has comment: http://stackoverflow.com/comment/43979385
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27786759
type: Question
has answer: http://stackoverflow.com/a/27784666
has comment: http://stackoverflow.com/comment/43979316
accepted answer: http://stackoverflow.com/a/27784666
tagged with: javascript
has title: How to get information from a clicked element with JQuery?
tagged with: jquery
answer count: 3
possible better answer: http://stackoverflow.com/a/27784612
has comment: http://stackoverflow.com/comment/43979814
has comment: http://stackoverflow.com/comment/43979040
upvote count: 1

http://stackoverflow.com/comment/43851389
type: QuestionComment
type: Comment
has text: `<path onmouseover="selection=this">`
comment on: http://stackoverflow.com/q/27719767
score: 0

http://stackoverflow.com/comment/43950729
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27769920
type: Comment
has text: Having formatted your code it's very obvious that you have extra `}`.

http://stackoverflow.com/q/27715473
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27715533
type: Question
has answer: http://stackoverflow.com/a/27715525
has title: javascript - insert div after elements with a certain class on mouseover
tagged with: javascript
has answer: http://stackoverflow.com/a/27715715
upvote count: 1
has body: I know that there is a really simple jQuery way to to this, but now I would like to understand why my code is not working properly: function insertAfter(referenceNode, newNode) { referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); } var menuHelp = document.querySelector(".menu_help"); for (var i = 0;i&lt;menuHelp.length;i++){ menuHelp[i].onmouseenter = function(){ menuHelpPopup = document.createElement("div"); menuHelpPopup.setAttribute('class','menu_help_popup'); menuHelpPopup.innerHTML = "test"; insertAfter(menuHelp[i], menuHelpPopup); } menuHelp[i].onmouseleave = function(){ menuHelpPopup.remove(); } } What I'm trying to do is to create a popup and insert it after elements with a certain class when mouseover on them.. DEMO http://jsfiddle.net/r5e8rvkg/
favorite count: 0
has answer: http://stackoverflow.com/a/27715605
accepted answer: http://stackoverflow.com/a/27715533
answer count: 4
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27715605

http://stackoverflow.com/a/27727151
score: 0
has comment: http://stackoverflow.com/comment/43866402
type: Answer
has body: This should do the job. You basically find all the relevant parents of all the matching elements, get the intersection of each of those sets, then grab the first one to get the most nested common parent. You can even wrap it up as as jquery plugin. if(console && console.clear) console.clear(); // create a handy intersection method for Arrays // see http://stackoverflow.com/a/16227294/1901857 Array.prototype.intersect = function(arr) { var a = this, b = arr; var t; if (b.length > a.length) t = b, b = a, a = t; // indexOf to loop over shorter return a.filter(function (e) { return b.indexOf(e) > -1; }); }; ;(function($) { $.fn.commonParents = function(selector) { // find all relevant parents for each element and get set intersection // pushStack means you can use end() etc in chaining correctly return this.pushStack(sometexts.get().reduce(function(prevParents, el) { // common parents for this element - note the lowest level parent is first var parents = $(el).parents(selector || '*').get(); // intersect with the previous value (or itself if first) return (prevParents || parents).intersect(parents); }, null), "commonParents", arguments); }; })(jQuery); // text to search for var search = "Sometext"; // parent selector to filter parents by e.g. '.unknown' - use null for all parents var parentSelector = null; // find everything containing search var sometexts = $(":contains('" + search + "')").filter(function() { return $(this).text() == search; }); // grab the first common parent - the lowest level one - or null if there isn't one var commonParent = sometexts.commonParents(parentSelector).get(0); console.log(commonParent); Sometext Sometext Sometext
answers question: http://stackoverflow.com/q/27726869
has comment: http://stackoverflow.com/comment/43866310

http://stackoverflow.com/a/27668320
has comment: http://stackoverflow.com/comment/43751621
has body: It seems like you placed your &lt;div id="container"&gt; inside another div or any parent element (except html and body). If so, the parent element/s don't have a height of 100%. If you add height:100%; to the parent element your container must fill the entire height of the parent element. I tested your code provided and it's working.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27667973

http://stackoverflow.com/q/27671083
score: 0
has comment: http://stackoverflow.com/comment/43759158
answer count: 0
type: UnansweredQuestion
has title: IOS/ safari, Skeljs side navigation issue
tagged with: css
has comment: http://stackoverflow.com/comment/43758577
has body: I decided to use an HTML5up template (Verti => here) as the basis for a WordPress theme for a client. The client needed me to deploy early, so the site is live=> here. The side navigation doesn't work on IOS/ safari, or Chrome on an iPhone. Those are the only browsers with problems Here's the javascript called in the footer: $('.banner').unslider({ arrows: true, fluid: true, dots: true, fade:true }); // Find any element starting with a # in the URL // And listen to any click events it fires $('a[href^="#"]').click(function() { // Find the target element var target = $($(this).attr('href')); // And get its position var pos = target.offset(); // fallback to scrolling to top || {left: 0, top: 0}; // jQuery will return false if there's no element // and your code will throw errors if it tries to do .offset().left; if(pos) { // Scroll the page $('html, body').animate({ scrollTop: pos.top, scrollLeft: pos.left }, 1000); } // Don't let them visit the url, we'll scroll you there return false; }); $("#mygallery").justifiedGallery({ rowHeight : 160 }); And here's the navigation: Culinary Craft Catering Co. <a href="<?php echo get_site_url(); ?>">Home <a href="<?php echo get_site_url(); ?>/our-services/">Services <a href="<?php echo get_site_url(); ?>/our-services/">Services <a href="<?php echo get_site_url(); ?>/our-services">Catering <a href="<?php echo get_site_url(); ?>/liquid-catering">Liquid Catering <a href="<?php echo get_site_url(); ?>/corporate-events">Weddings and Corporate Events <a href="<?php echo get_site_url(); ?>/planning">Planning <a href="<?php echo get_site_url(); ?>/execution">Execution <a href="<?php echo get_site_url(); ?>/menus">Menus <a href="<?php echo get_site_url(); ?>/about">About <a href="<?php echo get_site_url(); ?>/why-culinary-craft">Why Culinary Craft? <a href="<?php echo get_site_url(); ?>/about">Our Executive Team <a href="<?php echo get_site_url(); ?>/frequently-asked-questions">Frequently Asked questions <!-- <a href="<?php echo get_site_…
has comment: http://stackoverflow.com/comment/43762150
tagged with: wordpress
has comment: http://stackoverflow.com/comment/43757037
type: Question
tagged with: ios
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43757084
has comment: http://stackoverflow.com/comment/43757116
has comment: http://stackoverflow.com/comment/43758702

http://stackoverflow.com/comment/43769982
has text: Also, if you want your site to be scrollable in horizontal please not that this is an UX antipattern - un mobile this is left-right swipe is often "go back / go forth" and so it is on my MacBook - if I scroll left to the edge i am triggering "go back" in both Chrome and Safari and I don't like that :)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27677052
score: 0

http://stackoverflow.com/q/27738121
tagged with: jquery
score: 1
has answer: http://stackoverflow.com/a/27739284
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43888106
favorite count: 0
has title: bootstrap-datepicker takes client pc time, how to set default time from server
has comment: http://stackoverflow.com/comment/43887495
upvote count: 1
has comment: http://stackoverflow.com/comment/43887451
accepted answer: http://stackoverflow.com/a/27739284
answer count: 1
has body: I am using bootstrap-datepicker(http://eternicode.github.io/bootstrap-datepicker/). I want to run this plugin depending on server time. I can change default date like this: $('.datepicker').datepicker('update', new Date(2011, 2, 5)); If i do like this then how do i apply other formatings like this: $(''.datepicker').datepicker({ format: "dd-mm-yyyy", todayBtn: "linked", daysOfWeekDisabled: "1,2,3,4,5,6", calendarWeeks: true, autoclose: true, todayHighlight: true, });
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/43997919
type: QuestionComment
has text: @ar.gorgin, Added it as an answer
score: 0
comment on: http://stackoverflow.com/q/27793769
type: Comment

http://stackoverflow.com/comment/43810255
comment on: http://stackoverflow.com/q/27698176
has text: not if you don't register it as a provider, service , factory etc.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43864761
score: 0
comment on: http://stackoverflow.com/q/27726224
type: Comment
has text: Thanks! How do I actually go about pushing the time to the backend?
type: QuestionComment

http://stackoverflow.com/comment/43968329
type: QuestionComment
has text: This error comes up with any variable used inside the " {{ }} ". Will look at the link and try to get around this. Thanks so much Simon !
comment on: http://stackoverflow.com/q/27778437
score: 0
type: Comment

http://stackoverflow.com/comment/44001775
comment on: http://stackoverflow.com/q/27796544
has text: "scrape" how exactly? Do you even need to insert it into the DOM ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43976851
type: QuestionComment
comment on: http://stackoverflow.com/q/27783426
score: 0
has text: You're ignoring the action when the touch ends, from what you're saying , you want to ignore it if the user scrolls. Try moving your `touchend` listener into the `touchmove`.
type: Comment

http://stackoverflow.com/q/27733139
has title: Display age from DoB input in Javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27733367
has comment: http://stackoverflow.com/comment/43877780
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27733522
upvote count: 1
has answer: http://stackoverflow.com/a/27733412
has body: I am trying to create a form in html/javascript where the user can input their date of birth and then a message is displayed stating "you are 'x' years old", using the data from their date of birth. However I am completely unsure of how to get this to work? Here is the code I have currently: HTML: Submit JS: function submitBirthday() { var birthday = document.getElementById("myBirthday").value; document.getElementById("displayBirthday").innerHTML = ("You are " + birthday + " years old."); } I realise this displays "you are 'dd-mm-yyyy' years old currently, but this is all I've been able to do. Any help will be greatly appreciated! Thanks
downvote count: 1
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43877925
answer count: 3
linked to: http://stackoverflow.com/q/4944750
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/123568706
score: 0
has text: Wouldn't this fail if the user's timezone had the hard coded time in the first 12 hours of the day (AM not PM)
type: Comment
comment on: http://stackoverflow.com/a/27648032
type: AnswerComment

http://stackoverflow.com/comment/43933198
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27760998
has text: Thanks for the reply, but I'm not sure I fully understand it. I tried /[^\(\)]*/ on regex 101 and found that it doesn't have any capturing groups do doesn't return anything even though it has matches and 2 that it matches things in between the ( ).
type: AnswerComment

http://stackoverflow.com/a/27743190
score: 0
type: Answer
has body: We use code like this .... Script in head of Parent page : &lt;script type='text/javascript'&gt; function SetHeight(wParent,wChild) { // parent window, child window var f = wParent.frames["iFrameName"]; // whatever the iframe's name is if (f) f.style.height=(wChild.document.body.scrollHeight + 30)+"px"; } &lt;/script&gt; if calling from Child page, add to onload event .. &lt;body onload='SetHeight(parent,window)'&gt; if calling from the parent page .. SetHeight(window , window.frames["iFrameName"]) Which event ? if you need the code to be in the parent frame, then you need to do something to repeatedly check the state of the loading frame to check its state, perhaps using setTimeout. You will only be able to get the height of the document once the child page has loaded &amp; rendered. BUT If the child page is from a different domain, then trying to do this will almost certainly give you an "Access Denied" error because javascript from a parent frame can't access attributes of a child from from a different domain.
has comment: http://stackoverflow.com/comment/43897326
has comment: http://stackoverflow.com/comment/43898268
answers question: http://stackoverflow.com/q/27743071

http://stackoverflow.com/q/27720389
type: Question
has answer: http://stackoverflow.com/a/27720406
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27720406
score: 0
answer count: 1
has body: Having looked at the documentation I know that the issue lies with the fact the item I want to delete is being appended. Though from I can see using .on should allow for this. I am appending some content to a list with a button I want to delete the appended content when clicked. Child <?php echo form_dropdown('year[]', $years, date('Y')); ?> var c = 1; $( ".child-add" ).click(function() { $( "#child1" ).clone().append( "" ).attr('id', 'child'+(++c) ).appendTo( "#children" ); }); $( ".child-delete" ).on('click',function() { $(this).parent().remove(); }); The content appends fine, but the click function for remaking it will not fire. It does work however if the content is already on the page, e.g. no appended later.
tagged with: append
type: AnsweredQuestion
has title: jQuery click action on appended item

http://stackoverflow.com/comment/43973789
type: QuestionComment
comment on: http://stackoverflow.com/q/27781948
score: 0
has text: you should put the code you want to run inside the `success` property of the ajax request
type: Comment

http://stackoverflow.com/a/27653787
downvote count: 0
has body: In case you don't want any common module, you can define your service like this : var app = angular.module('app',[]);//creating module app.service('utils', [function() { /*insert your code here*/ }]); Using this format will ensure you dont re-create the module by mistake. And then in you controller you can inject the service like : app.controller('storageController', ['$scope', 'storage', 'utils', function ($scope, storage, utils) { /*controller code here*/ }]);
type: Answer
has comment: http://stackoverflow.com/comment/43724359
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43724447
answers question: http://stackoverflow.com/q/27653273

http://stackoverflow.com/a/27706409
has body: All you have to do is loop over your data. var visitors = [ { '2014.12.25': 141 }, { '2014.12.26': 630 }, { '2014.12.30': 71 } ]; var documents = [ { '2014.12.15': 31 }, { '2014.12.26': 60, }, { '2014.12.30': 95 } ]; var data = {}; visitors.forEach(function(el){var k = Object.keys(el)[0]; data[k] = data[k] || {}; data[k].visits = el[k];}); documents.forEach(function(el){var k = Object.keys(el)[0]; data[k] = data[k] || {}; data[k].docs = el[k];}); for(prop in data){ if(data[prop].docs === void 0){data[prop].docs = 0}; if(data[prop].visits === void 0){data[prop].visits = 0}; } This gives your data in a combined manner, all you have to do is add logic to move the date from key to a property.
has comment: http://stackoverflow.com/comment/43825688
has comment: http://stackoverflow.com/comment/43825752
type: Answer
has comment: http://stackoverflow.com/comment/43825650
has comment: http://stackoverflow.com/comment/43825784
has comment: http://stackoverflow.com/comment/43826418
has comment: http://stackoverflow.com/comment/43827010
answers question: http://stackoverflow.com/q/27705946
score: 0

http://stackoverflow.com/a/27653137
answers question: http://stackoverflow.com/q/27652929
type: Answer
has body: I think the DOM is not fully loaded when yourbeddingnumbering called. Try wrapping it in a DOM ready event listener. var count = 0; document.addEventListener("DOMContentLoaded", function(event) { setInterval(function() { document.getElementById('test').innerHTML=count; count++; }, 1000); });
has comment: http://stackoverflow.com/comment/43725359
score: 0

http://stackoverflow.com/a/27938312
downvote count: 0
score: 42
type: Answer
has body: Seems like it is another way to add a workspace to the DevTools (another way of doing this: https://developer.chrome.com/devtools/docs/workspaces#). It happened for me when I dragged a file to an open browser page and the file was accidentally dragged over the open DevTools. If you want this to go away you can drag and drop a dummy file. This way there is no need to restart Chrome.
has comment: http://stackoverflow.com/comment/101198359
answers question: http://stackoverflow.com/q/27708614
has comment: http://stackoverflow.com/comment/102862212
upvote count: 42
has comment: http://stackoverflow.com/comment/128153626

http://stackoverflow.com/a/27746011
type: Answer
answers question: http://stackoverflow.com/q/27740970
accepted answer of: http://stackoverflow.com/q/27740970
type: AcceptedAnswer
has body: I solved this Problem by changing this if(request.getParameter("submitdata") != null) { if(request.getParameter("getdata") != null) { name += request.getParameter("getdata"); } } to this String name=""; if(request.getParameter("getdata") != null) { name += request.getParameter("getdata"); }
score: 0

http://stackoverflow.com/q/27748301
has title: Angular ngDisabled inside ngIf
favorite count: 0
has answer: http://stackoverflow.com/a/27748421
tagged with: angularjs
type: AnsweredQuestion
score: 2
upvote count: 2
linked to: http://stackoverflow.com/q/14049480
has body: I'm running into a roadblock. I have a simple piece of code: Hide Element Disable This works fine, but I want the text and second checkbox split into multiple divs, both still dependent on the first checkbox, like: Hide Element Disable When I do this, the model does not get applied correctly and I'm unable to disable the text box by using the second checkbox. Am I misunderstanding the scope, or is this a bug? I know with this example, I could wrap the two in an outer div, but my issue is that my structure is a table structure (yes, it's tabular data), where I don't want to hide an entire row, while keeping my markup as semantic as possible. //this does not get hidden //this does not get hidden //this does not get hidden //THIS GETS HIDDEN //THIS GETS HIDDEN If you want to play, I set up a basic fiddle: http://jsfiddle.net/qkmv6wfh/
accepted answer: http://stackoverflow.com/a/27748421
type: Question
possible better answer: http://stackoverflow.com/a/27748406
tagged with: javascript
tagged with: angularjs-scope
has answer: http://stackoverflow.com/a/27748406
tagged with: angularjs-ng-model
answer count: 2
downvote count: 0

http://stackoverflow.com/comment/43747322
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27665878
has text: i want the lens zoom effect to toggle .
type: Comment

http://stackoverflow.com/q/27770089
has answer: http://stackoverflow.com/a/27770109
has comment: http://stackoverflow.com/comment/43951078
tagged with: javascript
score: 0
answer count: 2
tagged with: this
tagged with: file-upload
has answer: http://stackoverflow.com/a/27770119
type: AnsweredQuestion
has body: So i am trying to grab an element by the class and then store File[0]. I am trying to then use the files[0] function to then process a file upload. When i do the following I get the error: "field.files is undefined" in my firebug console. document.querySelector('#afile').addEventListener('change', function(e) { var field = document.getElementsByClassName('File'); var file = field.files[0]; When I change my code to the following it works document.querySelector('#afile').addEventListener('change', function(e) { var file = this.files[0]; So I think the issue is with var file = field.files[0]. I need to grab this by class name and not "this". Can someone please help me grab the element using class name instead of "this". Thank you.
possible better answer: http://stackoverflow.com/a/27770109
has title: Javascript - Get Element By Class & files[0]
type: Question
accepted answer: http://stackoverflow.com/a/27770119

http://stackoverflow.com/comment/43958514
type: Comment
comment on: http://stackoverflow.com/a/27773820
has text: @FelixKling Though `typeof null === 'object'`.
type: AnswerComment
score: 0

http://stackoverflow.com/q/27766622
tagged with: javascript
has body: [Update] It was a stupid typo on my part. Thank you dfsq! There is a similar question here on SO, and my code follows the recommended answer, so please do not mark this as a duplicate. In my localhost I get the following error: Error: [ng:areq] Argument 'PostCtrl' is not a function, got undefined Contents of app.js: /* global app:true */ /* exported app */ 'use strict'; var app = angular .module('redjsApp', [ 'ngAnimate', 'ngCookies', 'ngResource', 'ngRoute', 'ngSanitize', 'ngTouch', 'firebase' ]) .constant('FIREBASE_URL', 'https://blazing-fire-6602.firebaseio.com/') .config(function ($routeProvider) { $routeProvider .when('/', { templateUrl: 'views/posts.html', controller: 'PostCtrl' }) .when('/about', { templateUrl: 'views/about.html', controller: 'AboutCtrl' }) .otherwise({ redirectTo: '/' }); }); Contents of scripts/services/post.js: 'use strict'; app.factory('Post', function ($firebase, FIREBASE_URL) { var ref = new Firebase(FIREBASE_URL + 'posts'); var posts = $firebase(ref.child('posts')).$asArray(); console.log($firebase(ref.child('posts')).$asArray()); var Post = { all: posts, create: function (post) { return posts.$add(post); }, get: function (postId) { return $firebase(ref.child('posts').child(postId)).$asObject(); }, delete: function (post) { return posts.$remove(post); } }; return Post; }); Contents of scripts/posts.js: 'use strict'; app.controller('PostsCtrl', function ($scope, Post) { $scope.posts = Post.all; $scope.post = {url: 'http://', 'title': ''}; $scope.submitPost = function () { Post.create($scope.post).then(function () { $scope.post = {url: 'http://', 'title': ''}; }); }; $scope.deletePost = function (post) { Post.delete(post); }; }); Contents of posts.html are : {{ post.title }} delete Posts: {{ posts}} Post: {{post}} Only the html is rendered, none of the associated js is rendered.The app was scaffolded using yeoman. Help would be appreciated!
has title: Error: [ng:areq] Argument is not a function, got undefined, on thinkster.io's tutorial
answer count: 1
has comment: http://stackoverflow.com/comment/43946575
has answer: http://stackoverflow.com/a/27766668
has comment: http://stackoverflow.com/comment/95278420
favorite count: 0
tagged with: yeoman-generator-angular
tagged with: angularjs
tagged with: yeoman
score: 2
type: AnsweredQuestion
upvote count: 3
accepted answer: http://stackoverflow.com/a/27766668
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43943838

http://stackoverflow.com/comment/43925049
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27757113
has text: Do you mean that you want to edit the pop up?
score: 0

http://stackoverflow.com/a/27660062
type: Answer
answers question: http://stackoverflow.com/q/27659860
score: 0
has body: You don't need all that ID / class trickery, also using inline JS is quite hard to maintain. See this instead, where I've only used class="qa" var qa = document.getElementsByClassName("qa"); function show(){ this.parentNode.getElementsByTagName("DIV")[0].style.display = (this.clicked^=1) ? "block" : "none"; } for(var i=0; i<qa.length; i++) qa[i].getElementsByTagName("BUTTON")[0].addEventListener("click", show, false); div.qa > div{ display:none; } This is the 1st answer Click For Answer This is the 1st answer Click For Answer You can even use pure CSS for this, by just replacing button with a and usign the :target pseudo selector div.qa > div{ display:none; } div.qa > div:target{ display:block; } This is the 1st answer Click For Answer This is the 2nd answer Click For Answer

http://stackoverflow.com/comment/43856617
comment on: http://stackoverflow.com/a/27722267
type: Comment
score: 0
has text: Judging by the DOM example in the question it seems likely the asker will need to address multiple elements. But feel free to disagree.
type: AnswerComment

http://stackoverflow.com/comment/43974012
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27781861
has text: forget I said that last bit. With a mess around with what you gave me, it finally works. I didn't think about just using the DOM property. Works perfectly :) Thank you
type: Comment

http://stackoverflow.com/a/27728328
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43871081
upvote count: 1
has body: Try it like like &lt;input type="radio" name="radioButtonName" value="1" /&gt;First &lt;input type="radio" name="radioButtonName" value="2" /&gt;Second Rule: { radioButtonName:"required" }
type: Answer
answers question: http://stackoverflow.com/q/27728270

http://stackoverflow.com/comment/43871410
score: 0
type: AnswerComment
type: Comment
has text: Encouraging people to use 'eval' is never a good thing. It's a big vulnerability.
comment on: http://stackoverflow.com/a/27728973

http://stackoverflow.com/comment/43751245
has text: And I can't remember a time when jQuery Deferreds' resolve and reject methods weren't ready bound. I may be wrong but I thought that dated back to v1.5.
type: QuestionComment
comment on: http://stackoverflow.com/q/27668060
score: 0
type: Comment

http://stackoverflow.com/a/27652521
has comment: http://stackoverflow.com/comment/43722384
has comment: http://stackoverflow.com/comment/43722459
answers question: http://stackoverflow.com/q/27652323
upvote count: 1
has body: There are several issues with your current code - test is an id, not a class, so the selector is #test instead of .test The array containing the images is not accessible from the function nextBackground(), as this array is defined in the function attached to the click event. To be accessible for other function, it can be declared global. I guess you don't want to change the image when select is clicked, but when an option is selected. Maybe you want to change the background image according to the selected option - in this case it's possible to attach a function to the change() event of the select and select the image from the background array with the index according to the option value e.g. like this: $('#test').change(function () { header.css('background-image', backgrounds[$(this).val() -1]); }); In addition, in your current code you call the function nextBackground() which cycles through all background images. I've just commented this out in the example Fiddle Remaining question is how the new select that you want to display instead of the old select when an option is selected should be different from the old select, maybe you can add this information to your question.
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/129230208
comment on: http://stackoverflow.com/a/70557483
type: AnswerComment
score: 0
type: Comment
has text: The only problem with this is browser support on [China mobile devices](https://caniuse.com/css-variables), where WeChat internal browser (QQ) does not still supports it. So if you're developing for non-China market, is great solution to go for. But if you need it to work in WeChat internal browser (Android devices), need to be aware of this issue.

asp.net
tags question: http://stackoverflow.com/q/27726964
tags question: http://stackoverflow.com/q/27778637
tags question: http://stackoverflow.com/q/27792893
tags question: http://stackoverflow.com/q/27662103
tags question: http://stackoverflow.com/q/27795813
tags question: http://stackoverflow.com/q/27707566
tags question: http://stackoverflow.com/q/27755724
tags question: http://stackoverflow.com/q/27681731
tags question: http://stackoverflow.com/q/27646883
tags question: http://stackoverflow.com/q/27745358
tags question: http://stackoverflow.com/q/27732463
tags question: http://stackoverflow.com/q/27739302
tags question: http://stackoverflow.com/q/27653674
tags question: http://stackoverflow.com/q/27645478
tags question: http://stackoverflow.com/q/27668233
tags question: http://stackoverflow.com/q/27716777
tags question: http://stackoverflow.com/q/27711392
tags question: http://stackoverflow.com/q/27700982
tags question: http://stackoverflow.com/q/27795907
tags question: http://stackoverflow.com/q/27722663
tags question: http://stackoverflow.com/q/27657661
tags question: http://stackoverflow.com/q/27759718
tags question: http://stackoverflow.com/q/27691731
tags question: http://stackoverflow.com/q/27772282
tags question: http://stackoverflow.com/q/27687644
tags question: http://stackoverflow.com/q/27743496
tags question: http://stackoverflow.com/q/27746217
tags question: http://stackoverflow.com/q/27695989
tags question: http://stackoverflow.com/q/27655818
tags question: http://stackoverflow.com/q/27773570
tags question: http://stackoverflow.com/q/27727328
tags question: http://stackoverflow.com/q/27753121
tags question: http://stackoverflow.com/q/27795056
tags question: http://stackoverflow.com/q/27774549
tags question: http://stackoverflow.com/q/27656753
tags question: http://stackoverflow.com/q/27760133
tags question: http://stackoverflow.com/q/27738550
tags question: http://stackoverflow.com/q/27793908
tags question: http://stackoverflow.com/q/27649815
tags question: http://stackoverflow.com/q/27764508
tags question: http://stackoverflow.com/q/27656456
tags question: http://stackoverflow.com/q/27791235
tags question: http://stackoverflow.com/q/27696567
tags question: http://stackoverflow.com/q/27744625
tags question: http://stackoverflow.com/q/27719656
tags question: http://stackoverflow.com/q/27708579
tags question: http://stackoverflow.com/q/27800367
tags question: http://stackoverflow.com/q/27739068
tags question: http://stackoverflow.com/q/27740855
tags question: http://stackoverflow.com/q/27777411
type: Tag
tags question: http://stackoverflow.com/q/27643902
tags question: http://stackoverflow.com/q/27649892
tags question: http://stackoverflow.com/q/27676392
tags question: http://stackoverflow.com/q/27796965
tags question: http://stackoverflow.com/q/27715261
tags question: http://stackoverflow.com/q/27777844
tags question: http://stackoverflow.com/q/27775811
tags question: http://stackoverflow.com/q/27715202
tags question: http://stackoverflow.com/q/27679603
tags question: http://stackoverflow.com/q/27705037
tags question: http://stackoverflow.com/q/27675385
tags question: http://stackoverflow.com/q/27782339
tags question: http://stackoverflow.com/q/27646049
tags question: http://stackoverflow.com/q/27734234
tags question: http://stackoverflow.com/q/27779654
tags question: http://stackoverflow.com/q/27774885
tags question: http://stackoverflow.com/q/27800493
tags question: http://stackoverflow.com/q/27648881
tags question: http://stackoverflow.com/q/27688830
tags question: http://stackoverflow.com/q/27671614
tags question: http://stackoverflow.com/q/27772568
tags question: http://stackoverflow.com/q/27753182
tags question: http://stackoverflow.com/q/27710094
tags question: http://stackoverflow.com/q/27740632
tags question: http://stackoverflow.com/q/27682084
tag name: asp.net
tags question: http://stackoverflow.com/q/27654099
tags question: http://stackoverflow.com/q/27750949
tags question: http://stackoverflow.com/q/27655348

http://stackoverflow.com/comment/43996970
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27793366
type: Comment
has text: @epascarello—it works because *Obj* has a *handleEvent* method on its prototype. The handler will call that when handling the event, see the spec for the [*W3C DOM 2 Events EventListener interface*](http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventListener), updated in the [*DOM 3 Events spec*](http://www.w3.org/TR/DOM-Level-3-Events/#interface-EventListener).

http://stackoverflow.com/q/27702096
score: 0
has comment: http://stackoverflow.com/comment/43816840
accepted answer: http://stackoverflow.com/a/27702195
tagged with: node.js
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43816811
tagged with: javascript
has answer: http://stackoverflow.com/a/27702195
linked to: http://stackoverflow.com/q/171251
has comment: http://stackoverflow.com/comment/43816739
has body: How can I update an object with another object? for example master = { name: "John", email: "j@j.com" } child = { phone: "888-333-3999" } How can I update master with child? Output of master need to be { name: "John", email: "j@j.com", phone: "888-333-3999" } Also, this is a node.js JavaScript, I don't want to use jQuery.
answer count: 1
duplicate of: http://stackoverflow.com/q/171251
has comment: http://stackoverflow.com/comment/43816863
has comment: http://stackoverflow.com/comment/43816724
has title: Updating one object with another

http://stackoverflow.com/q/27761168
tagged with: javascript
score: 0
answer count: 2
has title: How to set up an automated testing environment for AngularJS
has answer: http://stackoverflow.com/a/27769358
tagged with: angularjs
type: UnansweredQuestion
tagged with: maven
has answer: http://stackoverflow.com/a/27761247
has body: I have spent hours trying to set up an automated testing environment for my AngularJS applications that I can run from Maven (capturing results in Bamboo) A Google search reveals frameworks galore, based on Jasmine, Karma and generic JavaScript frameworks. But for some reason the installation of these never goes as described. Can anyone just point me to a set of downloads that I can install manually to proper directories, that will just execute my unit tests? I asked a similar question previously and got down checked and requests to close. If you need to check me down, please leave a reason, as I am besides myself with frustration trying to solve this, and I am sure there many other developers experiencing the same issue
tagged with: unit-testing
linked to: http://stackoverflow.com/q/20555953
type: Question

http://stackoverflow.com/comment/43915486
score: 0
comment on: http://stackoverflow.com/q/27752038
type: Comment
type: QuestionComment
has text: Not the client computer. I will run this in offline so it should stored the image to local drive via save dialog box.

http://stackoverflow.com/a/27704221
accepted answer of: http://stackoverflow.com/q/27703745
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27703745
has body: How about this $(function () { $('#datepicker').datepicker({ closedBySelect:false, onSelect: function (date, options) { alert('fired when selected'); options.settings.closedBySelect = true; }, onClose: function (date, options) { alert('fired on close'); if (options.settings.closedBySelect) { console.log('logic when closed on select'); } else { console.log('logic when closed on document click'); } options.settings.closedBySelect = false; } }); }); closedBySelect is not in the API rather it is a custom attribute added which we can easily be set in all events of datepicker :) Update Code : Used slightly different approach here - $(function () { var datePicker = $('#datepicker'); datePicker.data('closedOn','document').datepicker({ showButtonPanel:true, onClose: function (date, options) { alert($(this).data('closedOn')); // your logic goes here ... $(this).data('closedOn','document'); } }).datepicker('widget').on('mousedown',function(event){ var $this = $(this); var target = $(event.target); if(target.hasClass('ui-datepicker-close')) { console.log('closed from button panel'); datePicker.data('closedOn','byButtonPanel'); } if( typeof target.parent().data('month') != 'undefined') { console.log('closed by selecting date'); datePicker.data('closedOn','byDateSelect'); } }); });
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43821105
has comment: http://stackoverflow.com/comment/43830304
type: Answer
has comment: http://stackoverflow.com/comment/43821601

http://stackoverflow.com/comment/43811628
has text: Maybe too simple, but have you tried adding quotes? Following from your example in the comments, `$('[src$="'+a+'"]')` with quotes around the inserted string.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27698844

http://stackoverflow.com/comment/43703758
has text: @AdamZerner Is the value of `skim` assigned asyncronously from the parent controller?
score: 0
comment on: http://stackoverflow.com/q/27641908
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27747925
has comment: http://stackoverflow.com/comment/43940707
favorite count: 0
answer count: 0
type: UnansweredQuestion
has title: PHP/JS log of order details to text file only works in chrome, not other browsers
has comment: http://stackoverflow.com/comment/43940680
upvote count: 1
tagged with: php
tagged with: google-chrome
tagged with: logging
tagged with: safari
score: 1
type: Question
downvote count: 0
tagged with: javascript
has body: I have a simple PHP file which logs the details of an order to a text file. It is used on a custom shopping cart in Drupal using the form_wizard which collects the order details (what was ordered, where to ship it, etc) to a cookie, then processes the order via PayPal. When the user clicks the place order button, the log file saves that order info as a JSON object. However, the PHP file seems to only log the order to the file if the user is using Chrome. If the user is using Safari, the log does not get appended. The PHP is below: &lt;?php logcart(); function logcart() { $file = 'cart.txt'; $today = date("F j, Y, g:i a"); $customer = $_COOKIE["address"]; $cart = $_COOKIE["votre_commande"]; $cart_contents = $today.PHP_EOL.$customer.PHP_EOL.$cart; // Write the contents to the file, // using the FILE_APPEND flag to append the content to the end of the file // and the LOCK_EX flag to prevent anyone else writing to the file at the same // time file_put_contents($file, $cart_contents, FILE_APPEND | LOCK_EX); } Along with the above PHP is the following JS: function cartToLog() { console.log('logging the cart!'); $.ajax({ type: "POST", beforeSend: function (xhr) { xhr.withCredentials = false; }, crossDomain: true, dataType: 'jsonp', url: "http://example.com/modules/form_example/js/logcart.php", headers: { 'Access-Control-Allow-Origin': '*' }, contentType: 'application/json', data: "", success: function(msg) { console.log(msg); }, error: function(XMLHttpRequest, textStatus, errorThrown) { console.log(errorThrown); } }); } Drupal.behaviors.select_paypal = { attach: function(context) { $('.paypal-button', context).once(function() { $(this).click(function(e) { if ($('#edit-tf-prenom').val() == '' ) { $('#edit-tf-prenom').addClass('error'); } else { $('#edit-tf-prenom').removeClass('error');} if ($('#edit-tf-nom').val() == '' ) { $('#edit-tf-nom').addClass('error'); } else { $('#edit-tf-nom').removeClass('error');} if ($('#edit-tf-adresse').val() == '' ) { $('#edit-tf-adresse').…

http://stackoverflow.com/comment/43858173
has text: I tried the code you provided but I was unable to get the objects to save.
comment on: http://stackoverflow.com/a/27721675
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27699598
type: Question
answer count: 1
tagged with: javascript
has body: I have three AJAX calendar controls (start date, end date and effective date) for in my project. Which selects date in the format dd/MM/yyyy hh:mm:ss tt. I want to add a following client side validations : end date should be greater than or equal to start date. effective date should be greater than end date. I have tried using CompareValidator but it did not help as it do not allow me to compare time. Is there any workaround to achieve this validation on client side.
score: 0
tagged with: validation
tagged with: datetime
has title: Validating datetime fields in asp.net
tagged with: asp.net
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43814524
has comment: http://stackoverflow.com/comment/43815570
has answer: http://stackoverflow.com/a/27699665
tagged with: date

http://stackoverflow.com/comment/43998033
type: Comment
has text: yes but if you are using login based on cookies than he will be logged out as well
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27794428

http://stackoverflow.com/a/27715184
answers question: http://stackoverflow.com/q/27714959
downvote count: 0
score: 1
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/43842643
has body: First you don't have jquery.js and you are using $('#countdown') You don't have any function called cdreset . Well I wrote a similar code for you : 60 it will count down starting from 60 to -XXX You should add a condition so as to stop the timer at 0 :)

http://stackoverflow.com/comment/43976671
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27779837
has text: I wd use the animate function of jQuery ( http://api.jquery.com/animate/ ) catching the values that the link I provided uses, and passing them in an array. Example: `$("#your_element_id").animate( { "position":"absolute", "top": Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + $(window).scrollTop()) + "px", "left" : Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + $(window).scrollLeft()) + "px"}, 5000);`
type: AnswerComment

http://stackoverflow.com/comment/43920235
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27754427
has text: I'm looking to invoke the coffeescript repl from a .coffee file so that I can debug my code interactively. I've had a quick play with your suggestion but it doesn't seem to work
score: 0

http://stackoverflow.com/a/27760589
has body: Here's how you can track progress with jQuery: $.ajax({ // ... cache: false, processData: false, contentType: false, xhr: function () { var result = {}; result = $.ajaxSettings.xhr(); if (typeof result.upload === "object") { result.upload.addEventListener( "progress", function (e) { if (e.lengthComputable) { // here you have e.loaded and e.total } }, false ); } return result; } });
type: Answer
answers question: http://stackoverflow.com/q/27760327
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27760327
score: 1
has comment: http://stackoverflow.com/comment/43932287
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43932321

http://stackoverflow.com/a/27815973
downvote count: 1
upvote count: 4
has body: edit: Second prototype delivered. The answer really depends on what you're creating "dynamically", which I'm not clear on. Since I'm not allowed to request clarification until I provide useful answers for rep, here's a jscript that does something useful sorta like what you're saying. If I really did this myself, I'd integrate an XML file and generate the html entirely from JSON or something. Or at least populate the initial page from js. The solution you see here is horribly sloppy and tightly couples the html to the js. http://jsfiddle.net/P8X3B/109/ (prototype question adder, other controls present, not implemented) NEW: http://jsfiddle.net/y29vc5k0/28/ (prototype question and category adder) /** *** * questions and categories example * by Jason D'Aquila * 23 Jan 2015 * created as prototype of answer to stackoverflow question posted at: http://stackoverflow.com/questions/27772009/ * * relies on at least jQuery 1.4 ; browsers supporting getter definitions with Object.defineProperty */ /* GLOBAL */ function cleaner(text) { var s = text.replace(/(&lt;|&gt;)/g, '\\$1') .replace(/ /g, '_') .replace(/[!"#$%&amp;'()*+,.\/:;&lt;=&gt;?@[\\\]^`{|}~]/g, ''); return s; //can't split a return line } /* injective function jQuery objs =&gt; String; compact output * not actually achieved, but this function isn't called in this program anyway */ function injectJQueryObjToStr(jqueryObj) { return ("" + jqueryObj.length) + jqueryObj.attr("id") ? " id: " + jqueryObj.attr("id") : jqueryObj; //can definitely improve this function } canon = ({ /* contract: No enumerable property of canon has the name of an html tag */ outputField: $('#out'), categoriesList: $('#categories'), /* cannot actually canonize this; see below */ //questionsDropdown: (function () { //references must be invocations ofc // return $('#questions_del'); //}), init: function (undef) { //* //single slash comment toggle //this.questionsDropDown = (function(nothing) {return nothing;}()); Object.defineProperty(this, "quest…
answers question: http://stackoverflow.com/q/27772009
has comment: http://stackoverflow.com/comment/44349171
has comment: http://stackoverflow.com/comment/44567063
type: Answer
has comment: http://stackoverflow.com/comment/44270794
score: 3
has comment: http://stackoverflow.com/comment/44325317

http://stackoverflow.com/q/27783396
has comment: http://stackoverflow.com/comment/43976785
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: asp.net-mvc-4
has comment: http://stackoverflow.com/comment/43976715
type: Question
has title: refreshing an external web page when a button is clicked on a web page from a different website
has answer: http://stackoverflow.com/a/27783553
tagged with: javascript
has comment: http://stackoverflow.com/comment/43976879
score: 0
answer count: 1
tagged with: jquery
has body: I have developed two different asp.net mvc web application which has some data pulled from different databases. I would like a refresh a web page on first application when a button is clicked on second webpage using html meta tags or what ever is the best. I have the following HTML 5 mark up &lt;td &gt; &lt;input type="button" class="btn btn-success" data-bind="click: add" value="Add New Entry" /&gt; &lt;/td&gt; I want to embed a feature to above button which on clicking the button should invoke an event and refresh http://xyz.atlas.com/ Is there a way I could achieve this?

http://stackoverflow.com/comment/45577089
score: 2
has text: @Jordan I think the warning is coming from the browser, not jQuery. It will happen whenever you try to use synchronous AJAX. If you use jQuery, that will only happen if you specify that option to `$.ajax`.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27736383

http://stackoverflow.com/q/27784266
has title: in voodoo.js, what event trigger Model's "update" function?
has body: In voodoo, the class Model has a method called update. Does that be called automatically every second? or is there any event that will trigger this function?
tagged with: javascript
type: Question
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27807701
type: UnansweredQuestion

http://stackoverflow.com/q/27656575
score: 37
has answer: http://stackoverflow.com/a/27656611
answer count: 2
has comment: http://stackoverflow.com/comment/43729117
possible better answer: http://stackoverflow.com/a/27656651
has answer: http://stackoverflow.com/a/27656651
linked to: http://stackoverflow.com/q/5642315
tagged with: javascript
tagged with: string
favorite count: 0
has title: get string between two strings with javascript
linked to: http://stackoverflow.com/q/4029109
tagged with: regex
accepted answer: http://stackoverflow.com/a/27656611
duplicate of: http://stackoverflow.com/q/4029109
type: Question
upvote count: 40
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3172985
downvote count: 3
has body: How do I get a string between two strings using match with variables? The following code works well if I use match with strings Regular Expression to get a string between two strings in Javascript I also tried to apply the info at JavaScript - Use variable in string match : var test = "My cow always gives milk"; var testRE = test.match("cow(.*)milk"); alert(testRE[1]); But what if I have: var firstvariable = "cow"; var secondvariable = "milk"; var test = "My cow always gives milk"; I've tried various things including: var testRE = test.match("firstvariable(.*)secondvariable"); alert(testRE[1]); and: var testRE = testRE.match + '("' + firstvariable + "(.*)" + secondvariable +'")'; alert(testRE[1]); Neither worked.
has comment: http://stackoverflow.com/comment/43729945

http://stackoverflow.com/q/27703029
has body: I have the following code in javascript : var x = { a:1, b : { c : 2, d : //i want value of x.a in here } } I have read that accessing parent property like this is not at all possible. Is there any workaround for this?
tagged with: javascript
has comment: http://stackoverflow.com/comment/43818989
has title: Accessing parent object in javascript
has answer: http://stackoverflow.com/a/27703141
downvote count: 0
linked to: http://stackoverflow.com/q/183702
favorite count: 0
has answer: http://stackoverflow.com/a/27703093
answer count: 5
duplicate of: http://stackoverflow.com/q/183702
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27703044
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43818282
has answer: http://stackoverflow.com/a/27703298
has answer: http://stackoverflow.com/a/27703206
type: Question

http://stackoverflow.com/comment/43826468
comment on: http://stackoverflow.com/a/27698285
has text: @davidwarne You still have several concepts mixed around, and are therefore approaching this in the wrong way. There is more listing added. Please read it and **all** of the content carefully. Copy it and run it and understand what is happening here.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27740649
type: Question
accepted answer: http://stackoverflow.com/a/27742173
downvote count: 0
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/43892876
has body: I want to list all leaves ids where group name is i.e. "group110" So, output for this example is 014, 288, 223 and 244. Here is content of my JSON file: { "name": "visualization", "children": [ { "name": "group100", "children": [ { "name": "group110", "children": [ { "name": "group111", "children": [ {"id":"014","link":"-","name":" Animals/70","decade":"-"} ] }, { "name": "group112", "children": [ {"id":"288","link":"-","name":"Heidelberg platen press","decade":"1960s"} ] }, { "name": "group113", "children": [ {"id":"223","link":"-","name":"Camera Praktica Super TL – shutter release","decade":"1960s"}, {"id":"244","link":"-","name":"Mechanical calculator, Facit","decade":"1950s"} ] } ] },
favorite count: 0
has answer: http://stackoverflow.com/a/27741383
tagged with: d3.js
has title: how to find all leaves of group with javascript and json
has answer: http://stackoverflow.com/a/27742173
has comment: http://stackoverflow.com/comment/43892292
possible better answer: http://stackoverflow.com/a/27741383
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/33403798
upvote count: 1

http://stackoverflow.com/q/27684385
upvote count: 2
tagged with: twitter-bootstrap
tagged with: datepicker
answer count: 1
has body: I found out the datepicker for bootstrap at the link below, well, i downloaded the development version, and then after configuring some settings at the page in there, and after attaching the required stylesheets and javascript files, still i can't get an HTML example working. This is the link for the example to download. I gathered the required CSS and JS as below: HTML as below: to The JS script at the end of the file as below: Now the two inputs appear but they don't work, I don't know whats missing. I also can't find any HTML examples in the downloaded files for the demo, it's all .md, .jason, and other formats that it seems to be raw and I don't know actually how to implement this simply in HTML file.
has answer: http://stackoverflow.com/a/27684445
has title: How to implement bootstrap-datepicker sandbox in HTML example
score: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43783013
type: Question
favorite count: 0

http://stackoverflow.com/comment/43993546
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27791951
has text: @zerkms Why? They all say the same thing. Pick any. You link to an answer - which is not a duplicate, you have to link to a question :) My link cites the jslint doc, as you seem to have overlooked. There is nothing else to gain. It does not matter. Pick any. Why are we having this conversation?

http://stackoverflow.com/comment/43870056
has text: call function with parameter `setCustomValidity(response)`...
score: 0
comment on: http://stackoverflow.com/q/27729254
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43938222
has text: I did what you suggest, it worked now. It now redirect me to member page. But somehow my sessions are not set as in my login_validate.php? Any suggestions? Thank you
type: Comment
comment on: http://stackoverflow.com/a/27763623
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43806871
type: Comment
comment on: http://stackoverflow.com/a/27695991
has text: Double comment: This is not fool-proof, is it? What if someone happens to click at exactly (0,Y)?
score: 0
type: AnswerComment

http://stackoverflow.com/q/27643612
tagged with: parse-platform
has body: Parse.com with JavaScript SDK - unnecessary duplictions Every time I create a Parse object of "message", it duplicates that object in my Parse Core. It is so bizarre. The first time I run the code, everything is fine and Parse will create only one object. But when I run the code again, it will duplicate the most recent object twice. If I run it a third time, it will duplicate the most recent object five times. The number of duplications increases based upon how many objects have already been created. Does anyone have any idea how to make sure that it create one object in my Parse Core backend? Thank you so much!!! I wish I could post a picture, but I am a newbie and stackoverflow wont let me This is where I create the Parse object: App.Models.Message = Parse.Object.extend({ className: 'Message', idAttribute: 'objectId', defaults: { name : '', email : '', subject : '', message : '' } }); This is where I create an instance of the Parse object, and where I save it to Parse: App.Views.Contact = Parse.View.extend({ el : '#middle', template : _.template($('#contactTemp').html()), events: { 'click .submit' : 'submit', }, initialize : function () { this.render(); }, render : function () { this.$el.html(this.template); }, submit : function (e) { e.preventDefault(); var message = new App.Models.Message({ name: $('.nameVal').val(), email: $('.emailVal').val(), subject: $('.subVal').val(), message:$('.messVal').val(), }); message.save(null, { success:function() { console.log("Success"); }, error:function(e) { alert('There was an error in sending the message'); } }); } });
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43706152
has comment: http://stackoverflow.com/comment/43705999
type: Question
tagged with: object
has answer: http://stackoverflow.com/a/27663422
has title: Repeating issue in Parse.com - JavaScript SDK
tagged with: javascript
tagged with: duplicates
score: 0
answer count: 1

http://stackoverflow.com/comment/43893109
has text: How do you expect to be able to intercept link activation inside the iframe, which contains an external resource?
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27740793

http://stackoverflow.com/q/27793835
possible better answer: http://stackoverflow.com/a/54078097
score: 0
answer count: 2
tagged with: google-maps
has answer: http://stackoverflow.com/a/54078097
upvote count: 1
downvote count: 1
tagged with: javascript
favorite count: 0
has title: Marker Label not showing - Google Maps
has body: I am working with Google API v3 and also utilizing MarkerwithLabel. The problem I am having even after including the Google API v3 lib and MarkerwithLabel lib. My label never displays on the map. Here is what I am doing: &lt;script type="text/javascript"src="https://maps.googleapis.com/maps/api/js?key=.......v=3.exp&amp;libraries=places"&gt;&lt;/script&gt;&lt;!-- Very Important For Google Maps--&gt; &lt;script src="js/markerwithlabel.js"&gt;&lt;/script&gt; Now after I am running the test example they give: var latLng = new google.maps.LatLng(49.47805, -123.84716); var homeLatLng = new google.maps.LatLng(49.47805, -123.84716); map = new google.maps.Map(document.getElementById('map-cont'), { zoom: 12, center: latLng, mapTypeId: google.maps.MapTypeId.ROADMAP }); var marker1 = new MarkerWithLabel({ position: homeLatLng, draggable: true, raiseOnDrag: true, map: map, labelContent: "$425K", labelAnchor: new google.maps.Point(22, 0), labelClass: "labels", // the CSS class for the label labelStyle: {opacity: 0.75} }); var iw1 = new google.maps.InfoWindow({ content: "Home For Sale" }); google.maps.event.addListener(marker1, "click", function (e) { iw1.open(map, this); }); Now after running this, I never see a label. Suggestions?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44003142
type: Question
has answer: http://stackoverflow.com/a/27796459
accepted answer: http://stackoverflow.com/a/27796459
tagged with: google-maps-api-3

http://stackoverflow.com/q/27703918
downvote count: 0
has answer: http://stackoverflow.com/a/27714963
favorite count: 0
tagged with: electron
possible better answer: http://stackoverflow.com/a/27715038
score: 6
has answer: http://stackoverflow.com/a/27715038
upvote count: 6
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27714963
tagged with: webview
has title: How can I scroll content of <webview> tag from JavaScript?
type: Question
has body: atom-shell: https://github.com/atom/atom-shell version: v0.20.2 I am using &lt;webview&gt; tag to embed a page. &lt;webview&gt; tag has shadow-root which has one tag, &lt;object id="browser-plugin-1 ...&gt;. So I tried to set scrollTop value for this tag like this. var webView = document.getElementById('webview tag id'); var elm = webView.shadowRoot.firstChild; // elm is object tag console.log(elm.scrollTop); // 0 elm.scrollTop = 100; console.log(elm.scrollTop); // 0 But nothing happend... Is it possible to control &lt;webview&gt; tag scroll position from outside?
tagged with: javascript
answer count: 2

http://stackoverflow.com/a/27716593
has body: Use .getBoundingClientRect which accounts for CSS styling &amp; repositioning: var BB=canvas.getBoundingClientRect(); var BBoffsetX=BB.left; var BBoffsetY=BB.top; var mouseX=parseInt(e.clientX-BBoffsetX); var mouseY=parseInt(e.clientY-BBoffsetY);
has comment: http://stackoverflow.com/comment/43846807
has comment: http://stackoverflow.com/comment/43867472
answers question: http://stackoverflow.com/q/27716469
has comment: http://stackoverflow.com/comment/43859392
has comment: http://stackoverflow.com/comment/43845609
has comment: http://stackoverflow.com/comment/43846718
type: Answer
has comment: http://stackoverflow.com/comment/43847096
score: 0
has comment: http://stackoverflow.com/comment/43867692

http://stackoverflow.com/comment/43914843
score: 0
type: AnswerComment
type: Comment
has text: Use the Echo function of JSFiddle and you should be able to reproduce the behavior.
comment on: http://stackoverflow.com/a/27751802

http://stackoverflow.com/q/27726806
has body: I want to be able to create a "click" response for a class and then change the CSS of the particular element that was clicked. This does not seem to be working. I thought using $(this) would indicate the particular element but it doesn't seem to. One complicating issue is I am overriding an external stylesheet. My jquery code: $('.myClass').click( function() { $('this').css("width: 30% !important"); alert("THIS ALERT WORKS"); }) The alert does work. I have static CSS that is able to change .myClass. My HTML: Button I also tried $('this').val("") and that doesn't work.
has answer: http://stackoverflow.com/a/27726837
type: AnsweredQuestion
tagged with: this
tagged with: jquery
has answer: http://stackoverflow.com/a/27726821
possible better answer: http://stackoverflow.com/a/27726837
favorite count: 0
type: Question
has title: How to change an individual element based on a class jquery callback function?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27726845
tagged with: css
has answer: http://stackoverflow.com/a/27726880
score: 0
accepted answer: http://stackoverflow.com/a/27726821
upvote count: 1
downvote count: 1
answer count: 4
tagged with: javascript

angular-strap
tag name: angular-strap
type: Tag
tags question: http://stackoverflow.com/q/27746193
tags question: http://stackoverflow.com/q/27696547
tags question: http://stackoverflow.com/q/27786482

http://stackoverflow.com/q/27732209
type: Question
has comment: http://stackoverflow.com/comment/109366675
has answer: http://stackoverflow.com/a/44017709
has comment: http://stackoverflow.com/comment/75062358
has comment: http://stackoverflow.com/comment/116784422
has answer: http://stackoverflow.com/a/27732264
has answer: http://stackoverflow.com/a/71229869
has answer: http://stackoverflow.com/a/34678386
upvote count: 2041
has answer: http://stackoverflow.com/a/79419601
possible better answer: http://stackoverflow.com/a/27732264
downvote count: 1
has answer: http://stackoverflow.com/a/75192161
has answer: http://stackoverflow.com/a/76042422
has answer: http://stackoverflow.com/a/29592334
has answer: http://stackoverflow.com/a/35015622
has body: In order to turn off linting rule for a particular line in JSHint we use the following rule: /* jshint ignore:start*/ $scope.someVar = ConstructorFunction(); /* jshint ignore:end */ I have been trying to locate the equivalent of the above for eslint.
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29592334
has answer: http://stackoverflow.com/a/51306905
has answer: http://stackoverflow.com/a/57883911
tagged with: jshint
has answer: http://stackoverflow.com/a/54796570
answer count: 15
tagged with: eslint
has answer: http://stackoverflow.com/a/45666392
has answer: http://stackoverflow.com/a/44294760
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/138051118
has comment: http://stackoverflow.com/comment/138757586
favorite count: 0
score: 2040
has title: Turning off eslint rule for a specific line
has answer: http://stackoverflow.com/a/56088459

jquery-ui
tags question: http://stackoverflow.com/q/27743407
tags question: http://stackoverflow.com/q/27796237
tags question: http://stackoverflow.com/q/27701440
tags question: http://stackoverflow.com/q/27785225
tags question: http://stackoverflow.com/q/27721133
tags question: http://stackoverflow.com/q/27758379
tags question: http://stackoverflow.com/q/27656202
tags question: http://stackoverflow.com/q/27758274
tags question: http://stackoverflow.com/q/27669345
tags question: http://stackoverflow.com/q/27705910
tags question: http://stackoverflow.com/q/27776972
tags question: http://stackoverflow.com/q/27739508
tags question: http://stackoverflow.com/q/27802453
tags question: http://stackoverflow.com/q/27706961
tags question: http://stackoverflow.com/q/27801813
tags question: http://stackoverflow.com/q/27651130
tags question: http://stackoverflow.com/q/27642553
tags question: http://stackoverflow.com/q/27709587
tags question: http://stackoverflow.com/q/27760096
tags question: http://stackoverflow.com/q/27736320
type: Tag
tags question: http://stackoverflow.com/q/27681063
tags question: http://stackoverflow.com/q/27710874
tags question: http://stackoverflow.com/q/27784665
tags question: http://stackoverflow.com/q/27722988
tag name: jquery-ui
tags question: http://stackoverflow.com/q/27687499
tags question: http://stackoverflow.com/q/27680061
tags question: http://stackoverflow.com/q/27748042

http://stackoverflow.com/comment/43704493
score: 0
type: Comment
type: QuestionComment
has text: That's not enough - it's still the case that it's impossible to know for sure what `this` refers to. It's *probably* an object with properties that refer to an HTTP request (`req`) and response (`res`), but "req" is just a name - the value it refers to *could* be anything.
comment on: http://stackoverflow.com/q/27642835

gmail
type: Tag
tag name: gmail
tags question: http://stackoverflow.com/q/27732137

http://stackoverflow.com/comment/43907014
score: 0
type: QuestionComment
type: Comment
has text: You don't even get to do that from phone book by tapping the name: you have to specifically tap the "phone" icon. You are looking to implement a "nuisance" feature.
comment on: http://stackoverflow.com/q/27747899

http://stackoverflow.com/comment/43713803
comment on: http://stackoverflow.com/q/27648074
score: 0
type: Comment
type: QuestionComment
has text: no i want all the texts of all options

http://stackoverflow.com/comment/43807300
has text: Thanks! So simple, yet this had me searching for over an hour. I upvoted the answer of Patrick as well which was practically the same.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27695862

http://stackoverflow.com/q/27697872
answer count: 0
has comment: http://stackoverflow.com/comment/43813903
score: 0
has comment: http://stackoverflow.com/comment/43808989
type: Question
tagged with: google-analytics
has title: Window.location causes Google Analytics to stop working
tagged with: firefox
tagged with: javascript
has body: I have a piece of code where I do a bunch of Google Analytics event tracking. Say a user clicks on a button or a tab, there will be an event tracking sent out. But as soon as I click a button which downloads a CSV, the code being used is below, all the tracking stops working in Firefox. Other browsers continue tracking the events correctly. window.location= '/campaigns/coupon-links/get-coupons.csv'; I tried using window.open('/campaigns/coupon-links/get-coupons.csv') and that made the tracking work in Firefox, but I am perplexed on why window.location would cause just the Google Analytics to stop working. I checked all the events listeners and objects on the page, everything still is declared and nothing throws an error. Any clues?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43810154
linked to: http://stackoverflow.com/q/6256457

http://stackoverflow.com/a/27705399
has comment: http://stackoverflow.com/comment/43825508
has comment: http://stackoverflow.com/comment/43828347
has comment: http://stackoverflow.com/comment/43823966
upvote count: 9
score: 9
has comment: http://stackoverflow.com/comment/106614552
answers question: http://stackoverflow.com/q/27702162
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27702162
has comment: http://stackoverflow.com/comment/43847311
has comment: http://stackoverflow.com/comment/43850357
type: Answer
has body: Not sure if I understand you right but you can add hashtags in meteor too. Just route with iron-route r to a new hashtag by clicking your href. Blog About Me My Meetup Contact Me Than iron-router automatically scrolls to that hashtag if it is found on that page. By overriding the scrollToHash-function you can change the scroll behavior. Router._scrollToHash = function(hash) { var section = $(hash); if (section.length) { var sectionTop = section.offset().top; $("html, body").animate({ scrollTop: sectionTop }, "slow"); } }; Have a look on my website Click. There I have the access with the navbar on aboutme, meetup, contact by staying at the same page and just changing the hashtags.

http://stackoverflow.com/comment/43904312
comment on: http://stackoverflow.com/a/27746623
type: AnswerComment
has text: Hi user3134634, i would use this command and i have tried this. The only reason this will not work is due to the form being a process form (This is all designed to run on 1 page) However the user has to fill in selected details then click Next.. Fill in more information.. Click next again then at final stage the (Next Button) switches to (Apply Button)
score: 0
type: Comment

http://stackoverflow.com/q/27668486
has comment: http://stackoverflow.com/comment/43751701
answer count: 0
type: UnansweredQuestion
has body: It seems that the the body of the document doesn't see the javascript functions when im ca. I tried different ways: applying a function on the element from the head (form.addEventListener("submit", submitEvent)); and onsubmit but none of them works. Could you help me to solve the problem, please? <Title>Adminostrative interface Hello, <?php echo $_SESSION['name']; ?> Add new tour Country: <input type="text" name="country" class="nonDigits" value= "<?php if(isset($error_country)){echo $_POST["country"];}?>"/> <?php if (isset($error_country)){ echo $error_country; } ?> Tour name: <input type="text" name="tourName" class="nonDigits" value="<?php if(isset($error_tourName)){echo $_POST["tourName"];}?>"/> <?php if (isset($error_tourName)){ echo $error_tourName; } ?> Tour path: <input type="text" name="path" class="nonDigits" value="<?php if(isset($error_path)){echo $_POST["path"];}?>"/> <?php if (isset($error_path)){ echo $error_path; } ?> Amount of days: <input type="text" name="days" class="digits" value= "<?php if(isset($error_days)){echo $_POST["days"];}?>"/> <?php if (isset($error_days)){ echo $error_days; } ?> Hotel: <input type="text" name="hotel" class="nonDigits" value="<?php if(isset($error_hotel)){echo $_POST["hotel"];}?>"/> <?php if (isset($error_hotel)){ echo $error_hotel; } ?> Hotel price(single room): <input type="text" name="priceSingleRoom" class="digits" value="<?php if(isset($error_priceSingleRoom)){echo $_POST["priceSingleRoom"];}?>"/> <?php if (isset($error_priceSingleRoom)){ echo $error_priceSingleRoom; } ?> Hotel price(double room): <input type="text" name="priceDoubleRoom" class="digits" value="<?php if(isset($error_priceDoubleRoom)){echo $_POST["priceDoubleRoom"];}?>"/> <?php if (isset($error_priceDoubleRoom)){ echo $error_priceDoubleRoom; } ?> Breakfast price: <input type="text" name="priceBreakfast" class="digits" value="<?php if(isset($error_priceBreakfast)){echo $_POST["priceBreakfast"];}?>"/> <?php if (isset($error_priceBreakfast)){ echo $err…
has comment: http://stackoverflow.com/comment/43751717
has comment: http://stackoverflow.com/comment/43751678
has comment: http://stackoverflow.com/comment/43751651
has comment: http://stackoverflow.com/comment/43751650
score: 0
type: Question
has comment: http://stackoverflow.com/comment/43751794
tagged with: javascript
has title: html body doesn't see javascript

http://stackoverflow.com/q/27748131
has comment: http://stackoverflow.com/comment/43908227
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27748534
has comment: http://stackoverflow.com/comment/43907783
type: Question
has comment: http://stackoverflow.com/comment/43907622
has comment: http://stackoverflow.com/comment/43907669
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27748534
score: 0
answer count: 1
has body: I have a simple form layout that requires the user to input a code. Now that code will determine what php script to execute, but nonetheless this isn't my problem. You see when the user types in something wrong, the page does what it is supposed to do and give the user an error message saying.. Wrong code yadadada. But when the user goes back to type in the right code, it still gives the error.. unless the user refreshes the page and types the right code on the first try only then will it allow them to pass. I have to have that event.preventDefault(); because otherwise if the user types in the wrong code, it automatically refreshes the page and doesn't let the user know the code is wrong. How can i get past this? I tried setting the html field to blank, but that doesn't seem to help RSVP Code: Submit
tagged with: jquery
has comment: http://stackoverflow.com/comment/43908152
has title: After Form Submission, it does not clear or reset the html element.
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27647062
has comment: http://stackoverflow.com/comment/43712011
has comment: http://stackoverflow.com/comment/43711894
has comment: http://stackoverflow.com/comment/43711919
has body: When i submit my form it executes everything but when i include form validation on other text boxes it wont listen and will just check the usernameTxt text box and that's it. I have tried using JavaScript but I don't know how to validate with JS but process with PHP. If anyone can help with either please say! Here is my code: <?php //Used for stopping users seeing an errors only for our eyes. //commented out when published error_reporting(-1); ini_set('display_errors', 'On'); include 'includes/dbconnect.php'; session_start(); $error = ""; $username = $_POST['usernameTxt']; $password = sha1($_POST['passwordTxt']); $cnfrmPass = sha1($_POST['cnfrmPasswordTxt']); $email = $_POST['emailTxt']; $cnfrmEmail = $_POST['cnfrmEmailTxt']; $fName = $_POST['fNameTxt']; $lName = $_POST['lNameTxt']; try{ if(isset($_POST['submitBn'])){ if(!empty($username)){ $query = dbConnect()->prepare("INSERT INTO usersInfo (Username, Password, Email, FirstName, LastName) VALUES (:username, :password, :email, :fName, :lName)"); $query->bindParam(':username', $username); $query->bindParam(':password', $password); $query->bindParam(':email', $email); $query->bindParam(':fName', $fName); $query->bindParam(':lName', $lName); if($query->execute()){ header('Location: signin.php'); }else{ $error = "ERROR!"; } }else{ $error = "Username cannot be empty!"; } }else{ $error = " Form cannot be empty! "; } }catch(PDOException $e){ $error = $e->getMessage(); } ?> <?php include 'includes/head.php'; include 'includes/header.php'; ?> Register Here. <?php echo $error; ?> If you don't have an account why not register? Username Password Password Confirm Email Confirm Email First Name Last Name <?php include 'includes/footer.php'; ?>
tagged with: php
tagged with: pdo
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43712238
has comment: http://stackoverflow.com/comment/43712059
has comment: http://stackoverflow.com/comment/43815635
has comment: http://stackoverflow.com/comment/43711979
tagged with: javascript
has comment: http://stackoverflow.com/comment/43711932
tagged with: forms
has comment: http://stackoverflow.com/comment/43711938
has answer: http://stackoverflow.com/a/27647265
type: Question
has comment: http://stackoverflow.com/comment/43712265
score: 0
has title: PHP validation only validating the first text box in my form
tagged with: validation
answer count: 1

http://stackoverflow.com/comment/90744605
type: Comment
has text: I like this approach but get an error "An invalid form control with name='g-recaptcha-response' is not focusable."
comment on: http://stackoverflow.com/a/37048027
score: 1
type: AnswerComment

http://stackoverflow.com/q/27667329
downvote count: 0
score: 1
favorite count: 0
tagged with: regex
accepted answer: http://stackoverflow.com/a/27667504
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27667366
has title: Get the second bracket content using regular expression
upvote count: 1
has comment: http://stackoverflow.com/comment/43749436
type: Question
possible better answer: http://stackoverflow.com/a/27667366
has body: I want to modify the content of the second square bracket for the following DOM extra_fields_setting_name[1][0][extra_fields_setting_name_label] i'm using the following for changing the content of the first bracket of the dom, like the following replace ( /\[[^\]]+\]/, "[" + (new_number_here) + "]" ); but i can't get the second bracket content like the first, how can i do that ?
tagged with: javascript
has comment: http://stackoverflow.com/comment/43749553
has answer: http://stackoverflow.com/a/27667504
answer count: 2

http://stackoverflow.com/q/27698773
type: Question
upvote count: 2
score: 0
downvote count: 2
has answer: http://stackoverflow.com/a/27698910
answer count: 3
has comment: http://stackoverflow.com/comment/43810652
has comment: http://stackoverflow.com/comment/43810653
has comment: http://stackoverflow.com/comment/43810686
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43810741
has comment: http://stackoverflow.com/comment/43810714
has title: Querying the DOM using jQuery, code not working?
has body: This is really strange and I checked the jQuery API just to make sure things have not changed since the tutorial was created. However the above code still gives me all the child elements, which are I am first, You are second and Hello from the nest instead of the first element. $('ul.emphasis').children('li').first().addClass('emphasis'); .emphasis { color: red; font-weight: bold; } Welcome to my website Lorem ipsum dolor sit amet, consectetur adipisicing elit. Temporibus suscipit rem quibusdam sapiente obcaecati unde quod sed? Veritatis, laudantium? Ullam aliquid, rem ipsum cupiditate non repellendus culpa consequatur incidunt, perspiciatis! I am first YOu are second Hello from the nest
favorite count: 0
has answer: http://stackoverflow.com/a/27698845
has comment: http://stackoverflow.com/comment/43810699
has answer: http://stackoverflow.com/a/27698812

http://stackoverflow.com/a/27721795
score: 0
answers question: http://stackoverflow.com/q/27721666
type: Answer
has body: You can check for page bottom with this code. if ($(window).scrollTop() &gt;= $(document).height() - $(window).height() - 500) { // fun stuff goes here } 500 is the offset value from the bottom, as you might want to trigger your code a bit earlier to prepare content. For example, hipster.cc uses the same code for endless scrolling.
has comment: http://stackoverflow.com/comment/43868566

http://stackoverflow.com/comment/44004088
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27794288
has text: duplicate of [Google Maps JS API v3 - Simple Multiple Marker Example](http://stackoverflow.com/questions/3059044/google-maps-js-api-v3-simple-multiple-marker-example), "i" is invalid once the loop ends, it is pointing past the end of the infowindows array.

http://stackoverflow.com/comment/43928127
type: Comment
has text: @user52889 actually, thinking about your argument, it still doesnt make sense to me. Given the usecase, this works just fine. Either you are overthinking, or you dont understand the problem.
comment on: http://stackoverflow.com/a/27756671
score: 0
type: AnswerComment

http://stackoverflow.com/q/27642121
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/27643068
has comment: http://stackoverflow.com/comment/43703728
has title: Result of the radio buttons does not work properly if I have the code for both of the options
accepted answer: http://stackoverflow.com/a/27642571
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43703083
score: 1
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/43703194
has body: I have a problem, i have two radio buttons which if you select on the Doctor radio button it will display all the next fields which are needed to show for the doctors and the same we want to happen if you select the patient radio button , i did it to work fine if I have the code for the patient for example but if i write the code also for the doctor it destroy the result of the both options HERE IS THE CODE... Registration Form First Name Last Name Username Email Password User Type: Doctor Patient Male Female Age: Disease: A B C D SPID: PS 1: I COMMENTED THE CODE FOR THE DOCTOR IN ORDER TO WORK PROPERLY FOR THE PATIENT PS 2: http://jsfiddle.net/niklakis/qp7s409a/24/ HERE IS A LINK TO SEE WHAT HAPPENS IF A HAVE BOTH OF THE CODE
has answer: http://stackoverflow.com/a/27642571
upvote count: 1
has comment: http://stackoverflow.com/comment/43703019

http://stackoverflow.com/comment/43732476
score: 0
type: AnswerComment
type: Comment
has text: Please explain a bit. I am a newbie in terms of Javascript. May I know what is the first line means.
comment on: http://stackoverflow.com/a/27658272

http://stackoverflow.com/q/27677884
tagged with: javascript
tagged with: jquery
score: 6
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/27677961
tagged with: angularjs
type: Question
answer count: 1
upvote count: 6
tagged with: momentjs
has title: Moment.js: only certain localizations
has body: I am looking for a way to include momentjs with a localization (german in my case), but not with all other localizations (the 40kb minified version), to keep it slim. Is it possible to exclude all other localizations but one specific?
accepted answer: http://stackoverflow.com/a/27677961
downvote count: 0

http://stackoverflow.com/comment/43856233
has text: @adeneo, im not talking about the context and `this`, im talking about the scope chain
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27721950
score: 0

http://stackoverflow.com/comment/43981118
has text: somehow the global variable declaration is not accepting and after Div3 again if user clicks on "Click to see other Divs" Div1 should be shown which is not possible with the mentioned javascript. Please suggest.Updated fiddle http://jsfiddle.net/0w9yo8x6/61/ . @Koen Hoeijmakers
type: AnswerComment
comment on: http://stackoverflow.com/a/27785246
score: 0
type: Comment

http://stackoverflow.com/comment/43955379
type: Comment
has text: Is this one approach? http://www.createjs.com/#!/TweenJS
comment on: http://stackoverflow.com/q/27771701
score: 0
type: QuestionComment

http://stackoverflow.com/a/27731286
has body: The loop in the function doesn't do what you think. Using for(var firstName in friends) doesn't mean that you get the firstName property from each object in friends. You will get the key for each object in friends, and that key is put in a variable named firstName. With your current data, the variable will get the value "bill" in the first iteration, then "steve" in the second iteration. Also, the action taken for not finding anything (logging "not cool") is premature. As you are doing it in the loop, you will get one of those for each person until you find the match. Determining that nothing was found would be done after the loop, i.e. when all items in the object has been checked. A more useful version of the function would be: function search(name) { for (var key in friends) { var friend = friends[key]; if (friend.firstName === name) { return friend; }; } return null; }; Usage: var f = search('Steve'); if (f != null) { // found steve } else { // not found }
type: Answer
answers question: http://stackoverflow.com/q/27731192
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/27696066
favorite count: 0
has comment: http://stackoverflow.com/comment/43805888
accepted answer: http://stackoverflow.com/a/27696401
has body: I am wondering and sadly I don't know where else to ask the question. I want to make a interactive chart using the top 5 downloaded movies. And the current box office top 5. How i'm going to make this interactive is beyond me yet. What I would like to know first is, if there is any way to manipulate or change the given chart from Mojo. Right now I use: http://boxofficemojo.com/about/data.htm With the code given by Mojo: &lt;script type="text/javascript" language="javascript" src="http://www.boxofficemojo.com/data/js/wknd5.php?h=myclass1&amp;r=myclass2"&gt;&lt;/script&gt; This just shows me the top 5 (see example at the previously provided URL). Is there any way that I can use that chart and make a, pie chart or any other chart or graph out of it? And if this is possible will it still update with money and new movies every time the site does, like the given chart with the javascript code does right now? Hopefully someone can help me or maybe has a different way of making a chart/graph out of this data (the box office top 5). So to be more clear. I would like to create my own chart/graph with the box office top 5 data. And I would also like it to be "live" and update itself when ever the top 5 changes or the numbers change. There for it doesn't seem like the best idea to create my own Json with data since it won't update when the data updates without me making changes into the Json file. The interactive part doesn't matter yet.
linked to: http://stackoverflow.com/q/17604071
has comment: http://stackoverflow.com/comment/43805654
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43805617
tagged with: rss
score: 1
has title: Can I adjust or use a given (JavaScript)chart to create a different/new chart?
has comment: http://stackoverflow.com/comment/43805564
upvote count: 1
has comment: http://stackoverflow.com/comment/43805767
type: Question
tagged with: charts
tagged with: javascript
has answer: http://stackoverflow.com/a/27696401
has comment: http://stackoverflow.com/comment/43805714
has comment: http://stackoverflow.com/comment/43805831
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/43707293
comment on: http://stackoverflow.com/a/27644316
has text: What is it in the OP that makes `jQuery.parseJSON` preferable to `JSON.parse`? Anything?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43857360
type: AnswerComment
has text: Error: <?php echo $aux; //Hi! "Text" Text2'Text3 ?> <a onclick="share('<?= json_encode(htmlentities ($aux))') ?>)">Send
score: 0
comment on: http://stackoverflow.com/a/27721804
type: Comment

http://stackoverflow.com/comment/43963917
type: QuestionComment
has text: Did you add the `crossorigin` attribute to your image? I think you can use `crossorigin="anonymous"`
comment on: http://stackoverflow.com/q/27774998
score: 0
type: Comment

http://stackoverflow.com/a/27753713
answers question: http://stackoverflow.com/q/27752042
has comment: http://stackoverflow.com/comment/43925909
downvote count: 0
has comment: http://stackoverflow.com/comment/43932722
has body: In onEachFeature callback, you can get the center of the L.Polygon created by GeoJSON layer and bind a label to it. var polygonCenter = layer.getBounds().getCenter(); // e.g. using Leaflet.label plugin L.marker(polygonCenter) .bindLabel(feature.properties['NAME'], { noHide: true }) .addTo(map); Here is an example: http://jsfiddle.net/FranceImage/ro54bqbz/ using Leaflet.label
type: Answer
has comment: http://stackoverflow.com/comment/43928518
has comment: http://stackoverflow.com/comment/43926340
upvote count: 5
score: 5

google-chrome-app
tags question: http://stackoverflow.com/q/27713854
type: Tag
tags question: http://stackoverflow.com/q/27680628
tags question: http://stackoverflow.com/q/27733811
tags question: http://stackoverflow.com/q/27712470
tags question: http://stackoverflow.com/q/27770393
tags question: http://stackoverflow.com/q/27651596
tags question: http://stackoverflow.com/q/27693814
tags question: http://stackoverflow.com/q/27643384
tag name: google-chrome-app

http://stackoverflow.com/comment/44001755
has text: Can't figure out a way outside of ignorign those files/components with wiredep and adding that conditional block and its content manually to HTML.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27794237

http://stackoverflow.com/comment/43753264
type: QuestionComment
type: Comment
has text: array with 1 item as per your requirement of `split(,1)`
comment on: http://stackoverflow.com/q/27669238
score: 0

http://stackoverflow.com/comment/43987471
type: QuestionComment
comment on: http://stackoverflow.com/q/27788676
type: Comment
has text: This is, in a word, insane... especially to code by hand. Have you thought of writing a small script to write the code for you, to eliminate the possibility of typos?
score: 0

http://stackoverflow.com/comment/43865910
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27727001
type: Comment
has text: @T-M Pay attention is not jQuery fadeOut, is pure CSS and JS you just need to add the class 'hide' to your element using JS.

http://stackoverflow.com/comment/43733488
type: QuestionComment
has text: you're attaching the event handlers before the dom is ready but defining the functions when the dom is ready
comment on: http://stackoverflow.com/q/27658906
score: 0
type: Comment

http://stackoverflow.com/q/27782594
tagged with: javascript
answer count: 3
upvote count: 0
has answer: http://stackoverflow.com/a/27782942
has comment: http://stackoverflow.com/comment/43975227
possible better answer: http://stackoverflow.com/a/27782693
has title: Received comma while excluding letter using reqex
favorite count: 0
accepted answer: http://stackoverflow.com/a/27782798
has answer: http://stackoverflow.com/a/27782693
score: -3
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43975439
downvote count: 3
type: Question
has body: How can I exclude letters from input rpn("2 3 + 7 d -"); ? I've tried with this: function rpn(input) { var str = input.split(/[a-z]/); return arr; }; but then I receive 2 3 + 7 , -, so comma instead of d I then tried to remove spaces with var str = input.split(/[a-z]\s+/);, but this didn't work at all. I'm looking for a result like that: 2,3,+,7,-, so I can push it to an array and work with it there.
has comment: http://stackoverflow.com/comment/43975090
has answer: http://stackoverflow.com/a/27782798

http://stackoverflow.com/q/27712423
score: 0
accepted answer: http://stackoverflow.com/a/27715820
tagged with: wordpress
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27715820
has body: I currently am developing a custom Wordpress theme. The page is set up in a single page vertically scrolling format. At one point in the theme there is a blogroll with the option to view older posts. Clicking to view older posts refreshes the page &amp; brings the user back to the top, I want to user to remain in place so that upon clicking "View Older Posts" the posts are refreshed and the user is still at the same fixed scroll area instead of being bumped back to the top. Is there a possible way to use Jquery to bring the next posts in? I thought about editing the "get_next_post_link" function in link-template.php but I'm not sure what javascript to use or how to modify the code to work: function get_next_post_link( $format = '%link &amp;raquo;', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { return get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, false, $taxonomy ); } I am using a modified version of this theme: http://www.andersnoren.se/themes/fukasawa/
type: Question
answer count: 1
tagged with: javascript
has title: Setting Page Scroll on "get_next_posts_link"?
tagged with: jquery

http://stackoverflow.com/comment/43764021
score: 0
has text: Thanks for the reply. How exactly do I remove the font?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27674532

http://stackoverflow.com/comment/43730218
has text: With this comment your answer becomes complete. You could have added this to the answer.
type: Comment
comment on: http://stackoverflow.com/a/27656989
score: 0
type: AnswerComment

http://stackoverflow.com/q/27653657
has answer: http://stackoverflow.com/a/27653783
has title: How to call a function that is in a js file from another js file
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43724391
upvote count: 1
has comment: http://stackoverflow.com/comment/43724458
has comment: http://stackoverflow.com/comment/43724508
type: Question
has answer: http://stackoverflow.com/a/27653798
has answer: http://stackoverflow.com/a/27653971
has comment: http://stackoverflow.com/comment/43724598
has body: I know this question has been answered many times but the solutions in those questions aren't working for me. I have a function in lets suppose, a.js. This function is outside the document.ready function and here is its format: function thisIsFromAnotherFile(){ alert("This alert is from another js file"); } I'm calling this function from the other file, b.js this way: var openFile = function(context){ thisIsFromAnotherFile(); } openFile is an onclick function. onclick = "openFile(this)" When I run this code I'm getting an Uncaught ReferenceError: thisIsFromAnotherFile is not defined. Please help me out. Thanks.
has comment: http://stackoverflow.com/comment/43724422
tagged with: javascript
has comment: http://stackoverflow.com/comment/43724659
answer count: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/43724788
tagged with: external
favorite count: 0
has comment: http://stackoverflow.com/comment/43724437
has comment: http://stackoverflow.com/comment/43724477
has comment: http://stackoverflow.com/comment/43724593
has comment: http://stackoverflow.com/comment/43724196
has comment: http://stackoverflow.com/comment/43724127

http://stackoverflow.com/q/27746593
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
answer count: 2
has title: Calling function without event
favorite count: 0
has answer: http://stackoverflow.com/a/27746629
possible better answer: http://stackoverflow.com/a/27746630
has answer: http://stackoverflow.com/a/27746630
upvote count: 1
accepted answer: http://stackoverflow.com/a/27746629
type: AnsweredQuestion
score: 0
has body: I would like to call the below function to execute on the below span, WITHOUT writing a script in the HTML. I don't want to write a script in the HTML in order to follow the rule of separating behavior from mark-up. And there is no listener event to trigger the function (the function simply generates a spam-proof email address without any triggering event). How do I do this? HTML: &lt;span id="myEmail"&gt;&lt;/span&gt; External JS file: function myFunction() { /* a function to generate a spam-proof email address */ }

http://stackoverflow.com/a/27717251
accepted answer of: http://stackoverflow.com/q/27709559
answers question: http://stackoverflow.com/q/27709559
downvote count: 0
has body: You should assign a custom class to your bootbox-alert and change its width on the CSS: jQuery: bootbox.alert({ "message": "Success", "className" : "my-custom-class", "callback": function() { console.log("Success callback"); } }); CSS: .my-custom-class .modal-dialog{ width:200px; } This will take your bootbox alert and size it down. This is a jsFiddle with the fix you needed. If you want all of the alerts to be smaller, just change the original modal-dialog class: .modal-dialog{ width:200px; }
upvote count: 6
type: AcceptedAnswer
score: 6
type: Answer

http://stackoverflow.com/q/27706555
has body: I'm trying to call a function from an image in my HTML, wondering if anyone could shed some light on why the function does not appear to be running? function markAnswers() { var intCorrect = 0; if document.getElementById('question1').value.toUpperCase() = "GROUNDHOG DAY" { correct = (correct + 1); } if document.getElementById('question2').value.toUpperCase() = "CAMERON DIAZ" { correct = (correct + 1); } if document.getElementById('question3').value.toUpperCase() = "BLADE RUNNER" { correct = (correct + 1); } if document.getElementById('question4').value.toUpperCase() = "THE AVENGERS" { correct = (correct + 1); } if document.getElementById('question5').value.toUpperCase() = "WHOOPI GOLDBERG" { correct = (correct + 1); } switch (correct) { case 0: alert("You scored 0/5! You weren't even trying!"); break; case 1: alert("You scored 1/5! Come on you can do better than that!"); break; case 2: alert("You scored 2/5! Well at least you got a couple right!"); break; case 3: alert("You scored 3/5! Average..."); break; case 4: alert("You scored 4/5! Not bad... Not bad at all!"); break; case 5: alert("You scored 5/5!! Perfection!"); break; default: alert("Ermm... something went wrong. Well this is awkward."); } } .submitbtn { background-image: url('../images/markup.png'); width: 221px; height: 39px; margin-left: auto; margin-right: auto; } .submitbtn:hover { background-image: url('../images/markdown.png'); } DOUGHY DRAGON GROUNDHOG DAY CORN MAIZE AD CAMERON DIAZ NEAR BLUNDER BLADE RUNNER SEVENTH GEAR THE AVENGERS WORD BOGGLE IHOP WHOOPI GOLDBERG I thought the onclick="markAnswers()" should call this. Any help would be much appreciated!
has comment: http://stackoverflow.com/comment/43824912
has comment: http://stackoverflow.com/comment/43825669
has answer: http://stackoverflow.com/a/27706746
has comment: http://stackoverflow.com/comment/43824959
has comment: http://stackoverflow.com/comment/43825348
has comment: http://stackoverflow.com/comment/43825139
tagged with: javascript
downvote count: 6
has comment: http://stackoverflow.com/comment/43825146
has answer: http://stackoverflow.com/a/27706702
upvote count: 1
accepted answer: http://stackoverflow.com/a/27706702
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/43824944
has title: Javascript function doesn't appear to run?
has comment: http://stackoverflow.com/comment/43824996
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27707929
possible better answer: http://stackoverflow.com/a/27706743
score: -5
has answer: http://stackoverflow.com/a/27706743
type: Question

replace
tags question: http://stackoverflow.com/q/27712157
tags question: http://stackoverflow.com/q/27758010
tags question: http://stackoverflow.com/q/27711600
tags question: http://stackoverflow.com/q/27780238
tags question: http://stackoverflow.com/q/27679287
tags question: http://stackoverflow.com/q/27670320
type: Tag
tags question: http://stackoverflow.com/q/27785245
tags question: http://stackoverflow.com/q/27747487
tag name: replace
tags question: http://stackoverflow.com/q/27736680

http://stackoverflow.com/comment/43992189
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27791007
has text: Note that setting an element property doesn't necessarily affect the related attribute and *vice versa*.
score: 0

http://stackoverflow.com/a/27801324
type: Answer
answers question: http://stackoverflow.com/q/27800121
score: 0
has body: On the site you refer to the icon to trigger the menu has an id of 'menu-toggle-wrapper'. If you search their custom js @ http://owwwlab.com/toranj/assets/js/custom.js you will find the function that fires when this button is clicked. You'll also have to dissect their CSS to figure out all the details of how the transitions work, because this behaviour is governed partly by this javascript trigger and partly by the site CSS. Option B is to search for some jQuery off canvas menu plugins. This might be an easier route. Good luck!

http://stackoverflow.com/comment/43921369
type: AnswerComment
type: Comment
score: 0
has text: In reality I actually like and use jQuery core (I prefer to implement my own plugins so that I'm in control of their behaviour), but as per my other comments I wouldn't introduce jQuery to a site just for this. I like regex, too, but don't use it on html.
comment on: http://stackoverflow.com/a/27755242

http://stackoverflow.com/comment/43935471
comment on: http://stackoverflow.com/q/27762057
type: QuestionComment
type: Comment
score: 1
has text: See if [this answer](http://stackoverflow.com/a/11922384/2055998) helps.

http://stackoverflow.com/q/27763781
tagged with: node.js
has answer: http://stackoverflow.com/a/27763797
type: AnsweredQuestion
score: 3
upvote count: 3
accepted answer: http://stackoverflow.com/a/27763797
has title: Nodejs import fails with syntax error
type: Question
has body: I am making use of react-router node module for routing in a react app. I am importing required modules as follows. var React = require('react'); var Router = require('react-router'); var { Route, RouteHandler, Link } = Router; // ... remaining code ... But I am getting syntax error on line no. 3 i.e. var { Route, RouteHandler, Link } = Router; Error: Uncaught SyntaxError: Unexpected token {
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/27798371
has comment: http://stackoverflow.com/comment/44005299
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27798248
has body: Why not used @Html.Hidden ? @Html.Hidden("hId", ViewData["name"], new { @id = "hId" })

http://stackoverflow.com/a/27766024
has body: Usually you would put the code in two different js files and include the webService before the validate, which would make the one function available before the other. // other code
score: 0
has comment: http://stackoverflow.com/comment/43942690
type: Answer
answers question: http://stackoverflow.com/q/27765844

http://stackoverflow.com/comment/43797627
comment on: http://stackoverflow.com/a/27691986
score: 0
type: Comment
has text: We are talking about the same things. The issue is because there is no block-level scope. Hence the problem with closure. If inside of each `for` iteration there was separate scope the value in closure would be correct.
type: AnswerComment

http://stackoverflow.com/q/27721881
has comment: http://stackoverflow.com/comment/43856078
favorite count: 0
type: Question
has body: I have data.js file with content: var table=[]; table.push('10','11'); I want to use it in the other script, which looks like this: var script=document.createElement("script"); script.src="http://xxxx/data.js"; document.body.appendChild(script); setTimeout(function(){alert(table);},5000); When i paste this to Firebug and run it, at the first time i got function () { [native code] } When i run this again i get what i wanted which is: 10,11 How can i achive this result at the first time i run this script?
has comment: http://stackoverflow.com/comment/43855455
score: 0
upvote count: 1
answer count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/27722278
tagged with: javascript
type: UnansweredQuestion
has title: Variable from another file

http://stackoverflow.com/q/27709676
has body: I want to upload a file with jquery-file-upload (blueimp) with some data in cross domain. So in client side I use the code from basic.html file from jqueryfileupload. I just added forceIframeTransport for cross domain (doc here)&amp; formData (for format type doc here). var idResp = {name:'id-resp',value: SLjQuery('#media_answer_answer').data('id-resp')}; var dataSup = $('form#answer_process_form').serializeArray(); dataSup.push(idResp); $(function () { 'use strict'; $('#media_answer_answer').fileupload({ url: "mywebsite.dev/app_dev.php/api/media/questionnaire-test-media/uploads", dataType: 'json', formData: dataSup, forceIframeTransport: true, done: function (e, data) { console.log('upload ok ', data); }, progressall: function (e, data) { console.log(data.loaded/data.total); } }).prop('disabled', !$.support.fileInput) .parent().addClass($.support.fileInput ? undefined : 'disabled') ; $('#media_answer_answer').fileupload( 'option', 'redirect', 'mywebsite.dev/result.html?%s' ); }); When I select a file by the input, into the console, the log of progressall is to 1. So it seems to be sending. Moreover I can see in the network tab in the console the request sent //in request headers Content-Length: 43463 Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryvU5EBWuRkyGkSRBS ... //in request payload ------WebKitFormBoundaryvU5EBWuRkyGkSRBS Content-Disposition: form-data; name="media_answer[_token]" e6583ea5230f1f80a218825ed399115925556f0c ------WebKitFormBoundary1JHxUF9xgtcO5fJ2 Content-Disposition: form-data; name="id-resp" 420 ------WebKitFormBoundaryvU5EBWuRkyGkSRBS Content-Disposition: form-data; name="media_answer[answer]"; filename="file-to-upload.jpg" Content-Type: image/jpeg ------WebKitFormBoundaryvU5EBWuRkyGkSRBS-- //in response headers ... X-ChromeLogger-Data: eyJ2ZXJzaW9uIjoiNC4wIiwiY29sdW1.... // I think this is the file in base64 ... Now in server side, I use FosRestBundle for routing. In my symfony controller I want to get the data and the fil…
tagged with: http://stackoverflow.com/tag/html
tagged with: symfony
has comment: http://stackoverflow.com/comment/43832547
downvote count: 0
has comment: http://stackoverflow.com/comment/43850963
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27722936
accepted answer: http://stackoverflow.com/a/27722936
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/43849857
has title: Using Symfony2, how to get ajax post data from the request?
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: ajax
tagged with: jquery-file-upload

http://stackoverflow.com/a/27666279
downvote count: 0
type: Answer
score: 2
upvote count: 2
has body: If you put this into &lt;head&gt;, it will execute before #clickme exists in the DOM. Solution is to wrap your code in a DOMContentLoaded listener: document.addEventListener("DOMContentLoaded", function() { document.getElementById('clickme').addEventListener('click', hello); });
answers question: http://stackoverflow.com/q/27665917
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27665917

http://stackoverflow.com/q/27698565
tagged with: viewer
has answer: http://stackoverflow.com/a/29105353
upvote count: 1
answer count: 1
favorite count: 0
type: UnansweredQuestion
has body: I have integrated scribd document viewer to my website but setPage function is not working Can you help me to view only the first 2 pages in the document please look into in the below url and help me to find the solution. Scribd
has title: Scribd setPage function is not working
tagged with: php
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43810186
type: Question
tagged with: scribd
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27792961
type: Question
tagged with: javascript
tagged with: express
has title: Node.js: Extract data from JSON response
accepted answer: http://stackoverflow.com/a/27792983
has body: I'm fetching product details using an API which gives the response as a JSON object. { "productBaseInfo": { "productIdentifier": { "productId": "EKTDDD23232zYHR94E4", }, "productAttributes": { "title": "Nova KT 72BC 1 Electric Kettle", "imageUrls": { "400x400": "http://img5a.flixcart.com/image/electric-kettle/4/e/4/nova-kt-722-c-kt-722c-400x400-imadddh2fdvuzpxz.jpeg", "75x75": "http://img6a.flixcart.com/image/electric-kettle/4/e/4/nova-kt-722-c-kt-722c-75x75-imadddh2fdvuzpxz.jpeg", }, "sellingPrice": { "amount": 599.0, "currency": "INR" }, "productUrl": "http://dl.mykart.com/dl/nova-kt-722c-1-electric-kettle/p/itmdddf398rhhhz2?pid=EKTDDDEGXYHR94E4&amp;affid=userid" } } } Now I want to get the productId, title in ProductAttributes, and all the image urls and productURL. I tried var productURL = JSON["productAttributes"].productUrl But it returns an error productUrl not found error. Looking for suggestion on how to extract the data. Thanks in advance.
answer count: 1
downvote count: 0
score: 1
favorite count: 0
tagged with: parsing
tagged with: node.js
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
has answer: http://stackoverflow.com/a/27792983

http://stackoverflow.com/q/27752659
tagged with: loops
downvote count: 1
type: Question
score: 3
has answer: http://stackoverflow.com/a/27752721
has body: I'm having trouble understanding the way this for in loop works. function createSimpleNode(name, options, text) { var node = document.createElement(name); for (var o in options) { node.setAttribute(o, options[o]); } if (text) { node.innerHTML = text; } return node; }
upvote count: 4
answer count: 2
possible better answer: http://stackoverflow.com/a/27752681
has answer: http://stackoverflow.com/a/27752681
tagged with: javascript
tagged with: for-in-loop
favorite count: 0
has comment: http://stackoverflow.com/comment/43916327
accepted answer: http://stackoverflow.com/a/27752721
has comment: http://stackoverflow.com/comment/43916520
type: AnsweredQuestion
has title: Explanation for in loop javascript

http://stackoverflow.com/q/27717443
downvote count: 0
has comment: http://stackoverflow.com/comment/43846848
tagged with: javascript
tagged with: github
tagged with: ubuntu
has body: Though I have the same problem that is in this question, But I am facing another problem i.e, even https://github.com/ is not running in the browser and showing that this webpage is not available and this happens after I installed Heroku. Cannot access github from terminal and not even from browser. After diagnosis I get to know that this problem is related to my WiFi because when I try to open https://github.com/ in mobile using mobile data, It is opening but when I connect my mobile to WiFi then same problem i.e, this webpage is not available and when I use mobile data internet in my laptop I am able to access the site but when using WiFi this webpage is not available. I am running Ubuntu(Linux), dual boot with Windows-7 Diagnosis Results: @Aroll605 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=144 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=71.4 ms 64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=192 ms 64 bytes from 8.8.8.8: icmp_seq=4 ttl=57 time=112 ms 64 bytes from 8.8.8.8: icmp_seq=5 ttl=57 time=137 ms 64 bytes from 8.8.8.8: icmp_seq=6 ttl=57 time=58.0 ms 64 bytes from 8.8.8.8: icmp_seq=7 ttl=57 time=83.6 ms 64 bytes from 8.8.8.8: icmp_seq=8 ttl=57 time=104 ms 64 bytes from 8.8.8.8: icmp_seq=9 ttl=57 time=128 ms @epascarello unknown host 192.30.252.131
has answer: http://stackoverflow.com/a/27721185
has comment: http://stackoverflow.com/comment/43854060
has comment: http://stackoverflow.com/comment/43854018
answer count: 1
has comment: http://stackoverflow.com/comment/43868619
has comment: http://stackoverflow.com/comment/43846870
favorite count: 0
has comment: http://stackoverflow.com/comment/43847522
linked to: http://stackoverflow.com/q/20370294
has comment: http://stackoverflow.com/comment/43853349
has comment: http://stackoverflow.com/comment/43854037
has comment: http://stackoverflow.com/comment/43847575
upvote count: 1
has comment: http://stackoverflow.com/comment/43853185
has comment: http://stackoverflow.com/comment/43847057
has comment: http://stackoverflow.com/comment/43846941
has comment: http://stackoverflow.com/comment/43846911
tagged with: git
has title: Could Not Resolve Host github.com
accepted answer: http://stackoverflow.com/a/27721185
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43846821
has comment: http://stackoverflow.com/comment/43846877
score: 1
has comment: http://stackoverflow.com/comment/43846839
has comment: http://stackoverflow.com/comment/43853121
has comment: http://stackoverflow.com/comment/43847510
type: Question
tagged with: browser
has comment: http://stackoverflow.com/comment/43853965

http://stackoverflow.com/q/27803210
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: How to check each input on focus
type: Question
score: 0
tagged with: input
upvote count: 1
answer count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/27803700
has comment: http://stackoverflow.com/comment/44016083
has comment: http://stackoverflow.com/comment/44015967
has body: This code is working but focus come to reversed when I click the submit button first focus on textarea box isn't focused to reverse focus on first input. How could I fix it? &lt;input type="text" class="textbox texrr" name="" /&gt; &lt;input type="text" class="textbox texrr" name="" /&gt; &lt;textarea class="textbox1 texrr"&gt;&lt;/textarea&gt; &lt;input type="submit" class="send" value="Send" name="submit"&gt; $(".send").click(function(){ $(".texrr").each(function(index, element) { if($(this).val()!=""){ $(this).removeClass('texerrbg'); } else{ $(this).addClass('texerrbg').focus(); } }); });
tagged with: javascript
has comment: http://stackoverflow.com/comment/44016012
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27803700
tagged with: focus
type: AnsweredQuestion

http://stackoverflow.com/q/27740525
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27740585
score: 0
has answer: http://stackoverflow.com/a/27740571
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has answer: http://stackoverflow.com/a/27740722
has title: Get table cell id from rowid
has answer: http://stackoverflow.com/a/27740585
has body: I have a table with two rows and three columns: Cell A Cell B Cell C Cell A Cell B Cell C How can I get all the ids under a particular using javascript or jquery? Thanks in advance.
has comment: http://stackoverflow.com/comment/43891981
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43892104
has answer: http://stackoverflow.com/a/27740663
has comment: http://stackoverflow.com/comment/43891898
type: Question
tagged with: html-table
accepted answer: http://stackoverflow.com/a/27740571
tagged with: jsp
has comment: http://stackoverflow.com/comment/43892042

http://stackoverflow.com/comment/43995556
has text: jquery is always loaded because going on / loads main.php who loads jquery and other scripts. On this other scripts is page.js who loads the anchor's url.
comment on: http://stackoverflow.com/q/27792419
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27671871
has body: function validateArguments(args) { if(args.length &lt; 1 &amp;&amp; args.length &gt; 2) { throw new RangeError("Invalid amount of arguments. Follow the syntax"); } if(typeof args[0] !== "object") { throw new TypeError("Invalid first argument type. Follow the syntax"); } if(args[1] &amp;&amp; typeof args[1] !== "function") { throw new TypeError("Invalid second argument type. Follow the syntax"); } return true; } What I'm trying figure out is for args[1] if it is a function get the arguments list of that as well. Is this possible? Basically, here is an example code. someFunction({ object:"//object" },function(data,datas,dataCall){ //is data, datas, and dataCall too many arugments. //if so how to throw the error here });
type: AnsweredQuestion
has title: Getting the Function.Arguments of one of the callee Function.Arguments
has answer: http://stackoverflow.com/a/27672274
type: Question
answer count: 3
possible better answer: http://stackoverflow.com/a/27672274
has answer: http://stackoverflow.com/a/27671972
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27672046
accepted answer: http://stackoverflow.com/a/27672046
tagged with: arguments
tagged with: throw
linked to: http://stackoverflow.com/q/11796093

http://stackoverflow.com/comment/43825324
score: 0
type: QuestionComment
has text: yes its the Bootstrap Modal, sry , i will edit this.So i can just use $(this) instead of all my ID's?
type: Comment
comment on: http://stackoverflow.com/q/27706367

http://stackoverflow.com/a/30426791
has body: JS bundling tools like Browserify or Webpack will bundle all your .js files input one or several bundles, even in developing mode. So in this case, adding inline source map to generated bundles is the easiest way to help debugging without bringing extra files.
answers question: http://stackoverflow.com/q/27671390
downvote count: 0
has comment: http://stackoverflow.com/comment/67666500
type: Answer
upvote count: 13
score: 13

http://stackoverflow.com/comment/43843048
has text: @meagar - well spotted, didn't even notice the obvious conflict, just pasted in a fiddle, and it worked.
comment on: http://stackoverflow.com/q/27715424
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27706803
type: AcceptedAnswer
has body: You should implement some metatags. Look here: http://davidwalsh.name/facebook-meta-tags So for example, in head: You can add more properties. Just google OpenGraph, or click on the provided link.
accepted answer of: http://stackoverflow.com/q/27706686
type: Answer
answers question: http://stackoverflow.com/q/27706686
score: 0

http://stackoverflow.com/q/27663660
has comment: http://stackoverflow.com/comment/43743151
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/27663715
score: 1
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/25111831
downvote count: 0
tagged with: javascript
has title: Angular js Controller prints only the curly brackets
favorite count: 0
has answer: http://stackoverflow.com/a/27663728
has comment: http://stackoverflow.com/comment/43743222
tagged with: http://stackoverflow.com/tag/html
has body: I am going over a tutorial on Angular JS, I have gone over the code several times and its exactly as the person types but get {{name}} and {{age}} in the browser. Can anyone tell me what I am doing wrong? Another question that I have is that in one tutorial his html document has got the head and body tags in another its just the doctype, a link to angular and then he starts typing his code. If this is a style, which one should I follow, shall i leave the body tag on or remove them? {{name}} {{age}}

http://stackoverflow.com/q/27726006
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43864251
answer count: 0
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/43864503
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43871805
tagged with: loops
upvote count: 1
has title: Flash banner won't loop in HTML modal
has body: I don't think the HTML modal is the reason for this, but my flash banner plays once it's opened, but does not loop as it is expected to. Any reason for this? A jQuery on click event handler would work too, but can't seem to figure out how to integrate that. Flash code: <!--[if !IE]>--> <!--<![endif]--> <!--[if !IE]>--> <!--<![endif]-->
tagged with: flash

permissions
tag name: permissions
type: Tag
tags question: http://stackoverflow.com/q/27669590
tags question: http://stackoverflow.com/q/27642037

http://stackoverflow.com/a/27786284
has comment: http://stackoverflow.com/comment/43982708
upvote count: 2
has comment: http://stackoverflow.com/comment/43983134
type: Answer
has comment: http://stackoverflow.com/comment/43982999
score: 2
has body: I created this quick example for you and added in comments so it's easy to follow. // Add a "click" event handler to the element document.getElementById("showDivs").addEventListener("click", function () { // Get all div's var divs = document.getElementsByTagName("div"); // Get the visible div var visibleDiv; for (var i = 0; i < divs.length; i++) { var id = divs[i].id; var index = divs[i].id.indexOf("Div"); if (divs[i].style.display === "block" && divs[i].id.indexOf("Div") > -1) { visibleDiv = divs[i]; } } // Hide the visible div visibleDiv.style.display = "none"; // Get the number of the current div var divNum = Number(visibleDiv.id.replace("Div", "")); // Show the next div var nextDiv; if (divNum === 3) { nextDiv = 1; } else { nextDiv = ++divNum; } document.getElementById("Div" + nextDiv).style.display = "block"; }); div{border:1px solid black;width:100px;height:100px;text-align:center;} Div 1 Div 2 Div 3 Fixed Div This can be done with less code, however, for ease of understanding I used a lot of variables and commented every step of the way so you can see which parts of the code are doing what actions. EDIT In the edit, I added in a fixed div, just to show that the code will work if there are other div's on the page that aren't included in the div's that change. --- EDIT 2 jQuery Example --- Here's a jQuery example as requested with slide effects: // Add click event handler $("#showDivs").click(function () { // Get the visible div var visibleDiv = $("div[id^='Div']:visible")[0]; // Hide the visible div $("#" + visibleDiv.id).slideToggle(); // Get the number of the current div var divNum = Number(visibleDiv.id.replace("Div", "")); // Get the number of the next div to show var newDiv; if (divNum === 3) { newDiv = 1; } else { newDiv = ++divNum; } $("#Div" + newDiv).slideToggle(); }); div{border:1px solid black;width:100px;height:100px;text-align:center;} Div 1 Div 2 Div 3
has comment: http://stackoverflow.com/comment/43982616
accepted answer of: http://stackoverflow.com/q/27785136
answers question: http://stackoverflow.com/q/27785136
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/43801057
type: QuestionComment
has text: @adeneo could be useful within a web-worker, where there is no concern of blocking the UI thread
score: 1
comment on: http://stackoverflow.com/q/27693814
type: Comment

http://stackoverflow.com/comment/43996637
score: 0
has text: @NikhilGeorge `*` is not a valid character for an attribute name, so you should access it like this `jsObject.productBaseInfo.productAttributes.imageUrls["400*400"]`
type: AnswerComment
comment on: http://stackoverflow.com/a/27792983
type: Comment

http://stackoverflow.com/q/27679474
answer count: 1
has comment: http://stackoverflow.com/comment/43773784
favorite count: 0
has comment: http://stackoverflow.com/comment/43773582
has body: How stackoverflow is generating a web page whenever a new question is asked by users. I need to generate a php file with the name provided by users data.
type: UnansweredQuestion
score: -3
tagged with: php
has comment: http://stackoverflow.com/comment/43773562
downvote count: 3
type: Question
upvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27679510
has title: How to generate dynamically a web page in php
tagged with: http://stackoverflow.com/tag/html

extjs
tags question: http://stackoverflow.com/q/27706034
tags question: http://stackoverflow.com/q/27649281
tags question: http://stackoverflow.com/q/27795879
tags question: http://stackoverflow.com/q/27793997
tags question: http://stackoverflow.com/q/27640872
tags question: http://stackoverflow.com/q/27713015
tags question: http://stackoverflow.com/q/27781211
type: Tag
tags question: http://stackoverflow.com/q/27717808
tags question: http://stackoverflow.com/q/27753744
tags question: http://stackoverflow.com/q/27755291
tags question: http://stackoverflow.com/q/27793369
tags question: http://stackoverflow.com/q/27776231
tags question: http://stackoverflow.com/q/27801025
tags question: http://stackoverflow.com/q/27773278
tags question: http://stackoverflow.com/q/27684916
tags question: http://stackoverflow.com/q/27680910
tags question: http://stackoverflow.com/q/27677819
tag name: extjs
tags question: http://stackoverflow.com/q/27703937
tags question: http://stackoverflow.com/q/27741673

http://stackoverflow.com/q/27712109
has body: I am new to JavaScript, but looking to create a script that will take the value of the fill when a halftone is set and apply that value to the opacity. Once the opacity value has been adjusted, I need the fill to reset to 100(full). The most helpful code I've seen so far was in this article, and I've tried adjusting several ways to be consistent with some of the other scripts I use for consistency as seen here: doc = app.activeDocument; i = 0 var selection = activeDocument.pageItems[i]; var storedColor = activeDocument.pageItems[i].fillColor; //apply value of stored color of individual selection to opacity selection.opacity = storedColor[i]; selection.fillColor = 100; This seems like it should be reasonably simple if I was clearer on what I was doing. Any help or code adjustments would be greatly appreciated. I'm trying to streamline some of the steps used in my business. Thank you!
has comment: http://stackoverflow.com/comment/43864961
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/9899229
type: UnansweredQuestion
has title: Illustrator Script: Invrting Fill/Opacity
tagged with: opacity
has comment: http://stackoverflow.com/comment/43836346
tagged with: adobe-illustrator
answer count: 0
type: Question

http://stackoverflow.com/comment/43805455
comment on: http://stackoverflow.com/a/27693685
type: Comment
has text: Thanks. Maybe I've not been very clear. Your example works well in static mode. I need to animate the transition from the rectangle to the parallelogram. Is it possible?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43938324
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27761440
type: Comment
has text: In any case, thanks for the idea to use only one for loop.I actually didn't know that you could use the same variable to loop through multiple arrays like that. http://codepen.io/terratunaz/pen/XJNzrX If anyone is curious

http://stackoverflow.com/q/27736195
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43893889
has comment: http://stackoverflow.com/comment/43932926
tagged with: clipboard
has comment: http://stackoverflow.com/comment/43893936
has answer: http://stackoverflow.com/a/27760510
has comment: http://stackoverflow.com/comment/43932375
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43931505
score: 1
has title: How to test Copy Paste in Firefox Developer Tools Web Console?
upvote count: 1
type: Question
tagged with: firefox
has comment: http://stackoverflow.com/comment/43932954
has comment: http://stackoverflow.com/comment/43931721
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27760510
has comment: http://stackoverflow.com/comment/43888018
linked to: http://stackoverflow.com/q/5700519
has body: I'm looking at writing a small Firefox addin/extension wherein I will use the copy/paste buffer. I tried to test the code I saw on MDN in the Firefox / Tools / Web Developer / Web Console / Javascript tab, in order to get an online 'REPL' evaluator, to no avail. This is what I tried and the error; https://developer.mozilla.org/en-US/docs/Using_the_Clipboard Components.utils.import('resource://gre/modules/Services.jsm'); TypeError: Components.utils is undefined I am very new to this and perhaps am misreading the docs, but it seemed like this was the correct page and the correct place to start per other readings, eg Firefox Xul Clipboad thank you!
tagged with: firefox-addon
linked to: http://stackoverflow.com/q/26545871
linked to: http://stackoverflow.com/q/27034198
answer count: 1

http://stackoverflow.com/comment/43886058
has text: But this isn't inside a function. So is j global?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27737271

http://stackoverflow.com/q/27798121
has answer: http://stackoverflow.com/a/27798270
has body: When I click on the button, a class gets added, and the text changes from "Get in touch" to "Work." However, when I click the button again in its "work state," the text doesn't change back to "Get in touch." Why doesn't it work? Fiddle: http://jsfiddle.net/cLgkwjhb/ HTML Get in touch CSS #contact-button { background: #000; background-size: 24px; color: #fff; text-decoration: none; text-transform: uppercase; font-weight: bold; padding: 10px 20px; } JS jQuery('#contact-button').click(function( e ){ e.preventDefault(); jQuery(this).addClass('work-button').text('Work'); }); jQuery('#contact-button.work-button').click(function( e ){ e.preventDefault(); jQuery(this).removeClass('work-button').text('Get in touch'); });
has title: Make a div toggle words by changing the text via jQuery?
favorite count: 0
tagged with: css
answer count: 4
possible better answer: http://stackoverflow.com/a/27798266
score: 2
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/27798200
type: Question
has answer: http://stackoverflow.com/a/27798196
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27798266
has answer: http://stackoverflow.com/a/27798200
upvote count: 2

http://stackoverflow.com/comment/43829709
type: AnswerComment
type: Comment
has text: The answer is correct but it has one small issue... on function( index, posts) change the posts on the parameters to any other name like `obj` and also on the table `posts.name` to `obj.name`
score: 0
comment on: http://stackoverflow.com/a/27708543

http://stackoverflow.com/q/27656391
upvote count: 1
has body: Update: This turned out to be a really stupid question. I just failed to notice some simple things in the quoted example. I've been looking at information about ticks and the event loop, and mostly it's clear, but there is an example in the nextTick documentation that puzzles me. It says: It is very important for APIs to be either 100% synchronous or 100% asynchronous. Consider this example: // WARNING! DO NOT USE! BAD UNSAFE HAZARD! function maybeSync(arg, cb) { if (arg) { cb(); return; } fs.stat('file', cb); } This API is hazardous. If you do this: maybeSync(true, function() { foo(); }); bar(); then it's not clear whether foo() or bar() will be called first. First questions: why is foo not guaranteed to be called first? There is a simple function call (of maybeSync), an if, and a callback of cb=foo. I take it that something in this chain is in some way (possibly) asynchronous, pushing something to the event queue and continuing execution? I don't see how anything there could have that effect. Second question: is there some documentation somewhere that could have helped me understand this on my own?
type: AnsweredQuestion
score: 1
has title: Please explain example in nextTick documentation
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27656884
favorite count: 0
tagged with: events
has answer: http://stackoverflow.com/a/27656884
tagged with: node.js

http://stackoverflow.com/comment/43972568
type: Comment
has text: Without any serverside scripting, then URL querystring is the only way +1
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27781388

http://stackoverflow.com/comment/43900478
type: QuestionComment
has text: Properly indenting your code will show you the problem
score: 1
comment on: http://stackoverflow.com/q/27744561
type: Comment

http://stackoverflow.com/comment/43995837
score: 0
comment on: http://stackoverflow.com/a/27792982
type: Comment
type: AnswerComment
has text: ya. it is working here. but my array is : $scope.array ={dates:['MON 5', ' TUE 6']};

http://stackoverflow.com/a/27668329
has comment: http://stackoverflow.com/comment/43753080
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27664103
score: 0
accepted answer of: http://stackoverflow.com/q/27664103
has comment: http://stackoverflow.com/comment/43761112
has comment: http://stackoverflow.com/comment/43753561
type: Answer
has comment: http://stackoverflow.com/comment/43753452
has comment: http://stackoverflow.com/comment/43753072
has body: Whenever faced with some issues with performances, use a profiler. Here i saw that it wad action() that was to blame, using 32% of the CPU. The code of action is too generic, yet with 3 separate cases, which makes it hard to read and lowers its performances. By writing it more clearly, i go from 32% CPU to 3% CPU !!!! // execute an action // list: generate, attract, draw function action(actions, arr, addParticles, arg2) { if (actions == 'draw') { for (var i = 0; i &lt; arr.length; i++) { arr[i].draw(); } return; } else if ('generate' in actions) { if (addParticles) { var generators = actions['generate']; for (var i = 0; i &lt; generators.length; i++) { generators[i].generate(arr); } } } var attractors = actions['attract']; if (attractors) { for (var j = 0; j &lt; attractors.length; j++) { for (var i = 0; i &lt; data.lives; i++) { attractors[j].attract(arr[i]); } } } var repulsors = actions['repulse']; if (repulsors) { for (var j = 0; j &lt; repulsors.length; j++) { for (var i = 0; i &lt; data.lives; i++) { repulsors[j].repulse(arr[i], arg2); } } } } move can gain a bit with a little easy caching. the draw of the particle was done in update (fixed) + some other fixes made your app more fluid : http://jsfiddle.net/gamealchemist/kwgp7kmh/3/ Edit : The code above is way faster because it will be compiled by the Javascript engine that will assume (which is right) every array contains only objects of the same kind. So the cost will be closer to the cost of the same C++ code. On the other hand, when writing : actions[prop][j][prop](arr[i], arg1, arg2); every time the engine will perform all operations : read prop and actions, retrieve prop[actions] (1), retrieve its j-th element (2), retrieve the prop method of this element (3), retrieve arr[i] (4); then call, 4 costly operations that can't use type assumptions to be optimized. You have to write a code quite 'obvious' for the engine to be able to optimize it.

http://stackoverflow.com/comment/44012874
type: QuestionComment
comment on: http://stackoverflow.com/q/27797931
type: Comment
has text: you may want to try the PouchDB forum, https://groups.google.com/forum/#!forum/pouchdb
score: 0

http://stackoverflow.com/a/27651928
accepted answer of: http://stackoverflow.com/q/27651847
type: Answer
has body: I'm not really sure what you are trying to do. But I think you are over complicating this. Define your action (a PHP controller to deal with the the request) and the form will be submitted by the browser when the submit button is clicked. UPDATE: It sounds to me like what you want to do is submit these by AJAX. I'd highly recommend you use the jQuery library to to this. Add this to your page tag: Then change your form to use a class, rather than id because you can only have one id per name for each page. Since you are using a while loop you need to eliminate this issue. Now, we need some jQuery to help us out... $(document).on('submit', '.comments', function(event) { event.preventDefault(); var serialized = $(this).serialize(); $.ajax({ url: "handler.php", method: "post", data: serialized, }) .done(function(data) { // take some action when the request completes }); }); This will prevent the default action of submitting the form when you click the button, then the jQuery will take over and serialize (stringify) the form data and send it to the server as an AJAX request. Once the .done fires you can do more, like show the user a message that the submission was successful... maybe disable the submit button so they can't hammer the server with messages easily, etc... I really hope this helps!
has comment: http://stackoverflow.com/comment/43721178
has comment: http://stackoverflow.com/comment/43721054
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43721845
answers question: http://stackoverflow.com/q/27651847
has comment: http://stackoverflow.com/comment/43721778
has comment: http://stackoverflow.com/comment/43721865

http://stackoverflow.com/comment/43745118
type: AnswerComment
type: Comment
has text: Ah ok, it's very helpful. In my mind I was thinking it would evaluate to true if closestSide was equal to dleft OR dright. I can understand the mistake I made now.
comment on: http://stackoverflow.com/a/27664796
score: 0

http://stackoverflow.com/comment/44123661
comment on: http://stackoverflow.com/q/27801055
type: QuestionComment
type: Comment
has text: Where i did something wrong ? Why someone given me -vote ?
score: 0

http://stackoverflow.com/comment/43756848
type: QuestionComment
has text: @JohnKurlak That is a low cost watch.. :) do you think OP is doing that simple thing in the use case and there could just be say 10 additional such low cost watches.. :) `You need to know what the value updates` -> This is where pub/sub mechanism comes into picture.
score: 0
comment on: http://stackoverflow.com/q/27670824
type: Comment

http://stackoverflow.com/a/27659779
has comment: http://stackoverflow.com/comment/43735427
has comment: http://stackoverflow.com/comment/43735555
answers question: http://stackoverflow.com/q/27659675
has comment: http://stackoverflow.com/comment/43736748
score: 0
has body: Number.MIN_VALUE is the smallest possible representable number, not the smallest possible difference between representable numbers. Because of the way javascript handles floating point numbers the smallest possible difference between representable numbers changes with the size of the number. As the number gets larger the precision gets smaller. Thus there is no one number that will solve your problem. I suggest you either rethink how you're going to solve your problem or choose a subset of numbers to use and not the full range of MAX and MIN values. for example: 1.7976931348623156e+308 == 1.7976931348623155e+308 //true Also, by subtracting MIN_VALUE from MAX_VALUE you're trying to get javascript to accurately represent a number with over 600 significant figures. That's a bit too much.
type: Answer

http://stackoverflow.com/q/27721347
has comment: http://stackoverflow.com/comment/43854902
tagged with: javascript
has answer: http://stackoverflow.com/a/27725396
accepted answer: http://stackoverflow.com/a/27725396
upvote count: 3
tagged with: angularjs
linked to: http://stackoverflow.com/q/12336897
tagged with: angularjs-ng-repeat
answer count: 4
favorite count: 0
downvote count: 0
has answer: http://stackoverflow.com/a/27721467
has body: The problem occurs when trying to ng-repeat over dynamically created collection: Angular is going in to loop with 10 $digest() iterations reached. Aborting! error I have simplified the problem to minimum with this example &lt;body ng-init='a = [1, 2, 3]'&gt; &lt;div ng-repeat="item in a.reverse()"&gt;{{item}}&lt;/div&gt; &lt;/body&gt; and here is it working copy in Plunkr (View shows correct result, but in console you will see errors mentioned above. More complicated examples fail completely) Considered [1, 2, 3] could be array of objects, if it may make any difference So questions are why is it so, and is there an easy way to come over this? Thanks
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/27721432
linked to: http://stackoverflow.com/q/19693410
has answer: http://stackoverflow.com/a/27721432
type: Question
has comment: http://stackoverflow.com/comment/43857641
linked to: http://stackoverflow.com/q/15266671
has answer: http://stackoverflow.com/a/27722934
has title: Angular ng-repeat - creating collection dynamically

http://stackoverflow.com/comment/43996251
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27792887
has text: What is the reason for doing this?
score: 0

http://stackoverflow.com/q/27645855
tagged with: http://stackoverflow.com/tag/html
has title: Keyboard event with ionic form
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27645986
downvote count: 0
tagged with: ionic-framework
type: Question
score: 3
has body: I have an input field in my ionic form: Search And I wanna add an event that calls the function "search()" when I press enter button of my keyboard. Is there any suggestion ? Thank you in advance
tagged with: javascript
upvote count: 3
answer count: 1
tagged with: events
favorite count: 0
accepted answer: http://stackoverflow.com/a/27645986

http://stackoverflow.com/comment/43912948
comment on: http://stackoverflow.com/a/27750880
score: 0
type: AnswerComment
has text: Correct, I suspect he meant to used `downvotes` instead of `upvoted`.
type: Comment

http://stackoverflow.com/comment/44039348
comment on: http://stackoverflow.com/q/27796395
has text: Since there is no rotate bits operation in JavaScript, the overflow bits are discarded and the least-significant bits are all zeroes. Rotation means instead of discarding the shifted bits, re-introduce them at the other end of the bit pattern (instead of 'inserting zeroes'). This is why the discarded bits need to be _ored_ with the result of shifting, to simulate bit rotation.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44677116
score: 0
type: Comment
has text: Nice plugin! :) Have created a jsfiddle.. Now my problem is that the dragster on document is only working until the first time you drag over a dropzone http://jsfiddle.net/L7v2f96z/2/
comment on: http://stackoverflow.com/a/27834554
type: AnswerComment

http://stackoverflow.com/a/27758250
score: 0
answers question: http://stackoverflow.com/q/27758155
type: AcceptedAnswer
type: Answer
has body: As far as I can see, your refactor isn't off by much. What you're looking for is probably function getTripData() { var request = { origin: start, destination: start, waypoints: [{ location: end }], travelMode: google.maps.TravelMode.DRIVING }; var dfd = $.Deferred(); directionsServices.route(request, function(response, status) { dfd.resolve(response, status); }); return dfd.promise(); } if (locationsChanged) { trip = getTripData(); trip.done(function(response, status) { console.log(response); console.log(status); }); }
accepted answer of: http://stackoverflow.com/q/27758155

http://stackoverflow.com/comment/44006377
has text: @Manwal:First of all only anchor tag will be displayed on page. Then when user clicks on anchor tag the first div containing some field s of form should appear and so on. How can I do this?
type: QuestionComment
comment on: http://stackoverflow.com/q/27798771
type: Comment
score: 0

http://stackoverflow.com/q/27709202
has answer: http://stackoverflow.com/a/27851025
downvote count: 1
has answer: http://stackoverflow.com/a/27885819
upvote count: 13
type: AnsweredQuestion
has title: Javascript async function composition
has comment: http://stackoverflow.com/comment/44226983
has body: I have several async functions with varying numbers of parameters, in each the last param is a callback. I wish to call these in order. For instance. function getData(url, callback){ } function parseData(data, callback){ } By using this: Function.prototype.then = function(f){ var ff = this; return function(){ ff.apply(null, [].slice.call(arguments).concat(f)) } } it is possible to call these functions like this, and have the output print to console.log. getData.then(parseData.then(console.log.bind(console)))('/mydata.json'); I've been trying to use this syntax instead, and cannot get the Then function correct. Any ideas? getData.then(parseData).then(console.log.bind(console))('/mydata.json');
has comment: http://stackoverflow.com/comment/43830456
score: 12
type: Question
has comment: http://stackoverflow.com/comment/44172871
tagged with: javascript
has comment: http://stackoverflow.com/comment/43830552
has comment: http://stackoverflow.com/comment/44162888
has answer: http://stackoverflow.com/a/27899230
has answer: http://stackoverflow.com/a/27881749
tagged with: functional-programming
has comment: http://stackoverflow.com/comment/43831184
has comment: http://stackoverflow.com/comment/44163393
has comment: http://stackoverflow.com/comment/44163419
has comment: http://stackoverflow.com/comment/43830231
favorite count: 0
has answer: http://stackoverflow.com/a/27912398
answer count: 5
possible better answer: http://stackoverflow.com/a/27851025
has comment: http://stackoverflow.com/comment/43830243
accepted answer: http://stackoverflow.com/a/27899230

http://stackoverflow.com/comment/43906157
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/27747302
has text: I made a little experiment myself and had to write a shim to make it work. Inside requirejs.config, added `shim: {c3: { deps: ['d3'], exports: 'c3' }}`. I've seen c3 trying to do this in its own code, but in my case, it didn't work out of the box.
type: Comment

http://stackoverflow.com/comment/43703045
has text: Yes. It shows the right gallery perfect and the left one, it just puts the pictures on the page without the gallery feature of smoothgallery.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27641188
type: QuestionComment

audio
tags question: http://stackoverflow.com/q/27713331
tags question: http://stackoverflow.com/q/27753390
tags question: http://stackoverflow.com/q/27773674
tags question: http://stackoverflow.com/q/27650444
tags question: http://stackoverflow.com/q/27727908
tags question: http://stackoverflow.com/q/27665261
tags question: http://stackoverflow.com/q/27790666
tags question: http://stackoverflow.com/q/27789890
tags question: http://stackoverflow.com/q/27715481
tags question: http://stackoverflow.com/q/27754926
type: Tag
tag name: audio
tags question: http://stackoverflow.com/q/27761467
tags question: http://stackoverflow.com/q/27758432
tags question: http://stackoverflow.com/q/27714498
tags question: http://stackoverflow.com/q/27784437
tags question: http://stackoverflow.com/q/27668722
tags question: http://stackoverflow.com/q/27735713
tags question: http://stackoverflow.com/q/27684354

http://stackoverflow.com/comment/43954766
comment on: http://stackoverflow.com/q/27771790
score: 0
type: QuestionComment
has text: @IagoMelanias jQuery isn't needed. Anything that can be done with jQuery can be done with vanilla JavaScript.
type: Comment

http://stackoverflow.com/a/27672025
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43776065
has body: The fragment: &lt;%== @$sections %&gt; is equivalent to: print scalar @$sections; ...so that is why you are getting the array length: an array in scalar context is the length of the array. To get a javascript array, you have to replace &lt;...> below with something that will cause the output to look like a js array: print scalar &lt;....&gt;; You can do something like this: use Mojolicious::Lite; get '/test' =&gt; sub { my $c = shift; $c-&gt;stash(sections =&gt; [1, 2, 3]); { local $" = ", "; #The value that gets inserted between array elements #when an array is interpolated into a string. The default #value is a space. $c-&gt;render('template1'); } # $" gets reset to its previous value here }; app-&gt;start; __DATA__ @@ template1.html.ep %= javascript begin var arr = &lt;%== "[@$sections]" %&gt;; console.log(arr[0]); % end Examine your browser's javascript console....
accepted answer of: http://stackoverflow.com/q/27671347
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27671347
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43776197

http://stackoverflow.com/a/27756472
answers question: http://stackoverflow.com/q/27756032
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43923819
accepted answer of: http://stackoverflow.com/q/27756032
score: 1
upvote count: 1
has body: Okay, as an official answer: jQuery .width() or .innerWidth() is rounding the width of subpixel to the next integer value either with floor or ceil, depending on the value. To avoid that you can use some raw javascript: $('.person').each(function() { var front = $(this).find('.front'); var back = $(this).find('.back'); var link = $('&lt;a href="#"&gt;&lt;/a&gt;'); link.on('click', function() { var width = $(front)[0].getBoundingClientRect().width; back.innerWidth(width); back.toggle(); }); $(this).wrap(link); back.hide(); }); The following function is for checking pixel errors by resizing the window with active overlay: $(window).resize(function() { $('li').each(function() { var back = $(this).find('.back'); var width = $(this)[0].getBoundingClientRect().width; back.width(width); }); }); If you use .innerWidth() instead of getBoundingClientRect() you will see the error you have stated.

http://stackoverflow.com/comment/43991463
type: Comment
type: QuestionComment
score: 4
comment on: http://stackoverflow.com/q/27790820
has text: Oh, a space is the least of your problems.

http://stackoverflow.com/q/27690526
favorite count: 0
score: 4
answer count: 0
type: UnansweredQuestion
tagged with: node.js
type: Question
upvote count: 4
downvote count: 0
tagged with: javascript
has title: Strange memory behaviour on agenda
has body: I've just started using agenda in a node js app and I find a strange memory behaviour. The memory increase by 200kb after every job execution. Here a simple example that present the same behaviour var Agenda = require('agenda'); var agenda = new Agenda({db: { address: 'mongodb://localhost:27017/my-test-db'}}); agenda.define('say hi', function(job, done) { console.log('Hi!!!!') done(); }); agenda.every('10 seconds', 'say hi'); agenda.start(); Any idea why it happens?

http://stackoverflow.com/q/27801486
has title: Javascript bmi calculator pointer position
has answer: http://stackoverflow.com/a/27801736
accepted answer: http://stackoverflow.com/a/27801736
possible better answer: http://stackoverflow.com/a/27801848
has body: I'm building a BMI (Body Mass Index) Calculator and everything works fine but now I want to add an image with a pointer on it indicating the result of BMI. My problem is that I don't know what formula to use in order to calculate where the pointer will fall and to position the pointer correctly on image. So if the result is 21.5 I want the pointer to be somewhere where the 21.5 will be on the image. Please see the image attached to see exactly what I want to achieve thank you
has answer: http://stackoverflow.com/a/27801848
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44011673
tagged with: draw
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44012204
tagged with: javascript
has comment: http://stackoverflow.com/comment/44013095
score: 0

http://stackoverflow.com/a/27779049
type: Answer
has body: You should handle it from your web framework, such that if any request comes to that page then use the redirect method from your framework to show desired page. Also Since you are using history method that's why you get the cached result. You should use something like: // similar behavior as an HTTP redirect window.location.replace("http://stackoverflow.com"); or // similar behavior as clicking on a link window.location.href = "http://stackoverflow.com"; Also see: Close child window, redirect parent window
has comment: http://stackoverflow.com/comment/43994673
answers question: http://stackoverflow.com/q/27779009
score: 0

http://stackoverflow.com/a/32707397
score: 12
answers question: http://stackoverflow.com/q/27670996
downvote count: 0
type: Answer
has body: There is another answer to this question. Even though it's a bit old I am going to respond. It is possible to do this with the mongo shell. You can convert your JSON to valid JavaScript by prefixing it with var myData= then use the load() command to load the JavaScript. After the load() you will be able to access your data from within your mongo script via the myData object. data.js var myData= [ { "letter" : "A" }, { "letter" : "B" }, { "letter" : "C" } ] read.js #!/usr/bin/mongo --quiet // read data load('data.js'); // display letters for (i in myData) { var doc = myData[i]; print(doc.letter); } For writing JSON is easiest to just load your result into a single object. Initialize the object at the beginning with var result={} and then use printjson() at the end to output. Use standard redirection to output the data to a file. write.js #!/usr/bin/mongo --quiet var result=[]; // read data from collection etc... for (var i=65; i&lt;91; i++) { result.push({letter: String.fromCharCode(i)}); } // output print("var myData="); printjson(result); The shebang lines (#!) will work on a Unix type operating system (Linux or MacOs) they should also work on Windows with Cygwin.
upvote count: 12

http://stackoverflow.com/q/27740343
tagged with: facebook
has body: Hello guys I am trying to add twitter and Facebook share buttons on my fancybox using the following code. But there is no social button. JS HTML SOLVED
has comment: http://stackoverflow.com/comment/43891542
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43891569
has comment: http://stackoverflow.com/comment/43891733
downvote count: 0
answer count: 0
score: 1
has title: how to add social buttons on fancybox.js?
type: Question
has comment: http://stackoverflow.com/comment/43891585
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43891663
upvote count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/43793646
type: Comment
has text: You can add this class to all the menus you're adding.
type: AnswerComment
comment on: http://stackoverflow.com/a/27689989
score: 0

http://stackoverflow.com/comment/44009550
score: 0
has text: Scrap last comment, this is what happens when I try and help people with non related JavaScript problems :(
type: Comment
comment on: http://stackoverflow.com/q/27800493
type: QuestionComment

http://stackoverflow.com/a/27749886
accepted answer of: http://stackoverflow.com/q/27727429
answers question: http://stackoverflow.com/q/27727429
has comment: http://stackoverflow.com/comment/79241193
has comment: http://stackoverflow.com/comment/43938118
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/79240880
has body: The chrome.runtime.onInstalled event is fired directly after loading your code. When you add an event listener asynchronously, then the onInstalled event has already been dispatched when you add the event listener. To solve this issue, you have to make the initialization of your app synchronous. Unfortunately, require.js is designed to be an asynchronous script loader. Modifying this library to make it synchronous is possible, but a waste of efforts without any benefits. To use require-style modules (AMD) in a Chrome extension, I strongly recommend to use an intermediate build step that combines the scripts (such as r.js or grunt-contrib-requirejs), and almond.js as script loader. Contrary to require.js, almond.js does support synchronous loading. Here's an example of a config that you can use to build a single file called all.js that contains almond.js (as script loader), and uses mymain.js as entry point (main script): ({ name: 'mymain', out: 'all.js', include: [ 'almond' ], skipModuleInsertion: true, wrap: { start: '(function(){', // true = load synchronously. This is a feature of almond.js end: 'require(["mymain"], null, null, true);})();' } }) To avoid namespace pollution, I've wrapped the code in a n immediately-invoked function expression. If you want the modules to be available in the global namespace (e.g. for debugging), just remove the (function(){ and })();. For documentation of these configuration options (and more), see https://github.com/jrburke/r.js/blob/master/build/example.build.js. To try out the previous example: Install r.js: npm install -g requirejs Save the previous config as myfancyname.build.js Create a script called mymain.js: define(function() { ... });. (This is a simple module definition without dependencies. Read the require.js documentation if you want to learn more about other kind of modules, such as modules with dependencies). Run r.js to compile the file: r.js -o myfancyname.build.js Now you have a single file called all.js that ca…
score: 6
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/43957710
has comment: http://stackoverflow.com/comment/43994306
has comment: http://stackoverflow.com/comment/43962065

http://stackoverflow.com/comment/44019091
type: Comment
has text: Hello Max here is the updated fiddle http://jsfiddle.net/Kapil_B/g2z0kwzr/2/, where I am trying to update the pip value on changing the rates. So in formattedPrice2, I am able to get the updated price but the price1 is not getting updated value. Can you please tell me the reason why the price1 value is not getting updated?
type: AnswerComment
comment on: http://stackoverflow.com/a/27763941
score: 0

http://stackoverflow.com/comment/43985118
type: QuestionComment
has text: http://test.avrasyademo.xyz/test2/ I did example.Can you look the example.You can understand error.I wait for your help.
comment on: http://stackoverflow.com/q/27778317
score: 0
type: Comment

http://stackoverflow.com/comment/43841311
comment on: http://stackoverflow.com/a/27714583
has text: because it's perfectly possible (via `call` or `apply`) to supply a context to that function. An incorrect `this` is (in my experience) always a programmer error, not a runtime error.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27679202
score: 0
answer count: 2
tagged with: function
tagged with: callback
has comment: http://stackoverflow.com/comment/43773004
has answer: http://stackoverflow.com/a/27679564
type: UnansweredQuestion
has body: I am new to node js. It seems callback function is the norm in writing functions in node. Is this true? What are the advantages of writing callback function compare to function returns the result? When should I write callback function and when should I just use the regular return function in node js?
tagged with: node.js
has comment: http://stackoverflow.com/comment/43773032
type: Question
has title: Callback function vs return function in node js
has answer: http://stackoverflow.com/a/27679395
tagged with: javascript

http://stackoverflow.com/a/27794612
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27778364
has body: You can call JS function from Flex like this In AS3 if(ExternalInterface.available){ ExternalInterface.call(“openNotes”, parameter); } In Javascript function openNotes(notesUrl){ window.open(notesUrl, ”, ‘width=1000,height=600′); }

http://stackoverflow.com/q/27667973
has title: Making a div fill 100% height of screen
tagged with: javascript
has comment: http://stackoverflow.com/comment/43750687
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27668048
has answer: http://stackoverflow.com/a/27668320
tagged with: css
has body: Heres an image of my website right now: https://i.sstatic.net/McdLD.jpg The section says "What is Spheroid" is ment to be my content container. However, I can't seem to make it go from the header to the footer. My HTML code: What is Spheroid? My CSS Code: html, body { background-image:url(001.png); background-size: 100%; background-repeat: no-repeat; height: 100%; } #container { width: 800px; height: 100%; text-align: center; margin: 0 auto; background-color: #38788E; } I've tried using the "height: 100vh;" property, but it makes the container go beyond the footer so the page needs to be scrolled. Also think it might have to be done with JavaScript, but that's a field where I'm going to need some support. Thank you guys in advance :) EDIT - So I figured from one of the answers, that my div was inside another div. So I fixed this, and with the same code as provided it not looks like this: https://i.sstatic.net/ANqUZ.png Thought it might have been the bg size, but as it is only set to "cover" it shouldn't be the issue.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43752060
possible better answer: http://stackoverflow.com/a/27668320
has comment: http://stackoverflow.com/comment/43751306
score: 0
has comment: http://stackoverflow.com/comment/43750891
type: Question
has comment: http://stackoverflow.com/comment/43751875
has comment: http://stackoverflow.com/comment/43750630
answer count: 2
has answer: http://stackoverflow.com/a/27668048
has comment: http://stackoverflow.com/comment/43750960

http://stackoverflow.com/a/27769779
has body: Mongoose calls are asynchronous. What's happening is that you're adding each Color.find call to the event queue and then you're calling console.log('OUTPUT:', results); before any Color.find call has run. This means that at that point in time, your array is empty. Solution Pass in the number of remaining calls and a callback. After every colour has been queried, you call your callback. Here's a fiddle var colours = ['white', 'red']; var result = { items: [], left: colours.length }; function myCallback(param){ console.log(param); } for(var i=0; i&lt;colours.length; ++i){ (function(results, colour_name, cb){ ... setTimeout(function(){ // remove this, just simulating an async call // this should be inside the Color.find callback result.items.push(colour_name); result.left--; if (!result.left) { cb(result.items); } },0); ... }(result, colours[i], myCallback )); }
type: Answer
has comment: http://stackoverflow.com/comment/43952829
answers question: http://stackoverflow.com/q/27769338
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27769338
score: 0

http://stackoverflow.com/q/27776948
type: Question
has comment: http://stackoverflow.com/comment/43964646
tagged with: javascript
has title: how to unwrap the multiple parents elements
score: 0
answer count: 1
tagged with: jquery
has body: i am getting the html decoded from server. once i receive that's look like this: it has spans simply nested inside of no.of span's &lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;The portacabin consist of toilets, &lt;strong&gt;&lt;/strong&gt; &lt;strong&gt;\u003e\u0026#160;&lt;/strong&gt; showers and changing cubicles, a classroom, an office and a store room.&amp;nbsp;&lt;br&gt;The upgrade shall include development of foot paths and installation of new up-lights around the area complete with all the required &amp;amp; necessary directional signages, as per the Standards Engineering Specification &amp;amp; approval by client.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; I would like to remove the span whichever not required, even if it has only space. how to do this? i tried this: var p = $('p').contents().unwrap(); console.log(p); there is a empty strong element and with only space with strong elment - how to clear it? It unwraps step, that's it. Any one help me please? Live
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27777884
has comment: http://stackoverflow.com/comment/43964737
accepted answer: http://stackoverflow.com/a/27777884

http://stackoverflow.com/a/27678470
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27673591
has body: The createToken method requires a JS object with number and expiry date values. I don't believe you're sending those to it. Try passing those explicitly, and putting breakpoints after the method in your browser debugger to see what happens.

http://stackoverflow.com/a/27679943
has comment: http://stackoverflow.com/comment/44407945
has comment: http://stackoverflow.com/comment/44411937
has comment: http://stackoverflow.com/comment/43776270
downvote count: 0
has body: Well, since you've tagged jQuery, I will give you a jQuery solution. A stopwatch can be created using the following JavaScript/jQuery: var h1 = document.getElementsByTagName('h1')[0], seconds = 0, t; function add() { seconds++; h1.textContent = seconds; timer(); } function timer() { t = setTimeout(add, 1000); } We then also need to define a start() and a stop() function which start and stop the timer: // start and stop functions function start() { timer(); } function stop() { clearTimeout(t); } That's it! Now we've created a stopwatch. In your question, you mention that you would like the stopwatch to start after an animation finishes. We can do this now by calling .start() in an animation's callback function like so: // Example of an animation that starts the timer when complete $("#animatedDiv").animate({ left: "+=50", top: "+=150", height: "100px", width: "200px" }, 4000, function() { // define a callback function // Animation complete. start(); // Start the timer in the callback function }); Likewise, we can also stop() the timer upon a keypress: // Example of a function that stops the timer $(document).keypress(function( event ) { if ( event.which == 115 ) { // when pressing s for 'stop' alert('You stopped the timer'); stop(); } }); Now when we want to send the stopwatch's time to another page, we need to add the timer's value as a url parameter when directing to another page. In general this is done as follows: http://www.newpage.com/?myParameter=myValue Where we send variable myParameter containing the value myValue. In your example, we could do this as follows: // button click function $("#theButton").click(function() { window.open('http://www.yourpage.com/?time='+h1.textContent); }); Where h1.textContent would then be the timer's value. The other page could then get the variable time from the url. If you don't know how to do this, read this: How to get the value from the GET parameters? Get url parameter jquery Or How to Get Query String Values In js I've p…
has comment: http://stackoverflow.com/comment/44357523
has comment: http://stackoverflow.com/comment/44390503
has comment: http://stackoverflow.com/comment/44357961
has comment: http://stackoverflow.com/comment/44357710
has comment: http://stackoverflow.com/comment/44407325
score: 1
accepted answer of: http://stackoverflow.com/q/27678604
has comment: http://stackoverflow.com/comment/44407278
has comment: http://stackoverflow.com/comment/44317567
answers question: http://stackoverflow.com/q/27678604
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43777380
has comment: http://stackoverflow.com/comment/44405225
has comment: http://stackoverflow.com/comment/44411990
has comment: http://stackoverflow.com/comment/44357462
upvote count: 1
type: Answer

http://stackoverflow.com/q/27781948
upvote count: 1
has answer: http://stackoverflow.com/a/27782123
type: Question
has answer: http://stackoverflow.com/a/27782030
tagged with: javascript
has title: doing something when specific ajax request finish
tagged with: jquery
tagged with: ajax
answer count: 2
downvote count: 0
has body: I Have many ajax request , and i want to doing some code when one of them exactly finish , but $.when not working correctly , how i can doing that correctly ? getData(); $.when().done(function() //doing something here ); function getData(){ $.ajax({ type: 'POST', url: '1.php', data:'', dataType: 'json', success:function(data_Object){ } }); }
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43973789
tagged with: php
score: 1
has comment: http://stackoverflow.com/comment/43997062

http://stackoverflow.com/comment/43926254
has text: That really quite a change from your original question.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27754224
score: 1

http://stackoverflow.com/comment/43925961
has text: I agree with everyone. I also created a fiddle the shows that it works. http://jsfiddle.net/m0nk3y/47gfzucv/
comment on: http://stackoverflow.com/a/27757609
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27766709
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43954771
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27766756
answer count: 2
tagged with: button
has comment: http://stackoverflow.com/comment/43943995
favorite count: 0
possible better answer: http://stackoverflow.com/a/27766763
has body: I have 9 buttons in my page. When ever I click on a button the inner HTML of the button should change. How can I achieve this using a single JavaScript function? i.e. What can I do so that the code detects different buttons in the HTML? How should the code be modified so that when ever I click on a button, let it be the first or the sixth button the code should detect the button and therefore call the "changeHtml" function on that button?
has comment: http://stackoverflow.com/comment/43945140
has answer: http://stackoverflow.com/a/27766763
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43944040
has title: How can i use a single function to change the innerHTML of all the buttons in a webpage?
upvote count: 3
score: 0
has comment: http://stackoverflow.com/comment/43945963
downvote count: 3
type: Question
has answer: http://stackoverflow.com/a/27766756

http://stackoverflow.com/a/27715913
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43872442
type: Answer
answers question: http://stackoverflow.com/q/27714541
has comment: http://stackoverflow.com/comment/43846957
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27714541
has body: Bootstrap data-spy is very strictly dependent on the links and anchors. The fix is as following: Add id to your body tag like this: And add the anchor to your home page link tag: Home See the jsfiddle
upvote count: 1

http://stackoverflow.com/q/27724295
type: AnsweredQuestion
has title: pdf.js failing on getDocument
has comment: http://stackoverflow.com/comment/43863756
score: 7
has comment: http://stackoverflow.com/comment/43863727
has answer: http://stackoverflow.com/a/27726934
accepted answer: http://stackoverflow.com/a/27726934
possible better answer: http://stackoverflow.com/a/45510582
type: Question
has comment: http://stackoverflow.com/comment/43861291
has comment: http://stackoverflow.com/comment/43863750
answer count: 2
tagged with: javascript
tagged with: grails
tagged with: pdf.js
upvote count: 7
tagged with: html5-canvas
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43863579
has body: browser: Chrome environment: grails app localhost I'm running a grails app on local host (which i know there's an issue with pdf.js and local file system) and instead of using a file: url which i know would fail i'm passing in a typed javascript array and it's still failing. To be correct it's not telling me anything but "Warning: Setting up fake worker." and then it does nothing. this.base64ToBinary = function(dataURI) { var BASE64_MARKER = ';base64,'; var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length; var base64 = dataURI.substring(base64Index); var raw = window.atob(base64); var rawLength = raw.length; var array = new Uint8Array(new ArrayBuffer(rawLength)); for(i = 0; i &lt; rawLength; i++) { array[i] = raw.charCodeAt(i); } return array; }; PDFJS.disableWorker = true; // due to CORS // I convert some base64 data to binary data here which comes back correctly var data = utilities.base64ToBinary(result); PDFJS.getDocument(data).then(function (pdf) { //nothing console logs or reaches here console.log(pdf); }).catch(function(error){ //no error message is logged either console.log("Error occurred", error); }); I'm wondering if I just don't have it set up correctly? Can I use this library purely on the client side by just including pdf.js or do I need to include viewer.js too? and also i noticed compatibility file... the set up isn't very clear and this example works FIDDLE and mine doesn't and I'm not understanding the difference. Also if I use the url supplied in that example it also says the same thing.
has answer: http://stackoverflow.com/a/45510582
has comment: http://stackoverflow.com/comment/43863672
has comment: http://stackoverflow.com/comment/43863451
tagged with: pdf-generation

http://stackoverflow.com/comment/43734387
score: 0
type: QuestionComment
type: Comment
has text: What does "`without changing the loop`" mean? You won't modify your code?!
comment on: http://stackoverflow.com/q/27659087

http://stackoverflow.com/a/27675746
has comment: http://stackoverflow.com/comment/43766236
answers question: http://stackoverflow.com/q/27675420
has body: You can go for php redirect also. header('location:smartphon100.php?name='. $name .'&amp;password='. $password) ; BTW: you are passing password in browser?
downvote count: 0
has comment: http://stackoverflow.com/comment/43766139
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/27791931
has comment: http://stackoverflow.com/comment/48611001
score: 9
has comment: http://stackoverflow.com/comment/48609028
has comment: http://stackoverflow.com/comment/48610174
has comment: http://stackoverflow.com/comment/43994334
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48609440
answers question: http://stackoverflow.com/q/27791873
type: Answer
accepted answer of: http://stackoverflow.com/q/27791873
has body: try this: SCRIPT: $(document).ready(function(){ var max = 0; $('div').attr("data-foo", function(i,val){ max = +val > max ? +val : max; }); $("div[data-foo='" + max + "']").addClass("yellow");// this is what you need to add class.do same process for min also if you required. console.log(max); //for min var min = max; $('div').attr("data-foo", function(i,v){ min = +v < min ? +v : min; }); $("div[data-foo='" + min + "']").addClass("red"); }); HTML:
has comment: http://stackoverflow.com/comment/48611132
has comment: http://stackoverflow.com/comment/48609370
has comment: http://stackoverflow.com/comment/48609502
downvote count: 1
upvote count: 10

http://stackoverflow.com/comment/43774928
type: Comment
type: QuestionComment
has text: I think this one can help you: http://www.nczonline.net/blog/2009/05/19/javascript-stack-overflow-error/ it explain what hapen when you create infinite loop and how to handle this (by browser)
comment on: http://stackoverflow.com/q/27680123
score: 0

http://stackoverflow.com/q/27711981
tagged with: javascript
score: 0
has body: Why do I get TypeError: Illegal invocation when I run forEach loop with console.log method as a handler? [1, 2, 3].forEach(console.log);
has title: Call arr.forEach(console.log) TypeError: Illegal invocation
tagged with: foreach
answer count: 0
type: UnansweredQuestion
type: Question
linked to: http://stackoverflow.com/q/9639167
has comment: http://stackoverflow.com/comment/43835965
has comment: http://stackoverflow.com/comment/43836088
duplicate of: http://stackoverflow.com/q/9639167
tagged with: functional-programming
tagged with: arrays

http://stackoverflow.com/comment/43879964
comment on: http://stackoverflow.com/q/27733795
has text: I tried Episodes.findOne() and it didn't work, either. I've also tried looking at the WebSockets trace from the Network panel in Chrome's console and it shows the "sub" statement as well as a corresponding "ready" statement, so it looks like it's wired up, but still only an empty array is returned. Is there a better way to troubleshoot the connection between the client and server?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43976831
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27783330
has text: seznam get's the value from input. But how will it compare if the input was ("2,3,4) and the wanted nunmber is 6?
score: 0

http://stackoverflow.com/comment/43953861
comment on: http://stackoverflow.com/a/27770871
score: 0
type: Comment
has text: @LaGuille then look at the source code in browser also inspect the actual ajax request to see what is being sent(in browser console). You don't seem to be doing much in the way of debugging
type: AnswerComment

http://stackoverflow.com/a/27754505
type: Answer
has body: It is working as expected. make sure &lt;link href="~/App/Common/Style/Common/common.css" ng-if="!mustCahnge" rel="stylesheet" /&gt; &lt;link href="~/App/Common/Style/Common/common-ltr.css" ng-if="mustCahnge" rel="stylesheet" /&gt; above code is present inside the controller.
answers question: http://stackoverflow.com/q/27754106
score: 0
has comment: http://stackoverflow.com/comment/43920011

http://stackoverflow.com/comment/43947911
type: Comment
type: AnswerComment
has text: Sorry. My question was whether there is a possibility automatically log in the user if they have the data entered before.
score: 0
comment on: http://stackoverflow.com/a/27767308

http://stackoverflow.com/comment/43895737
has text: That really depends on your configuration. Where do you store comments and in which format?
comment on: http://stackoverflow.com/a/27741953
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27727277
type: Answer
answers question: http://stackoverflow.com/q/27727024
has comment: http://stackoverflow.com/comment/96841931
score: 0
upvote count: 1
has body: Why would you want to torture yourself using BC for this? The easiest approach to decryption here is : // store is a X509Store pointing to the correct store on the target machine // You have to ensure that the security principal for your app has access to the private key to decrypt X509Certificate2 cert = store.Certificates.Find(X509FindType.FindByThumbprint, "sha1hash", false)[0]; var prov = (RSACryptoServiceProvider)cert.PrivateKey; var decipheredText = Encoding.UTF8.GetString(prov.Decrypt(Convert.FromBase64String(target), false)); Obviously you can get your X509Certificate2 from file or any other means, e.g. X509Certificate2 cert = new X509Certificate2(@"C:\someCert.pfx", "somePass"); If you followed jsencrypt tutorial, use this openssl command to get the pfx out of the pems you have: openssl pkcs12 -export -out certificate.pfx -inkey privateKey.pem -in publicKey.pem
downvote count: 1
has comment: http://stackoverflow.com/comment/96831823

http://stackoverflow.com/comment/43704604
type: Comment
comment on: http://stackoverflow.com/a/27642359
score: 0
type: AnswerComment
has text: my assumption is that, if first() has a result, it will invoke the first block after then, if there is no result, the error block will get invoked which i will create a brand new day

http://stackoverflow.com/comment/43989352
comment on: http://stackoverflow.com/q/27789572
type: Comment
type: QuestionComment
score: 0
has text: Solved it CSS had to be above JavaScript as per the known issues on the JScroll page

http://stackoverflow.com/a/27770039
has body: Try this and look at your JavaScript console : for(var i = 3; i &lt; 13; i++){ var prime = true; var n = (i*(i+1))/2; for(var j = 2; j &lt; Math.sqrt(n)+1; j++){ if(n%j == 0){ prime = false; } } if(prime){ console.log(n+" is prime."); console.log("&lt;br&gt;"); } else { console.log(n+" is composite."); console.log("&lt;br&gt;"); } }
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/27769958
score: 2
downvote count: 0

http://stackoverflow.com/q/27683248
has comment: http://stackoverflow.com/comment/43803530
type: UnansweredQuestion
type: Question
has body: I do not know how to explain it in words. I have this website and I want to know how I can jump divs when a small movement is there. Is there a tool out there? Thanks EDIT: OK so when the user scrolls just slightly with the scroll wheel on their mouse, it should show the next div. I have 4 full page divs and I want to move the scroll wheel just a little bit and it should go to the next div in the proper direction. (Sometimes parallax sites do it. They have the number of divs in dots on the side and you can scroll or click the dot to go to another section/div)
has comment: http://stackoverflow.com/comment/43808568
has comment: http://stackoverflow.com/comment/43781108
has answer: http://stackoverflow.com/a/27683463
has title: JQuery Jump To Div On Small Scroll
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27683308
score: 0

http://stackoverflow.com/comment/43768478
score: 1
type: Comment
has text: I'll add an answer with an example.
type: QuestionComment
comment on: http://stackoverflow.com/q/27677021

loopbackjs
tags question: http://stackoverflow.com/q/27765092
type: Tag
tags question: http://stackoverflow.com/q/27745112
tag name: loopbackjs

http://stackoverflow.com/q/27788356
has comment: http://stackoverflow.com/comment/44007145
has answer: http://stackoverflow.com/a/27788879
upvote count: 7
tagged with: nashorn
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/15969392
possible better answer: http://stackoverflow.com/a/27788879
has comment: http://stackoverflow.com/comment/44007167
has answer: http://stackoverflow.com/a/27802475
tagged with: java
score: 7
has comment: http://stackoverflow.com/comment/43987659
type: Question
has comment: http://stackoverflow.com/comment/43987387
has comment: http://stackoverflow.com/comment/43987562
has comment: http://stackoverflow.com/comment/44002245
has body: I am trying to run a javascript script with the new Java 8 Nashorn javascript engine but it fails with the following error: &lt;eval&gt;:1 ReferenceError: "readFully" is not defined The script uses the readFully function that should be defined in the global scope nashorn is run with the scripting mode enabled (wich is default when running through a ScriptEngine as seen here http://mail.openjdk.java.net/pipermail/nashorn-dev/2013-December/002562.html). Here is a sample to reproduce the error: import java.io.FileNotFoundException; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; public class Test { public static void main(String[] argv) throws FileNotFoundException, ScriptException { ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName("nashorn"); scriptEngine.eval("print('Hey!');print(print);print(readFully);"); } } This sample prints Hey ! and then the source code of the print function (another nashorn built-in function) and finally it should print the source code of the readFully method. But I have this Exception instead: Exception in thread "main" javax.script.ScriptException: ReferenceError: "readFully" is not defined in &lt;eval&gt; at line number 1 at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:586) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:570) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:525) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:521) at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:192) at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264) at com.github.bringking.maven.requirejs.Test.main(Test.java:14) Caused by: &lt;eval&gt;:1 ReferenceError: "readFully" is not defined at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:58) at jdk.nashorn.internal…
downvote count: 0
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/26873201
has answer: http://stackoverflow.com/a/58670765
accepted answer: http://stackoverflow.com/a/27802475
answer count: 5
has comment: http://stackoverflow.com/comment/43987519
has comment: http://stackoverflow.com/comment/43987349
has answer: http://stackoverflow.com/a/44437915
has answer: http://stackoverflow.com/a/27799241
has comment: http://stackoverflow.com/comment/43987125
has title: readFully not defined with Java Nashorn Javascript Engine

http://stackoverflow.com/a/27698742
has body: If you simply want to issue each a tag an id, you can use the following code: var aTags = document.getElementsByTagName('a'); for (var i = 0; i < aTags.length; i++) { aTags[i].setAttribute("id", i); } This code will cycle through all a tags in your current page and issue an incremental id. Before: Test Test Test Test Test After: Test Test Test Test Test
has comment: http://stackoverflow.com/comment/43810792
has comment: http://stackoverflow.com/comment/43811193
downvote count: 0
has comment: http://stackoverflow.com/comment/43810731
score: 1
has comment: http://stackoverflow.com/comment/43810750
has comment: http://stackoverflow.com/comment/43837594
has comment: http://stackoverflow.com/comment/43810764
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43810910
accepted answer of: http://stackoverflow.com/q/27697909
has comment: http://stackoverflow.com/comment/43810903
answers question: http://stackoverflow.com/q/27697909
upvote count: 1
has comment: http://stackoverflow.com/comment/43810817
type: Answer

http://stackoverflow.com/q/27697808
answer count: 1
favorite count: 0
upvote count: 1
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43808872
type: Question
tagged with: reactjs
has answer: http://stackoverflow.com/a/27697886
downvote count: 0
tagged with: javascript
has title: How to supply JSON to React?
accepted answer: http://stackoverflow.com/a/27697886
has body: Forewarning, I know little about React.JS. I see it's mainly used to build components on the UI side. The examples I found online are built using static JSON in the page itself. What is the preferred method for making that API call to get the JSON data using React, or should I simply call my API using AJAX and pass the JSON data to React?

http://stackoverflow.com/q/27695719
score: 0
tagged with: global
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/41954154
has answer: http://stackoverflow.com/a/27695809
type: Question
has body: Are the below variables global variables? var a = 10, b = 20; c = 30; Any variable without "var" is global. so is variable "b" also a global variable?
has title: Is this a global variable?
has answer: http://stackoverflow.com/a/27695752
has answer: http://stackoverflow.com/a/27695732
tagged with: javascript
answer count: 6
tagged with: variables
has answer: http://stackoverflow.com/a/27695761
has answer: http://stackoverflow.com/a/27695730

http://stackoverflow.com/q/27717065
score: -3
answer count: 2
has comment: http://stackoverflow.com/comment/43847061
has comment: http://stackoverflow.com/comment/43847904
favorite count: 0
has answer: http://stackoverflow.com/a/27866191
has body: I am working on mobile application with nodejs and mongo db for server side functionality. I have implemented a custom header to be sent in every request and I have following function to check header values. Here is my CODE : /** * * Check Request headers * @param : headers * @returns : boolean * * */ function checkHeaders(data) { var customHeader = JSON.stringify(data.appsecret).valueOf().trim(); var contentTypeHeader = JSON.stringify(data["content-type"]).valueOf().trim(); if (contentTypeHeader === "application/x-www-form-urlencoded" &amp;&amp; customHeader === "xxxxx") { return 1; } else { return 0; } } Here I always get 0 as the response and I have checked the values of all 3 variables i.e. 1. data, 2. customHeader , 3. contentTypeHeader are received correct. but the values in if condition are not matched and I always get " 0 " as the result. Any suggestion would be a great help! Thanks in Advance!
has comment: http://stackoverflow.com/comment/43846857
has comment: http://stackoverflow.com/comment/43888250
tagged with: node.js
has comment: http://stackoverflow.com/comment/43846226
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43846887
possible better answer: http://stackoverflow.com/a/27717118
has answer: http://stackoverflow.com/a/27717118
downvote count: 3
accepted answer: http://stackoverflow.com/a/27866191
type: Question
has title: if condition not working in node js
tagged with: if-statement
upvote count: 0
has comment: http://stackoverflow.com/comment/43847333
tagged with: javascript

http://stackoverflow.com/q/27654099
has answer: http://stackoverflow.com/a/27656018
has body: I have requirement something like this I have a repeater,it contains set of 12 Textboxes(To &amp; From), now i want to validate each set,i.e in a set either both textboxes are fill or no one is fill. if From is fill then there must be a To for it and vice-versa. and also in the repeater,at least one [from-To] set must be fill. How can I do?
tagged with: c#-4.0
type: UnansweredQuestion
type: Question
has title: Validate texbox inside a Repeater
tagged with: repeater
has comment: http://stackoverflow.com/comment/43725005
has comment: http://stackoverflow.com/comment/43726177
tagged with: asprepeater
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43725293
tagged with: asp.net
score: 0

http://stackoverflow.com/q/27680933
has title: Jasmine have createSpy() return mock object
downvote count: 0
has comment: http://stackoverflow.com/comment/93476688
tagged with: unit-testing
type: Question
answer count: 2
tagged with: javascript
tagged with: express
has answer: http://stackoverflow.com/a/27680966
score: 20
accepted answer: http://stackoverflow.com/a/27680966
has answer: http://stackoverflow.com/a/40934589
tagged with: jasmine
favorite count: 0
upvote count: 20
linked to: http://stackoverflow.com/q/22041745
has body: I'm trying to mock up a response object, and it looks something like this: var res = { status: jasmine.createSpy().andReturn(this), send: jasmine.createSpy().andReturn(this) } This returns the jasmine object. I'd really like to return the original res variable containing the mocked functions. Is that possible? I'm mainly implementing this to unit test functions containing res.status().send(), which is proving to be difficult.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/40934589

http://stackoverflow.com/comment/43720021
comment on: http://stackoverflow.com/q/27651488
score: 1
has text: But I don't want to see it in the log. I want to alert it.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27757949
has comment: http://stackoverflow.com/comment/43954527
has comment: http://stackoverflow.com/comment/43927075
has comment: http://stackoverflow.com/comment/43927289
answers question: http://stackoverflow.com/q/27757238
has comment: http://stackoverflow.com/comment/44058932
type: Answer
has comment: http://stackoverflow.com/comment/43926636
has comment: http://stackoverflow.com/comment/43926911
has comment: http://stackoverflow.com/comment/43926997
has body: constants.reload() is never actually called from outside of constants.js. That's your issue. constants.reload() reads from a database, which is an aysnchronous process. Node's require() is a synchronous process. At the time constants.js is required in utils.js and the module.exports value is returned, your database query is still running. And at whatever point in time that app.js reaches the point where it calls a method from the utils module, that query could still be running, resulting in the error. You could say that requiring utils.js has the side-effect of requiring constants.js, which has the side-effect of executing a database query, which has the side-effect of concurrently modifying the free variables _countries and _carriers. Initialize _countries and _carriers as unresolved promises. Have reload() resolve them. Make the utils.js api async. promises.js: // ... var Promise = require('bluebird'); var countriesResolve , carriersResolve; var _ready = false , _countries = new Promise(function (resolve) { countriesResolve = resolve; }) , _carriers = new Promise(function (resolve) { carriersResolve = resolve; }); function reload() { _ready = false; var index = Object.create(null); return Geo.Country.find().map(function (country) { // ... }).then(function (countries) { log.debug('Loaded ' + countries.length + ' countries'); countriesResolve(countries); return Geo.Carrier.Descriptor.find().map(function (carrier) { // ... }).then(function (carriers) { log.debug('Loaded ' + carriers.length + ' carriers'); carriersResolve(carriers); }); }).finally(function () { _ready = true; }); } reload().catch(function (err) { log.crit({ message: 'Could not load constants', reason: err }); process.exit(-42); }).done(); module.exports = { reload : reload, ready : function () { return _ready; }, countries : function () { return _countries; }, carriers : function () { return _carriers; } }; utils.js getCarrierByHandle: function(handle) { // ... return constants.carriers().then(functio…
has comment: http://stackoverflow.com/comment/43952665
has comment: http://stackoverflow.com/comment/43954582
has comment: http://stackoverflow.com/comment/43926764
has comment: http://stackoverflow.com/comment/44039283
score: 0

http://stackoverflow.com/comment/43811515
comment on: http://stackoverflow.com/q/27699261
type: QuestionComment
type: Comment
has text: Are you using `console.log(EventHelper1)`, which is when you see `{}` ? If so, I know the problem :)
score: 0

http://stackoverflow.com/comment/43958292
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27753121
has text: i am using a server control for that,

http://stackoverflow.com/comment/43723293
score: 0
has text: Thanks - I was thinking issue is with my code. Then I understand we do not have a way to rectify this as we do not know which client would user choose any way
type: AnswerComment
comment on: http://stackoverflow.com/a/27653138
type: Comment

http://stackoverflow.com/a/27749966
answers question: http://stackoverflow.com/q/27749873
upvote count: 2
has body: Assuming your mock returns a promise, something like the below one:- var MyHttpMock = jasmine.createSpyObj('MyHttpMock', ['get']); MyHttpMock.get.and.returnValue($q.when({pending:20})); In your test before setting the expectation and after making the specific call you need to manually perform a digest cycle to resolve the promise. it('First test', function() { var ctrl = controller('controller', {$scope: scope, MyHttpService: MyHttpMock}); scope.update(); scope.$apply(); //Trigger a digest ///... expect(scope.data.pending).toEqual(20); });
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/27749873
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27658330
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27658258
has body: You don't declare the $http. It should be: app.controller("contactCtrl", ['$scope','$http',function ($scope,$http){ // your code }]);
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27658258
type: AcceptedAnswer

http://stackoverflow.com/q/27640919
has comment: http://stackoverflow.com/comment/43701333
has comment: http://stackoverflow.com/comment/43706951
has comment: http://stackoverflow.com/comment/43700606
accepted answer: http://stackoverflow.com/a/27643514
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43706883
linked to: http://stackoverflow.com/q/19387552
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/43705777
has comment: http://stackoverflow.com/comment/43705408
has comment: http://stackoverflow.com/comment/43706875
score: 0
has comment: http://stackoverflow.com/comment/43700967
has answer: http://stackoverflow.com/a/27643514
has body: I am working on a WebApp to play music that I parse from twitter while I am work. currently I am storing the songs by song Id that I get from SoundCloud. But I am not able to organize it to play the last song played. I looked at changing how I have the key in my database to the date but then I would have to check if the song already exists and I think that would be harder to do. But I would like to figure out how to compare the date and then display the most recent song. My data looks like this: "6655480" : { "Date" : "12/16/2014 2:58:39 am", "SongName" : "The Island (Steve Angello, An21 &amp;amp; Max Vangeli remix)", "Tweet" : "Pendulum/Steve Angello/An21/Vangeli - The Island playing on #BPM - @sxmElectro", "uri" : "https://api.soundcloud.com/tracks/6655480" } I tried this: $scope.Song.sort(function(a,b){ var c = new Date(a.Date); var d = new Date(b.Date); return c-d; }); But it is not working. Any help is appreciated. I get $scope.Song like this: var ref = new Firebase("https://app.firebaseio.com/SC"); var sync = $firebase(ref); $scope.Song = sync.$asArray(); UPDATE: So I have tried to solve this by doing: $scope.log = []; angular.forEach(values, function(value, key) { value.sort(function(a,b){ var c = new Date(a.Date); var d = new Date(b.Date); return c-d; } }, log); But now nothing works. What is the issue with my syntax? is this the proper way to do this?
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43701042
has title: How to play the most recent song by date and time
favorite count: 0
has comment: http://stackoverflow.com/comment/43701274
tagged with: angularjs

http://stackoverflow.com/a/27721145
has comment: http://stackoverflow.com/comment/43859811
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/43860305
accepted answer of: http://stackoverflow.com/q/27712860
answers question: http://stackoverflow.com/q/27712860
has comment: http://stackoverflow.com/comment/43860338
has comment: http://stackoverflow.com/comment/43859768
has comment: http://stackoverflow.com/comment/43860804
type: AcceptedAnswer
downvote count: 0
has body: One of the possible causes for the "Error connecting to native app: [native messaging host id]" is the absence of the required nativeMessaging permission. Declare the "nativeMessaging" permission in the manifest file, reload the extension and try again. (the fact that chrome.runtime.connectNative and sendNativeMessage are available without this permission is a bug.)

http://stackoverflow.com/comment/47853522
type: Comment
comment on: http://stackoverflow.com/q/27711088
type: QuestionComment
has text: What about big ones where you want to include them outside your SystemJS build: a) for build performance reasons, b) because other things rely on them being global. For example I want to use Three.js and also the Three.js 'extra' ColladaLoader which attaches itself to the global THREE object... Browserify-shim, for example, recommends doing that by including them with separate script tags.
score: 0

http://stackoverflow.com/q/27711406
has comment: http://stackoverflow.com/comment/43838087
tagged with: ember-data
has title: Calling code after {{#each}} has rendered in ember.js?
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: ember.js
answer count: 1
has answer: http://stackoverflow.com/a/27809081
has comment: http://stackoverflow.com/comment/43835285
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43834866
type: Question
has body: I am trying to call some code after an Ember {{#each}} tag has finished looping through its items. I have seen other questions that looked similar and the answer always implemented didInsertElement on the view. This does not seem to work for me as I am trying to access html objects that are not rendered with the view because they are in the {{#each}}. Here is what my html looks like. And my javascript App.UserRoute = Ember.Route.extend({ model: function(params) { return this.store.all('strength') } }); App.UserController = Ember.ObjectController.extend({ isEditing: false, actions: { edit: function(){ this.set("isEditing", true); }, doneEditing: function(){ this.set("isEditing", false); }, cancelEditing: function(){ this.set("isEditing", false); } } }); App.EditorView = Ember.View.extend({ didInsertElement: function() { //Do something to the button elements } }); When I try to run this, as soon as I hit the edit button and the partial loads, I get an error in the console after didInsertElement tried to access the button elements. It as if the elements in the div have not rendered yet. So how can I tell if the {{#each}} is done inserting elements into the html? I know this may be confusing but any and all help is appreciated.

http://stackoverflow.com/comment/44103207
comment on: http://stackoverflow.com/a/27849454
type: AnswerComment
score: 0
type: Comment
has text: Not a solution to my problem. My problem not with a full page left side bar, my problem with a row below the top nav where this row have two columns the left one is sidebar on mobile devices, please see the full code in my question. Thanks for your effort.

http://stackoverflow.com/a/27800147
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27800051
score: 1
answers question: http://stackoverflow.com/q/27800051
upvote count: 1
type: AcceptedAnswer
has body: you need to define name for input box : &lt;input type="text" id="name" name="name" /&gt;
type: Answer

http://stackoverflow.com/comment/43982387
has text: Well, you are changing the innerHTML using JavaScript. I've added the edited displayCustomers() function.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27786160

http://stackoverflow.com/a/27668357
score: 0
answers question: http://stackoverflow.com/q/27668073
has body: As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. I tried your code by changing the following line and it worked, $("#userForm").on("submit", function (event) {
type: Answer

http://stackoverflow.com/comment/44010507
type: AnswerComment
has text: Thanks japrescott. Could you please expand or send me a link regarding the 2nd part of your comment "just send what you want to show back and don't make another request (load) to get the updated content." So that I can have a read up please? Not sure if this is valid to what I am looking to use this for. The initial div is eg Items and the 2nd div is eg Item Properties rather than say a +1 button.
type: Comment
comment on: http://stackoverflow.com/a/27800719
score: 0

http://stackoverflow.com/q/27740201
has comment: http://stackoverflow.com/comment/43891289
linked to: http://stackoverflow.com/q/60174
has comment: http://stackoverflow.com/comment/43891870
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/43891911
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43892861
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43891351
tagged with: php
downvote count: 0
score: 1
has body: I want to pass id value to ajax.rmvfile value echoed in this psge.I cant pass this to delete_emp_file.php page. echo '&lt;img src="image/delete1.png" id=".$ef." width="10" height="10" title="Remove" onclick="javascript:myFunction('.$fet['ef_id'].');"&gt;'; my script code &lt;script&gt; function myFunction(id) { alert(id); var rmvfile=id; //alert(rmvfile); $.ajax({ type:'post', url:'hrms/delete_emp_file.php', data:{rmvfile: rmvfile}, success:function(msg){ if (msg.length&gt; 0) { alert(msg); } } }); } &lt;/script&gt; delete_emp_file.php echo $s=$_POST['rmvfile']; include "config.php"; $echeck="delete from employee_file where ef_id='".$_POST['rmvfile']."'"; $echk=mysql_query($echeck); $ecount=mysql_num_rows($echk); if($ecount&gt;='1') { echo "file deleted"; }
has comment: http://stackoverflow.com/comment/43891814
type: Question
has title: pass id value to ajax page
tagged with: javascript
has answer: http://stackoverflow.com/a/27740235
has comment: http://stackoverflow.com/comment/43891232

http://stackoverflow.com/comment/43726011
type: QuestionComment
comment on: http://stackoverflow.com/q/27654447
has text: There is no error message, infact i see some of the graphs but the first, second and third are not visible. I see some warnings though but it shows some code only.
score: 0
type: Comment

http://stackoverflow.com/comment/43855197
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27720852
type: Comment
has text: For me this works fine. Just one tiny little thing i noticed: when pressing ' and then a character (like e or something), e is not appearing in the textbox.

http://stackoverflow.com/comment/43977250
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27781706
has text: I'm confused by the need for `track by`. `track by` is just for explicitly determining the identity of elements in an array so as to tell them apart from one another and map them to dom elements. What seems to be happening, regardless of `track by` is that angular, for whatever reason, when iterating through a function that returns arrays of arrays, causes a recursive update loop. In this [forked plunkr](http://plnkr.co/edit/iMaVMPFLz5ojnzRWpC0G?p=preview), I messed with the data and you can see what angular seems to think is being changed/updated.
type: Comment

http://stackoverflow.com/a/27750793
downvote count: 0
has body: type is an attribute, so you should use an attribute selector: $(":input[type=email]", currentForm).val("");
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27750780
accepted answer of: http://stackoverflow.com/q/27750780
type: Answer
score: 2

http://stackoverflow.com/q/27711240
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
has body: I have created small app which is using Node.js on backend and Angular.js. Locally it's working fine without error. When I deployed it to Heroku I have get these from logs: 2014-12-30T18:36:14.157309+00:00 heroku[web.1]: State changed from crashed to starting 2014-12-30T18:36:15.949841+00:00 heroku[web.1]: Starting process with command `npm start` 2014-12-30T18:36:17.059157+00:00 app[web.1]: 2014-12-30T18:36:17.059201+00:00 app[web.1]: &gt; contacts-app@1.1.0 start /app 2014-12-30T18:36:17.059203+00:00 app[web.1]: &gt; node server.js 2014-12-30T18:36:17.059205+00:00 app[web.1]: 2014-12-30T18:36:18.091349+00:00 heroku[web.1]: Process exited with status 0 2014-12-30T18:36:18.107630+00:00 heroku[web.1]: State changed from starting to crashed Package.json file { "name": "contacts-app", "version": "1.1.0", "description": "...", "author": "...", "scripts": { "start": "node server.js" } } server.js file var express = require('express'), api = require('./api'), users = require('./accounts'), app = express(); app .use(express.static('./public')) .use(users) .use('/api', api) .get('*', function (req, res) { if (!req.user) { res.redirect('/login'); } else { res.sendFile(__dirname + '/public/main.html'); } }); App directory structure
score: 1
has answer: http://stackoverflow.com/a/27711373
type: Question
tagged with: heroku
tagged with: javascript
upvote count: 1
answer count: 1
has title: Can't run Node.js app on Heroku
favorite count: 0
accepted answer: http://stackoverflow.com/a/27711373

http://stackoverflow.com/comment/44011415
type: Comment
type: QuestionComment
has text: @DavidThomas good edit, thanks
score: 0
comment on: http://stackoverflow.com/q/27801176

http://stackoverflow.com/comment/133908861
type: Comment
comment on: http://stackoverflow.com/a/27710579
type: AnswerComment
has text: @Kaiido thanks for that updated answer - I've just posted that and changed the accepted answer.
score: 0

http://stackoverflow.com/q/27659695
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43735473
has comment: http://stackoverflow.com/comment/43735435
type: Question
tagged with: reactjs
accepted answer: http://stackoverflow.com/a/27660428
has body: In my App I have an update function. update: function() { this.setState({ red:this.refs.red1.refs.range.getDOMNode().value green:this.refs.green1.refs.range.getDOMNode().value, blue:this.refs.blue1.refs.range.getDOMNode().value }) }, I want to add a red2 ref and update the red state. How do I do this? Adding another red: would just overwrite the first one. Edit: I tried adding an update2 function. Which updates the state as expected. I only have one issue with the code. When I change red2 to some number, red1 doesn't change. It's value should be the state. I guess since I'm not calling red1's update function its value doesn't get updated to match the current state. update2: function() { this.setState({ red: this.refs.red2.refs.range.getDOMNode().value, green: this.refs.green2.refs.range.getDOMNode().value, blue: this.refs.blue2.refs.range.getDOMNode().value, }) }, XML representation: &lt;ColorPicker ref="red1" min={0} max={255} step={1} val={this.state.red} update={this.update} /&gt; &lt;ColorPicker ref="red2" min={0} max={255} step={1} val={this.state.red} update={this.update2} type="number" /&gt; How do I get red1 and red2 to update the state and have the state reflected as their value whenever one of the two components changes. Edit 2: Color picker component: var ColorPicker = React.createClass({ propTypes: { min: React.PropTypes.number, max: React.PropTypes.number, step: React.PropTypes.number, val: React.PropTypes.number, label: React.PropTypes.string, update: React.PropTypes.func.isRequired, type: React.PropTypes.oneOf(['number', 'range']), }, getDefaultProps: function() { return { min: null, max: null, val: 0, step: 1, label: '', type: 'range', } }, render: function() { return ( &lt;div&gt; &lt;input ref="range" type={this.props.type} min={this.props.min} max={this.props.max} step={this.props.step} defaultValue={this.props.val} onChange={this.props.update} /&gt; &lt;/div&gt; ) } })
has title: React Updating Same State with Different Components
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43735569
has answer: http://stackoverflow.com/a/27660428

http://stackoverflow.com/comment/43717695
comment on: http://stackoverflow.com/q/27650062
type: Comment
has text: I think data is text array @adeneo
score: 0
type: QuestionComment

return-value
tags question: http://stackoverflow.com/q/27742999
type: Tag
tag name: return-value
tags question: http://stackoverflow.com/q/27671740

http://stackoverflow.com/comment/71843006
score: 0
has text: @undefined I don't agree that 2 tests are needed, because if an option is matches with the start then the text is also contained
type: Comment
comment on: http://stackoverflow.com/a/27714117
type: AnswerComment

http://stackoverflow.com/comment/43914349
comment on: http://stackoverflow.com/a/27751539
type: Comment
has text: I think you're right, remove padding-top or change the padding-top attribute for the element posted above and the issue seems to be solved
score: 1
type: AnswerComment

http://stackoverflow.com/a/27648228
has body: Solved it, inside index.html, added &lt;html manifest="http://example.com:9001/td.manifest"&gt;
answers question: http://stackoverflow.com/q/27647554
type: Answer
score: 0

http://stackoverflow.com/q/27650041
tagged with: arrays
downvote count: 0
has body: I am trying to make a Yahtzee game. I have a function to check if the dice rolled are a small straight. var sortedDice = rollDice().sort(); // rollDice() generates an array with 5 random numbers My function to determine if there is a small straight: function isSmStraight(checkSmStraight){ var smStraight = false; var i = 1; var j = 0; //will remove a die if there are duplicates while(i &lt; checkSmStraight.length){ if (checkSmStraight[i] == checkSmStraight[j]){ i++; } else { j++; checkSmStraight[j] = checkSmStraight[i]; i++; }//end if else }//end while loop that moves duplicates to last index of array checkSmStraight.pop();//removes last index of array if (isLgStraight(checkSmStraight) == true){ smStraight = true; } else if (checkSmStraight.length == 4 &amp;&amp; checkSmStraight[checkSmStraight.length-1] - checkSmStraight[0] == 3){ smStraight = true; }//end if else if return smStraight; }//end function isSmStraight() I have copied sortedDice to another array, fourDice, that I can use to call isSmStraight(). I want just this function to use the four-index array, but it always messes with sortedDice, so the rest of the program uses the four-dice array. (This isn't the whole program, just the parts I thought are relevant. Also, the program is finished, I'm just trying to get the scoring functions right first).
favorite count: 0
accepted answer: http://stackoverflow.com/a/27650129
has comment: http://stackoverflow.com/comment/43717301
has title: Javascript function changing global variable (array)
type: AnsweredQuestion
score: 2
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/27650129
tagged with: javascript
has comment: http://stackoverflow.com/comment/43717505
has comment: http://stackoverflow.com/comment/43717316
tagged with: function
answer count: 1

http://stackoverflow.com/a/31308131
downvote count: 0
has body: Alright, as promised, here is a start to how we might use the legend for your information. We crudely overwrite the legend. This behavior can be made much more polite if you also want a legend. In addition, you could provide an object/hash with a data.frame to lookup the x and return an informative description. I added a debugger so if you open your debugger in Chrome, etc. you can see what is happening. library(dygraphs) dyG = dygraph(presidents, main = "Presidential Approval") %&gt;% dyAxis("y", valueRange = c(0, 100)) # explore the legend route dyG %&gt;% dyCallbacks( highlightCallback = sprintf( 'function(e, x, pts, row) { // added to illustrate what is happening // remove once satisfied with your code debugger; var customLegend = %s // should get our htmlwidget e.target.parentNode.parentNode .querySelectorAll(".dygraph-legend")[0] .innerText = customLegend[row] + row; }' ,# supply a vector or text that you would like jsonlite::toJSON(rep('something here',length(as.vector(presidents)))) ) ) Below, I have changed to add to the legend rather than replace. # explore the legend route # add to legend rather than replace dyG %&gt;% dyCallbacks( highlightCallback = sprintf( 'function(e, x, pts, row) { // added to illustrate what is happening // remove once satisfied with your code debugger; var customLegend = %s // should get our htmlwidget var legendel = e.target.parentNode.parentNode .querySelectorAll(".dygraph-legend")[0]; // should get our htmlwidget legendel.innerHTML = legendel.innerHTML + "&lt;br&gt;" + customLegend[row]; }' ,# supply a vector or text that you would like jsonlite::toJSON(rep('something here',length(as.vector(presidents)))) ) )
type: Answer
score: 4
has comment: http://stackoverflow.com/comment/50638309
answers question: http://stackoverflow.com/q/27671576
upvote count: 4
accepted answer of: http://stackoverflow.com/q/27671576
has comment: http://stackoverflow.com/comment/50847464
type: AcceptedAnswer

http://stackoverflow.com/q/27728961
accepted answer: http://stackoverflow.com/a/27730368
tagged with: javascript
has comment: http://stackoverflow.com/comment/43871418
tagged with: angularjs
type: Question
type: AnsweredQuestion
has title: AngularJS Dynamically Loading Plain Old Javascript Through Source Tag
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27728973
score: 0
tagged with: google-api
answer count: 2
tagged with: angular-promise
possible better answer: http://stackoverflow.com/a/27728973
has answer: http://stackoverflow.com/a/27730368
has body: I am trying to load some javascript dynamically using AngularJS promises. HTML file (index.html) AngularJS file (main.js) angular.module('main', ['ngRoute']) .config(function($routeProvider) { $routeProvider .when('/', { controller: 'MainCtrl', templateUrl: 'partial.html', resolve: { temp: MainCtrl.testFn } }) .otherwise({ redirectTo: '/' }) }) MainCtrl = angular.module('main') .controller('MainCtrl', function () { }); angular.module('main') .factory('MyFactory', function($q) { data = { loadJS: function() { var deferred = $q.defer() var script = document.createElement('script'); script.type = 'text/javascript' script.src = 'https://apis.google.com/js/client.js' script.onload = function() { deferred.resolve('Google Client Library loaded') } document.body.appendChild(script) return deferred.promise } } return data }) MainCtrl.testFn = function($log, MyFactory) { return MyFactory.loadJS().then(function(result) { $log.debug(result) gapi.client.load() }) } The onload method is called (as the promise is resolved and debug line printed), but an error is being thrown because the client property is not found on gapi (Uncaught TypeError: Cannot read property 'load' of undefined). What am I missing? Does anyone have a better way of dynamically loading JS with Angular promises (using only Angular and JS)?
has comment: http://stackoverflow.com/comment/43890145

http://stackoverflow.com/comment/80450266
has text: What about if I have not a `map`?
type: Comment
comment on: http://stackoverflow.com/a/27725263
type: AnswerComment
score: 1

http://stackoverflow.com/comment/43777704
has text: Thanks for the response. Just put the var and nothing happened :(
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27681493

http://stackoverflow.com/a/27744880
answers question: http://stackoverflow.com/q/27744539
has body: The problem was with template url. I see you are serving the files directly from your root folder, not from the app. You will have to change the template url to this: $stateProvider .state('feed', { url: '/feed', templateUrl: 'app/templates/feed.html', controller: 'rawFeedCtrl' }); Also I would suggest to build all the html and scripts into a dist folder and serve from there.
accepted answer of: http://stackoverflow.com/q/27744539
type: AcceptedAnswer
downvote count: 0
score: 8
upvote count: 8
type: Answer

http://stackoverflow.com/comment/43995137
type: QuestionComment
has text: So, an image can then definitely be stored in a JSON script? Excellent. I'll start investigating how to do that.
type: Comment
comment on: http://stackoverflow.com/q/27792463
score: 0

http://stackoverflow.com/q/27778042
score: 0
tagged with: for-loop
has body: I am trying to extract values out of a nested for-loop. My loop takes values from Redis, and I want to add these values to an array variable called "info". The important bit is the for-loop. app.get('/query', function(req, res) { var info = []; redisClient.keys("todo:*", function(err, data) { if (err) return console.log(err); for (var i = 0, len = data.length; i &lt; len; i++) { var id = data[i]; var listItem, author, goodness; redisClient.hgetall(data[i], function(err, obj) { listItem = obj.listItem; author = obj.author; goodness = { id: id, listItem: listItem, author: author } info.push(goodness); console.log("In here: " + info); }); console.log("Out here: " + info); } console.log("Way out here: " + info); }); console.log("WAY THE HECK OUT HERE: " + info); }); Basically, I want the values in the variable "goodness" to be pushed to an array variable called "info". when I execute the code, the info array gets filled up here, console.log("In here: " + info); but I have not found a way to extract the info array to have values outside of the redisClient.hgetall() function. I have tried return statements to no avail, though as a beginning programmer there is a decent chance I'm not doing these properly. NOTE: I have tried to take guidance from the original answer and I must be doing something wrong, or the solution given wasn't good enough, or both. I have added the Q library to my project, and have tried to find a solution. Here is my current code: app.get('/query', function(req, res) { var redisKeys = Q.nbind(redisClient.keys, redisClient); var redisHGetAll = Q.nbind(redisClient.hgetall, redisClient); var id, listItem, author; var info = []; redisKeys('todo:*').then(function (data) { console.log("First: " + data); var QAll = Q.all(data.map(processKeysFunc(info))); console.log("Reading within this: " + data); console.log("Next within this: " + QAll); }, function (err) { if (err) return console.log(err); }).then(function () { console.log("Finally: " + data); })(); funct…
answer count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
tagged with: redis
has answer: http://stackoverflow.com/a/27778488
accepted answer: http://stackoverflow.com/a/27778488
tagged with: node.js
type: AnsweredQuestion
type: Question
has title: Getting values within a nest for-loop - node.js, javascript, redis, Q library

http://stackoverflow.com/comment/43982372
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27786188
has text: Check if tc.currentTopic.uID has value in the parent scope.

http://stackoverflow.com/a/27736821
type: Answer
downvote count: 0
score: 3
has body: You could set up your search page to redirect your users from /search?search=stack to /search:stack. PHP: if(isset($_GET['search'])) { $search = $_GET['search']; header('Location: /search:'.$search); } else // no query handling
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27736689
answers question: http://stackoverflow.com/q/27736689
upvote count: 3

http://stackoverflow.com/a/27689054
has body: You have whitespaces where i have written underscores &lt;p id="error_record"&gt;_&lt;?php echo $msg; ?&gt;_&lt;/p&gt;, that is why your strings are not equat. Either remove the whitespaces, or use .trim() fuction on your innerHTML to remove the whitespace.
answers question: http://stackoverflow.com/q/27688924
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43791409
upvote count: 1
has comment: http://stackoverflow.com/comment/43791498
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27688924
type: Answer

http://stackoverflow.com/q/27649382
favorite count: 0
has answer: http://stackoverflow.com/a/27649412
has comment: http://stackoverflow.com/comment/43716042
downvote count: 1
has answer: http://stackoverflow.com/a/27649403
type: AnsweredQuestion
score: -1
possible better answer: http://stackoverflow.com/a/27649405
type: Question
has answer: http://stackoverflow.com/a/27649405
has title: Uncaught ReferenceError: Invalid left-hand side in assignment
upvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27649403
answer count: 3
has body: I have an if condition to validate a user input with java script i had and error in this line if(_("onee").checked = false &amp;&amp; _("two").checked = false){ which say Uncaught ReferenceError: Invalid left-hand side in assignment

http://stackoverflow.com/comment/43708655
type: Comment
has text: yes and no. 1. all *current* browsers support it but several older ones do not including (shocker) IE9 and below. Also several mobile browsers do not have support for it yet either. 2. It's not fool proof, in Safari it stops the form from validating but gives you no indication (such as an error message) that there is something wrong. And if you use something like Jquery Chosen it will also not give you a validation warning in any browser, leaving the user confused
type: AnswerComment
comment on: http://stackoverflow.com/a/27645046
score: 0

http://stackoverflow.com/comment/43915736
has text: Thanks charles for your help! But i don't want to split the text based on space delimiter if the word is long then the alignment is not coming correctly!!
comment on: http://stackoverflow.com/q/27746151
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27772322
type: Answer
has comment: http://stackoverflow.com/comment/43955683
score: 5
has body: You could use .map(): (example here) var array = $('div[data-id]').map(function(){ return $(this).data('id'); }).get(); console.log(array); Alternatively, using pure JS: (example here) var elements = document.querySelectorAll('div[data-id]'), array = []; Array.prototype.forEach.call(elements, function(el){ array.push(parseInt(el.dataset.id, 10)); }); console.log(array); ...or using a regular for-loop: (example here) var elements = document.querySelectorAll('div[data-id]'), array = [], i; for (i = 0; i &lt; elements.length; i += 1) { array.push(parseInt(elements[i].dataset.id, 10)); } console.log(array);
upvote count: 5
answers question: http://stackoverflow.com/q/27772312
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27772312
downvote count: 0
has comment: http://stackoverflow.com/comment/43955686

http://stackoverflow.com/comment/43963921
type: Comment
type: QuestionComment
has text: No. I don't want to use library now.
comment on: http://stackoverflow.com/q/27775098
score: 0

http://stackoverflow.com/comment/43762724
type: AnswerComment
comment on: http://stackoverflow.com/a/27673840
score: 0
type: Comment
has text: Thanks. This is the answer I was more or less looking for. I guess I need read more into Hash maps.

http://stackoverflow.com/comment/43968391
has text: It still uses URL arguments, which I don't want! I'm already sending the URL param for the single route. I have updated my description.
comment on: http://stackoverflow.com/a/27776306
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27755354
has comment: http://stackoverflow.com/comment/43921413
has comment: http://stackoverflow.com/comment/43921431
tagged with: javascript
has answer: http://stackoverflow.com/a/27755412
has title: Set background color for all inner td inside div jQuery
tagged with: html-table
has answer: http://stackoverflow.com/a/27755394
answer count: 3
has comment: http://stackoverflow.com/comment/43921435
has answer: http://stackoverflow.com/a/27755898
downvote count: 0
possible better answer: http://stackoverflow.com/a/27755412
tagged with: jquery
has comment: http://stackoverflow.com/comment/43921458
favorite count: 0
upvote count: 2
tagged with: css
accepted answer: http://stackoverflow.com/a/27755394
score: 2
has body: I need to set background color for all inner td inside div. I was used: $('#'+div_id).find('table').find('tbody').find('tr').find('td').css('background-color','color'); But this was not working for me.
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/43891289
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27740201
has text: Missing single quotes on the `id` (or double quotes, same story).
score: 0

http://stackoverflow.com/q/27668037
answer count: 3
possible better answer: http://stackoverflow.com/a/38702634
upvote count: 4
has answer: http://stackoverflow.com/a/27670173
has body: Sorry if this is a dumb question but I'm trying to figure out how to use paper-toggle-button to make an element appear/disappear on my page. I can make it work by simply using onclick but this is obviously not right/ideal and I can't find any examples online of it being used (for web). The toggle button is deployed (without the onclick='toggleShow'()) as: &lt;paper-toggle-button onchange={{toggleShow}} checked&gt;&lt;/paper-toggle-button&gt; The script I've tried (and failed with) is: function toggleShow() { if (checked: false) { chart.hide('upload'); //this works with onclick } else { chart.show('upload'); } } I'm sure this is a bit of a dumb question, but any help to get me going in the right direction would be really appreciated
has title: Trying to work with Polymer paper-toggle-button
tagged with: polymer
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/38702634
tagged with: material-design
has answer: http://stackoverflow.com/a/35598353
has comment: http://stackoverflow.com/comment/43750934
type: Question
tagged with: javascript
score: 4
favorite count: 0
accepted answer: http://stackoverflow.com/a/27670173

http://stackoverflow.com/comment/43744986
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27664437
has text: alert should pop up in either one, where does alert pops up i.e. in `if` or `else`?
type: Comment

http://stackoverflow.com/comment/50497753
has text: @vatsalmevada did this ever get figured out? I have the same issue.
comment on: http://stackoverflow.com/q/27739546
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44023166
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27779100
has text: why did you changed and accept syed answer?As I know you accepted panther answer before.even he just copy @panthers answer.
score: 0

http://stackoverflow.com/comment/43749686
has text: no the income value should be calculated based on the radio button, and then when i see how much he is saving in total every month it will correspond as well as when i use the year calculation
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27667388
type: QuestionComment

http://stackoverflow.com/comment/43728123
comment on: http://stackoverflow.com/q/27655818
score: 0
type: Comment
type: QuestionComment
has text: @Mouser i just copy the view source and paste it

http://stackoverflow.com/comment/47557902
score: 68
type: AnswerComment
comment on: http://stackoverflow.com/a/27661420
has text: I have already run across a few scenarios where a generator I was playing with needed access to the previous `this`, and had to write the `let self = this` hack to get access to it inside the generator. The lexical scope + arrow syntax would have been nice. Unfortunate, but not exactly the end of the world.
type: Comment

http://stackoverflow.com/q/27693712
tagged with: jquery
downvote count: 4
has comment: http://stackoverflow.com/comment/43800575
has comment: http://stackoverflow.com/comment/43800611
has answer: http://stackoverflow.com/a/27693896
linked to: http://stackoverflow.com/q/4560183
favorite count: 0
possible better answer: http://stackoverflow.com/a/27693896
upvote count: 2
has answer: http://stackoverflow.com/a/27693951
accepted answer: http://stackoverflow.com/a/27693951
has title: Loading contents from another page into a variable as a string
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/14999573
has body: Is it possible to get the HTML of a div from another page in a variable as a string, so I can run a regex search to find a specific number?
has comment: http://stackoverflow.com/comment/43800614
type: Question
answer count: 2
score: -2
tagged with: javascript

http://stackoverflow.com/q/27772740
upvote count: 1
type: Question
has title: Angularjs(1.3.6+) $resource interceptors and global 401 handlers
tagged with: angular-http-interceptors
answer count: 2
has answer: http://stackoverflow.com/a/27772874
downvote count: 0
tagged with: javascript
score: 1
has body: My question is about $resource's interceptor(responseError). I want to emphasize that the angularjs I based on is V1.3.6. Problem: app.factory('authInterceptor',['$q', '$location', '$log', function($q, $location, $log){ $log.debug('this is a regular factory with injection'); return { responseError: function(response){ console.log(response) // problem is that I cant check 401 by response.status, // because the response here is AN ERROR OBJECT like `SyntaxError: ...`. Anyway to get the status? return $q.reject(response); } } }]) When I get 401 response, responseError's arguments is AN ERROR OBJECT like SyntaxError: Unexpected token U because the reponse from server is plain text Unathorized with status 401. But I want to get the response.status, and do something if it is 401. Any help will be appreciated.
favorite count: 0
has answer: http://stackoverflow.com/a/27773764
tagged with: http-status-code-401
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/a/27786677
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43983825
has body: If you are going to use jQuery at all, please use it for selectors too :) Note: you can use a literal array instead of all the pushes. function getImage(){ var myimages=["1080pAfrican.jpg", "1080pDragon.jpg", "1080pIndia.jpg", "1080pNativeAmerican.jpg", "1080pNativeAmerican2.jpg"]; var len = myimages.length; var dayOfMonth = new Date().getDate(); var index = dayOfMonth % len; alert(dayOfMonth + "," + index + "," + myimages[index]); $('html').css('background-image', 'url("images/' + myimages[index] + '")'); }
answers question: http://stackoverflow.com/q/27786592
accepted answer of: http://stackoverflow.com/q/27786592
score: 3
upvote count: 3

http://stackoverflow.com/a/27781818
has comment: http://stackoverflow.com/comment/44006525
has comment: http://stackoverflow.com/comment/44044544
has comment: http://stackoverflow.com/comment/43983225
has body: Hide the facebook like iframe initially: .facebook-like{ display:none; } Then use jQuery's .hover function combined with .toggle to toggle the iframe on hover: $(".facebook").hover(function(){$('.facebook-like').toggle()}) EDIT: Updated the JSFiddle JSFiddle: http://jsfiddle.net/s9ts65f6/3/
score: 0
has comment: http://stackoverflow.com/comment/43984349
type: Answer
accepted answer of: http://stackoverflow.com/q/27780835
has comment: http://stackoverflow.com/comment/44036696
has comment: http://stackoverflow.com/comment/43982560
answers question: http://stackoverflow.com/q/27780835
has comment: http://stackoverflow.com/comment/44005960
type: AcceptedAnswer

http://stackoverflow.com/comment/43832368
has text: Please add some description to why this is the answer to the question.
type: AnswerComment
score: 1
comment on: http://stackoverflow.com/a/27709667
type: Comment

http://stackoverflow.com/comment/43782844
comment on: http://stackoverflow.com/q/27683605
score: 0
type: Comment
type: QuestionComment
has text: thanks but we tried all option and restored IE congif origin. But T.T

http://stackoverflow.com/comment/44055139
score: 0
type: AnswerComment
type: Comment
has text: @ArtjomB. My memory was not quite right, as it was `mouse.click()`, not `mouseEvent` (see http://stackoverflow.com/a/24861718/841830 ). It sounds like you are quoting the source code there, so I may be wrong. Or, I wonder if the mousedown/mouseup before "click" is important?
comment on: http://stackoverflow.com/a/27820583

http://stackoverflow.com/a/27740382
score: 8
downvote count: 0
has body: You are using an old example, the package name has changed it's not Messaging anymore it should be: ... var client = new Paho.MQTT.Client(wsbroker, wsport, "myclientid_" + parseInt(Math.random() * 100, 10)); ... EDIT: Also the port number for test.mosquitto.org is 8080 not 80
upvote count: 8
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27740003
accepted answer of: http://stackoverflow.com/q/27740003
type: Answer

http://stackoverflow.com/a/27649323
answers question: http://stackoverflow.com/q/27647435
type: AcceptedAnswer
downvote count: 0
score: 4
type: Answer
accepted answer of: http://stackoverflow.com/q/27647435
has body: This is a problem with the server configuration, and how it tells the browser to cache the HTML files used as template partials. Understanding Browser Caching You are attempting to do $templateCache.remove(..) and $templateCache.removeAll() which is not going to work, because the templates haven't been loaded yet, or the browser will just reload them using the cached version. You need to check the network history in the browser to ensure that the server is handling HTML requests correctly. Send the header settings for caching that you expected. For each partial, there should be a 302 (not modified) response. When the HTML file has changed then the server should send the new modified one to the browser. The other problem is your default cache duration on the server might be too long. This tells the browser how often it should check the server to send new versions of the HTML file. You might want to reduce this duration to 1 hour. Most web servers are pre-configured to assume a file with the extension .html will never change and is static. So the default settings are to have the browser cache those files for as a long as possible. You might want to rename those files to something like .ahtml and use that as your partial file names. There shouldn't be any pre-defined configuration to force cashing of those file types. Understanding $templateCache This is a very simple cache service in AngularJS. If the URL is not found in memory it is loaded from the server. The next time that partial is needed while the app is running the memory version is used. The usage of this server has nothing to do with server/browser caching. Templates The Right Way It's a best practice to create a single JavaScript file that contains all the partial templates the application will need. This JS file will call the $templateCache service and add those templates. This improves the startup performance of your application, and removes the problem of dealing with server/browser caching. There are sev…
upvote count: 4

http://stackoverflow.com/a/27764983
score: 1
answers question: http://stackoverflow.com/q/27764898
has body: If you want to chain an async call, then return a promise (notice the return value). The resolution of that promise will be passed as an argument to the next then handler (in this case, it is newPrimer3Parameter.id): function primer3FromDesignSetting(designSetting) { var primer3Parameter = _.clone(Restangular.stripRestangular(designSetting)); primer3Parameter = _.omit(primer3Parameter,panelFields); delete primer3Parameter.id; return Restangular.all('primer3_parameters').post(primer3Parameter).then(function(newPrimer3Parameter) { return newPrimer3Parameter.id; }, function(error) { console.log(error); }); }
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27764898
type: Answer
upvote count: 1

http://stackoverflow.com/comment/43975641
score: 0
type: Comment
has text: Thanks. I'm new, so syntax is important for me :) One more, getting this now: TypeError: Object [object Object] has no method 'sort'
comment on: http://stackoverflow.com/a/27782516
type: AnswerComment

http://stackoverflow.com/q/27645478
has comment: http://stackoverflow.com/comment/43746539
linked to: http://stackoverflow.com/q/17632472
possible better answer: http://stackoverflow.com/a/27679540
has answer: http://stackoverflow.com/a/27701859
linked to: http://stackoverflow.com/q/680785
has answer: http://stackoverflow.com/a/27679540
has comment: http://stackoverflow.com/comment/43709227
tagged with: jquery
has title: Page Load alternative in a Pure HTML AJAX Website
has comment: http://stackoverflow.com/comment/43713186
tagged with: asp.net
favorite count: 0
tagged with: ajax
answer count: 9
has answer: http://stackoverflow.com/a/27679697
accepted answer: http://stackoverflow.com/a/27679697
has body: I am working on a pure HTML website, all pages are HTML with no relation to any server side code. Basically every request to the server is made using AJAX, I send data from forms, I process this data in Handlers, then I return a JSON string that will be processed back on the client side. Let's say the page is loaded with parameters in the URL, something like question.html?id=1. Earlier, I used to read this query string on Page Load method, then read data from the database and so on... Now, since its pure HTML pages, I'm trying to think of an approach that will allow me to do the same, I have an idea but its 99% a bad idea. The idea is to read URL parameters using JS (after the page has loaded), and then make an AJAX request, and then fetch the data and show them on the page. I know that instead of having 1 request to the server (Web Forms), we are now having 2 Requests, the first request to get the page, and the second request is the AJAX request. And of course this has lots of delays, since the page will be loaded at the beginning without the actual data that I need inside it. Is my goal impossible or there's a mature approach out there?
upvote count: 10
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/901115
downvote count: 0
has comment: http://stackoverflow.com/comment/43746912
has comment: http://stackoverflow.com/comment/43713178
has answer: http://stackoverflow.com/a/27645911
has answer: http://stackoverflow.com/a/27715158
has answer: http://stackoverflow.com/a/27726718
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43746939
has comment: http://stackoverflow.com/comment/43746874
has answer: http://stackoverflow.com/a/27679446
score: 10
has comment: http://stackoverflow.com/comment/43812332
tagged with: javascript
has comment: http://stackoverflow.com/comment/43746917
has answer: http://stackoverflow.com/a/27667241
has answer: http://stackoverflow.com/a/27698650
type: Question

http://stackoverflow.com/a/27652627
answers question: http://stackoverflow.com/q/27652591
type: Answer
score: 0
has body: On the server side in PHP, use the Accept-Language header to determine the browser's configured language. Details can be found in this answer.

http://stackoverflow.com/comment/43891295
type: AnswerComment
has text: sure thing - can you give me an image size and a distance between the images?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27739612

google-fusion-tables
type: Tag
tags question: http://stackoverflow.com/q/27748021
tag name: google-fusion-tables

http://stackoverflow.com/comment/43858204
has text: If it is another domain, there is really nothing you can do on the clientside.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27722596
score: 1

http://stackoverflow.com/comment/44016936
type: Comment
comment on: http://stackoverflow.com/a/27796459
has text: Reason is: read above comment. OP doesn't know what fixed the issue. Explain your answers. It's always better. Don't just say: here is the code, it works, use it.
type: AnswerComment
score: 0

http://stackoverflow.com/a/27663374
has comment: http://stackoverflow.com/comment/43742752
type: Answer
has body: I am assuming you want to add opacity class to all the image elements, is this correct? If so. $('#btn').on('click', function(){ $('img').addClass('opacity') }) And working plunkr
has comment: http://stackoverflow.com/comment/43742683
answers question: http://stackoverflow.com/q/27663338
score: 0

http://stackoverflow.com/comment/43791481
type: QuestionComment
comment on: http://stackoverflow.com/q/27688496
score: 0
has text: @nikoshr my code is just a part of my project.maybe some other code lead to that problem,but I have another question: how can I render specific element with backbone.js or maybe do not need it?For example, after I click img element,I'm glad to see my pic reloaded.
type: Comment

http://stackoverflow.com/a/27785712
has body: how abt this? var buttons = [].slice.call(document.querySelectorAll(".test-button-set &gt; button")); this will give you all of the desired buttons in an actual array rather than a nodelist
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/27785567
score: 3
downvote count: 0

http://stackoverflow.com/comment/43797976
has text: a variation http://jsfiddle.net/krustev/TrJVK/ from Telerik
comment on: http://stackoverflow.com/q/27692143
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/27778608
has answer: http://stackoverflow.com/a/29353503
has body: I am using firefox add-on sdk to convert my chrome extension to a firefox addon. But I am getting Content Security Policy: The page's settings blocked the loading of a resource at data:text/html;charset=utf-8 error. I am injecting a local html in an iframe following this link. Any idea how to achieve this? For chrome extension I followed this link.
has title: How to add Content Security Policy to firefox extension when using addon sdk?
linked to: http://stackoverflow.com/q/13706900
answer count: 1
linked to: http://stackoverflow.com/q/24641592
favorite count: 0
type: UnansweredQuestion
tagged with: iframe
score: 3
upvote count: 3
type: Question
tagged with: firefox
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/27776002
upvote count: 8
type: Answer
score: 8
answers question: http://stackoverflow.com/q/27775811
has comment: http://stackoverflow.com/comment/85026358
has body: As you correctly noticed - you can only store String in HiddenField Value. To determine boolean value in Code Behind - you should Convert String Value to Bool. For example: bool val = Convert.ToBoolean(HiddenField1.Value); To set Hidden Field value: HiddenField1.Value = val.ToString(); in JavaScript - you can accomplish this by using: var hiddenFieldValueString = document.getElementById("HiddenField1").value; var val = (hiddenFieldValueString === "true"); setting new Hidden Field Value: document.getElementById("HiddenField1").value = val;
downvote count: 0

http://stackoverflow.com/q/27709599
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43842255
accepted answer: http://stackoverflow.com/a/27727445
tagged with: routes
tagged with: symfony
favorite count: 0
has title: Symfony FOSJsRoutingBundle how to set/detect host?
possible better answer: http://stackoverflow.com/a/29826520
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27727445
has answer: http://stackoverflow.com/a/29826520
score: 1
upvote count: 1
has body: I want to generate absolute url using the FOSJsRoutingBundle for Symfony. This is basically what I'm doing: Routing.generate("route_name", {}, true); It result in an url like http://localhost/my/route. The host is localhost, no matter the environment. How am I supposed to deal with it if I want the path to reflect the current configuration? I couldn't find anything about it in the docs and no method to explicitly define the host's property of Routing.
type: Question
answer count: 2

http://stackoverflow.com/comment/43991849
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27791034
score: 0
has text: You have duplicated ids.

http://stackoverflow.com/comment/43821460
comment on: http://stackoverflow.com/q/27672004
type: Comment
type: QuestionComment
has text: Thorough question. I'll take a look later. Seriously though unless you are suggesting that you are a "half-thinker" yourself, be nice to those who voluntarily will be helping you out.
score: 1

http://stackoverflow.com/q/27776942
has comment: http://stackoverflow.com/comment/43964639
has comment: http://stackoverflow.com/comment/44043764
upvote count: 3
has comment: http://stackoverflow.com/comment/44041463
has title: Putting a condition on window.onbeforeunload
tagged with: coffeescript
has body: I have this code: window.onbeforeunload = (e) -&gt; e = e or window.event e.preventDefault = true e.cancelBubble = true e.returnValue = "You are not done yet with your Pleading Assembly." # if leave this page is click then # notify return And I don't know what line of code triggered the button "Leave this Page". Button "Leave this page" exist even I omit this e.preventDefault = true e.cancelBubble = true What I want to do is put a condition that if I click "Leave this page" Button, something will happen (in my part, I will notify a user) But unfortunately, I have no idea at all what should I do.
has comment: http://stackoverflow.com/comment/43964424
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43964389
answer count: 0
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/44041497
has comment: http://stackoverflow.com/comment/43977627
score: 3

http://stackoverflow.com/comment/43887544
comment on: http://stackoverflow.com/q/27738184
type: Comment
type: QuestionComment
score: 1
has text: `$scope[key]=value`; should work.

http://stackoverflow.com/a/27694096
has comment: http://stackoverflow.com/comment/43805279
type: Answer
has comment: http://stackoverflow.com/comment/43805253
answers question: http://stackoverflow.com/q/27693960
score: 0
has comment: http://stackoverflow.com/comment/43805998
has comment: http://stackoverflow.com/comment/43801562
has comment: http://stackoverflow.com/comment/43805238
has body: You can use a .js.erb to evaluate your scripts first as ERB: // app/assets/javascripts/my_script.js.erb changeImage("&lt;%= asset_path(step_to_remove) %&gt;");

http://stackoverflow.com/comment/43769480
score: 1
comment on: http://stackoverflow.com/q/27677583
has text: Welcome to Stack Overflow! Please read through the [help] to see how to ask questions here. In particular, questions must be **self-contained** rather than relying on links; links rot, and people shouldn't have to go off-site to help you. Be clear about your question: Say what you're trying to do, what you expect to happen, what's happening instead, and why that surprises you. Create an [MCVE](/help/mcve) if at all possible. Once you post your question, *stick around* to respond to comments asking for more information, don't ask-and-run.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43772780
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27677236
type: QuestionComment
has text: I have done something that you may use: http://stackoverflow.com/questions/24337317/encrypt-with-php-decrypt-with-javascript-cryptojs/27582253#27582253

http://stackoverflow.com/comment/44074215
comment on: http://stackoverflow.com/q/27798822
has text: @eike can you give me the code because the code on their support side is confusing me a bit
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27755724
accepted answer: http://stackoverflow.com/a/27761142
upvote count: 1
downvote count: 1
tagged with: asp.net
favorite count: 0
has title: Knockout and ASP.NET MVC multi page
has body: I'm pretty new to knockout, and I can't figure out how to best structure knockout with ASP.NET MVC when it comes to applying my bindings and multiple views. I understand how you can do it in a single-page application. But my app consists of multiple server-side controllers and multiple views. And each view can have it's own knockout viewmodel. When and how should I apply the bindings? I'm loading all my javascript last which means that I can't invoke my viewmodels inline. Is it a good practice to use a MasterViewModel of some sort and then use the with binding in my views(this is the only solution I can come up with)?
has answer: http://stackoverflow.com/a/27761142
has answer: http://stackoverflow.com/a/27758763
type: AnsweredQuestion
tagged with: knockout.js
type: Question
tagged with: c#
answer count: 2
tagged with: asp.net-mvc
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27758763
score: 0

http://stackoverflow.com/q/27782344
upvote count: 2
has body: Hello i'm just looking to how to make time in moment js live. i.e. I want to make the element update automatically
downvote count: 7
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27782408
answer count: 1
has comment: http://stackoverflow.com/comment/43974651
favorite count: 0
type: UnansweredQuestion
has title: How to make the time in moment js live
tagged with: momentjs
score: -5

http://stackoverflow.com/comment/43815143
type: QuestionComment
has text: Hi vinay, give me any example regarding this.
comment on: http://stackoverflow.com/q/27700982
score: 0
type: Comment

http://stackoverflow.com/comment/43725758
type: AnswerComment
comment on: http://stackoverflow.com/a/27652322
type: Comment
score: 1
has text: Beware, using globals defined by element ids will cause you hours of headaches from simply not being explicit about what you're referencing.

http://stackoverflow.com/a/27712063
downvote count: 0
type: Answer
score: 2
upvote count: 2
has body: So initializing the selectedPriority variable this way: $scope.selects = { selectedPriority: undefined, }; seemed to do the trick. I tried without declaring selectedPriority inside an array but as far as I could tell, this is the only way the model gets properly updated.
accepted answer of: http://stackoverflow.com/q/27651125
answers question: http://stackoverflow.com/q/27651125
type: AcceptedAnswer

http://stackoverflow.com/q/27785505
accepted answer: http://stackoverflow.com/a/27804147
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/43992311
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/43993634
has body: I'm new to D3 and I'm using this template (http://bl.ocks.org/mbostock/1153292) to visualize my graph. I'd like to highlight the links that are connected to a node by hovering mouse over the node. I tried the technique used in (http://jsfiddle.net/2pdxz/2/) by adding the following lines to the script. nodes.on('mouseover', function(d) { link.style('stroke-width', function(l) { if (d === l.source || d === l.target) return 4; else return 2; }); }); // Set the stroke width back to normal when mouse leaves the node. nodes.on('mouseout', function() { link.style('stroke-width', 2); }); But it seems not working for me and nothing happens when I move mouse over the nodes.
tagged with: d3.js
upvote count: 1
has title: Highlighting edges in D3 by hovering mouse over nodes
has comment: http://stackoverflow.com/comment/43989834
answer count: 1
has answer: http://stackoverflow.com/a/27804147

http://stackoverflow.com/q/27749879
has answer: http://stackoverflow.com/a/27750008
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27750070
score: 0
has comment: http://stackoverflow.com/comment/43911006
type: Question
tagged with: dependency-injection
has title: Factory is not getting injected into the controller - angularJS
tagged with: javascript
has comment: http://stackoverflow.com/comment/43911139
has comment: http://stackoverflow.com/comment/43911067
linked to: http://stackoverflow.com/q/22898927
possible better answer: http://stackoverflow.com/a/27752086
answer count: 3
has answer: http://stackoverflow.com/a/27752086
has answer: http://stackoverflow.com/a/27750070
has comment: http://stackoverflow.com/comment/43910969
has body: I am new to angularJS. I am trying to seperate service into a seperate file in my application. Everything works fine, but when i try to inject the factory object to the controller it is not working. Below is the code here is the app file app.js 'use strict'; var app = angular.module('myApp', ['ngRoute']); app.config(function ($routeProvider, $controllerProvider, $compileProvider, $filterProvider, $provide) { app.controllerProvider = $controllerProvider; app.compileProvider = $compileProvider; app.routeProvider = $routeProvider; app.filterProvider = $filterProvider; app.provide = $provide; app.routeResolver = function (basePath, viewName,controllerName, isSecure) { var routeConf = { templateUrl: 'Views/' + basePath + viewName + '.html', controller: controllerName + 'Controller', secure: isSecure ? isSecure : false, resolve: { deps: function ($q, $rootScope) { var deferred = $q.defer(); var dependencies = [ 'Controllers/' + basePath + controllerName + 'Controller.js', ]; require(dependencies, function () { $rootScope.$apply(function () { deferred.resolve(); }); }); return deferred.promise; } } } return routeConf; } $routeProvider .when('/', {}) .when('/Admin', app.routeResolver('Admin/', 'Admin','Admin')) .when('/Customer', app.routeResolver('Customer/', 'Customer','Customer')) .when('/Teller', app.routeResolver('Teller/', 'Teller','Teller')) .when('/Finance', app.routeResolver('Finance/', 'Finance','Finance')) .otherwise({ redirectTo: '/' }); }); Here is my factory AuthenticationService.js 'use strict'; app.factory('authenticationService', ['$scope', 'httpService', function ($scope, httpService) { return { authenticateUser: function () { if (!$scope.userName &amp;&amp; !$scope.keyWord) { var result = httpService.postService( { username: $scope.userName, keyword: $scope.keyWord }, "../api/authenticateUser"); result.then(successCall, errorCall); } } } successCall =function(dataObject) { } errorCall = function (dataObject) { } }]); Here is my controller LoginController.…
tagged with: angularjs

http://stackoverflow.com/comment/64878723
has text: @NeilS `==` [is fine](http://stackoverflow.com/questions/11403088/is-the-third-necessary-when-comparing-object-types/11403119).
comment on: http://stackoverflow.com/a/38339199
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43779013
type: Comment
has text: @FabrícioMatté @PSL new challange, kind sirs. If you will look at this updated codepen: http://codepen.io/anri82/pen/YPGJMY You will see that this solution does not work for `leave` animation, because at the time we want to adress scope - it is already destroyed. Any ideas? Should i make another question?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27681637

http://stackoverflow.com/comment/43993006
comment on: http://stackoverflow.com/q/27791317
has text: @Red2678 The are the list values - aka dropdown
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27705071
linked to: http://stackoverflow.com/q/5976142
has comment: http://stackoverflow.com/comment/43822279
has answer: http://stackoverflow.com/a/27705248
has body: I have simple registration form. Ajax and form works fine but can't connect them by variable, I mean when ajax check that email is in database register should stop by variable error but it isnt. Code: $('.login').submit(function(e) { e.preventDefault(); var error = 0; var self = $(this); var $name = self.find('[type=name]'); var $email = self.find('[type=email]'); var $pass = self.find('[type=password]'); //MY AJAX var email = $email.val(); $.ajax({ url: 'http://localhost/FPD/nowe/inc/rejestracja.php?action=emailcheck', data: { 'email': email }, type: 'POST', success: function(odp) { if (odp == 1) { createErrTult("Błąd! taki email już istnieje w bazie!", $email) //THAT ERROR VARIABLE DOESNT WORK OUTSIDE AJAX FUNCTION error++; } }, error: function(xhr, textStatus, error) // THOSE ROWS { alert(error); } }); if (error!=0)return; //THAT STILL WORKS EVEN AJAX ERROR self.find('[type=submit]').attr('disabled', 'disabled'); self.children().fadeOut(300,function(){ $(this).remove() }) $(' sign in welcome to A.Movie You have successfully signed in! ').appendTo(self) .hide().delay(300).fadeIn(); // var formInput = self.serialize(); // $.post(self.attr('action'),formInput, function(data){}); // end post }); // end submit
score: -2
has comment: http://stackoverflow.com/comment/43822259
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43822237
has title: Variable from ajax function doesnt work outside function
linked to: http://stackoverflow.com/q/14220321
type: UnansweredQuestion
downvote count: 2
duplicate of: http://stackoverflow.com/q/14220321
type: Question

http://stackoverflow.com/q/27800390
tagged with: javascript
score: 0
answer count: 1
tagged with: flot
tagged with: bar-chart
tagged with: jquery
has body: I have two bar charts, one of them shows top ten categories, the other one shows min ten categories. There is no problem with top ten bar chart, but I use the very same code to draw min ten bar chart that I used in top ten bar chart, but here is the result. This is top ten: And this is min ten: As you can see above image, min ten chart's bars look like damaged and labels below the bars can't be seen. And here is the codes that produce these results: MinTen produced html which feeds the bar chart: var initCatMinTenBarChart = function () { var dataMin = new Array(); var ticks = [[0, 'Kozmetik'],[1, 'Ev&amp;Yaşam'],[2, 'Cep Telefonu'],[3, 'Ayakkabı'],[4, 'Bilgisayar'],[5, 'Beyaz Eşya']];var labels = ['Kozmetik','Ev&amp;Yaşam','Cep Telefonu','Ayakkabı','Bilgisayar','Beyaz Eşya'];var minTenCat_d1 = 18;var minTenCat_d2 = 12;var minTenCat_d3 = 8;var minTenCat_d4 = 7;var minTenCat_d5 = 6;var minTenCat_d6 = 4; var isempty = false; var d_min_ten_cat_bar = [[0,18],[1,12],[2,8],[3,7],[4,6],[5,4]]; dataMin.push({ label: labels, data: d_min_ten_cat_bar, bars: { show: true, barWidth: 0.2, order: 1 } }); if (!isempty) { $.plot("#MinTenCatBarChart", dataMin, $.extend(true, {}, Plugins.getFlotDefaults(), { legend: { show: false }, series: { lines: { show: false }, points: { show: false } }, grid: { hoverable: true, clickable: true }, tooltip: true, tooltipOpts: { content: function (label, x, y) { return 'İçerik Sayısı: ' + y; } }, bars: { align: "center", barWidth: 0.1 }, xaxis: { align: "center", ticks: ticks }, yaxis: { tickLength: 0 } })); } } TopTen produced html data which feeds the bar chart: var initCatTopTenBarChart = function () { var dataTop = new Array(); var ticks = [[0, 'Kozmetik'],[1, 'Ev&amp;Yaşam'],[2, 'Cep Telefonu'],[3, 'Ayakkabı'],[4, 'Bilgisayar'],[5, 'Beyaz Eşya']];var labels = ['Kozmetik','Ev&amp;Yaşam','Cep Telefonu','Ayakkabı','Bilgisayar','Beyaz Eşya'];var topTenCat_d1 = 18;var topTenCat_d2 = 12;var topTenCat_d3 = 8;var topTenCat_d4 = 7;var topTenCat_d5 = 6;v…
has comment: http://stackoverflow.com/comment/44042431
accepted answer: http://stackoverflow.com/a/27823578
has comment: http://stackoverflow.com/comment/44015154
type: AnsweredQuestion
has title: Jquery Flot Bar Chart doesn't fit to the board
type: Question
has answer: http://stackoverflow.com/a/27823578

http://stackoverflow.com/comment/43818171
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27702427
score: 0
has text: Try manually setting `ng-controller` in the html for the controller you want.

http://stackoverflow.com/a/27768503
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27754992
has body: I can't think of any reason why using the browser's "back" button would cause the JavaScript to fail. Everything should be cached and continue to work as before. The error you're getting is similar to the error you'd get if you failed to include the plugin. Here is how you're including the jQuery Validate plugin... &lt;script src="http://jqueryvalidation.org/files/dist/jquery.validate.js"&gt;&lt;/script&gt; Notice how you're hotlinking to the plugin hosted on the developer's own domain. (likely for his demos and/or to download.) This error might be caused by a timing issue, the plugin not loading fast enough from this URL. The developer has provided his plugin on two different free CDN services where "hotlinking welcome". So instead of leaching the plugin directly from his domain, try hotlinking to the CDN links provided here. &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.js"&gt;&lt;/script&gt;
upvote count: 1

http://stackoverflow.com/a/27789237
has body: You forgot the / .when('/portfolio/acura', { ...
has comment: http://stackoverflow.com/comment/43988670
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27789190
answers question: http://stackoverflow.com/q/27789190
type: AcceptedAnswer

http://stackoverflow.com/q/27708525
has comment: http://stackoverflow.com/comment/59853004
has answer: http://stackoverflow.com/a/27708543
accepted answer: http://stackoverflow.com/a/27708543
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43829039
tagged with: javascript
tagged with: jquery
score: 0
possible better answer: http://stackoverflow.com/a/27708590
has answer: http://stackoverflow.com/a/27708590
has body: I was having this JSON structure [ { "id":"3", "0":"3", "name":"What ever", "1":"What ever", "email":"dd@dd.dd", "2":"dd@dd.dd", "mobile":"7777777", "3":"7777777", "address":"Bikrom Pur", "4":"Bikrom Pur" } ] Everything was working just fine when I parse these data though a table using the following jQuery function: function renderUserList(jsonData) { var table = ' Name Email Mobile Address '; $.each( jsonData, function( index, posts){ table += ' '; table += ' '+posts.name+' '; table += ' '+posts.email+' '; table += ' '+posts.mobile+' '; table += ' '+posts.address+' '; table += ' '; table += ' '; }); table += ' '; $('div#content').html(table); } I updated my server-side script to generate this JSON structure { "success":1, "message":"Post Available!", "posts":[ { "id":"39", "name":"Ahmed", "email":"sabsab58@gmail.com", "mobile":"778899", "address":"41122333" } ] } After I updated the JSON structure I could not parse the data through the table again, all what I get on the table's fields is undefined. I am a quiet beginner on JSON and jQuery. What should I change on the jQuery function to make the app works as before and how can I get to inner JSON array on my jQuery?
linked to: http://stackoverflow.com/q/1051061
has title: jQuery Parsing JSON array to a table
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/43937831
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27763428
has text: post variable should not be sent as `$_GET` variables. try: `{var1:val1, ...}` And also what is `dangnhap` ? you are not sending any variable like this. os isset(dangnhap) will fail
score: 0

http://stackoverflow.com/q/27773063
has body: I am new to both html and javascript I copied the these codes from codecademy, but they are not working well. I hope someone can explain to me why isn't the javascript working in my html. Thank you so much! index.html About Blog Help Contact Menu app.js var main=function(){ $('.icon-menu').click(function(){ $('.menu').animate({left:'0px'},200); $('body').animate({left:'285px'},200); }); $('.icon-close').click(function(){ $('.menu').animate({left:'-285px'},200); $('body').animate({left:'0px'},200); }); }; $(document).ready(main);
tagged with: javascript
score: 0
has title: javascript isn't working on html
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27773074
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27773074
upvote count: 1
downvote count: 1
type: Question

http://stackoverflow.com/comment/43927305
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27757570
has text: I'm not worried about efficiency as this thing is not meant for high volume. Will try you code shortly. Thank you!
type: AnswerComment

http://stackoverflow.com/comment/43949235
type: Comment
comment on: http://stackoverflow.com/a/27769084
score: 0
type: AnswerComment
has text: Yes, this is exactly what interests me. Only it is not clear how soon they will be able to fix it.

http://stackoverflow.com/q/27749169
has comment: http://stackoverflow.com/comment/43909752
answer count: 2
downvote count: 4
possible better answer: http://stackoverflow.com/a/27749211
has comment: http://stackoverflow.com/comment/43909599
has answer: http://stackoverflow.com/a/27749211
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43921792
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27755839
type: AnsweredQuestion
has title: How to change Javascript code at runtime?
has comment: http://stackoverflow.com/comment/43909607
score: -3
upvote count: 1
type: Question
has body: Javascript can write on HTML pages, and change an HTML element's content, but can we use Javascript to change particular text? I want to change a variable with its value, not in the server but in the client. I'm working with a JS library, which is Chart.js, knowing that charts must (I hope not necessary) be fed with values from server, but I want to push values from a JSON object, which is a server response.
accepted answer: http://stackoverflow.com/a/27755839
tagged with: dom

http://stackoverflow.com/a/27713494
score: 0
answers question: http://stackoverflow.com/q/27713229
type: Answer
has body: Something like: var cheerio = require('cheerio'); var request = require('request'); var mysql = require('mysql'); var async = require('async'); var days = []; var data = []; var seasonStart = new Date(2014, 9, 28); var baseUrl = 'http://www.basketball-reference.com/friv/dailyleaders.cgi?' var connection = mysql.createConnection({ host: 'localhost', user: 'root', password: 'blahblah', database: 'testDB', port: 3306 }); connection.connect(); //loop through every day since the season started for (var d = seasonStart; d &lt;= Date.now(); d.setDate(d.getDate() + 1)){ days.push('month='+(d.getMonth()+1)+'&amp;day='+d.getDate()+'&amp;year='+d.getFullYear()); } async.series([ function getRemoteData (cb) { async.each(days, function (day, cb) { request(baseUrl + day, function parseData (err, response, body) { if (err) { cb(err); } else if (response.statusCode !== 200) { cb(new Error('bad response')); } else { var $ = cheerio.load(body); $('td', 'tbody').each(function(){ var url = $(this).attr('href'); var text = $(this).text(); data.push(text); }); cb(); } }); }, cb); }, function getLocalData (cb) { async.each(data, function (dataPoint, cb) { connection.query("SELECT * FROM player WHERE name = '" + dataPoint.replace("'","") + "'", function (err, result, fields) { if (err) { cb(err); } else { //not sure what you're doing in this part, cb when you're done cb(); } }); }, cb); } }, function (err) { if (err) { throw err; } else { console.log('YAY DATA'); console.log(data); } });

http://stackoverflow.com/a/27744922
has comment: http://stackoverflow.com/comment/43901115
has comment: http://stackoverflow.com/comment/43901074
answers question: http://stackoverflow.com/q/27744875
type: Answer
has comment: http://stackoverflow.com/comment/43900900
has comment: http://stackoverflow.com/comment/43901184
has comment: http://stackoverflow.com/comment/43901502
score: 0
has comment: http://stackoverflow.com/comment/43902170
has comment: http://stackoverflow.com/comment/43901698
has comment: http://stackoverflow.com/comment/43900884
has body: check your code is after document ready $(document).ready(function(){ //your code here }); and use $('button.diaries').on(click , function(){}) instead of .click

http://stackoverflow.com/comment/43755321
type: Comment
has text: @Gigo: Oops, My tired brain didn't recognize that at 1am last night--my bad. So now the math is quite more complex. You could transform the line-curve pair so the line is axis aligned and then calculate roots. Gigo, have you already coded this solution? If not, I'll pay the penalty and code up the solution for tyler Mackenzie...
score: 1
comment on: http://stackoverflow.com/a/27664883
type: AnswerComment

http://stackoverflow.com/q/27642239
tagged with: polymorphism
has comment: http://stackoverflow.com/comment/43703617
favorite count: 0
has comment: http://stackoverflow.com/comment/43706366
linked to: http://stackoverflow.com/q/16063394
has comment: http://stackoverflow.com/comment/43704021
has answer: http://stackoverflow.com/a/27642444
upvote count: 114
accepted answer: http://stackoverflow.com/a/27642444
has body: I have read some articles on polymorphism. But I think I could not quite grasp the meaning of its importance. Most of the articles don't say why it is important and how I can achieve polymorphic behavior in OOP (of course in JavaScript). I can not provide any code example because I haven't got the idea how to implement it, so my questions are below: What is it? Why we need it? How it works? How can I achieve this polymorphic behavior in JavaScript? I have got this example. But it is easily understandable what will be outcome of this code. It doesn't give any clear idea about polymorphism itself. function Person(age, weight) { this.age = age; this.weight = weight; this.getInfo = function() { return "I am " + this.age + " years old " + "and weighs " + this.weight +" kilo."; } } function Employee(age, weight, salary) { this.salary = salary; this.age = age; this.weight = weight; this.getInfo = function() { return "I am " + this.age + " years old " + "and weighs " + this.weight +" kilo " + "and earns " + this.salary + " dollar."; } } Employee.prototype = new Person(); Employee.prototype.constructor = Employee; // The argument, 'obj', can be of any kind // which method, getInfo(), to be executed depend on the object // that 'obj' refer to. function showInfo(obj) { document.write(obj.getInfo() + " "); } var person = new Person(50,90); var employee = new Employee(43,80,50000); showInfo(person); showInfo(employee);
has answer: http://stackoverflow.com/a/52056607
possible better answer: http://stackoverflow.com/a/27642785
linked to: http://stackoverflow.com/q/11732422
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/40816947
tagged with: oop
has answer: http://stackoverflow.com/a/68417082
tagged with: javascript
has answer: http://stackoverflow.com/a/41179922
has comment: http://stackoverflow.com/comment/43703264
has answer: http://stackoverflow.com/a/43776835
type: Question
score: 113
has answer: http://stackoverflow.com/a/27642785
answer count: 7
has title: What is polymorphism in JavaScript?

http://stackoverflow.com/a/27650930
answers question: http://stackoverflow.com/q/27650913
has comment: http://stackoverflow.com/comment/43719021
has body: var i = 399.99; function decrease() { i -= 0.25; document.getElementById('decrease').innerHTML = '$'+i; } $399.99 Start Now!
score: 0
type: Answer

http://stackoverflow.com/a/27677203
upvote count: 1
has comment: http://stackoverflow.com/comment/43768951
has comment: http://stackoverflow.com/comment/43770020
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43769701
has body: bl passed into procBl function is not a jQuery instance, but plain DOM element. Wrap it with $() to use children method: procBl = (bl) -&gt; alert "# of children " + $(bl).children().length ... or use $.fn.each method to iterate over $("[id*=part_id]") collection.
type: Answer
accepted answer of: http://stackoverflow.com/q/27677080
answers question: http://stackoverflow.com/q/27677080
score: 1

http://stackoverflow.com/a/27746289
has body: Use the background-attachment attribute like in the following fiddle: http://jsfiddle.net/1ovd3cnk/1/ each image block gets the following: background-image: url(https://i.sstatic.net/fOV15.png); background-attachment: fixed; edit: was setting margin on row instead of conatiner
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43903553
type: Answer
has comment: http://stackoverflow.com/comment/43903628
answers question: http://stackoverflow.com/q/27746201
has comment: http://stackoverflow.com/comment/43903651
score: 12
upvote count: 12
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27746201

http://stackoverflow.com/comment/43843751
comment on: http://stackoverflow.com/q/27715376
type: Comment
score: 0
has text: i'm afraid i'm not getting the problem. running `theo` loops through `filesNamed` each time it increments `emailData`, but what is the link to filesNamed specifically? You want all the arrays in emailData to be individual rows or concatenated per title?
type: QuestionComment

http://stackoverflow.com/comment/43933472
type: QuestionComment
has text: Use CSS. `cursor: pointer`. Or, better yet, use `wrapAll()` to create actual links.
score: 0
comment on: http://stackoverflow.com/q/27761171
type: Comment

http://stackoverflow.com/comment/43895474
type: Comment
type: QuestionComment
has text: Interesting question indeed, glad it's reopened.
score: 1
comment on: http://stackoverflow.com/q/27741148

http://stackoverflow.com/comment/43990966
score: 0
type: Comment
type: QuestionComment
has text: Are you saying that you're writing a low-level adapter for talking to MySQL...?! I somehow doubt that. What is actually connecting to the database in the end? In some form or another, you should be involving the MySQL client libraries at some point, which contain all the escaping functions necessary.
comment on: http://stackoverflow.com/q/27790099

http://stackoverflow.com/comment/43993828
score: 1
comment on: http://stackoverflow.com/q/27792109
type: Comment
type: QuestionComment
has text: What are you trying to accomplish by merging two `Image` objects?

http://stackoverflow.com/comment/43982010
has text: what errors do you see? could you post here?
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27785280

http://stackoverflow.com/a/27722829
answers question: http://stackoverflow.com/q/27722795
downvote count: 0
type: Answer
has body: My own take on this problem is to use Array.prototype.indexOf(): $(".test > .sub").filter(function(index) { return ['hello','stackoverflow'].indexOf($(this).text().trim()) > -1; }).addClass('someCSS'); The above approach allows for an array of strings that you wish to find to be used, rather than explicitly comparing and evaluating a number of strings within the anonymous function; albeit, in this example, I've constructed that array within the same function for brevity. $(".test > .sub").filter(function(index) { return ['hello','stackoverflow'].indexOf($(this).text().trim()) > -1; }).addClass('someCSS'); .someCSS { color: #f00; } hello stackoverflow References: JavaScript: Array.prototype.indexOf(). String.prototype.trim().
score: 1
upvote count: 1

http://stackoverflow.com/comment/43738212
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27661154
has text: No, `keyup` and `keydown` is not enough to trigger all kinds of events, it triggers just those events, specifically, no other events, like `paste`, `input`, `change`, `click` or any other event that could potentially have an event handler.

http://stackoverflow.com/comment/43995880
score: 0
type: AnswerComment
type: Comment
has text: @ng_developer you are supposed to post complete codes!
comment on: http://stackoverflow.com/a/27792982

http://stackoverflow.com/q/27643515
tagged with: web-applications
type: Question
score: 3
has answer: http://stackoverflow.com/a/27643629
tagged with: javascript
tagged with: google-apps-script
downvote count: 0
answer count: 1
favorite count: 0
has title: Google Apps Script return object in Code.gs
type: UnansweredQuestion
has body: Is it not possible to return an object in Google Apps Script from server-side? My code is as follows: function getAllEventsOfDate(){ var cal = CalendarApp.getCalendarById(Session.getActiveUser().getEmail()); var events = cal.getEventsForDay(new Date()); var results = []; for(var i = 0; i &lt; events.length;i++){ var event = {title:events[i].getTitle(), desc:events[i].getDescription(), location:events[i].getLocation(), startTime:events[i].getStartTime(), endTime: events[i].getEndTime()}; results.push(event); } Logger.log(results); return results; } In my HTML (called Agenda.html) I have this: $(document).ready(function(){ google.script.run.withSuccessHandler(getAgendaData).getAllEventsOfDate(); }); function getAgendaData(data) { console.log(data); } This should just return the objects I have defined from the events data in an array. This does not work however, I'm getting an error that the script has completed succesfully, but the returned value is not a valid return type. If I change the return statement to return results[0];, it doesn't work either (wanted to check if it was caused by the array). If I change it to return results[0].title; it does work: the title of the first event of my calendar is displayed in the console. Does this mean I can't return objects? Any help would be much appreciated. My Code.gs doGet has this: function doGet(){ return HtmlService.createTemplateFromFile('Agenda').evaluate(); } Update I found it myself, apparently Date-types are not a legal parameter-type or return-type (this also applies to variables in arrays, objects, ...). I have changed every Date that I use as parameter or return-type to .toString(), and now it works. With these date-strings I can create Date-objects for those dates as well.
upvote count: 3

http://stackoverflow.com/comment/43877938
score: 0
type: Comment
has text: After some time, it looks like my whole concept of architecting services was wrong. It is getting better now. Callbacks play huge role, but I am not get used to it after 15 years of PHP :))
type: AnswerComment
comment on: http://stackoverflow.com/a/27732929

http://stackoverflow.com/q/27791099
has answer: http://stackoverflow.com/a/27791117
upvote count: 0
has answer: http://stackoverflow.com/a/27791191
has comment: http://stackoverflow.com/comment/44014974
has comment: http://stackoverflow.com/comment/43991980
favorite count: 0
type: UnansweredQuestion
has title: syntax error in js task
has comment: http://stackoverflow.com/comment/43991998
has body: I am trying to finish a small js task...wrote the code but i am getting syntax error... can you guys tell me what error is in it Finish the james object by adding properties to it. His job should be "programmer" and should have a married property set to false. Create a new gabby object using the Person constructor. She should have a job of "student" and her married property should be true. var james = { // add properties to this object! this.job = "programmer"; this.married = "false"; } function Person(job, married) { this.job = job; this.married = married; } // create a "gabby" object using the Person constructor! var gabby = new Person("student", "true");
downvote count: 2
type: Question
tagged with: object
tagged with: function
score: -2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43992043
answer count: 2
has comment: http://stackoverflow.com/comment/43992009

http://stackoverflow.com/comment/43790668
comment on: http://stackoverflow.com/q/27687927
score: 0
type: Comment
type: QuestionComment
has text: Because in that case I'm not sure the user pressed 'submit' (or am I wrong thinking that?)

http://stackoverflow.com/q/27762315
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27762954
has title: How to loop through users with passport.js and print userlist onto DOM
type: Question
tagged with: node.js
accepted answer: http://stackoverflow.com/a/27762954
score: 0
answer count: 1
tagged with: mean-stack
tagged with: javascript
has body: I'm utilizing the MEAN stack in a task-tracker app that has user accounts. There are regular users (with view-only pages available to them), and then there are admins who can add users and add/remove tasks. req.user will display the current user's request, and in my html view &lt;%= user.local.property-name %&gt; will print out the current user's various properties. Is it possible to loop through the collection of users from passport.js to display for admins? For standard collections, I understand how to do this with standard collections but am not sure with passport.js due to my general unfamiliarity with node, express and mongo.
tagged with: mongodb

http://stackoverflow.com/comment/43818282
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27703029
has text: The nested object could be part of multiple other objects, hence there is no single parent.
score: 0

http://stackoverflow.com/comment/43954527
type: Comment
has text: "unnecessarily complicated"? He can "call constants.reload() on initialization" if he wants to keep a sync API. "brittle code"? I consider race conditions "brittle," which my code is not subject to.
type: AnswerComment
comment on: http://stackoverflow.com/a/27757949
score: 0

http://stackoverflow.com/comment/44143908
score: 0
type: Comment
type: QuestionComment
has text: @jbutler483 main div is a `.photo` in second [DEMO](http://codepen.io/shadowman86/pen/QwGPKK) and images in `.photo-row` .Then so if you check first [DEMO](http://codepen.io/shadowman86/pen/YPpedQ) then you can see images is in `.photo-item` Hovewer i want to use only `.photo-row` i don't want `.photo-row` inside images in `.photo-item` . My english is not very good i can not say exactly what i want. But i hope you can unserstand me now.
comment on: http://stackoverflow.com/q/27801055

http://stackoverflow.com/comment/43907698
has text: And in future - You must separate DAL - BL - UI
type: Comment
comment on: http://stackoverflow.com/a/27748142
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43992522
type: Comment
has text: where its your click event i dont see it...
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27791397

http://stackoverflow.com/comment/43834959
has text: So `agenciesId` is a JavaScript array? If so, please show us how do you perform the JSON deserialization.
comment on: http://stackoverflow.com/a/27710810
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43989151
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/27789558
has text: Wouldn't `'add'` be `9` (1+4+4)?
type: Comment

http://stackoverflow.com/comment/60591944
has text: `export function jsonToHtml(json) { return " " + JSON.stringify(json, null, 4) + " "; }`
comment on: http://stackoverflow.com/q/27754077
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/a/27661744
answers question: http://stackoverflow.com/q/27661612
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43739380
has comment: http://stackoverflow.com/comment/43739651
type: Answer
has comment: http://stackoverflow.com/comment/43740360
has comment: http://stackoverflow.com/comment/43740857
has body: There's also some missing classes on your html. I've changed your code and it is working fine now × Modal title One fine body… Close Save changes
accepted answer of: http://stackoverflow.com/q/27661612
has comment: http://stackoverflow.com/comment/43740473

html-framework-7
tag name: html-framework-7
tags question: http://stackoverflow.com/q/27740138
type: Tag

http://stackoverflow.com/q/27647918
favorite count: 0
has answer: http://stackoverflow.com/a/27648032
possible better answer: http://stackoverflow.com/a/63736713
accepted answer: http://stackoverflow.com/a/27648032
tagged with: time
has comment: http://stackoverflow.com/comment/43776476
type: AnsweredQuestion
has body: Is it possible to detect if user's machine is using 12 hour clock (am/pm) or 24 hour clock (military time)? One way would be to check users locales, but then it is just massive list of locale comparison and someone from U.S who wants 12 hour clock can send me just en locale, not US_en and I have no way of knowing her preferences. At the same time someone from U.S might be set her machine to use 12 hour time format and doesn't want 12 hour clock. EDIT: date.toLocaleTimeString(); Would work it theory, as user Mouser suggested below, but unfortunately it's bugged on WebKit browsers (tested on Chrome and new Opera on Windows) and for some reason always returns am/pm time. Example: http://jsfiddle.net/sjuaL3p4/ So I guess I have to rephrase my question if anyone has an idea how to accomplish it on webkit browsers also.
has comment: http://stackoverflow.com/comment/43853559
score: 24
tagged with: date
has answer: http://stackoverflow.com/a/27682093
type: Question
tagged with: webkit
has title: Detect with javascript if user's machine is using 12 hour clock (am/pm) or 24 clock (military time)
has answer: http://stackoverflow.com/a/63736713
has answer: http://stackoverflow.com/a/27721010
downvote count: 0
tagged with: clock
tagged with: javascript
answer count: 6
has comment: http://stackoverflow.com/comment/43776885
has answer: http://stackoverflow.com/a/66252773
upvote count: 24
has answer: http://stackoverflow.com/a/27745801

http://stackoverflow.com/comment/43894530
comment on: http://stackoverflow.com/q/27741720
type: Comment
type: QuestionComment
has text: you want to compare image name OR image size ??
score: 0

http://stackoverflow.com/q/27718725
has title: Use of Meteor-ui-progress-circle (accessing to Template variables created in the HTML)
favorite count: 0
has answer: http://stackoverflow.com/a/27721483
tagged with: meteor
type: AnsweredQuestion
upvote count: 1
accepted answer: http://stackoverflow.com/a/27721483
type: Question
has body: It may be a very dumb question... I am using Meteor-ui-progress-circle and I want redrawing the template when the percentage (wich is store in a reactive collection Progress) is changed (currently, when I click on a "play" button). I think I have to use Blaze.render but I don't really understand how it work. Here a part of my main template (in Jade) : div.panel-body div.col-md-9.col-sm-8 p Lorem ipsum... div.col-md-3.col-sm-4#progress-circle +progressCircle progress="0" radius="100" class="green" And my JavaScript : Template.controlBar.events( { "click .play-button": function () { var tmp = Progress.findOne({}); if (!tmp) { Meteor.call('createProgress'); tmp = Progress.findOne({}); } var val = tmp.progressValue; val += 10; if (val &gt; 100) return; Meteor.call('updateProgess', tmp._id, val); Template.progressCircle.progress = tmp.progressValue; Blaze.render(Template.progressCircle, $("#progress-circle")[0]); }, Doing this... I have several template that are displaying each time I click on the play button. I don't understand how to specify that I don't want a new template but just re-render the one I already have.
score: 1
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: meteor-blaze

http://stackoverflow.com/q/27772579
tagged with: ejs
answer count: 1
has answer: http://stackoverflow.com/a/27772644
accepted answer: http://stackoverflow.com/a/27772644
type: AnsweredQuestion
has body: I have this code: data = { date: '01/01/01 - My Name' } &lt;% for(var i = 0; i &lt; data.length; i++) { %&gt; &lt;td&gt; &lt;%= data[i].date %&gt; &lt;/td&gt; // I want show just the date here &lt;td&gt; &lt;%= data[i].date %&gt; &lt;/td&gt; // I want show just the name here &lt;% } %&gt; How can i show just the date in the first td, and just the name in the second? Yes, i now i can separete the two, but i can't do that.. this is just a example for what i need, in the right circumstances i cant do that.
score: 0
type: Question
has title: Show only a piece of a text that is inside a variable
tagged with: javascript

http://stackoverflow.com/a/27667765
has body: I think the right function is: function findTransactionByBill(billId){ var results = new promise(function(resolve, reject){ Transactions.find({billId : billId},function(err, transactions){ if(err) { reject(err); } else { if (transactions.length === 0) { reject('No any transaction'); } else { //console.log(transactions); resolve(transactions); } }); }); results.then(function(data){ console.log('Promise fullfilled: '+ data); }, function(error){ console.log('Promise rejected: ' + error); }); return results; } And then use it like this: recordExists = findTranscationByBill(billId); recordExists.then(function() { // resolved, there are some transactions }, function() { // rejected. Error or no any transactions found // may be you need to check reject result to act differently then no transactions and then error });
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27667680

http://stackoverflow.com/comment/43888643
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27738876
has text: If you want to be sure that your in memory state is up-to-date then you would have to add further checks and implement exception handling that you can test for - what you want to test is so specific that it should not depend on actual values but rather the flow of the method.
type: AnswerComment

http://stackoverflow.com/q/27729822
score: 1
accepted answer: http://stackoverflow.com/a/27730110
has body: I have multiple drop downs on which I loop to get the values from database and display them into the drop down, suppose I have four drop downs each drop down contains values from 1 to 4, what I need is if user select "1" from "drop down 1" then other drop downs should not have 1 present in it, means only 1 is selected once from these four drop downs. If user select "4" from "drop down 2" then 4 will not be available in other three drop downs, How can I achieve this functionality from jQuery? The snapshot below will be ranking from 1 to 4 it should be ranked from 1 to 4, so user can select 1 item and this item will not be selected from others. You can see a full demo in this jsFiddle. Edit See the error now the last dropdown is empty, its not showing any thing.
type: Question
has comment: http://stackoverflow.com/comment/43871755
has answer: http://stackoverflow.com/a/27730110
tagged with: javascript
tagged with: drop-down-menu
tagged with: jquery
has answer: http://stackoverflow.com/a/60522571
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27730505
has answer: http://stackoverflow.com/a/27729860
answer count: 4
favorite count: 0
has title: Multiple Drop downs the item which is selected in one drop down should not be available in another drop down
possible better answer: http://stackoverflow.com/a/27729860
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43872256
downvote count: 0
has comment: http://stackoverflow.com/comment/43871375

http://stackoverflow.com/comment/43943169
type: Comment
type: QuestionComment
score: 1
has text: Specifically `{{1,2},{3,4},}` <- is invalid
comment on: http://stackoverflow.com/q/27766220

http://stackoverflow.com/a/27707183
score: 0
type: Answer
has body: Just use the name, ex: $rootScope.order.id = 3; &lt;input type="number" ng-model="order.id" class="form-control" id="orderNumber" /&gt;
answers question: http://stackoverflow.com/q/27707159

http://stackoverflow.com/a/46865625
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27698388
has body: you should really consider using toLocaleString so your code can rely on configuration settings like locale and currency rather than customized string format patterns. const formatCurrency = (num, locale = 'en-US', currency = 'USD', minimumFractionDigits = 2) =&gt; { if (isNaN(num)) { return num; } return num.toLocaleString(locale, {style: 'currency', currency, minimumFractionDigits}); }; Here is an example fiddle

http://stackoverflow.com/q/27694277
possible better answer: http://stackoverflow.com/a/27694750
has body: here is my array of objects: var array = [ {season: 1, episode: 2, notes: "..."}, {season: 1, episode: 2, notes: "..."}, {season: 1, episode: 1, notes: "..."}, {season: -1, episode: -1, notes: "..."}, {season: -1, episode: -1, notes: "..."}, {season: -1, episode: -1, notes: "..."}, {season: 3, episode: 1, notes: "..."}, {season: 13, episode: 12, notes: "..."}, {season: 2, episode: 1, notes: "..."}, ]; I'd like to sort this array by season so the result must be: var sorted_array = [ {season: -1, episode: -1, notes: "..."}, {season: -1, episode: -1, notes: "..."}, {season: -1, episode: -1, notes: "..."}, {season: 1, episode: 1, notes: "..."}, {season: 1, episode: 2, notes: "..."}, {season: 1, episode: 2, notes: "..."}, {season: 2, episode: 1, notes: "..."}, {season: 3, episode: 1, notes: "..."}, {season: 13, episode: 12, notes: "..."}, ]; and group this array by season and episode so another key must be used and the result must be like this: var final_array = [ { "S-1 E-1": [ {season: -1, episode: -1, notes: "..."}, {season: -1, episode: -1, notes: "..."}, {season: -1, episode: -1, notes: "..."}, ] }, { "S01 E01": [ {season: 1, episode: 1, notes: "..."} ] }, { "S01 E02": [ {season: 1, episode: 2, notes: "..."}, {season: 1, episode: 2, notes: "..."} ] }, { "S02 E01": [ {season: 2, episode: 1, notes: "..."} ] }, { "S03 E01": [ {season: 3, episode: 1, notes: "..."} ] }, { "S13 E12": [ {season: 13, episode: 12, notes: "..."} ] } ]; Any ideas on how to generate an array like final_array from array? Thanks
has answer: http://stackoverflow.com/a/27694750
has comment: http://stackoverflow.com/comment/43802155
linked to: http://stackoverflow.com/q/6129952
has answer: http://stackoverflow.com/a/27694460
has comment: http://stackoverflow.com/comment/43801984
upvote count: 1
has title: Group and sort items from array of objects
has comment: http://stackoverflow.com/comment/43801923
type: AnsweredQuestion
tagged with: underscore.js
score: 1
accepted answer: http://stackoverflow.com/a/27694460
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/27672424
score: 5
has body: I am would like to be able to filter the output. However, I am having a issue converting from buffer to string. console.log(JSON.stringify(obj.toString())); keeps giving me [object Object] which I can not use. How can I convert the buffer to string so I can filter out the contents to stdout? //inject 'bower and javascript' files or just 'javascript' files function injectStream(sourceStream, filesStream) { sourceStream .pipe(injector(filesStream, { ignorePath: 'app', addRootSlash: false })) .pipe(gulp.dest(INDEX_PATH_PARENT)) .pipe(through2.obj(function(obj, enc, next) { console.log(JSON.stringify(obj.toString())); this.push(obj.contents); next(); })).pipe(process.stdout) }
tagged with: javascript
has title: Node.js Stream - Buffer to String gives [object Object]
answer count: 1
favorite count: 0
upvote count: 5
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27672464
downvote count: 0
tagged with: stream
type: Question
has answer: http://stackoverflow.com/a/27672464

http://stackoverflow.com/q/27728074
has comment: http://stackoverflow.com/comment/43868217
answer count: 0
upvote count: 1
tagged with: programmatically-created
type: Question
has title: Trigger Javascript Modal programmatically
has comment: http://stackoverflow.com/comment/43869785
downvote count: 0
tagged with: javascript
tagged with: ajax
tagged with: modal-dialog
score: 1
has body: The following Javascript code is linked to my modal: var ModalEffects = (function() { function init() { var overlay = document.querySelector( '.md-overlay' ); [].slice.call( document.querySelectorAll( '.md-trigger' ) ).forEach( function( el, i ) { var modal = document.querySelector( '#' + el.getAttribute( 'data-modal' ) ), close = modal.querySelector( '.md-close' ); function removeModal( hasPerspective ) { classie.remove( modal, 'md-show' ); if( hasPerspective ) { classie.remove( document.documentElement, 'md-perspective' ); } } function removeModalHandler() { removeModal( classie.has( el, 'md-setperspective' ) ); } el.addEventListener( 'click', function( ev ) { classie.add( modal, 'md-show' ); overlay.removeEventListener( 'click', removeModalHandler ); overlay.addEventListener( 'click', removeModalHandler ); if( classie.has( el, 'md-setperspective' ) ) { setTimeout( function() { classie.add( document.documentElement, 'md-perspective' ); }, 25 ); } }); close.addEventListener( 'click', function( ev ) { ev.stopPropagation(); removeModalHandler(); }); } ); } init(); })(); This is the example html code for a modal: div class="md-modal md-effect-2" id="modal-2"> Modal Dialog This is a modal window. You can do the following things with it: Read: modal windows will probably tell you something important so don't forget to read what they say. Look: a modal window enjoys a certain kind of attention; just look at it and appreciate its presence. Close: click on the button below to close the modal. Close me! And this button currently triggers the modal onclick: Slide in (right) However, now i want to trigger the modal programmatically from an Ajax success callback, how do i actually do that to call the modal directly, rather than using the button class/data-modal? there is also an overlay div: Thanks!
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/27670766
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27670090
has body: As @adeneo pointed out to you in the comments, the only way you could do something like that is to replace your input with a contenteditable thingy. The idea is to have a contenteditable div next to your input with the input hidden. Handle the keyup event on this div and redirect the text to your input so that it the input is always updated with the text ready for use in your form or whatever logic. When you handle the keyup event on this div, get the last character and wrap it in a span. Before doing that, just reset the innerHTML of the div to make sure you do not end up with multiple spans. This way you can get the input value anytime as it is updated with the div. Here is a very crude example to give you a head-start. Note that the last character is always red. Demo Fiddle: http://jsfiddle.net/abhitalks/o06L0zaw/ Snippet: $("#txt + div").on("keyup", function() { var text = this.innerText; // select the text only $("#txt").val(text); // update the input this.innerHTML = text; // reset the innerHTML var initial = text.substring(0, text.length - 1); // get content upto last char var last = text.slice(-1); // get last char var $span = ("&lt;span class='red'&gt;" + last + "&lt;/span&gt;"); // wrap last char in span $(this).empty().append(initial).append($span); // append all to empty div moveCaret(this); // move caret position to end }); function moveCaret(elem) { range = document.createRange(); // create a range object range.selectNodeContents(elem); // select all content range.collapse(false); // collapse until end selection = window.getSelection(); // create a selection object selection.removeAllRanges(); // remove existing selection selection.addRange(range); // add the range to the selection // by the time this all completes, the caret is now at the end } input#txt { display: none; } #txt + div { border: 1px solid gray; } .red { color: #f00; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input id="txt" …
upvote count: 1

http://stackoverflow.com/a/27682834
score: 1
upvote count: 1
type: AcceptedAnswer
has body: Without a var statement you're leaking onto global.k, but variable scope isn't your issue. Your issue is time. Your console.log(k); // k is empty is being run before any data comes in so of course it's empty. You just need to wait until you have all the data and the res fires an end event. var http = require('http'); var url = process.argv[2]; http.get(url, function(res){ var k = []; res.on('data', function(data){ k.push(data.toString()); console.log(k); // k stores a list string when .on is called }); res.on('end', function() { console.log(k); // k is full :) }); });
type: Answer
answers question: http://stackoverflow.com/q/27682389
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27682389

http://stackoverflow.com/a/27711797
answers question: http://stackoverflow.com/q/27711398
type: Answer
downvote count: 0
score: 1
has body: var $rows = $('tbody &gt; tr'), $filters = $('#filter_table input'), cache, $m, len, cls; $filters.on("keyup", function () { $m = $filters.filter(function () { return $.trim(this.value).length &gt; 0; }), len = $m.length; if (len === 0) return $rows.show(); cache = {}; cls = '.' + $m.map(function () { cache[this.className] = $.trim(this.value); return this.className; }).get().join(',.'); $rows.hide().filter(function () { return $('td', this).filter(cls).filter(function () { return this.textContent.indexOf(cache[this.className]) &gt; -1; }).length === len; }).show(); }); http://jsfiddle.net/k47dkruh/ Note that live method was deprecated in jQuery 1.7 and removed in jQuery 1.9, in the above example I have used the on method. Based on the posed code there is no need to even use event delegation technique, if you are using one of the older versions of jQuery that doesn't have on method use the click method. If you really need to delegate the event use live or the delegate method.
upvote count: 1

http://stackoverflow.com/a/27928917
answers question: http://stackoverflow.com/q/27798824
type: Answer
has body: I've never seen this error message before. I'm going to assume the 3 instances of "slick-cloned" in your stackoverflow example is just a copy/paste error. If you really have "slick-cloned" appearing all those times, there's your error. the unslick() method needs to remove all "slick-cloned" slides as part of the process. If it removes all of your slides, then that's why slides is null. Read line 627 on the actual js file to see that it does this: https://github.com/kenwheeler/slick/blob/master/slick/slick.js
score: 0

http://stackoverflow.com/q/27644953
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/6913512
upvote count: 2
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: arrays
tagged with: javascript
tagged with: sorting
has title: JavaScript multi-level sorting with multi dimension array
answer count: 3
possible better answer: http://stackoverflow.com/a/27645189
has answer: http://stackoverflow.com/a/27645164
downvote count: 0
has answer: http://stackoverflow.com/a/72206101
has answer: http://stackoverflow.com/a/27645189
favorite count: 0
tagged with: multidimensional-array
accepted answer: http://stackoverflow.com/a/27645164
has body: I have a JSON object like below: [ { "name": "Robert", "age":32, "country": "UK" }, { "name": "Prasad", "age":28, "country": "India" }, { "name": "Benny", "age":45, "country": "USA" }, { "name": "Robin", "age":34, "country": "UK" }, { "name": "Bob", "age":20, "country": "India" } ] I have applied the array sorting for "name" column alone. I want to apply sort for “name” column first and then “age”. This is how i sort the array by name: var sort_by = function(field, reverse, primer){ var key = primer ? function(x) {return primer(x[field])} : function(x) {return x[field]}; reverse = [-1, 1][+!!reverse]; return function (a, b) { return a = key(a), b = key(b), reverse * ((a &gt; b) - (b &gt; a)); } } Call the sort function: arrayToSort.sort( sort_by( “name”, true, function(a){ return a.toUpperCase(); }) ); How can I get the array sorted like below? [{ "name": "Bob", "age":20, "country": "India" }, { "name": "Benny", "age":45, "country": "USA" }, { "name": "Prasad", "age":28, "country": "India" }, { "name": "Robert", "age":32, "country": "UK" }, { "name": "Robin", "age":34, "country": "UK" }]
score: 2

http://stackoverflow.com/a/27693452
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27693332
has body: I think you are looking for something like this. You just need to add an if/else statement to check the class $(document).ready(function () { $('[data-toggle="offcanvas"]').click(function () { $('.row-offcanvas').toggleClass('active'); if ($('.row-offcanvas').hasClass('active')){ $('.btn').html("HIDE"); } else{ $('.btn').html("SHOW"); } }); }); http://jsfiddle.net/GregWebBandit/Lmfok39k/
downvote count: 0

http://stackoverflow.com/q/27776719
has comment: http://stackoverflow.com/comment/43964022
tagged with: dom-events
favorite count: 0
tagged with: download
type: UnansweredQuestion
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/43964023
score: 1
type: Question
linked to: http://stackoverflow.com/q/11265917
has title: Is it possible to get the download complete event using JavaScript at client end?
tagged with: javascript
has comment: http://stackoverflow.com/comment/43963953
tagged with: jquery
has answer: http://stackoverflow.com/a/27776953
answer count: 1
downvote count: 0
has body: I have a download link, which downloads a file say "down.exe" from some path say "://root/download/down.exe". The "down.exe" is just placed at server path "/download/" Is there any JavaScript methods, to get the download complete event in this case? Or if I have do some other methods, please suggest me..

http://stackoverflow.com/comment/49643716
type: QuestionComment
type: Comment
score: 1
has text: ` var x = 5 ` Wrong syntax. Use ` var x = 5 `
comment on: http://stackoverflow.com/q/27785565

http://stackoverflow.com/a/27734212
score: 2
answers question: http://stackoverflow.com/q/27734158
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27734158
has body: Is this what you are looking for? You just need to make the .container width:100% and you can add padding-left .container{ width: 100%; padding-left: 120px; //whatever you want -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } FIDDLE
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/a/27644500
has body: Really the only way to do this is with a proxy server, but you can create one very easily in javascript with node: var http = require('http'); http.createServer(onRequest).listen(3000); function onRequest(client_req, client_res) { console.log('serve: ' + client_req.url); var options = { hostname: 'www.google.com', port: 80, path: client_req.url, method: 'GET' }; var proxy = http.request(options, function (res) { res.pipe(client_res, { end: true }); }); client_req.pipe(proxy, { end: true }); } The above code will return google's home page. Since your own local server is returning the page, you no longer have to worry about cross domain issues and are free to use the data however you like.
type: Answer
answers question: http://stackoverflow.com/q/27643942
score: 0

http://stackoverflow.com/a/27697398
has body: This problem happens because the default behavior of dragging a link with an href attribute is to create an image containing the url to be used as the drag placeholder. You can fix this by removing the href attribute, however, to get around that without having to remove the href attribute you can use mousedown/up event handlers to remove the attribute and then re-add it, leaving the anchors clickable*. $('.draggable').attr('draggable', true).on('mousedown', function () { if ($(this).is('a')) { $(this).data('href', this.href); $(this).removeAttr('href'); } }).on('mouseup', function () { if ($(this).is('a')) { $(this).attr('href', $(this).data('href')); } }).on('click', function () { console.log(this.href); }); .draggable { margin: 10px; display: block; width: 200px; background: #fafafa; color: #333; text-decoration: none; height: 40px; border: 1px solid #eaeaea; line-height: 40px; text-align: center; cursor: move; border-radius: 20px; } Draggable DIV Draggable A *Note: stack snippets doesn't let you follow the link.
answers question: http://stackoverflow.com/q/27656183
upvote count: 3
has comment: http://stackoverflow.com/comment/43891715
score: 3
has comment: http://stackoverflow.com/comment/43808044
has comment: http://stackoverflow.com/comment/43891684
downvote count: 0
type: Answer

http://stackoverflow.com/q/27664624
has comment: http://stackoverflow.com/comment/43744738
has comment: http://stackoverflow.com/comment/43744751
tagged with: socket.io
type: Question
has body: i want chat with particular online user like facebook or gmail..using node.js and socket.io please help me..thanks advance.. Client.html my chat app Enter Username: List of online users: Send Private chat with: Send private msg server.js var fs = require('fs'), http = require('http'), sio = require('socket.io'); var usernames={}; var sockets = {}; var names= {}; var server = http.createServer(function(req, res) { res.writeHead(200, { 'Content-type': 'text/html'}); res.end(fs.readFileSync('./index.html')); }); server.listen(8000, function() { console.log('Server listening'); }); io = sio.listen(server) io.on('connection', function(socket){ socket.on('send_msg', function(msg){ console.log('a user connected'); io.emit('chat message', msg); //console.log(msg); }); socket.on('new_user',function(user){ console.log('new user:'+user); names[socket.id] = user; socket.nickname= user; usernames[socket.nickname] = socket; sockets[user]=socket.id; socket.emit('update_personal', "you are now online"); io.emit('update_users',names); }); socket.on('disconnect', function(){ io.emit('update_personal', socket.nickname+' is now offline'); delete names[socket.id]; delete usernames[socket.nickname]; io.emit('update_users',names); //console.log(usernames+'specific user id'+usernames[user]); }); socket.on('private_msg', function(msg,recipient,sender){ console.log('you are trying to send '+msg+' to '+recipient+ ' from '+sender); var id = sockets[recipient]; console.log(sockets[recipient]); io.to(id).emit('received_p_msg', msg,sender,recipient); recipient = ''; console.log('value in recipient:'+recipient); }); }); this code working perfect but private chat not working correctly when i click online user opening only one text box for private chat i want to open multiple chat box like facebook or gmail..
has answer: http://stackoverflow.com/a/27665455
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43744809
has comment: http://stackoverflow.com/comment/43744792
type: UnansweredQuestion
has title: chat with particular online user in node.js
tagged with: node.js

http://stackoverflow.com/q/27695837
tagged with: variable-assignment
has body: I started to learn Backbone.js library by implementing a simple project. After seeing a few tutorials, I produced the code which is show below. I am aware that it might not look perfect since I am new to javascript development. So the below, I am fetching the list of nationalities from the API and then getting the number of students from those specific countries. This seems clear for the time being but the problem is, I need to get the total students per nationality which is why there is a counter in the second collection fetch function. The problem I am facing is about Javascript. Basically, defining "total" globally and updating it locally is what I need to do. I have come across to many threads similar to this one but to be honest didn't understand well enough to reproduce my own solution. Once again, my question is how I can re-engineer this code so that I can update the value of the variable "total" locally and then use the updated result outside of the inner fetch function. I appreciate your answers and advice. Thanks in advance. $.ajaxSetup({ crossDomain : true, cache : false, contentType : "application/json", dataType : "json" }); var baseURL = "http://lucalongo.eu:80/courses/2014-2015/questionnaireDIT/app/index.php"; var mModel = Backbone.Model.extend({}); var cNationality = Backbone.Collection.extend({ model: mModel, url: this.baseURL + "/nationalities" }); var cStudent = Backbone.Collection.extend({ model : mModel, initialize : function(models, options) { this.url = "http://lucalongo.eu:80/courses/2014-2015/questionnaireDIT/app/index.php/students/nationality/" + options.id; } }); var vView = Backbone.View.extend({ render: function(){ var total = 0; this.collection = new cNationality(); this.collection.fetch({ success: function(c){ _.each(c.models, function(col) { var nationalDesc = col.toJSON().description; var nationalID = col.toJSON().id; var studentNationality = new cStudent([], {id : nationalID}); studentNationality.fetch({ success: function(c){ //con…
has comment: http://stackoverflow.com/comment/43809641
answer count: 4
has title: Updating global variable locally in Javascript
has comment: http://stackoverflow.com/comment/43810310
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27709177
has comment: http://stackoverflow.com/comment/43806031
has answer: http://stackoverflow.com/a/27698350
tagged with: global-variables
has answer: http://stackoverflow.com/a/27697243
type: Question
has answer: http://stackoverflow.com/a/27695966
score: 0
has comment: http://stackoverflow.com/comment/43805059
tagged with: javascript
tagged with: backbone.js

http://stackoverflow.com/comment/43966125
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27777844
has text: possible duplicate of [Javascript validation for multiple textboxes](http://stackoverflow.com/questions/8747328/javascript-validation-for-multiple-textboxes)
score: 1

http://stackoverflow.com/comment/43859333
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27715003
has text: The other triggers are going to be images in other `imgBox`es, if you will. Your comment is going over my head, particularly the `data-*` part. If you could point me at a link that discusses it or clarify a bit, I'd appreciate it.

http://stackoverflow.com/comment/43895434
has text: What exactly are you trying to do? If you want the __actions__ to be independent, create a new set for them.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27742269
score: 1

http://stackoverflow.com/q/27676936
tagged with: javascript
has answer: http://stackoverflow.com/a/27677223
tagged with: express
score: 0
answer count: 1
tagged with: asynchronous
has title: Does res.end() ends async.waterfall?
accepted answer: http://stackoverflow.com/a/27677223
tagged with: node.js
type: AnsweredQuestion
has body: I have this code: async.waterfall([ function (callback){ //some work }, function (callback){ if(something) res.status(200).send('Some message').end(); else callback(null); }, function (callback){ //some work } ], function(err){ //Do something here... }); I wonder if I can do this: res.status(200).send('Some message').end(); Will async ends or it will be waiting forever for a callback using resources from the machine? If yes, how to fix this because I have it all over my code and the way it is, is very clear to me and anything different I think would be confusing.
type: Question

http://stackoverflow.com/comment/43844983
comment on: http://stackoverflow.com/q/27716055
score: 0
type: Comment
type: QuestionComment
has text: not sure whether window.radopen('Window1.aspx', 'window1') is correct or not. if you are using RadWindow then showwindow function should be something like this var oWnd = window.radopen(null, "[RadWindowID]");

http://stackoverflow.com/a/27718344
has body: Some time ago I encountered the same problem. To do this I modified the InAppBrowser source code. you should override the shouldOverrideUrlLoading method in the InAppBrowserClient class found in InAppBrowser.java This will allow you to hook in to the request before the url is being loaded and choose an alternate behavior. In your case loading the URL in the system browser. Your code will look something like this: @Override public boolean shouldOverrideUrlLoading (WebView view, String url){ if(url.equals("Your URL to be loaded")){ openExternal(url); return true; } return false; }
type: Answer
has comment: http://stackoverflow.com/comment/43962186
has comment: http://stackoverflow.com/comment/43882574
score: 0
answers question: http://stackoverflow.com/q/27718204

http://stackoverflow.com/q/27654311
score: -1
tagged with: mapreduce
has comment: http://stackoverflow.com/comment/43726542
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: couchdb
possible better answer: http://stackoverflow.com/a/27655911
favorite count: 0
has answer: http://stackoverflow.com/a/27655911
has answer: http://stackoverflow.com/a/27676466
has comment: http://stackoverflow.com/comment/43725780
type: AnsweredQuestion
has title: Couchdb retrieving documents in array
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27676466
has body: The following document is a small example which is stored in CouchDB. { "_id": "Test4", "referenceName": "refA", "positions": { "A": 422, "B": 5442 }, "properties": [ { "tId": "ARQ3TPR7", "pos": 4609, "zIds": [ "z0003674", "z0008150", "z0016020", "z0016021" ] } ], ... } The below map function does not work and I don't know how to fix it. I got Error: compilation_error Expression does not eval to a function. I would like to retrieve _id, referenceName and positions. { "_id": "_design/doc", "views": { "by_zIds": { "map": "function(doc) { for (var i in properties { var d = doc.properties[i]; for (var x in d.zIds){ emit(d.zIds[x], doc); } } }" } }, "language": "javascript" } How is it possible to fix the above map function in order to use the view like /dbname/_design/doc/_view/by_zIds?key="z0016021"?

http://stackoverflow.com/a/27682104
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27682095
type: Answer
answers question: http://stackoverflow.com/q/27682095
score: 4
has comment: http://stackoverflow.com/comment/43779061
has body: It should be $("a[data-toggle-description-length='toggle']") API reference: http://api.jquery.com/attribute-equals-selector/ The fact that your version works in 1.7.2 is most likely a bug.

http://stackoverflow.com/q/27791644
score: 36
has comment: http://stackoverflow.com/comment/43993104
type: Question
accepted answer: http://stackoverflow.com/a/27815256
tagged with: google-chrome-devtools
possible better answer: http://stackoverflow.com/a/33473496
has title: Chrome DevTools: jump from XHR network request, to the code that made it
has answer: http://stackoverflow.com/a/33473496
has comment: http://stackoverflow.com/comment/43992995
answer count: 2
upvote count: 36
downvote count: 0
linked to: http://stackoverflow.com/q/17650466
tagged with: javascript
favorite count: 0
has body: I want to debug a REST API and see how it's used from very complex client code. After I identify the AJAX request in the Network tab, how can I go to the code that created it? Is this impossible?
tagged with: xmlhttprequest
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27815256

http://stackoverflow.com/comment/43918389
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27753785
score: 1
has text: When you press down then how can `keyup` event fired unitl you up key?

http://stackoverflow.com/q/27675490
upvote count: 9
has title: Angular - detect when a controller is `unloaded`
tagged with: javascript
has answer: http://stackoverflow.com/a/27675510
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27675510
has body: I'm new be in angular. I want to know before viewDashboard controller will unload and I'm not sure how I can detect that. Basicali after click an item from left menu Template.fn_change_view() changing Template.active_view to active view name e.g. 'dashboard' and it show/hide some view- element directives. But after that code written inside inactive directive controller not execute any more. Before that happen I need to execute one function from this inactive controller. Is there any way to do that? I hope I write that clear enough, if not I will try to explain better. HTML: index.html left-menu.html loaded by leftMenu directive Toggle Menu <a href> {{item.label}} dashboard.html - loaded by viewDashboard directive Dashboard JS: chartYearly directive app.directive('chartYearly', function () { return{ restrict: 'E', templateUrl: 'views/chart-yearly.html', controller: function ($scope) { // how I can detect here before Yearly controler will be unloaded? // when Template.active_view will change to different than dashboard $scope.$watch('Template.active_view', function () { // I need to execute this when this directive is active either before is unloaded console.log(2); }); }, controllerAs: 'Yearly' };
type: Question
score: 9

http://stackoverflow.com/q/27733109
tagged with: thickbox
answer count: 1
has body: I'm using one jQuery pop-up library called thickbox.js. There is one small image present on my page. When user clicks on this image a call to some function is given, the thickbox.js library creates the HTML/CSS for pop-up on the fly and shows up the pop-up. The most important thing to note here is if the HTML source of page is viewed when the pop-up is shown I'm not able to see the HTML code of pop-up. I tried to view the HTML source of pop-up through Firebug console by inspecting the element then I could see the HTML source of pop-up. This indicates that the DOM doesn't contain the HTML code of pop-up box. Now my issue is I want to close this opened pop-up if user clicks anywhere on the page other than the pop-up area. I tried few codes but unfortunately they are not able to do the thing I want to do. Now I'm just clueless for this issue. Following is the code for your reference: Following is the pop-up HTML generated dynamically. I've taken from Firebug console: Contact Your details submit succesfully Full Name Email Message Send Yourself a Copy Contact x prj_name.contactform The jQuery codes I tried are as follows: $('body').click(function(e) { if( $('.js_box_image_holder_full').length ) { if (!$(e.target).closest('.js_box_image_holder_full').length) { $('.js_box_image_holder_full').hide(); } } }); The second code I tried is as follows: $(document).click(function(event) { if(!$(event.target).closest('.js_box_image_holder_full').length) { if($('.js_box_image_holder_full').is(":visible")) { $('.js_box_image_holder_full').hide() } } }) The issue with both of the above code snippets is the pop-up doesn't open up when user clicks on image. Also I didn't get any error or warning in a Firebug console. The third code snippet I tried: $(document).mouseup(function (e) { var container = $(".js_box"); if (!container.is(e.target) && container.has(e.target).length === 0) { $(".js_box_image_holder_full").remove(); } }); The issue I get with above code is the opened pop-up gets …
upvote count: 5
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27741943
has title: How to close the dynamically added pop-up when user clicks anywhere on the page outside of that pop-up's surface?
type: AnsweredQuestion
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: jquery-ui-dialog
type: Question
score: 5
has answer: http://stackoverflow.com/a/27741943
tagged with: popup

http://stackoverflow.com/q/27790387
has comment: http://stackoverflow.com/comment/49378981
answer count: 0
type: UnansweredQuestion
tagged with: php
has body: I am trying to update data field with PHP recourd using var point. Here is my PHP code: $query_Recordset1 = "SELECT * FROM table"; $Recordset1 = mysql_query($query_Recordset1, $egrid) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); $Peak = mysql_result($Recordset1 ,0,"Peak"); print $Peak; The PHP script does work, however when I attempt to insert it into my .js document nothing happens. Here is my javascript: series: [{ name: 'Peak Average', data: [18000], //interval update in Add some life tooltip: { valueSuffix: ' Peak' } }] }, // Add some life function(chart) { setInterval( function() { var point = chart.series[0].points[0], newVal; $.get("peak.php", function(newVal) { console.log(newVal, typeof newVal); point.update(parseFloat(newVal)); }); } ,5000); }); I have even tried making adjustments as per string versus number: point.update(newVal); PLEASE HELP.
has comment: http://stackoverflow.com/comment/44030372
downvote count: 0
has comment: http://stackoverflow.com/comment/43990687
score: 1
type: Question
has title: Highcharts Gauge (Speedometer) How to point.update PHP value
has comment: http://stackoverflow.com/comment/44001936
has comment: http://stackoverflow.com/comment/44030683
tagged with: highcharts
tagged with: javascript
has comment: http://stackoverflow.com/comment/43991976
upvote count: 1
favorite count: 0
tagged with: parsefloat

http://stackoverflow.com/comment/43995202
type: AnswerComment
type: Comment
has text: I mean the outcome is the same*
comment on: http://stackoverflow.com/a/27792831
score: 0

http://stackoverflow.com/comment/43872467
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27730277
has text: sorry if i wasn't clear. except for the index.php, all my php files contain only html. when i say it doesn't work i mean that the page is loading but the js script is not executing. i fixed the path and i'm sure it's right. When i try to include the js file in welcome.php with the line in my first post, the js script is not executing. If i write my js code directly to welcome.php(in script tags) in welcome.php , it runs perfect. hope i'm clear this time.

http://stackoverflow.com/a/27664788
answers question: http://stackoverflow.com/q/27664727
type: Answer
downvote count: 1
upvote count: 0
has body: This is a very detailed explanation for the question you have asked. I hope this helps you in some way !
score: -1

http://stackoverflow.com/q/27722647
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/31215949
score: 9
type: Question
upvote count: 9
has comment: http://stackoverflow.com/comment/46172405
tagged with: javascript
tagged with: jquery
has body: I am using DataTable in my application. My application is not a server hosted one. (I will render the HTML directly in my standalone application. Well, that is a different story.) Currently I am populating DataTable like below, $(dataTableSelector).dataTable({ "sDom": 't &lt;f&gt; &lt;i&gt; &lt;p&gt; &gt; ', "bRetrieve": true, "aaSorting": [], "aaData": rows, "aoColumns": columns, "oLanguage": { "sSearch": "", "sInfo": "_START_ - _END_ Total: _TOTAL_ ", "sInfoFiltered": "(filtered from _MAX_)" } }); Here rows are my entire data, in array of arrays as a Javascript sourced data. But now my problem is, if the data I am going to render with DataTable is huge, then loading takes longer time. So I am trying to change the data table similar to server side processing(but please note that I don't have any server. It is just a local HTML page). On clicking next,it should load next only, page data.Till then, it should not load the same. Say, I have a function in javascript function loadData(start,end, searchString){ //Function to fetch records from a Table with start and end numbers of records. //searchString is optional. //rows= GetDataFromTable(start,end, searchString); return rows; } So, whenever the next or previous button is clicked in the data table, or searched, my javascript method should be called and it should repopulate Datatable. Any ideas?
tagged with: datatables
downvote count: 0
answer count: 1
has title: Dynamic Javascript sourced data - DataTable
has comment: http://stackoverflow.com/comment/50433655
has comment: http://stackoverflow.com/comment/43860918
has comment: http://stackoverflow.com/comment/46070199
favorite count: 0
has comment: http://stackoverflow.com/comment/43857651

http://stackoverflow.com/comment/43910522
has text: @fuzzybabybunny: What you get from an object literal is an object of the type `Object`. A function declaration creates an object of the type `Function`. You can't turn an object of type `Object` into an object of the type `Function`. An object of the type `Function` on the other hand inherits from the type `Object` so it has all its properties.
comment on: http://stackoverflow.com/a/27749435
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27769617
type: UnansweredQuestion
tagged with: web-scraping
upvote count: 1
has title: jQuery, ajax, and php web scraper acting strangely
type: Question
score: 1
has answer: http://stackoverflow.com/a/27769686
downvote count: 0
answer count: 1
has body: I'm trying to scrape a web page, but getting some weird results in my browser's console (as seen below). Here's my code: index.html Icefilms Searcher script.js $(document).ready(function(){ var currNum = 168000; var maxNum = 168005; function generateNextUrl(){ currNum++; return currNum-1; } scrapeThis(generateNextUrl()); function scrapeThis(theUrl){ $.ajax({ url: "php.php", data: "icefilmsURL=" + theUrl, success: function(response){ var movieTitle = $(response).find("#videotitle").find("span:first").text(); $("#container").append(""+movieTitle+" "); }, complete: function(){ if(currNum < maxNum+1){ scrapeThis(generateNextUrl()); } }, error: function(xhr,err){ $("#container").append("readyState: "+xhr.readyState+"\nstatus: "+xhr.status); $("#container").append("responseText: "+xhr.responseText); } }); }; }); php.php <?php echo file_get_contents("http://www.icefilms.info/ip.php?v=".$_GET["icefilmsURL"]); ?> The code works fine, but this is what I see in my console: Any ideas?
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: php

http://stackoverflow.com/comment/43992347
comment on: http://stackoverflow.com/a/27791268
type: Comment
has text: Edited to val() vs value()
score: 1
type: AnswerComment

http://stackoverflow.com/comment/43994796
type: AnswerComment
has text: You are absolutely correct. What a dumb mistake on my part.
type: Comment
comment on: http://stackoverflow.com/a/27792601
score: 1

http://stackoverflow.com/a/27726520
answers question: http://stackoverflow.com/q/27726447
has body: Don't use .each() or .queue(). Just make a function that operates on the current element and delays the execution of the next call to the same function. The current element is determined by an i counter that you increment on each call. To break it, have a flag that is checked to exit the function immediately. var tr = $('.js-channel-notes tr'); var i = 0; var halt; function next() { if (halt) return; $('.channel-row-highlight').removeClass('channel-row-highlight'); tr.eq(i).addClass('channel-row-highlight'); i++; if (i &lt; tr.length) { setTimeout(next, 160); } } next(); Or skip jQuery altogether since there's so little being used there anyway. var tr = document.querySelectorAll('.js-channel-notes tr'); var i = 0; var halt; function next() { if (halt) return; var c = document.querySelector('.channel-row-highlight'); if (c) c.classList.remove('channel-row-highlight'); tr[i].classList.add('channel-row-highlight'); i++; if (i &lt; tr.length) { setTimeout(next, 160); } } next(); There's far more engineering than is needed by using .delay() and .queue(). Simpler is better.
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43865323
accepted answer of: http://stackoverflow.com/q/27726447

google-oauth
type: Tag
tag name: google-oauth
tags question: http://stackoverflow.com/q/27675436

timer
tags question: http://stackoverflow.com/q/27678604
tag name: timer
tags question: http://stackoverflow.com/q/27662513
tags question: http://stackoverflow.com/q/27660993
tags question: http://stackoverflow.com/q/27803162
type: Tag
tags question: http://stackoverflow.com/q/27693186
tags question: http://stackoverflow.com/q/27714959
tags question: http://stackoverflow.com/q/27726224
tags question: http://stackoverflow.com/q/27694033
tags question: http://stackoverflow.com/q/27754727

http://stackoverflow.com/q/27766440
favorite count: 0
has comment: http://stackoverflow.com/comment/43943734
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43943633
tagged with: php
has comment: http://stackoverflow.com/comment/43943652
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27766657
has comment: http://stackoverflow.com/comment/43943473
upvote count: 1
has comment: http://stackoverflow.com/comment/43943582
type: Question
has title: Issue in passing data across php file
has comment: http://stackoverflow.com/comment/43943787
has body: I am transferring data across php files. index.php &lt;a href="sample.php?var=&lt;?=$var?&gt;" class="title"&gt;link&lt;/a&gt; sample.php $var = $_GET['var']; The problem is if $var includes " then it take data up to that only. For eg index.php $var="Academic "Calendar" for Semester"; &lt;a href="sample.php?var=&lt;?=$var?&gt;" class="title"&gt;link&lt;/a&gt; sample.php $var = $_GET['var']; In sample.php $var=Academic. It doesn't take the whole sentence. Because it takes " as closure of &lt;a href=" . How to overcome this problem.
tagged with: javascript
has comment: http://stackoverflow.com/comment/43943539
has comment: http://stackoverflow.com/comment/43943499
has comment: http://stackoverflow.com/comment/43943665
accepted answer: http://stackoverflow.com/a/27766657
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43943845
has comment: http://stackoverflow.com/comment/43943715

http://stackoverflow.com/comment/43927262
comment on: http://stackoverflow.com/q/27757172
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/68144/discussion-between-kim-gysen-and-dennis-laymi).
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43941805
type: Comment
type: QuestionComment
has text: possible duplicate of [Many-to-many relations in Breeze](http://stackoverflow.com/questions/13636528/many-to-many-relations-in-breeze)
score: 0
comment on: http://stackoverflow.com/q/27761772

http://stackoverflow.com/comment/43843516
type: AnswerComment
type: Comment
has text: I tried adding this in the same script tag as the document.ready but it still did not work correctly after submit. The post of pulse still works, just not the refresh of loading.
comment on: http://stackoverflow.com/a/27713886
score: 0

http://stackoverflow.com/comment/43963226
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27775618
has text: How do I unmark this as duplicate? MY question is not anything like 'How to return the response from an Ajax call?' Obviously my question was not even skimmed by the person who did that.
type: Comment

http://stackoverflow.com/comment/43778606
has text: Hey Todd, you are absolutely right. It is a little tricky to get jsfiddle working with a bootstrap app but for what it is worth, I am pretty sure that the issue I am running into is turbolinks related. It appears as if rails doesn't fire off the $(document).ready after the page loads because of turbolinks.
comment on: http://stackoverflow.com/q/27681615
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27706133
has title: linking css files in php
tagged with: javascript
has answer: http://stackoverflow.com/a/61813567
linked to: http://stackoverflow.com/q/23285503
accepted answer: http://stackoverflow.com/a/27706249
has answer: http://stackoverflow.com/a/27706216
score: 0
has answer: http://stackoverflow.com/a/27706218
possible better answer: http://stackoverflow.com/a/27706216
favorite count: 0
linked to: http://stackoverflow.com/q/21048976
answer count: 5
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
has comment: http://stackoverflow.com/comment/43824133
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27706249
has answer: http://stackoverflow.com/a/27706290
upvote count: 1
has body: I am new to php and i am working on a project i am facing some problems with linking css and js files. Now when the project is executed,First index.php loads (located in root directory) which includes home.php and everything in it is executed correctly. But as soon as you click on 'about' link on the 'home page' ,the page is redirected to about.php( which is located inside Presentation/about.php )here the css and js linking fails....... On execution of index.php it takes css link successfully (the link is as follows) &lt;link href="css/bootstrap-theme.min.css" rel="stylesheet"&gt; but later when the page is redirected to about.php it expects the link to be &lt;link href="../css/bootstrap-theme.min.css" rel="stylesheet"&gt; and i am using a common file for these links, i kept all links in header.php(located in Presentation/Template/header.php) I have also defined all paths in config.php(located in inc/config.php) i have defined the path in config.php as follows // SITE_ROOT contains the full path to the RichTongue folder define('SITE_ROOT', dirname(dirname(__FILE__))); // Application directories define('PRESENTATION_DIR', SITE_ROOT . '/Presentation/'); define('TEMPLATE_DIR', PRESENTATION_DIR.'Template/'); define('BUSINESS_DIR', SITE_ROOT . '/Business/'); define('CSS_DIR', SITE_ROOT. '/css/'); define('FONT_DIR', SITE_ROOT . '/fonts/'); define('IMAGE', SITE_ROOT . '/images/'); define('JS', SITE_ROOT . '/js/'); so i tried linking css in the following way &lt;link href="&lt;?php echo CSS_DIR ?&gt;bootstrap.min.css" rel="stylesheet" &gt; now the above code gives me an error in chrome which says Not allowed to load local resource: file:///C:/xampp/htdocs/RichTongue/css/bootstrap.min.css home.php:13 now the path in the error above(file:///C:/xampp/htdocs/RichTongue/css/bootstrap.min.css) is correct but it doesnt load the file and gives the error (error specified above) Q)What should i do? what is the correct way of linking css and js files in php? need help
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43824117
has comment: http://stackoverflow.com/comment/43824161

http://stackoverflow.com/comment/43758779
type: AnswerComment
type: Comment
has text: @meager I like these solutions, they are very clean. Also hocus pocus for beginning programmers. I've been reading up with those modern `array` functions. It seems that `for` and `while` lus are sometimes quicker than using functions like `map`. http://jsperf.com/map-vs-native-for-loop/7. For this example it won't really matter of course.
comment on: http://stackoverflow.com/a/27671970
score: 0

http://stackoverflow.com/a/27699840
has comment: http://stackoverflow.com/comment/43812665
has comment: http://stackoverflow.com/comment/43812624
upvote count: 1
has body: I think you wanted something like this: var x=10; var collatz; while (x&lt;2000) { if (x%2==0) collatz = function(n) {return n+2;} if (x%2==1) collatz = function(n) {return 2*n;} x=collatz(x + 1); document.write(x, ","); } One of the problems of your code (not the major one) was that starting with 10 both + 2 and * 2 produce only even numbers.
score: 1
answers question: http://stackoverflow.com/q/27699747
has comment: http://stackoverflow.com/comment/43812644
downvote count: 0
type: Answer

http://stackoverflow.com/a/27733532
answers question: http://stackoverflow.com/q/27733499
upvote count: 3
has body: Try this var elements = document.getElementsByTagName('*'), i = 0; while (elements[i]) { if (elements[i].className == 'c') { elements[i].addEventListener('click', function (e) { alert(this.className) }) } i++; } Demo: http://jsfiddle.net/r19r7djb/3/
type: Answer
score: 3
downvote count: 0

http://stackoverflow.com/comment/43748197
score: 0
type: Comment
type: QuestionComment
has text: is it something like that you are looking for ? : JSON.stringify(myobject, undefined, 2);
comment on: http://stackoverflow.com/q/27666569

d3.js
tags question: http://stackoverflow.com/q/27764087
tags question: http://stackoverflow.com/q/27696967
tags question: http://stackoverflow.com/q/27654913
tags question: http://stackoverflow.com/q/27801655
tags question: http://stackoverflow.com/q/27787520
tags question: http://stackoverflow.com/q/27688615
tags question: http://stackoverflow.com/q/27675327
tags question: http://stackoverflow.com/q/27721737
tags question: http://stackoverflow.com/q/27666838
tags question: http://stackoverflow.com/q/27700379
tags question: http://stackoverflow.com/q/27726743
tags question: http://stackoverflow.com/q/27729234
tags question: http://stackoverflow.com/q/27695206
tags question: http://stackoverflow.com/q/27802669
tags question: http://stackoverflow.com/q/27781298
tags question: http://stackoverflow.com/q/27715435
tags question: http://stackoverflow.com/q/27725994
tags question: http://stackoverflow.com/q/27653675
tags question: http://stackoverflow.com/q/27756267
tags question: http://stackoverflow.com/q/27661121
tags question: http://stackoverflow.com/q/27771893
tags question: http://stackoverflow.com/q/27681195
tags question: http://stackoverflow.com/q/27650510
tags question: http://stackoverflow.com/q/27777980
tags question: http://stackoverflow.com/q/27738692
tags question: http://stackoverflow.com/q/27684956
tags question: http://stackoverflow.com/q/27798222
tags question: http://stackoverflow.com/q/27666349
tags question: http://stackoverflow.com/q/27775579
tags question: http://stackoverflow.com/q/27747302
tags question: http://stackoverflow.com/q/27696443
tags question: http://stackoverflow.com/q/27726056
tags question: http://stackoverflow.com/q/27787204
type: Tag
tags question: http://stackoverflow.com/q/27709470
tags question: http://stackoverflow.com/q/27788211
tags question: http://stackoverflow.com/q/27654447
tags question: http://stackoverflow.com/q/27801510
tags question: http://stackoverflow.com/q/27799828
tags question: http://stackoverflow.com/q/27771523
tags question: http://stackoverflow.com/q/27696036
tags question: http://stackoverflow.com/q/27681147
tags question: http://stackoverflow.com/q/27803556
tags question: http://stackoverflow.com/q/27798064
tags question: http://stackoverflow.com/q/27752605
tags question: http://stackoverflow.com/q/27784895
tags question: http://stackoverflow.com/q/27660158
tags question: http://stackoverflow.com/q/27702287
tags question: http://stackoverflow.com/q/27762982
tags question: http://stackoverflow.com/q/27679698
tag name: d3.js
tags question: http://stackoverflow.com/q/27762837
tags question: http://stackoverflow.com/q/27672989
tags question: http://stackoverflow.com/q/27694062
tags question: http://stackoverflow.com/q/27780687
tags question: http://stackoverflow.com/q/27785505
tags question: http://stackoverflow.com/q/27668236
tags question: http://stackoverflow.com/q/27740649
tags question: http://stackoverflow.com/q/27784529
tags question: http://stackoverflow.com/q/27690410
tags question: http://stackoverflow.com/q/27733811
tags question: http://stackoverflow.com/q/27727144
tags question: http://stackoverflow.com/q/27784574
tags question: http://stackoverflow.com/q/27782431
tags question: http://stackoverflow.com/q/27678592
tags question: http://stackoverflow.com/q/27772527
tags question: http://stackoverflow.com/q/27775067

http://stackoverflow.com/a/27666155
has comment: http://stackoverflow.com/comment/43749287
score: 1
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27662406
type: Answer
accepted answer of: http://stackoverflow.com/q/27662406
has body: Here's the relevant function using the suggested answer, modified slightly to incorporate a promise: function animation2(){ var image1 = $("&lt;img /&gt;", { css : { position : 'absolute', left : '50px', top : '0px', }, src : img1 }); $("#animationcontainer").append(image1); return image1.animate({opacity: 0}, "slow") .queue(function() { image1.attr("src", img2); image1.dequeue(); // This is necessary to continue the animation }) .animate({opacity: 1}, "slow") .promise(); }
downvote count: 0

http://stackoverflow.com/q/27652228
favorite count: 0
answer count: 1
has answer: http://stackoverflow.com/a/27658082
has title: WebSocket events not firing sporadically
upvote count: 1
has body: I searched for a while but couldn't find a working solution for my particular problem. I have the "default" WebSocket implementation in my JavaScript file. It works but it does not work everytime. Sometimes (can be the first time but could also be the 101st time) the event don't fire. Shouldn't at least the onclose-event fire with wasClean == false? Maybe someone can help me out with this. Edit: Forgot something. Only happens if I provide a wrong IP-Adress for: ws = new WebSocket("ws://" + ip + ":9999/"); So server-side code is not necessary to answer this question. $(document).ready(function () { ws = new WebSocket("ws://" + ip + ":9999/"); ws.onopen = function(evt) { console.log("CONNECTED"); doSend("getInfo"); }; ws.onclose = function(evt) { if (!evt.wasClean) { showError(); return; } console.log("DISCONNECTED"); }; ws.onmessage = function(evt) { newIP = evt.data; }; });
accepted answer: http://stackoverflow.com/a/27658082
type: AnsweredQuestion
score: 1
type: Question
downvote count: 0
tagged with: websocket
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/43849613
type: AnswerComment
score: 0
has text: @dbc: That's quite possible, yes.
type: Comment
comment on: http://stackoverflow.com/a/27718161

http://stackoverflow.com/comment/43806926
comment on: http://stackoverflow.com/q/27696788
has text: 1. `string` doesn't contain `#` = match 2. return this (1) `fragment` of the `string`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27704062
linked to: http://stackoverflow.com/q/13471129
has title: Call function after reordering an ng-repeat div
tagged with: angularjs-ng-repeat
tagged with: angularjs-orderby
has answer: http://stackoverflow.com/a/27704166
type: Question
has comment: http://stackoverflow.com/comment/43820696
has comment: http://stackoverflow.com/comment/43820131
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43820817
answer count: 1
tagged with: jquery
linked to: http://stackoverflow.com/q/24361576
has body: I'm using the Justified Gallery jQuery plugin to work with Angular. I need to call the updateJustify() function after the ng-repeat has reordered itself. I suspect what is happening now is that when I change the sortorder it updates the gallery before it has even reordered. Is there a directive that can help me or any workarounds? Please note this isn't for the first run through of 'ng-repeat'. I need to detect when the reordering of my ng-repeat has been completed so I can call my own function. Here's the code from my HTML Filters Title (A-Z) Title (Z-A) Created (New-Old) Created (Old-New) Thanks
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43821179
type: UnansweredQuestion

http://stackoverflow.com/q/27790923
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27791026
tagged with: http://stackoverflow.com/tag/html
has title: angular directive attributes not evaluated
upvote count: 3
has body: I've tried the answer mentioned here but no luck (I'm using angularjs 1.3). My problem is two part 1) Complex attributes are not being passed as objects despite using '=' (see code below) in scope 2) the function that should evaluate to provide one-way binding is also being passed as string instead sample use, &lt;button type="button" class="btn btn-success" ng-click="RestEditCtrl.saveRestaurantDetails();"&gt; &lt;smart-btn-label btn-state="RestEditCtrl.ajaxState(RestEditCtrl.restaurant.id)" when-normal="{label: 'Save', icon: 'glyphicon-floppy-disk' }" when-active="{label: 'Saving...', icon: 'glyphicon-refresh glyphicon-spin-animate'}" when-success="{label: 'Saved!', icon: 'glyphicon glyphicon-floppy-saved'}" when-error="{label: 'Try saving again', icon: 'glyphicon glyphicon-exclamation-sign'}"&gt;&lt;/smart-btn-label&gt; &lt;/button&gt; directive code, angular.module("app") .directive('smartBtnLabel', function () { return { restrict: 'E', scope: { btnState: '&amp;', // not working, @ evaluates but that defeats my purpose whenActive: '=', // not evaluating any which way, it always comes as string whenError: '=', whenSuccess: '=', whenNormal: '=' }, link: function (scope, elem, attrs) { console.log(attrs); var curState = "normal", curLabel = attrs.whenNormal ? attrs.whenNormal.label : "", curIcon = attrs.whenNormal ? attrs.whenNormal.icon : ""; if (attrs.btnState) curState = attrs.btnState; if(curState == "active"){ curLabel = attrs.whenActive ? attrs.whenActive.label : ""; curIcon = attrs.whenActive ? attrs.whenActive.icon : "" } else if(curState == "success"){ curLabel = attrs.whenSuccess ? attrs.whenSuccess.label : ""; curIcon = attrs.whenSuccess ? attrs.whenSuccess.icon : "" } else if(curState == "error"){ curLabel = attrs.whenError ? attrs.whenError.label : ""; curIcon = attrs.whenError ? attrs.whenError.icon : "" } scope.curLabel = curLabel; scope.curIcon = curIcon; }, template: '&lt;span aria-hidden="true" ng-show="curIcon" class="glyphicon {{curIcon}}" &gt;&l…
type: Question
tagged with: angularjs-directive
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27791026
tagged with: javascript
tagged with: angularjs-scope
score: 3
linked to: http://stackoverflow.com/q/12371159
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43992282

http://stackoverflow.com/comment/58456564
has text: Exactly what I was looking for.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/31959514

http://stackoverflow.com/q/27738901
tagged with: javascript
has body: For example, suppose I have a REST API that create a voucher. The client would POST to: /create/voucher Then, to use a simplified example, a GET request to /voucher/123456 would return {amount: 100, expired: false} to represent a $100 voucher for client 123456 that hasn't expired. Let's say that the voucher should expire in 24 hours. At a conceptual level, how would I test this functionality? The 'manual' way to do it would be to have the test case sleep for 24 hours and then rerun the GET request. This obviously isn't feasible. For what it's worth the language that I'm using is JavaScript. I can't think of any 'nice' ways to do this without doing something hacky like overwriting Date.getTime()
downvote count: 0
has title: How can I write a test for content that expires?
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/43889403
score: 1
tagged with: unit-testing
type: Question
tagged with: testing

http://stackoverflow.com/comment/43767124
type: QuestionComment
comment on: http://stackoverflow.com/q/27676151
has text: true if you have better please post and i will gladly accept
score: 0
type: Comment

http://stackoverflow.com/comment/44018597
has text: OK...ill do that now...I already renamed the question. It is sometimes hard when you have no idea where to start as I didnt in the case of this question.
comment on: http://stackoverflow.com/q/27751511
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43961968
has text: @slebetman the core returns a number that could be 0. or false when it cannot find a value. I would call that strict. But in a non-strict compare 0 == false and that makes the x = foo || bar be an issue
comment on: http://stackoverflow.com/q/27774783
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43704004
comment on: http://stackoverflow.com/a/27642590
score: 0
type: Comment
has text: I'm a newbie. Does this only work on the body element? where do i give this an element ID? I tried this `document.getElementById('randomId').scrollLeft = ( divRef.scrollWidth - divRef.offsetWidth ) / 2 ;` with no success
type: AnswerComment

relative-path
type: Tag
tags question: http://stackoverflow.com/q/27666456
tag name: relative-path

http://stackoverflow.com/comment/43790367
type: Comment
type: QuestionComment
score: 0
has text: But above you are specifying "prefix: 'App/i18n/locale-". That's why I thought it is perhaps needed to remove the 'locale-' from the prefix or add 'locale-' to the file name? So that the System can find the ir.json file or the locale-ir.json file.
comment on: http://stackoverflow.com/q/27688160

http://stackoverflow.com/q/27713304
has answer: http://stackoverflow.com/a/27723425
has comment: http://stackoverflow.com/comment/43839029
accepted answer: http://stackoverflow.com/a/27723425
type: AnsweredQuestion
tagged with: settimeout
type: Question
linked to: http://stackoverflow.com/q/6330431
has comment: http://stackoverflow.com/comment/43838817
has comment: http://stackoverflow.com/comment/43838955
has comment: http://stackoverflow.com/comment/43838961
tagged with: javascript
tagged with: jquery
tagged with: double-click
has comment: http://stackoverflow.com/comment/43838785
score: 0
has title: Single click interfering with double click. How can resolve this?
answer count: 1
has comment: http://stackoverflow.com/comment/43838815
has body: I have a problem where my single click events keep interfering with my double click event such that even though I double clicked, the single click event gets called. Here's my code before a solution I found on SO: grid.bind('change', function() { SearchPSelected(); }); $('#PGrid').delegate('tbody&gt;tr', 'dblclick', function(e) { SearchPSelected(); GotoNextView(); }); Here's my code after I followed a solution on SO: grid = $('#PGrid').data('kendoGrid'); var DELAY = 700, clicks = 0, timer = null; grid.on("click", function(e) { clicks++; //count clicks if (clicks === 1) { timer = setTimeout(function() { grid.bind('change', function() { SearchPSelected(); }); //perform single-click action clicks = 0; //after action performed, reset counter }, DELAY); } else { clearTimeout(timer); //prevent single-click action $('#PGrid').delegate('tbody&gt;tr', 'dblclick', function(e) { SearchPSelected(); GotoNextView(); }); //perform double-click action clicks = 0; //after action performed, reset counter } }) .on("dblclick", function(e) { e.preventDefault(); //cancel system double-click event }); With the attempted solution, nothing gets called (with inspection from firebug) and I'm not sure why? I'm still relatively new to js (not my language of choice), so I could be missing something?
has comment: http://stackoverflow.com/comment/43838924

http://stackoverflow.com/comment/43824181
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27705738
has text: @MattGray I put that as an answer, just in case.. :)

http://stackoverflow.com/a/27663397
has body: You can add a class like this: var name = $("#input").val(); $("img[src='images/"+name+"']").addClass("opacity"); It will only add opacity class to the image which has src attribute like the input.
accepted answer of: http://stackoverflow.com/q/27663338
score: 1
has comment: http://stackoverflow.com/comment/43742916
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43742809
answers question: http://stackoverflow.com/q/27663338
type: Answer

http://stackoverflow.com/comment/43755797
comment on: http://stackoverflow.com/q/27670526
type: QuestionComment
type: Comment
score: 1
has text: I can't figure out what you have in mind but you simply cannot send a PHP object across the wire and use it from JavaScript. Your script must print something that JavaScript can parse (possibly JSON).

http://stackoverflow.com/a/27760489
score: 333
has comment: http://stackoverflow.com/comment/59698988
has comment: http://stackoverflow.com/comment/58374332
has comment: http://stackoverflow.com/comment/114591436
has comment: http://stackoverflow.com/comment/69105902
has comment: http://stackoverflow.com/comment/124636165
has comment: http://stackoverflow.com/comment/101995820
has comment: http://stackoverflow.com/comment/57145787
downvote count: 20
has comment: http://stackoverflow.com/comment/58446029
has comment: http://stackoverflow.com/comment/130035493
has comment: http://stackoverflow.com/comment/130014664
has comment: http://stackoverflow.com/comment/58440957
has comment: http://stackoverflow.com/comment/67622131
has comment: http://stackoverflow.com/comment/57152840
has comment: http://stackoverflow.com/comment/130013902
has comment: http://stackoverflow.com/comment/111356391
has body: Checking if something is promise unnecessarily complicates the code, just use Promise.resolve Promise.resolve(valueOrPromiseItDoesntMatter).then(function(value) { })
has comment: http://stackoverflow.com/comment/134327935
has comment: http://stackoverflow.com/comment/59712379
has comment: http://stackoverflow.com/comment/113287589
answers question: http://stackoverflow.com/q/27746304
has comment: http://stackoverflow.com/comment/58446248
type: Answer
upvote count: 353
has comment: http://stackoverflow.com/comment/75965545
has comment: http://stackoverflow.com/comment/67835715

http://stackoverflow.com/a/27752792
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27752673
upvote count: 3
has comment: http://stackoverflow.com/comment/43916665
answers question: http://stackoverflow.com/q/27752673
has body: You need to trigger a digest. A safe way of doing this is using $timeout with a 0-time delay. You can also call the code in $scope.$apply (checking that a digest is not already running). $timeout, while ugly, is generally preferred. app.directive("penaltyTable", function($timeout) { return { restrict: 'E', templateUrl: '/Content/AngularPartials/Coach/PenaltyLine.html', controller: function() { this.players = []; var penaltyController = this; var uri = "ws://localhost.local/api/CoachesTracker/10"; //Initialize socket var websocket = new WebSocket(uri); // Error handling stuff here..... //Socket message handler websocket.onmessage = function (event) { $timeout(function() { var data = JSON.parse(event.data); penaltyController.players = data; }); }; }, controllerAs: 'penaltyTrackerCtrl' }; }); The reason is that AngularJS doesn't know that your websocket just got a message, and hence doesn't know that anything happened in the "Angular" way of data binding and watchers etc. Maybe, coincidentally, something happened in your application to trigger a digest at just that moment and you don't see the issue, but most of the time you will. A 'better' solution might be to write a wrapper around websocket that calls $rootScope.$digest after whatever callback you have there runs. If you aren't doing it too much then it's probably fine to go like this though.
has comment: http://stackoverflow.com/comment/43916644
score: 3
type: AcceptedAnswer

http://stackoverflow.com/a/27755412
has body: try this: $('#'+div_id + 'table tr td').css('background-color','blue'); also, check if it's not overridden by other css styles
score: 0
has comment: http://stackoverflow.com/comment/43921600
type: Answer
answers question: http://stackoverflow.com/q/27755354
has comment: http://stackoverflow.com/comment/43921567
has comment: http://stackoverflow.com/comment/43921510
has comment: http://stackoverflow.com/comment/43921626

http://stackoverflow.com/a/27690866
type: Answer
score: 3
upvote count: 3
has body: Don't use setAttribute for event handling. Use addEventListeners instead. For now, you could make your function like this, which uses event object that gets passed when it's called on the triggering of the event, in this case click function addToCart(e){ var that = e.target; // use that instead of this // more code goes here } And then you could just set it to the onclick property button.onclick = addToCart; // pass the function reference
answers question: http://stackoverflow.com/q/27690827
downvote count: 0

http://stackoverflow.com/comment/43786895
comment on: http://stackoverflow.com/q/27686426
type: Comment
has text: Yeah, sorry, misread. Confused `.show-more` with `.more-exhi`.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44014844
type: Comment
has text: In HTML5, you have the option of using the autofocus attribute. This would bring focus to an element when the page reloads.
comment on: http://stackoverflow.com/q/27802771
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43973262
comment on: http://stackoverflow.com/q/27781480
type: Comment
has text: You have a reference to it already: `this.maskScreen`
type: QuestionComment
score: 0

http://stackoverflow.com/a/27661897
has body: The Javascript-method requests a REST-service, you may do the same. Documentation: http://www.onemap.sg/api/help/Geometry.aspx (what you are looking for is "Project")
score: 0
answers question: http://stackoverflow.com/q/27652768
type: Answer
has comment: http://stackoverflow.com/comment/43743167
has comment: http://stackoverflow.com/comment/43747619

http://stackoverflow.com/q/27664640
type: Question
accepted answer: http://stackoverflow.com/a/27664674
has title: Regex group generates empty matches among wanted matches
tagged with: javascript
answer count: 2
possible better answer: http://stackoverflow.com/a/27664680
downvote count: 0
has answer: http://stackoverflow.com/a/27664680
favorite count: 0
has answer: http://stackoverflow.com/a/27664674
tagged with: regex
has body: I'm trying to learn regex. I've created this /(\d?\.?\d?)/g to extract all numbers in a comma separated list of float numbers. like this: 1,2.2,3,4,5,6,7,8,9,10 https://regex101.com/r/aJ3eF2/2 But this pattern generates empty matches among wanted matches. MATCH 1 1. [0-1] `1` MATCH 2 1. [1-1] `` MATCH 3 1. [2-5] `2.2` MATCH 4 1. [5-5] `` I want to understand why this happens? and how to fix it.
type: AnsweredQuestion
score: 1
upvote count: 1

http://stackoverflow.com/comment/43794076
score: 0
type: QuestionComment
has text: Maybe it's my lack of skills, but you callback a success message when you get an error. Also, you do nothing with your request's response. `.success` or `.then` should be available. I don't use `request.js` so you should do more research by yourself.
type: Comment
comment on: http://stackoverflow.com/q/27689904

http://stackoverflow.com/comment/43911078
type: QuestionComment
has text: It works ok for me. What versions of browserify, gulp, and vinyl-source-stream? What platform? By the way, you don't need to wrap your exported function in parens.
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27745296

http://stackoverflow.com/comment/43826485
type: Comment
has text: may you post your total source in [IDEONE](http://ideone.com/) and add this to your post to really see whats going on
type: AnswerComment
comment on: http://stackoverflow.com/a/27660920
score: 0

http://stackoverflow.com/comment/43884870
type: QuestionComment
comment on: http://stackoverflow.com/q/27736680
has text: What's the issue here? Why replace Test(5) with Test(5)？
score: 0
type: Comment

http://stackoverflow.com/a/27798672
accepted answer of: http://stackoverflow.com/q/27798262
type: AcceptedAnswer
downvote count: 0
has body: The reason is probably because the win.offsetHeight; causes the method to wait for a few milliseconds before the transition can start again. If you put alert(1); instead of the win.offsetHeight; it will still work. You need to wait for the transition to complete before starting another animation. UPDATE: Fiddle Link This should work without having any delays (check fiddle): window.setTimeout(function() { showAnimateWin(); }, 25);
score: 1
has comment: http://stackoverflow.com/comment/44005914
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27798262
has comment: http://stackoverflow.com/comment/44005980
has comment: http://stackoverflow.com/comment/44006072

http://stackoverflow.com/comment/43948528
has text: and per @jfriend00 suggestion , it's far less work to get or save one object than writing a whole bunch of individual items
type: Comment
comment on: http://stackoverflow.com/q/27768810
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44011774
score: 0
has text: in option 1, why is `rv` declared outside of the `if`? just to make it clearer that it would be in scope if the `if` is skipped? it isn't accessed outside of the `if`.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27801267

http://stackoverflow.com/a/27689989
has body: To get the text white, try adding a class (sign-up-link for example) to your anchor tag: Test .sign-up-link { color: #ffffff; } The red color http://www.thrillist.com/ is using on hover is #b1000e, so add: .sign-up-link:hover { color: #b1000e; }
has comment: http://stackoverflow.com/comment/43793257
has comment: http://stackoverflow.com/comment/43793352
score: 0
has comment: http://stackoverflow.com/comment/43793646
has comment: http://stackoverflow.com/comment/43793729
type: Answer
has comment: http://stackoverflow.com/comment/43793309
has comment: http://stackoverflow.com/comment/43793702
answers question: http://stackoverflow.com/q/27689705

http://stackoverflow.com/a/27716411
has comment: http://stackoverflow.com/comment/43845855
has body: $('.menu-link').click(function() { $('[id^=menu]').not('#menu' + this.id).slideUp(); $('#menu' + this.id).slideToggle(); }); .menu-item { display: none; width: 100%; height: 200px; background: rgba(0,0,0,0.5); } Menu 1 Menu 2 Menu 3 Menu 1 Menu 2 Menu 3
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/27716301
upvote count: 1
has comment: http://stackoverflow.com/comment/43845253

http://stackoverflow.com/q/27757859
type: Question
possible better answer: http://stackoverflow.com/a/27758028
accepted answer: http://stackoverflow.com/a/27758378
tagged with: javascript
has body: I am having issue with the localtime zone things in javascript. If I got a string value from the server is "2014-02-03T00:00:00.000Z", once I pass it into Date object new Date('2014-02-03T00:00:00.000Z'), the new date object will be in localtime zone ex. Sun Feb 02 2014 18:00:00 GMT-0600 (CST). How to keep the value as 'Mon Feb 03 2014 00:00:00' ? I see a lot of people is using moment.js for dealing date, but I don't find any help with this issue. Thanks
has comment: http://stackoverflow.com/comment/43926461
answer count: 2
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27758378
has comment: http://stackoverflow.com/comment/43926367
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27758028
score: 1
has title: How to keep the Date as it is without being converted into local time zone?
upvote count: 1

http://stackoverflow.com/q/27765177
has comment: http://stackoverflow.com/comment/43941131
has comment: http://stackoverflow.com/comment/43945415
has comment: http://stackoverflow.com/comment/43941608
tagged with: underscore.js
has body: I'm querying two collections to get the data from bills and transactions. After I get both, I loop transactions array for each billId. Once the billId from the transaction array matches with the _id from the bill array, I store the transaction under the bill array. So instead of having: bill_array = [{ "_id": "549bf0597886c3763e000001", "billName": "Leasing", "startDate": "2014-12-25T00:00:00.000Z", "endDate": "2017-10-14T22:00:00.000Z", "amount": 16500, "type": 4, "timestamp": "2014-12-25T11:09:13.957Z", "__v": 0 }] I can have: bill_array = [{"_id": "549bf0597886c3763e000001", "billName": "Leasing", "startDate": "2014-12-25T00:00:00.000Z", "endDate": "2017-10-14T22:00:00.000Z", "amount": 16500, "type": 4, "transactions": {[all transactions]} "timestamp": "2014-12-25T11:09:13.957Z", "__v": 0}] The code below is working in my JSfiddle test, however, when I try with real data (from the db), I can't get the map to insert the new object into the bills array. Here is the working sample: http://jsfiddle.net/dennislaymi/usanwkcL/ And here is the (not working) code on my machine: app.get('/getbills', function(req, res) { //get all bills allBills = Bills.find().exec(); //get all transactions allTransactions = Transactions.find().exec(); //aggregate bills and transactions in a promise promise.all([allBills, allTransactions]).then(function(results) { var bills = results[0]; var transactions = results[1]; _.map(bills, function(bValue) { bValue.transactions = []; _.each(transactions, function(tValue) { if (tValue.billId == bValue._id) { bValue.transactions.push(tValue); } }); console.log("transactons: " + bValue.transactions); return bValue.transactions; }); console.log(bills); res.send(bills); }); });
has title: _.map() not working when playing with real data
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43941678
has comment: http://stackoverflow.com/comment/43941138
has answer: http://stackoverflow.com/a/27765285
tagged with: javascript
tagged with: express
score: 0
has comment: http://stackoverflow.com/comment/43941032
upvote count: 1
answer count: 1
tagged with: mongoose
favorite count: 0
has comment: http://stackoverflow.com/comment/43941259
type: UnansweredQuestion

http://stackoverflow.com/comment/43785831
type: QuestionComment
has text: What happens if you put a single semicolon before the return instead of an alert? This isn't a solution, but it makes clear if it is something about the `alert` function or if it works with any statement.
score: 0
comment on: http://stackoverflow.com/q/27685863
type: Comment

http://stackoverflow.com/comment/43761796
comment on: http://stackoverflow.com/q/27673420
score: 1
has text: @Terry Could you please demonstrate that?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27771274
accepted answer of: http://stackoverflow.com/q/27770839
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43960923
upvote count: 2
has body: When the data comes back from the ajax call it needs to be mapped to your model that contains the observables. First declare the Document viewModel: function Document (document) { var self = this; self.DocID = ko.observable(document.DocID); self.DocName = ko.observable(document.DocName); self.isDocumentEdit = ko.observable(false); } Then you can use the jQuery $.map function to map the json response to your documents: function populateDocumentLocations() { ajaxHelper(url + '/api/Documents/' + self.businessList.busID().busID, 'GET').done(function (data) { var mappedDocuments = $.map(data, function(document) { return new Document(document) }); self.documents(mappedDocuments); }); } This is also in the Knockout tutorial which is a good reference: http://learn.knockoutjs.com/#/?tutorial=loadingsaving
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27770839

http://stackoverflow.com/comment/44007145
comment on: http://stackoverflow.com/q/27788356
type: Comment
score: 0
type: QuestionComment
has text: You can pass options to Nashorn using the direct nashorn interface or simply put a '#' as the first character of the script.

http://stackoverflow.com/a/27744422
has comment: http://stackoverflow.com/comment/44423879
has comment: http://stackoverflow.com/comment/44074492
downvote count: 0
answers question: http://stackoverflow.com/q/27742153
has comment: http://stackoverflow.com/comment/44438793
has comment: http://stackoverflow.com/comment/43974718
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/44090272
score: 2
has comment: http://stackoverflow.com/comment/44148057
has comment: http://stackoverflow.com/comment/43915320
has body: Since we don't know anything about your native wrapper, it's possible there are a couple of things going on: document.referrer is derived from the HTTP header Referer (note historical misspelling). It's possible that something in your iOS code is setting or suppressing that HTTP header. If your web app is hosted using URLs with file schema (as in file:///foo.html), browser engines will not set the HTTP Referer header to prevent leakage of sensitive information. (You wouldn't want to send local filenames to a remote webserver if, for example, you had a local webpage that linked out to a remote site.) If you find that one of these is happening, you can manually set the Referer header as described in "Specifying HTTP referer in embedded UIWebView"

http://stackoverflow.com/a/27713510
downvote count: 0
has comment: http://stackoverflow.com/comment/43839830
answers question: http://stackoverflow.com/q/27713449
type: Answer
has body: You can do it CSS-only, without JS: #requiredNum { display: none; } #returning_employee_yes:checked ~ #requiredNum { display: block; } *Returning Employee: Yes No *Employee Number:
score: 1
upvote count: 1

http://stackoverflow.com/q/27718189
answer count: 1
tagged with: angularjs
has body: I am trying to use High Stock Chart but rather than showing a line graph in it I want to show bar graph is there a possibility to do same JS Fiddle My end requirement is to make a graph like this Will it involve some additional CSS I need to show time slider at bottom as mentioned in screenshot On Change of time interval on slider my graph will change Please suggest on same.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27718266
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27718266
has title: How to show BAr graph rather than line graph in High Stoch Chart
score: 0
tagged with: highcharts

http://stackoverflow.com/comment/43811384
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27699220
has text: I had tested previously {{['test-name']}} was not working but binding `this` worked. great.
type: Comment

http://stackoverflow.com/q/27650584
has comment: http://stackoverflow.com/comment/43718436
accepted answer: http://stackoverflow.com/a/27650708
possible better answer: http://stackoverflow.com/a/27650687
has comment: http://stackoverflow.com/comment/43718293
has answer: http://stackoverflow.com/a/27650687
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43718287
type: Question
has body: I'm trying to add multiple modal windows to my page, but don't manage very well at it. Currently I'm using code below and I would need to modify it to be usable with multiple modals as well. HTML: Close How to install on Windows Step 1 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Step 2 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Step 3 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. How to install JS: var modal = $('.modal'); $( ".btn" ).on( "click", function() { $( modal ).toggleClass('modal--show'); }); $( ".overlay" ).on( "click", function() { $( modal ).toggleClass('modal--show'); }); $( ".modal--close" ).on( "click", function() { $( modal ).toggleClass('modal--show'); });
answer count: 2
has title: Multiple modals
has comment: http://stackoverflow.com/comment/43718327
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43718273
has answer: http://stackoverflow.com/a/27650708
score: 0
has comment: http://stackoverflow.com/comment/43718309
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43718301
linked to: http://stackoverflow.com/q/17635944

http://stackoverflow.com/a/27790992
has comment: http://stackoverflow.com/comment/43991956
type: Answer
downvote count: 0
score: 16
answers question: http://stackoverflow.com/q/27790950
has comment: http://stackoverflow.com/comment/43996300
accepted answer of: http://stackoverflow.com/q/27790950
upvote count: 16
has comment: http://stackoverflow.com/comment/43992666
type: AcceptedAnswer
has body: Try res.status.should.be.equal(400); or res.should.have.property('status', 400); And about " 'should' is a unused local variable". It's true. You don't use should directly. Only sideeffects. Try require('should'); instead.

http://stackoverflow.com/comment/43964288
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27776793
has text: Have you considered UI/UX part of mobile web app? If you were to drag across screen in Chrome (at least iOS), for example drawing, it would make you change tab and I don't think you can override it. And I think safari would register it as go backwards/forward in history.

http://stackoverflow.com/comment/43773980
score: 0
comment on: http://stackoverflow.com/a/27673329
type: AnswerComment
type: Comment
has text: I would have to see the syntax to figure out the syntax error.

http://stackoverflow.com/comment/43989911
type: QuestionComment
comment on: http://stackoverflow.com/q/27789946
has text: @TravisJ No, but now that I've seen it, it still doesn't explain it to me. Under what circumstances would `"0"` evaluate to `true`?
score: 0
type: Comment

http://stackoverflow.com/a/27651033
type: Answer
accepted answer of: http://stackoverflow.com/q/27650960
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27650960
has comment: http://stackoverflow.com/comment/43719173
has comment: http://stackoverflow.com/comment/43719197
has body: .append() should be used to add new DOM elements. To add text to an existing element, use .text. function doit(e) { e.preventDefault(); $('#item2').text( function(i, oldtext) { return oldtext + $("form[name=name_form] input[name=fname]").val()+"U WOT"; }); } You also have to use preventDefault() to prevent the form from being submitted. To match this, I changed the to: Demo: var greeting = "hello " var div = document.getElementById('#item2'); function doit(e) { e.preventDefault(); $('#item2').text(function(i, oldtext) { return oldtext + $("form[name=name_form] input[name=fname]").val() + "U WOT"; }); } // alert(greeting + document.name_form.fname.value) // // // $( " HEYTHERDUDE " + document.name_form.fname.value).appendTo($( " #item2 " )); // // div.innerHTML = div.innerHTML + 'LOOK AT ME' + document.name_form.fname.value; /***************************/ /*****CONTAINER STYLES******/ /***************************/ body { background-color: #212130; } #container { font-family: 'Exo 2', sans-serif; color: #c5c520; font-weight: 300; width: 100%; min-width: 225px; max-width: 325px; } /***************************/ /*******INPUT STYLES********/ /***************************/ .input { height: 25px; width: 100%; background-color: transparent; border-style: solid; border-width: 0px 0px 1px 0px; border-color: #c5c520; outline: 0; -webkit-transition: background-color 0.2s; -o-transition: background-color 0.2s; transition: background-color 0.2s; -webkit-transition: box-shadow 0.2s; -o-transition: box-shadow 0.2s; transition: box-shadow 0.2s; font-family: 'Exo 2', sans-serif; color: #c5c520; font-weight: 300; } .input:hover { box-shadow: inset 0 -10px 20px -10px #131322; -moz-box-shadow: inset 0 -10px 20px -10px #131322; -webkit-box-shadow: inset 0 -10px 20px border-right-width: 1px; border-left-color: #181825; border-right-color: #181825; } .input:focus { background-color: #191929; } .name_submit { color: #181825; background-color: #c5c520; border: none; } .submit_btn { display: no…
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/q/27721950
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27722018
score: 1
upvote count: 1
has body: just to clear my mind, correct me if i'm wrong. ok, let take this example: function foo() { var x = 1; return function bar() { console.log(x); }; } var b = foo(); b(); when foo is being executed code by code, and the control flow comes to function bar(), based on my understanding, this is the moment that bar.scope is assigned. foo's scopeChain in execution context is copied to bar.scope which is a collection of foo's active object (lexical environment from per ecma5) and it's ancestor's active object if any (global here) is there any misunderstanding here?
type: Question
has comment: http://stackoverflow.com/comment/43856233
has title: when function's internal scope property is assigned?
tagged with: javascript
has comment: http://stackoverflow.com/comment/43855644
has answer: http://stackoverflow.com/a/27722018
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43856154

http://stackoverflow.com/comment/132601339
has text: componentDidMount is actually called after first mount not render. componentDidUpdate is called after the state is updated, not after re-render. Rendered means entire dom painiting is completed. Right now, we don't have access to any lifecycle method to run a side-effect after render.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/40775373

http://stackoverflow.com/a/27762331
upvote count: 1
score: 1
downvote count: 0
has body: click was triggered before the change's event handler was regestered. $('input[name="location"]').change(function() { var location = $('input[name="location"]:checked').val(); var category = getUrlVars()["category"]; $.post( 'db/functions/package_conf.php', {category:category, location:location}, function(data) { $('#package_info').html(data); }); }); $("input:radio[name='location'][value='3']").click();
type: Answer
answers question: http://stackoverflow.com/q/27761789

http://stackoverflow.com/comment/44005825
type: AnswerComment
has text: thanks a lot. this by the making the controller specific to a certain module yeah ?
type: Comment
comment on: http://stackoverflow.com/a/27798551
score: 0

http://stackoverflow.com/q/27704727
duplicate of: http://stackoverflow.com/q/27459899
linked to: http://stackoverflow.com/q/25713118
has answer: http://stackoverflow.com/a/27708961
type: Question
downvote count: 0
answer count: 1
has title: How to run multiple actions in one gulp task?
tagged with: javascript
favorite count: 0
tagged with: gulp
tagged with: node.js
tagged with: npm
upvote count: 2
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/27459899
has body: How can I run multiple actions in one gulp task? The following doesn't work as things seem to run out of order and cause all kinds of strange errors. I've tried event-stream's merge like in How to perform multiple gulp commands in one task but that doesn't seem to work with del. I know I can divide it into multiple tasks and use the run-sequence plugin, but like in the linked question I don't want to bloat my Gulpfile with tasks that will never be run individually and don't make sense outside of a given context. gulp.task('task', function() { del('....'); gulp.src('....') .pipe(gulp.dest('....')); gulp.src('....') .pipe(gulp.dest('....')); });
score: 2
has comment: http://stackoverflow.com/comment/43822823

http://stackoverflow.com/q/27791484
has answer: http://stackoverflow.com/a/27791548
accepted answer: http://stackoverflow.com/a/27791548
upvote count: 4
tagged with: css
possible better answer: http://stackoverflow.com/a/27791546
has comment: http://stackoverflow.com/comment/43992773
has comment: http://stackoverflow.com/comment/44000064
type: AnsweredQuestion
downvote count: 0
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27791546
score: 4
linked to: http://stackoverflow.com/q/490910
has title: jQuery .css() method not working
answer count: 3
has comment: http://stackoverflow.com/comment/43992765
has comment: http://stackoverflow.com/comment/43993123
has comment: http://stackoverflow.com/comment/43993236
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/9398870
has body: I have a code that uses jQuery .css() method to modify the style of a DIV but it is not working. Here is a simplified version of my code that replicates the issue. HTML: Left Right XXXXXXXXX CSS: #cfwrapper { bottom: 10px; left: 30px; position: fixed; } JavaScript: $("input:radio[name=show]").click(function(event){ if (event.target.id == 'showleft') { // remove property 'right:30px' // add property 'left:30px' } else if (event.target.id == 'showright') { $('#cfwrapper').css('left',''); // remove property 'left:30px' // add property 'right:30px' } }); What happens in the above code is that the line $('#cfwrapper').css('left',''); does not work. I would expect it to remove the 'left' property from "cfwrapper" ("XXXXXXXXX" would then move 30px to the left) and then I would use a similar statement - $('#cfwrapper').css('right','30px'); - to add a "right" property so that "XXXXXXXXX" would then go to the right of the page, but it does not work. Can anyone tell me why it is not working? Wasn't it supposed to work? JSFiddle: http://jsfiddle.net/fidnut/hLqngbsb/
has comment: http://stackoverflow.com/comment/43993718
has answer: http://stackoverflow.com/a/27791562

http://stackoverflow.com/a/27790570
type: Answer
answers question: http://stackoverflow.com/q/27790508
score: 0
has body: Posting here since I am unable to comment... It looks like you have type="hidden" in your input element. This is likely why you aren't seeing the cityName value appear.

http://stackoverflow.com/comment/43795373
type: Comment
has text: Well than I would add value="<?php echo $_POST['shortby']; ?>" and value="<?php echo $_POST['radius']; ?>" would solve that. but radius is still not posting on submit.
comment on: http://stackoverflow.com/a/27690570
type: AnswerComment
score: 0

http://stackoverflow.com/a/27744440
has comment: http://stackoverflow.com/comment/43899780
type: Answer
has comment: http://stackoverflow.com/comment/43899826
has comment: http://stackoverflow.com/comment/43899799
upvote count: 1
has comment: http://stackoverflow.com/comment/43899739
has comment: http://stackoverflow.com/comment/43899913
has comment: http://stackoverflow.com/comment/43899908
score: 1
has body: Have you tried: var people = document.getElementById("attendees").textContent; ? Or the cross-browser-friendly: var people = $("#attendees").text();
has comment: http://stackoverflow.com/comment/43899959
has comment: http://stackoverflow.com/comment/43900148
downvote count: 0
answers question: http://stackoverflow.com/q/27744413

http://stackoverflow.com/comment/43957223
comment on: http://stackoverflow.com/a/27773123
type: AnswerComment
type: Comment
has text: #1 Avoiding creating watches is probably a good instinct in the controller code, but Angular creates a lot of watches for you anyway. And I was careful to only have two watches at all times, by deregistering the previous one. #2 See the example of my button to set A to 5. If you click that button while "set to A", the input should update, which only works if you set up a watch on the property being edited.
score: 0

http://stackoverflow.com/comment/43896609
has text: Are there any errors? What is your HTML? What exactly is happening?
score: 0
comment on: http://stackoverflow.com/q/27742911
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27735083
upvote count: 0
has answer: http://stackoverflow.com/a/27737835
has answer: http://stackoverflow.com/a/68520783
has comment: http://stackoverflow.com/comment/43885504
type: Question
has comment: http://stackoverflow.com/comment/43881676
linked to: http://stackoverflow.com/q/2815683
has title: Dynamically change element's TagName
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27765783
score: -1
has answer: http://stackoverflow.com/a/27765783
answer count: 3
has body: According to the jQuery API's Documentation I'm using the correct event handler. I'm also aware of the IE issue stated as well, and I don't care, as this is merely just a playful experiment. Note: Attempting to change the type property (or attribute) of an input element created via HTML or already in an HTML document will result in an error being thrown by Internet Explorer 6, 7, or 8. So I have been trying to get this to work and I'm left with a few questions: Is this possible? If so what am I doing wrong & how can I fix it? Edit My intention is to change .selected's tag from a span to whatever the user specified. I originally used a button as an example, but I saw how easily my post was misunderstood. As my intentions are to change the span tag to anything from a button to a input[type=text] element. All depending on what the user types in a textbox. I don't see how replaceWidth is going to help me in this case. How can I understand more about this? $(document).ready(function() { // Show active tag $(".activetag").html( $(".selected").prop("tagName").toLowerCase() ); // Change selected element's tag $(".convert").on("keyup", function() { $(".selected").replaceWidth( $("div") ).html( $(".selected").html() ); }); // Show selected element's code // ex. Hello world $(".code").val( $(".selected").html() ); }); new document Hello world Hello world
downvote count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43881780
favorite count: 0
has comment: http://stackoverflow.com/comment/43894631
linked to: http://stackoverflow.com/q/3435871
has comment: http://stackoverflow.com/comment/43881619
has comment: http://stackoverflow.com/comment/43881756
accepted answer: http://stackoverflow.com/a/27737835
has comment: http://stackoverflow.com/comment/43881944
has comment: http://stackoverflow.com/comment/43881768
has comment: http://stackoverflow.com/comment/43881681
has comment: http://stackoverflow.com/comment/43881716
type: AnsweredQuestion

http://stackoverflow.com/comment/43757022
has text: **Uncaught SecurityError**: ***Protocols, domains, and ports must match.***
comment on: http://stackoverflow.com/q/27671139
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27738009
answers question: http://stackoverflow.com/q/27737643
score: 0
has body: KG Lb's
type: Answer

http://stackoverflow.com/q/27689340
type: AnsweredQuestion
has title: Avoiding extra event call in Bootstrap Modal
type: Question
accepted answer: http://stackoverflow.com/a/27689772
has comment: http://stackoverflow.com/comment/43792100
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43791870
has comment: http://stackoverflow.com/comment/43791869
score: 1
favorite count: 0
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/27689772
upvote count: 1
has body: I am trying to load data in Bootstrap Modal using ajax request. This is my sample code : http://jsfiddle.net/tejashsoni111/f97gpwte/2/ HTML : &lt;!-- Button trigger modal --&gt; &lt;button type="button" class="btn btn-primary btn-lg" id="button"&gt; Launch demo modal &lt;/button&gt; &lt;div id="exec_count"&gt;&lt;/div&gt; &lt;!-- Modal --&gt; &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Modal title&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; ... &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; JS : var count=0 $("#button").click(function(){ $('#myModal').on('shown.bs.modal', function (e) { count++; jQuery("#exec_count").append("&lt;span&gt;"+count+"&lt;/span&gt;&lt;/br&gt;"); }); $('#myModal').modal('show'); $('#myModal').on('hide.bs.modal', function (e) { count=0; jQuery("#exec_count").append("&lt;/br&gt;"); }); }); The problem is, after each time button is pressed the event call is increased by one. So every time number of ajax calls are also increased with the event call. In the example, I have replace the ajax code with display event call count. I am not able to find any solution for avoiding extra calls. Any help will be appreciated, Thanks in advance.

http://stackoverflow.com/q/27706034
tagged with: layout
tagged with: javascript
has title: extjs layout scroll inside vbox
tagged with: extjs
answer count: 1
downvote count: 0
tagged with: extjs5
favorite count: 0
tagged with: sencha-touch
upvote count: 2
has answer: http://stackoverflow.com/a/27706611
has comment: http://stackoverflow.com/comment/43824729
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43824794
accepted answer: http://stackoverflow.com/a/27706611
has body: I have a problem with adding scrollbar to grid, that is inside of vbox container. I can not assign height directly, because I do not know it. In that vbox container also is 'another content' with undefined height, so I can not use neither 'height', neither 'flex'. I need to make grid fill all remaining space in the page, and if there will be more rows than it could fit - i need to add scrollbar to that grid. This is most important part of code: { layout: { type: 'vbox', align: 'stretch' }, items:[ { title: 'center' },{ html: 'another content' },{ xtype: 'grid', autoScroll: true, // &lt;-- this is not working columns: [ { text: 'User', dataIndex: 'userId' } ], store: new Ext.data.Store({ model: 'Ext.data.Record', fields: [ { name: 'userId', type: 'string' } ], data: ( function(){ var res = [] for(var i=0; i&lt;1000; i++){ res.push({ userId: 'User'+i}); } return res; })() }) } ] } I tryed a lot of variants, but no success. I also prepere some fiddles for most logical solutions(but scroll is not working there anyway): https://fiddle.sencha.com/#fiddle/fmo https://fiddle.sencha.com/#fiddle/fmp Any help will be good.
type: Question

http://stackoverflow.com/comment/43937284
has text: you are tying to center the canvas window ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27763195
score: 0

http://stackoverflow.com/q/27758106
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27758164
has title: Pulling information from API and adding it to database (MEAN stack)
tagged with: node.js
has body: I feel like a complete moron but me and a friend are working on a project together and having trouble getting the first route to return the items requested from the Etsy API and have getAllListings add the items to the database. If you can see something glaringly obvious that we are doing wrong please let me know. I should also mention that while the statement console.dir(body) does print out the items to the terminal it does not look like the contents are being passed to GET '/api/etsy/getListings' Thanks! routes.js //this i want to return a list of active listings from the users shop. app.get('/api/etsy/getListings',function(req, res){ bEtsy.getAllListings(req, res, function(err, body) { }); res.json(req.body); }); bEtsy.js var standardCallback = function (err, status, body, headers, callback) { if (err) { console.log(err); return callback(err, null); } if (body) { console.dir(body); return callback(null, body); // this gives me an error } } var getAllListings = function(itemId, callback){ var Item = mongoose.model('Item'); var listingsParams = { include_private: true } etsy.auth().get( '/shops/'+etsy.shop+'/listings/active', listingsParams, function(err, status, body, headers){ var newi = new Item({name: body.title, stock: body.count, owner: "00000000000000000000", etsy:{listingId: body.listing_id, stock: body.count}}); newi.save(function(err){ if (err) return handError(err); }); standardCallback(err, status, body, headers, callback); } ); };
type: AnsweredQuestion
score: 0
accepted answer: http://stackoverflow.com/a/27758164
type: Question
tagged with: mean-stack
tagged with: mongodb

http://stackoverflow.com/q/27669012
has comment: http://stackoverflow.com/comment/43754606
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/43752814
has comment: http://stackoverflow.com/comment/43757531
accepted answer: http://stackoverflow.com/a/27669114
score: 13
tagged with: css
possible better answer: http://stackoverflow.com/a/27669134
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27669134
upvote count: 14
downvote count: 1
type: Question
answer count: 2
has body: I was Creating an WebApp which requires to take Percentages of various Chemicals like (HCl[Hydrochloric acid], NaOH[Sodium Hydroxide] etc) as Input from User. So Here is what I'm Doing to do that in HTML: and this works fine in most of the cases, But Now My Client have an requirement of Entering Percentage of Chemicals like H2SO4, SiO2 etc. So Here is what I've Used for that: Fiddle But with No Success. So Now I have a question: How can we Format placeholders of html input to show Formatted Text like the one mentioned here? I know the possible solution to this scenario is: Use label outside of which will have that formatted text inside it like: Enter H2O% : Fiddle and also I'm using this approach right now; But Still I'm curious in knowing can it be done with placeholders too? Using CSS or CSS3? If not Then using JS? Any suggestions are welcome. Hope Experts will help me with this. Thanks in advance :)!
tagged with: javascript
has answer: http://stackoverflow.com/a/27669114
has comment: http://stackoverflow.com/comment/43757496
has comment: http://stackoverflow.com/comment/43757256
has title: html5 - using formatted placeholder for scientific inputs

http://stackoverflow.com/comment/43906196
comment on: http://stackoverflow.com/a/27648032
type: Comment
score: 0
type: AnswerComment
has text: While geolocation was something I wanted to avoid, it looks like because of webkit bug I have to go to that direction. Thank you for thinking about this problem with me.

http://stackoverflow.com/comment/44009362
type: QuestionComment
has text: What is wrong with your code is it not working?
comment on: http://stackoverflow.com/q/27800367
score: 0
type: Comment

http://stackoverflow.com/comment/43942164
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27765285
type: AnswerComment
has text: is there any chance you could give me a example applied to my code? There are no enough examples on web related to _.map or _.each. At least for adding multiple arrays into a object as in my example. Thanks

http://stackoverflow.com/a/57576219
answers question: http://stackoverflow.com/q/27751121
type: Answer
score: 5
upvote count: 6
downvote count: 1
has comment: http://stackoverflow.com/comment/116911975
has comment: http://stackoverflow.com/comment/101612625
has body: The Object.assign() method is used to copy the values of all enumerable own properties from one or more source objects to a target object. It will return the target object. Properties in the target object will be overwritten by properties in the sources if they have the same key. var obj = { a: 1, b: 2, }; var new_obj = Object.assign({}, obj); console.log(new_obj); //{ a: 1, b: 2, } console.log(new_obj == obj); //false

http://stackoverflow.com/comment/43912772
type: Comment
comment on: http://stackoverflow.com/q/27750761
type: QuestionComment
has text: Hmmm that is what I was looking for I think. Does that allow you to keep all libraries in individual (or optionally combining certain ones) files and still load them dynamically?
score: 0

http://stackoverflow.com/a/27678113
score: 0
has body: I have checked the condition for various degrees i.e 0,-1, and 45 function rotateAnimation(){ if(degrees==45){ for (degrees = 45; degrees &gt; -1; degrees--){ setTimeout(function(x){return function(){document.getElementById('thing').style.transform = "rotate("+x+"deg)";}}(degrees),20*(45-degrees)); } } if(degrees==0 ){ for (degrees = 0; degrees &lt; 45; degrees++){ setTimeout(function(x){return function(){document.getElementById('thing').style.transform = "rotate("+x+"deg)";}}(degrees),20*degrees); } } else if(degrees==-1){ degrees=0; } } Demo: http://jsfiddle.net/RahulB007/0r9ydm1x/1/
has comment: http://stackoverflow.com/comment/43821942
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27677861
accepted answer of: http://stackoverflow.com/q/27677861
type: Answer

http://stackoverflow.com/a/27761142
upvote count: 1
has comment: http://stackoverflow.com/comment/43948971
score: 1
has comment: http://stackoverflow.com/comment/43953372
answers question: http://stackoverflow.com/q/27755724
has body: For each ASP.NET view you create a ViewModel which is bound to the mvc view. I would name the ViewModel after the ASP.NET MVC model. ASP.NET MVC Model: public class LoginViewModel { [Required] [Display(Name = "Email")] [EmailAddress] public string Email { get; set; } [Required] [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [Display(Name = "Remember me?")] public bool RememberMe { get; set; } } Knockout ViewModel: var LoginViewModel = function () { var self = this; self.email = ko.observable(); self.password = ko.observable(); self.rememberMe = ko.observable(); self.login = function () { ... } }; I normally bundle up all the viewmodels .js using ASP.NET bundling and then in each MVC view the Knockout view model would then be bound. $(function() { ko.applyBindings(new LoginViewModel()); }); If you needed to populate the model from the mvc model on first load I would serialise to json using json.net and then pass that into the ViewModel contractor: var loginModel = '@JsonConvert.SerializeObject(Model)'; $(function() { ko.applyBindings(new LoginViewModel(loginModel)); }); Then in your knockout ViewModel you can populate the observables from the model passed into the contractor: var LoginViewModel = function (loginModel) { var self = this; self.email = ko.observable(loginModel.email); self.password = ko.observable(loginModel.password); self.rememberMe = ko.observable(loginModel.rememberMe); In order to use camel case for the json I change json.net to serialise to camlecase. You would use some MasterViewModel as explained by super cool if you having a complex page similar to a SPA such as a form page with multiple steps, essentially a page with multiple view states.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27755724
downvote count: 0
has comment: http://stackoverflow.com/comment/44116594
type: Answer

http://stackoverflow.com/q/27696647
has answer: http://stackoverflow.com/a/27696663
downvote count: 1
type: Question
has body: var contacts = { 'addressBook' : [ { 'name': 'hillisha' 'email': 'hill@example.com', }, { 'name': 'neil' 'email': 'neil@example.com', }, { 'name': 'brian' 'email': 'brian@example.com', }, { 'name': 'matt' 'email': 'matt@example.com', }, { 'name': 'mike' 'email': 'mike@example.com', } ] }; error pops up saying unexpected string. Not sure why and need help. I am trying to just run a rather simple loop and it isn't expecting string.
tagged with: javascript
score: -1
upvote count: 0
accepted answer: http://stackoverflow.com/a/27696663
answer count: 1
tagged with: string
favorite count: 0
has comment: http://stackoverflow.com/comment/43806517
has title: Having trouble with my string. Error pops up saying "unexpected string"
type: AnsweredQuestion

http://stackoverflow.com/q/27753655
has comment: http://stackoverflow.com/comment/43918229
score: 1
type: Question
has answer: http://stackoverflow.com/a/27754163
has answer: http://stackoverflow.com/a/27753792
tagged with: javascript
tagged with: jquery
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27753742
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44139746
tagged with: web
has comment: http://stackoverflow.com/comment/43929688
favorite count: 0
type: UnansweredQuestion
has body: Working Environment: I have a website that must have an image background (pretend its a math problem and there is no choice but to accept this). Is there a way for me to format my html and CSS so that background loads faster? One Idea I had was instead of having the "body" carry the image background, to instead partition the site into rows (using the tag) in the hopes the browser will load the divs, hence it can present some of the visible portions of the site before having loaded EVERYTHING. I'm pretty sure my method of manual div separation (And setting backgrounds of each slice) isn't the the most efficient approach to this. What is the best way to carry out this technique?
has title: Speeding up Page Loads for Image Background
tagged with: css
downvote count: 0

http://stackoverflow.com/a/27779261
upvote count: 1
has comment: http://stackoverflow.com/comment/43969225
score: 1
downvote count: 0
has body: Please try this private void Read(IAsyncResult ar) { int sizeOfReceivedData = ConnectionSocket.EndReceive(ar); if (sizeOfReceivedData &gt; 0) { int start = 0, end = sizeOfReceivedData - 1; var bufferList = dataBuffer.ToList(); bool endIsInThisBuffer = dataBuffer.Contains(255); // 255 = end if (endIsInThisBuffer) { end = bufferList.IndexOf(255); end--; // we dont want to include this byte } bool startIsInThisBuffer = dataBuffer.Contains(0); // 0 = start if (startIsInThisBuffer) { var zeroPos = bufferList.IndexOf(0); if (zeroPos &lt; end) // we might be looking at one of the bytes in the end of the array that hasn't been set { start = zeroPos; start++; // we dont want to include this byte } } dataString.Append(Encoding.UTF8.GetString(dataBuffer, start, (end - start) + 1)); if (endIsInThisBuffer) { var data = dataString.ToString(); OnDataReceived(new DataReceivedEventArgs(data.Length, data)); // Testing to see if readable ReadRecievedData(data); dataString = new StringBuilder(); } Listen(); } else // the socket is closed { if (Disconnected != null) Disconnected(this, EventArgs.Empty); } }
type: Answer
answers question: http://stackoverflow.com/q/27777564

http://stackoverflow.com/comment/54165034
type: AnswerComment
type: Comment
has text: I currently have some issues with Microsoft Edge that's why I'm investigating on this. I have a form which I set its target to an iframe. So I looked what Chrome is populating to my iframe after POSTing the form. There is 10 JavaScript files loaded, all are written by "The Chromium Authors" and one is actually named "pdf.js". Go to chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf.js in Chrome you will get the library automatically loaded. So I doubt in that case a 100% C++ code is used.
comment on: http://stackoverflow.com/a/27771671
score: 0

http://stackoverflow.com/q/27777620
has comment: http://stackoverflow.com/comment/43966103
has answer: http://stackoverflow.com/a/27778430
tagged with: javascript
score: 0
has title: Is it possible to reference scope in angularjs like in c#?
has comment: http://stackoverflow.com/comment/43965922
has comment: http://stackoverflow.com/comment/43966135
answer count: 1
has body: I have a problem in referencing angularjs scopes like in c# or c++. Here is the scenario: I have a code like this in HTML. {{year}} Here is another html code (another dropdown) {{year}} That summer1 and summer2 is a scope. Here is my code in controller $scope.SetYear = function(yearValue,myRef){ myRef = year; }; The logic here is to save year to myRef. I tried this one {{year}} but it didn't work.. i try to make that one scope function for all dropdown because i might have many dropdown that will use that function. Is there any solution to my problem.. and is there any referencing in angular?
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27778430
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43967143
has comment: http://stackoverflow.com/comment/43965900
type: Question

recaptcha
tags question: http://stackoverflow.com/q/27776964
tag name: recaptcha
tags question: http://stackoverflow.com/q/27706594
tags question: http://stackoverflow.com/q/27697406
tags question: http://stackoverflow.com/q/27713505
type: Tag

http://stackoverflow.com/comment/43896461
has text: And thats the problem :( i just need to get a normal HTTP post form submit instead of the angularjs form ajax submit
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27742552

http://stackoverflow.com/q/27783393
has comment: http://stackoverflow.com/comment/43976884
upvote count: 2
has comment: http://stackoverflow.com/comment/43977584
accepted answer: http://stackoverflow.com/a/27784015
answer count: 1
tagged with: end-to-end
favorite count: 0
has comment: http://stackoverflow.com/comment/43977125
tagged with: angularjs
has answer: http://stackoverflow.com/a/27784015
has body: When trying to test a visible button on a modal window using protractor and angular, I receive the error following error: UnknownError: unknown error: Element is not clickable at point (400, 234). Other element would receive the click: ... '. I have tried resizing the window to a larger size in the before each statement, and have tried a scrollTo the top of the page before the click as well. Any suggestions? Code: it('should create a new portfolio when modal form is completed', function () { portfolio_create_btn.first().click().then(); element(by.model('portfolios.portName')).sendKeys('Test'); element(by.css('#portfolio-modal-create-button')).click(); Tabs.filter(function (elem, index) { return elem.getTagName('tab-heading').getText(); }).then(function (filteredElements) { expect(filteredElements.length).toEqual(expect_tabs_len_start + 1); }); }); Most of the HTML: Portfolios Create New
has title: Protractor + angular error - Element is not clickable at point
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/43977292
type: Question
tagged with: testing
tagged with: protractor
tagged with: javascript

http://stackoverflow.com/q/27711699
tagged with: node.js
type: AnsweredQuestion
tagged with: socket.io
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27712506
answer count: 1
accepted answer: http://stackoverflow.com/a/27712506
has body: I am stuck at the get-started part of socket.io tutorial, on emitting events. Before that, I did get the user connected and user disconnected in the console. However, in the emitting part, I don't get any message passed by the socket.io client in the console. This is the code so far: index.js: var app = require('express')(); var http = require('http').Server(app); var io = require('socket.io')(http); app.get('/', function(req, res){ res.sendFile(__dirname+'/index.html'); }); io.on('connection', function(socket){ socket.on('chat message', function(msg){ console.log('message: ' + msg); }); }); http.listen(3000, function(){ console.log('listening on *:3000'); }); index.html: Socket.IO chat Send I would really appreciate if you could guide me through this problem. Thank you.
has title: not getting the values passed by the socket.io client
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43956001
has text: It is a good idea... However, there is limitation for my case that I cannot change any code in C# project... By the way, it is a good solution
comment on: http://stackoverflow.com/a/27740711
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27667213
type: UnansweredQuestion
answer count: 0
score: 0
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/43749540
has comment: http://stackoverflow.com/comment/43749472
tagged with: autocomplete
tagged with: jsp
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43749271
has body: suggesstion text box where the data should come from database and once selected it should auto-populate from database. How to use autocomplete in Jquery too. Here is my code, Index.jsp ` <%@page contentType="text/html" pageEncoding="UTF-8"%> Country : ` list.jsp ` <%@page import="java.io.PrintWriter"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@ page import ="java.sql.*" %> <% out.println("came"); try{ Class.forName("com.mysql.jdbc.Driver"); Connection connection; connection=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root", "root"); Statement statement = connection.createStatement() ; ResultSet rs; rs =statement.executeQuery("select * from sss where uname like '%"+request.getParameter("q")+"%';"); while(rs.next()) { out.println(rs.getString(1)); } } catch(Exception e) { out.println("wrong entry"+e); } %> ` Thanks in advance.
has title: How to do auto-suggesstion which should come from Database and once selected it should autopopulate the text box?

http://stackoverflow.com/a/27747472
accepted answer of: http://stackoverflow.com/q/27747333
answers question: http://stackoverflow.com/q/27747333
has comment: http://stackoverflow.com/comment/43905998
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43906065
type: Answer
has comment: http://stackoverflow.com/comment/43906243
score: 4
has body: You are calling imageLoader, not passing as a function to call. Replace fileInput.addEventListener('change', imageLoader(), false); by fileInput.addEventListener('change', imageLoader, false);

http://stackoverflow.com/a/27660204
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43751608
answers question: http://stackoverflow.com/q/27659822
has comment: http://stackoverflow.com/comment/43751726
accepted answer of: http://stackoverflow.com/q/27659822
type: Answer
has body: As an alternative to doing date arithmetic from scratch, why not use a library like moment.js which has done all of the hard work for us: var totalWeeks = moment(end).diff(moment(start), 'weeks'); jsFiddle Demo
score: 4

http://stackoverflow.com/a/27659281
score: 2
has body: Can you please detail the reason why would the second example be better? I'll be happy to get an ever wider explanation that would help me understand the concept.. It's all about concurrency for network servers (thus the name "node"). If this were in a build script the second, synchronous example would be "better" in that is is more straightforward. And given a single disk, there might not be much actual benefit to making it asynchronous. However, in a network service, the first, synchronous version would block the entire process and defeat node's main design principle. Performance would be slow as number of concurrent clients increased. However the second, asynchronous example, would perform relatively well as while waiting for the relatively-slow filesystem to come back with results, it could handle all the relatively-fast CPU operations concurrently. The async version should basically be able to saturate your filesystem and however much your filesystem can deliver, node will be able to get it out to clients at that rate.
downvote count: 0
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27659116

http://stackoverflow.com/q/27771523
upvote count: 2
tagged with: http://stackoverflow.com/tag/json
has title: d3 force directed graph, links not being drawn
type: Question
tagged with: graph
has body: I'm new to d3 and haven't much web frontend development experience. For a web application I have I'm trying to draw a force directed graph. I've been trying the last few hours to get it to work. I've been looking at lots of different code example and what I'm doing looks very similar. I eventually got nodes to draw but the links between the nodes don't show up and I was trying different things and nothing seems to work. I don't know why my code wouldn't draw the edges. From printing the nodes and links to the console I saw that the nodes got extra attributes like the d3 docs had mentioned but the links never seem to get these attributes. Below is my javascript file and the JSON file. I reduced the JSON file to only 3 entries to try and make it easier to solve the problem. var height = 1080; var width = 1920; var color = d3.scale.category20(); var force = d3.layout.force() .linkDistance(-120) .linkStrength(30) .size([width, height]); var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); d3.json("/static/javascript/language_data.json", function(data){ force .nodes(data.languages) .links(data.language_pairs) .start(); var link = svg.selectAll(".link") .data(data.language_pairs) .enter().append("line") .attr("class", "link"); var node = svg.selectAll(".node") .data(data.languages) .enter().append("circle") .attr("class", "node") .attr("r", 5) .style("fill", function(d) { return color(d.group); }) .call(force.drag); node.append("title") .text(function(d) { return d.language; }); force.on("tick", function() { link.attr("x1", function(d) { return d.source.x; }) .attr("y1", function(d) { return d.source.y; }) .attr("x2", function(d) { return d.target.x; }) .attr("y2", function(d) { return d.target.y; }); node.attr("cx", function(d) { return d.x; }) .attr("cy", function(d) { return d.y; }); }); }); Here is the JSON file: From looking at few examples my understanding is that the source and target are index positions from the list of nodes. {…
tagged with: force-layout
tagged with: javascript
has answer: http://stackoverflow.com/a/27771820
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/27771820
favorite count: 0
tagged with: d3.js
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/43806747
type: AnswerComment
comment on: http://stackoverflow.com/a/27696699
type: Comment
has text: Ahh. That makes sense. 1 follow-up question: I've read that the `streams` module is unstable (I know it has a 2 stability index) and people suggest other libs in it's place. Is it generally good to trust that advice or is it more case-by-case and `streams` can be somewhat relied upon?
score: 0

http://stackoverflow.com/a/27759177
answers question: http://stackoverflow.com/q/27759137
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: I think you want to have your h2 closed before setting it as the variable tem: change to
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27759137
score: 1

http://stackoverflow.com/q/27752624
tagged with: javascript
has comment: http://stackoverflow.com/comment/43916235
has title: How to detect the media query in use?
answer count: 1
downvote count: 0
favorite count: 0
has body: How to detect which the media query is in use,like" @media (max-width: 979px) { .menubar ul li a { border: 1px solid transparent; color:rgb(148,168,148) ; display: block; margin: 0; padding: 3px 13px; position: relative; text-align: center; z-index: 400; font-size:14px; } } @media (max-width: 1200px) { .menubar ul li a { padding: 10px 15px; text-align: left; font-size:19px ; } } I just want a method to get the matched media query string,return "@media (max-width: 979px)" or "@media (max-width: 1200px)" in this case.
type: UnansweredQuestion
tagged with: css
score: 1
has answer: http://stackoverflow.com/a/27752690
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/6747242

http://stackoverflow.com/comment/43806068
has text: Originally, I downvoted this answer because I, however long ago, misread this: http://goo.gl/xPBv4F to mean that you shouldn't use wrapper objects for primitive types -- without taking into consideration that you could be type casting. That being said, your print function would attempt to print the results of your match... like with an actual printer. Maybe you meant console.log?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27695887
score: 0

arrays
tags question: http://stackoverflow.com/q/27786879
tags question: http://stackoverflow.com/q/27798204
tags question: http://stackoverflow.com/q/27671904
tags question: http://stackoverflow.com/q/27782397
tags question: http://stackoverflow.com/q/27647032
type: Tag
tags question: http://stackoverflow.com/q/27667818
tags question: http://stackoverflow.com/q/27662454
tags question: http://stackoverflow.com/q/27769338
tags question: http://stackoverflow.com/q/27651176
tags question: http://stackoverflow.com/q/27792422
tags question: http://stackoverflow.com/q/27731313
tags question: http://stackoverflow.com/q/27739040
tags question: http://stackoverflow.com/q/27666011
tags question: http://stackoverflow.com/q/27669105
tags question: http://stackoverflow.com/q/27671347
tags question: http://stackoverflow.com/q/27770402
tags question: http://stackoverflow.com/q/27705946
tags question: http://stackoverflow.com/q/27644953
tags question: http://stackoverflow.com/q/27761828
tags question: http://stackoverflow.com/q/27759809
tags question: http://stackoverflow.com/q/27647387
tags question: http://stackoverflow.com/q/27695597
tags question: http://stackoverflow.com/q/27697720
tags question: http://stackoverflow.com/q/27780393
tags question: http://stackoverflow.com/q/27780325
tags question: http://stackoverflow.com/q/27655974
tags question: http://stackoverflow.com/q/27737288
tags question: http://stackoverflow.com/q/27714733
tags question: http://stackoverflow.com/q/27711981
tags question: http://stackoverflow.com/q/27734661
tags question: http://stackoverflow.com/q/27761332
tags question: http://stackoverflow.com/q/27684465
tags question: http://stackoverflow.com/q/27659087
tags question: http://stackoverflow.com/q/27737674
tags question: http://stackoverflow.com/q/27698083
tags question: http://stackoverflow.com/q/27704476
tags question: http://stackoverflow.com/q/27733192
tags question: http://stackoverflow.com/q/27732824
tags question: http://stackoverflow.com/q/27797601
tags question: http://stackoverflow.com/q/27768959
tags question: http://stackoverflow.com/q/27716673
tags question: http://stackoverflow.com/q/27739892
tags question: http://stackoverflow.com/q/27709520
tags question: http://stackoverflow.com/q/27658430
tags question: http://stackoverflow.com/q/27732651
tags question: http://stackoverflow.com/q/27755622
tags question: http://stackoverflow.com/q/27725822
tags question: http://stackoverflow.com/q/27718857
tags question: http://stackoverflow.com/q/27679764
tags question: http://stackoverflow.com/q/27652827
tags question: http://stackoverflow.com/q/27689925
tags question: http://stackoverflow.com/q/27801184
tags question: http://stackoverflow.com/q/27720489
tags question: http://stackoverflow.com/q/27693443
tags question: http://stackoverflow.com/q/27791980
tags question: http://stackoverflow.com/q/27668405
tags question: http://stackoverflow.com/q/27741114
tags question: http://stackoverflow.com/q/27662980
tags question: http://stackoverflow.com/q/27682679
tags question: http://stackoverflow.com/q/27783698
tags question: http://stackoverflow.com/q/27703407
tags question: http://stackoverflow.com/q/27764985
tag name: arrays
tags question: http://stackoverflow.com/q/27660622
tags question: http://stackoverflow.com/q/27798751
tags question: http://stackoverflow.com/q/27789355
tags question: http://stackoverflow.com/q/27695735
tags question: http://stackoverflow.com/q/27779673
tags question: http://stackoverflow.com/q/27712080
tags question: http://stackoverflow.com/q/27729956
tags question: http://stackoverflow.com/q/27726838
tags question: http://stackoverflow.com/q/27753706
tags question: http://stackoverflow.com/q/27715424
tags question: http://stackoverflow.com/q/27654146
tags question: http://stackoverflow.com/q/27782720
tags question: http://stackoverflow.com/q/27679656
tags question: http://stackoverflow.com/q/27738501
tags question: http://stackoverflow.com/q/27669345
tags question: http://stackoverflow.com/q/27747319

http://stackoverflow.com/comment/43886111
has text: @jfriend00 Yes and no. If a var were re-declared as `undefined` in every loop, the issue you not be present.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27737345
score: 1

http://stackoverflow.com/comment/43793986
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27690127
has text: This is pac script i want to use for my headless server. when i run apt-get update i get these errors W: Failed to fetch http://stingray.cyber.net.pk/pub/ubuntu/dists/trusty-proposed/Release.gpg Could not resolve 'stingray.cyber.net.pk'
type: Comment

http://stackoverflow.com/q/27673452
linked to: http://stackoverflow.com/q/22493723
has comment: http://stackoverflow.com/comment/43762086
tagged with: metalanguage
has answer: http://stackoverflow.com/a/27676139
has comment: http://stackoverflow.com/comment/43762081
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43762040
has title: Programmatically convert synchronous code to asynchronous code
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has body: I am writing a parser for a metalanguage to be run in the browser. The metalanguage is blocking, but needs to be converted to nonblocking in the interpreter due to the limitations of javascript. For example, the metalanguage code might look something like 1. dosomething(4) 2. dosomethingelse(1) 3. dosomething(7) 4. goto 2 with the functions implemented in javascript as function dosomething(n, callback) { ... // do something with n setTimeout(callback, 1000); } function dosomethingelse(n, callback) { ... // do something else with n setTimeout(callback, 1000); } Without the goto statements, this would be easy to compile to javascript and then eval. However, I have no clue how to implement the gotos. Any help is appreciated.
has comment: http://stackoverflow.com/comment/43762112
has comment: http://stackoverflow.com/comment/43762206
has answer: http://stackoverflow.com/a/27673721
score: 2
tagged with: interpreter
has comment: http://stackoverflow.com/comment/43762076
type: Question
has comment: http://stackoverflow.com/comment/43762060
has comment: http://stackoverflow.com/comment/43762053
tagged with: javascript

http://stackoverflow.com/comment/44004314
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27787531
has text: @BenjaminGruenbaum I like. Although that'll return an undefined rather than a null, so I could do `(myFn() || [null])[0]` if I needed a null

http://stackoverflow.com/a/54347475
has body: here is a cleaned up/debugged/working version of @Jim's solution function uploadArtifactsToS3() { const artifactFolder = `logs/${config.log}/test-results`; const testResultsPath = './test-results'; const walkSync = (currentDirPath, callback) =&gt; { fs.readdirSync(currentDirPath).forEach((name) =&gt; { const filePath = path.join(currentDirPath, name); const stat = fs.statSync(filePath); if (stat.isFile()) { callback(filePath, stat); } else if (stat.isDirectory()) { walkSync(filePath, callback); } }); }; walkSync(testResultsPath, async (filePath) =&gt; { let bucketPath = filePath.substring(testResultsPath.length - 1); let params = { Bucket: process.env.SOURCE_BUCKET, Key: `${artifactFolder}/${bucketPath}`, Body: fs.readFileSync(filePath) }; try { await s3.putObject(params).promise(); console.log(`Successfully uploaded ${bucketPath} to s3 bucket`); } catch (error) { console.error(`error in uploading ${bucketPath} to s3 bucket`); throw new Error(`error in uploading ${bucketPath} to s3 bucket`); } }); }
has comment: http://stackoverflow.com/comment/106119340
score: 9
upvote count: 9
answers question: http://stackoverflow.com/q/27670051
downvote count: 0
type: Answer

http://stackoverflow.com/q/27799544
type: Question
accepted answer: http://stackoverflow.com/a/27799665
tagged with: javascript
tagged with: fullcalendar
score: 4
has title: FullCalendar load events from JSON feed on viewRender
upvote count: 4
has body: FullCalendar v2.2.5, I want to use my JSON generating script to pull data only for the visible area of the calendar as mentioned in a few other questions. $(document).ready(function() { $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,basicWeek,basicDay', defaultAllDay: true, }, lazyFetching: false, defaultDate: '2015-01-06', editable: false, eventLimit: 10, weekMode: 'liquid', dayPopoverFormat: 'DD/MM/YYYY', //events: { // url: 'instant-tools.cgi', // type: 'POST', // data: { // events: 1, // pending: 1, // from: '2014-01-01', // to: '2016-12-31', // } // }, viewRender: function(view, element) { var events_slice = new Object(); events_slice.eventSources = [ { url: 'instant-tools.cgi', type: 'POST', data: { events: 1, pending: 1, from: '2014-01-01', to: '2016-12-31' } } ]; $('#calendar').fullCalendar('addEventSource', events_slice); //$('#calendar').fullCalendar('renderEvents'); }, eventClick: function(calEvent, jsEvent, view) { alert(calEvent.title + "n" + calEvent.start.format('DD/MM/YYYY') + " to " + calEvent.end.format('DD/MM/YYYY')); }, }); }); The commented out events definition works (when I use it) but the viewRender one does not. Before you ask viewRender does get triggered. I get no errors in the console and no events displayed. My script is not called at all. I know I have the dates hardcoded right now but I will use view.intervalStart and view.intervalEnd once I verify I get a similar result. Having $('#calendar').fullCalendar('renderEvents'); in there makes no difference, also toggling lazyFetching does not make a difference. Not a JS coder so I hope I'm just being silly somewhere.
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/44007839
has answer: http://stackoverflow.com/a/27799665
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44008258
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/a/27671685
has comment: http://stackoverflow.com/comment/43763123
has comment: http://stackoverflow.com/comment/43777339
has comment: http://stackoverflow.com/comment/43762946
accepted answer of: http://stackoverflow.com/q/27670798
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43765062
answers question: http://stackoverflow.com/q/27670798
has comment: http://stackoverflow.com/comment/43763853
has comment: http://stackoverflow.com/comment/43773701
has comment: http://stackoverflow.com/comment/43764621
has body: I'm sleep deprived, so there's def a better way to do this, but this seems to do what you want, if I understand. this will make every array an array of objs in the form of {"objkey": valAtIndex }. So in this case, Object {address: Array[3]} address: Array[3] 0: "dfddf" 1: "dfdfdf" 2: "fewwewe"length: 3 would become: {"address":[ {"address": "dfddf"}, {"address": "dfdfdf"}, {"address": "fewwewe"} ]} DEMO html &lt;form action="" id="form"&gt; &lt;input type="text" name='address' value='123' /&gt; &lt;input type="text" name='address' value='456' /&gt; &lt;/form&gt; js $.fn.serializeObject = function() { var o = {}; var a = this.serializeArray(); $.each(a, function() { if (o[this.name]) { if (!o[this.name].push) { o[this.name] = [o[this.name]]; } o[this.name].push(this.value || ''); } else { o[this.name] = this.value || ''; } }); return o; }; $(function() { var t = $('#form').serializeObject(); Object.keys(t).forEach(function(key) { if (t[key].constructor === Array) { t[key].forEach(function(a, i) { var obj = {}; obj[key] = a; t[key][i] = obj; }); } }); var myAddresses = t["address"]; console.log(JSON.stringify(myAddresses, null, 4)); }); Edit: to access them, use t["address"] as above. Looking at the console after running the code, you'd see: [ { "address": "123" }, { "address": "456" } ] edit: removed confusing "result" section.
has comment: http://stackoverflow.com/comment/43762964
has comment: http://stackoverflow.com/comment/43764652
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44004722
score: 0
type: Comment
type: QuestionComment
has text: im a noob with these kind of things. :(
comment on: http://stackoverflow.com/q/27797971

http://stackoverflow.com/a/27791748
type: Answer
has comment: http://stackoverflow.com/comment/44029794
accepted answer of: http://stackoverflow.com/q/27791235
answers question: http://stackoverflow.com/q/27791235
score: 0
has body: Answer to your question lies in the script for this plugin : //Active correct tab $($respTabs.find('.resp-tab-item.' + options.tabidentify)[tabNum]).addClass('resp-tab- active').css({ 'background-color': options.activetab_bg, 'border-color': options.active_border_color }); If you notice it takes [tabNum] to set the active tab. So you need to figure out the last selected tab num and in your custom javascript function that you need to set the appropiate css class to that tab. Then u will have it selected after the postback. Best yet try to submit using AJax. It easy and you can avoid hassles.
type: AcceptedAnswer

http://stackoverflow.com/comment/43843091
score: 0
has text: Thank you squint, I did not now that, I'll try it right now to make it cleaner.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27710880

http://stackoverflow.com/q/27644047
has body: I am new to angular and been struggling how to solve my problem. I need to access API multiple times for users data, store everything as JSON array and when all the data is collected(all results as one array) it needs to be passed to directive which will use it to draw visualization(eg. d3.js-pie chart). $scope.allData = []; $http.get("****link here****/students") .success(function (data) { students = data; for (i = 0; i &lt; students.length; i = i + 1) { $http.get("**** link here ****/quest/" + students[i].id) .success(function (data) { quest = data; $scope.allData.push({ id: quest.id, value: quest.length }); } } and then pass it to directive as &lt;bar-chart data='allData'&gt;&lt;/bar-chart&gt; even if I set watch in directive and have scope as '=' the directive gets empty array. In my other code when I just do one http get call for json array I can pass it to directive easily and it works fine. EDIT1: OK so I use premises now, but still allData array is 0. Even with simple example like this: $scope.allData = []; var promieses = []; for (i = 0; i &lt; 10; i = i + 1) { promieses.push($http.get("***link***/student/" + students[i].id)); } $q.all(promieses).then(function (data) { for (i = 0; i &lt; data.length; i = i + 1) { $scope.allData.push("test"); } }); in html {{ allData ]] // 0
downvote count: 0
tagged with: javascript
tagged with: get
has comment: http://stackoverflow.com/comment/43706801
has comment: http://stackoverflow.com/comment/43706755
accepted answer: http://stackoverflow.com/a/27644069
answer count: 1
has comment: http://stackoverflow.com/comment/43706743
favorite count: 0
score: 4
has title: AngularJS - Collecting multiple get requests into json array and then passing to directive
tagged with: angularjs
tagged with: http
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27644069
tagged with: http://stackoverflow.com/tag/json
type: Question
upvote count: 4

http://stackoverflow.com/comment/43979339
comment on: http://stackoverflow.com/q/27769369
has text: Thanks @AndreasArgelius, changed it jsut before calling onsen through angular... Easier than I thought and worked like a charm!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27772427
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43955851
accepted answer of: http://stackoverflow.com/q/27772370
upvote count: 1
answers question: http://stackoverflow.com/q/27772370
type: AcceptedAnswer
has body: Converting your getJson into a promise would be a good idea, as promises are nice to work with. Without the promises, the manual way is to keep a counter of outstanding requests: var outstanding = 0; json.forEach(function(d) { outstanding++; getJson(quoteSearch(d.Symbol), function(j) { quotes.push(j); if (!--outstanding) { res.send(quotes); } }); }); If you did go the promises way, you would make a map over json, and return the promise of the request; you could then specify a then over the array of promises. If you used jQuery instead of your own homebrew solution, for example, var requests = json.map(function(d) { return $.getJSON(quoteSearch(d.Symbol), function(j) { quotes.push(j); }); }); $.when(requests).then(function() { res.send(quotes); }); (untested code).
has comment: http://stackoverflow.com/comment/43961286
has comment: http://stackoverflow.com/comment/43955891
type: Answer
has comment: http://stackoverflow.com/comment/43991383
has comment: http://stackoverflow.com/comment/43958008
has comment: http://stackoverflow.com/comment/43991560

http://stackoverflow.com/q/27739892
answer count: 3
has comment: http://stackoverflow.com/comment/43890995
has answer: http://stackoverflow.com/a/27740017
has comment: http://stackoverflow.com/comment/43890789
has comment: http://stackoverflow.com/comment/43890962
has comment: http://stackoverflow.com/comment/43890698
has comment: http://stackoverflow.com/comment/43890636
has comment: http://stackoverflow.com/comment/43890635
possible better answer: http://stackoverflow.com/a/27740006
has answer: http://stackoverflow.com/a/27740006
has answer: http://stackoverflow.com/a/27740434
has body: &lt;span class="pop-ad-imagesName"&gt;'1.jpg', '2.jpg', '3.jpg'&lt;/span&gt; 1)//say a span tag contain: '1.jpg', '2.jpg', '3.jpg' var imageNames = $(".pop-ad-imagesName").text(); var array = [imageNames]; if i do the above way, array takes imageNames as a single value, and when i alert the output, it displays: '1.jpg', '2.jpg', '3.jpg' 2)but when i manually put the values: var array = ['1.jpg', '2.jpg', '3.jpg']; when i alert the output, it displays: 1.jpg,2.jpg,3.jpg here the quotes are gone. and this way it works.. but i need the above way since i am getting the values from my view page in this way " $(".pop-ad-imagesName").text(); "
type: AnsweredQuestion
has title: How to use a variable(containing text in the form of array) while initializing a new array
accepted answer: http://stackoverflow.com/a/27740017
type: Question
has comment: http://stackoverflow.com/comment/43891097
has comment: http://stackoverflow.com/comment/43891236
tagged with: arrays
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/q/27784547
has answer: http://stackoverflow.com/a/27784662
answer count: 4
has comment: http://stackoverflow.com/comment/43978992
has body: I included angular js in my asp.net mvc project but when i call object in controller the angular js expressions do not evaluate here is the app.js code please suggest var app = angular.module('app', []); app.controller('createController', createController); and here is the createController code var createController = function ($scope) { $scope.mydata = 'I work!'; } here is what i include in html {{scope.mydata}} {{6+9}}
type: AnsweredQuestion
score: 2
upvote count: 2
has title: Error in Angular JS
has answer: http://stackoverflow.com/a/27784804
possible better answer: http://stackoverflow.com/a/27784813
has comment: http://stackoverflow.com/comment/43979678
has comment: http://stackoverflow.com/comment/43979640
type: Question
has answer: http://stackoverflow.com/a/27784813
has answer: http://stackoverflow.com/a/27784788
has comment: http://stackoverflow.com/comment/43979183
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27784804
has comment: http://stackoverflow.com/comment/43979144
has comment: http://stackoverflow.com/comment/43979434
downvote count: 0
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/8228281
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43979322

http://stackoverflow.com/a/27653783
answers question: http://stackoverflow.com/q/27653657
type: Answer
downvote count: 1
upvote count: 0
has body: A function cannot be called unless it was defined in the same file or one loaded before the attempt to call it. You declare function fn1 in File1.js, and then in File2 you can just have fn1(); File1.js function thisIsFromAnotherFile() { alert("working"); } File2.js function openFile() { thisIsFromAnotherFile(); } **HTML** Click me
score: -1

http://stackoverflow.com/q/27794274
has answer: http://stackoverflow.com/a/27794336
has answer: http://stackoverflow.com/a/27794370
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43997656
has comment: http://stackoverflow.com/comment/43997704
has comment: http://stackoverflow.com/comment/43997781
type: Question
tagged with: c#
has answer: http://stackoverflow.com/a/27794367
tagged with: javascript
has body: How do I use this format? var dataSet = [ ['Trident', 'Internet Explorer 4.0', 'Win 95+', '4', 'X'] ]; I want to put my knowledge to this format server side or javascript thank you public ActionResult GetModuls() { var model = BLcontext.GetModuls(); return Json(new { data = model }, JsonRequestBehavior.AllowGet); }
score: 0
has title: How do I use this array format?
answer count: 3
tagged with: arrays

http://stackoverflow.com/comment/43716566
type: QuestionComment
comment on: http://stackoverflow.com/q/27649258
has text: yes. I have default selection set to some date. If user is ok with this, he will not reselect it and therefore the callback will not happen. I made a dirty workaround for this for now.
score: 0
type: Comment

http://stackoverflow.com/comment/43771338
type: Comment
comment on: http://stackoverflow.com/a/27678429
has text: "*...if you prefer jQuery then you don't need the onclick attribute attached with your HTML element*" - the `onclick` attribute is rarely, if ever, needed, with JavaScript or any of its libraries, so long as there's an alternate (better) means of identifying the specific element(s).
type: AnswerComment
score: 0

http://stackoverflow.com/a/27776257
answers question: http://stackoverflow.com/q/27773278
score: 0
has body: Table layout is very simple in Ext, it is just a wrapper around HTML table. Therefore I would recommend to use combinations of HBox an VBox layouts to achieve a table-like UI whenever you need anything more than simplicity of the HTML tables.
type: Answer

http://stackoverflow.com/comment/43747036
type: QuestionComment
type: Comment
has text: What do you mean by toggle the plugin?
comment on: http://stackoverflow.com/q/27665878
score: 0

http://stackoverflow.com/comment/43734803
comment on: http://stackoverflow.com/a/27659548
score: 0
type: Comment
type: AnswerComment
has text: deleteContent: '&' -it was in my question! If this is just functionality that will remain static for the directive - no, there i have huge logic

http://stackoverflow.com/a/31223490
has comment: http://stackoverflow.com/comment/50452514
answers question: http://stackoverflow.com/q/27800171
score: 10
has comment: http://stackoverflow.com/comment/50447233
has body: window.onresize = function() { $(".ga-charts").each(function(){ var id = $(this).attr('_echarts_instance_'); window.echarts.getInstanceById(id).resize(); }); };
upvote count: 10
type: Answer
has comment: http://stackoverflow.com/comment/77789418
downvote count: 0

http://stackoverflow.com/comment/130013902
type: Comment
score: 1
has text: @r3wt why do either Mongoose or your thing need to check anything? If you support promises then just blindly `await` (or `Promise.resolve`) everything at the spot where you'd need Promises resolved, and that'll Just Work whether it's a promise or not. Only if thenables are invalid bad inputs where it would be surprising to the user to have them not be awaited, then you might prefer to fail fast by detecting thenables and erroring out. Or if you want to give users strict "this will not `await` if you put in something that does not need awaiting" guarantees. Are those your use-cases?
comment on: http://stackoverflow.com/a/27760489
type: AnswerComment

http://stackoverflow.com/q/27729624
answer count: 1
tagged with: javascript
has body: I have a kendo numeric textbox. I have set the Min value to that as 1 and Max value as 31.If I enter a value greater than 31 I want to display an error message that "value must be between 1 and 31".If You enter greater value the widget will round it to the max value. So if You enter a value of 50 with the keyboard and lose focus from the input or save the form, the value will be rounded to the max value of 31. I want when You enter a greater value in the widget text box an error message to be displayed. Here is my code: @(Html.Kendo().NumericTextBox&lt;int&gt;() .Name("month_day_1") .Format("#") .Min(1) .Max(31) .Events(evnt =&gt; evnt.Change("Change")) Can anyone please tell me how to Implement that.I tried to apply the condition on change event of kendo numeric textbox.But I got the error as change is not defined on console. Here is my javascript function: function Change(e) { debugger; var numerictextbox = $("#month_day_1").data("kendoNumericTextBox"); var value = numerictextbox.value(); if (value &gt; 31) { alert("Month Day value must be between 1 and 31"); return false; } } )
has comment: http://stackoverflow.com/comment/43871117
score: 0
has comment: http://stackoverflow.com/comment/43870812
tagged with: kendonumerictextbox
type: UnansweredQuestion
has title: Want to display error message if value increases max value in kendo numeric textbox
type: Question
has comment: http://stackoverflow.com/comment/43871180
has comment: http://stackoverflow.com/comment/43871364
has answer: http://stackoverflow.com/a/27732680

http://stackoverflow.com/comment/43918592
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27753785
has text: Keydown is used to check whats in the input field before the character is entered. Keyup is used to compare that value with the input's value after the character has been entered. The code above works fine aside from the problem I asked.

http://stackoverflow.com/comment/43720004
has text: Note especially the use of `console.log`, and not `alert`
comment on: http://stackoverflow.com/q/27651488
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/comment/43771759
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27678487
score: 0
has text: @mplungjan, thanks for the quick reply, I want to show the form but the form is too long. :( The form validation is in the javascript above. How to connect `if (validate(this))` with my js validation above? Once again, thanks.

http://stackoverflow.com/comment/43861899
has text: google is full of suggestions... do what everyone else does ...search
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27724881
score: 1

http://stackoverflow.com/q/27748098
has body: So, I have a fairly simple setup. The site can be viewed here And the bootstrap library for the icons is here <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min$ My issue? The player works fine with controls enabled, but I want to be able to use custom controls, not the default browser controls. The button clicks, but doesn't imitate audio or change icons like it should. Any ideas?
downvote count: 0
has title: HTML 5 Shoutcast Stream not working
score: 1
type: Question
tagged with: javascript
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/27748163
has comment: http://stackoverflow.com/comment/43907422
accepted answer: http://stackoverflow.com/a/27748163
favorite count: 0
tagged with: twitter-bootstrap
tagged with: shoutcast
type: AnsweredQuestion

http://stackoverflow.com/a/27650237
type: Answer
answers question: http://stackoverflow.com/q/27650044
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43722691
type: AcceptedAnswer
downvote count: 0
has body: You may have encountered a possibly bug. It is a priority and directive processing order issue. Set your directive higher priority than the ng-model. When using 1.2 v, ng-model has the default priority of 0 and with 1.3 version ng-model has a priority 1. So let your directive have a higher priority than the ng-model so that the directive and transclusion happens before ng-model processes the input before your directive renders. .directive("myCustomInput", function(){ return{ restrict: "A", replace: true, scope:{}, priority: 1, //Here set the priority transclude: "element", template: "&lt;div class='input-wrap'&gt;"+ "&lt;div ng-transclude&gt;&lt;/div&gt;"+ "&lt;i class='glyphicon glyphicon-chevron-down'&gt;&lt;/i&gt;"+ "&lt;/div&gt;" } }); Demo
accepted answer of: http://stackoverflow.com/q/27650044

http://stackoverflow.com/q/27766121
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/43942870
has title: Replace unwanted footer text with empty space
tagged with: javascript
has body: how to replace unwanted footer text? --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com html code footer: &lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br&gt; This email has been checked for viruses by Avast antivirus software.&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br&gt; &lt;a href="http://www.avast.com" style="text-decoration: none; color: rgb(22, 54, 87); "&gt; http://www.avast.com&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; almost done, but I think the code can be placed on one line document.getElementById('footer').innerHTML = data; data = data.replace(/---.*/gi, ''); data = data.replace((/(&lt;br&gt;This email has.*).+?/gi, ''); data = data.replace((/(http:\/\/www\.avast\.com)&lt;\/a&gt;?(&lt;br\s*\/?&gt;{2,3})?/gi, ''); document.getElementById('footer').innerHTML = data; an example found in a forum data = data.replace(/(&lt;br&gt;){2,3}---(&lt;br&gt;This).+?(avast\.com)&lt;\/a&gt;( ---)?/gi, ''); the code above will workt in plain html, it won't work with the generated code by WebKit
has comment: http://stackoverflow.com/comment/43945755
accepted answer: http://stackoverflow.com/a/27767714
tagged with: replaceall
tagged with: regex
has comment: http://stackoverflow.com/comment/43945852
favorite count: 0
has comment: http://stackoverflow.com/comment/43946044
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27767724
score: -1
has answer: http://stackoverflow.com/a/27767714
downvote count: 1
has comment: http://stackoverflow.com/comment/43946183
type: Question
possible better answer: http://stackoverflow.com/a/27767724

http://stackoverflow.com/q/27680403
has title: passing arguments right in app.use (NODE.JS)
tagged with: node.js
type: UnansweredQuestion
has body: i'm trying to understand why the code 1 works, and why the 2 does not.. app.js: // Routes var server = require('./routes/server'); app.use('/', server); Route.js: var express = require('express'); var resource = require('express-resource'); var server = express(); server.resource('exampleserver', require('../controllers/example')); module.exports = server; Ok, working good. When i try pass everything to one file, the server will break: app.js: var express = require('express'); var resource = require('express-resource'); var server = express(); // Routes app.use('/', resource('exampleserver', require('./controllers/example'))); This will appear in the terminal: /Users/marceloalves/Desktop/MVC-Structure/node_modules/express-resource/index.js:63 if (actions[key]) this.mapDefaultAction(key, actions[key]); ^ TypeError: Object #&lt;Object&gt; has no method 'mapDefaultAction' at Resource (/Users/marceloalves/Desktop/MVC-Structure/node_modules/express-resource/index.js:63:28) at Object.&lt;anonymous&gt; (/Users/marceloalves/Desktop/MVC-Structure/app.js:40:15) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3 Can anyone give me a hand here? haha
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27680928
score: 0

http://stackoverflow.com/comment/44037955
comment on: http://stackoverflow.com/a/27711726
type: Comment
score: 1
has text: This answer is missing the point, which is that the two `element` variables in the question code contain two different instances of `angular.element()` wrapper (encapsulating the same `Element`).
type: AnswerComment

http://stackoverflow.com/comment/44002131
has text: It's send the same way you would do in a web host environment. There're a lot of articles on this topic
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27796743

http://stackoverflow.com/comment/43725483
has text: Seems to be fine in jsfiddle, if that's what you did. If I download the frame source that jsfiddle generates and run it locally, it bugs out and shows that upon resizing (randomly at different sizes). Chrome Version 39.0.2171.95 m
type: QuestionComment
comment on: http://stackoverflow.com/q/27653695
score: 0
type: Comment

http://stackoverflow.com/q/27643716
has comment: http://stackoverflow.com/comment/43706379
has comment: http://stackoverflow.com/comment/43717931
has title: HTML5 popstate event passed null
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43706482
answer count: 1
has comment: http://stackoverflow.com/comment/43706371
favorite count: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43706503
has answer: http://stackoverflow.com/a/27647356
has comment: http://stackoverflow.com/comment/43706387
type: AnsweredQuestion
tagged with: history
tagged with: pushstate
accepted answer: http://stackoverflow.com/a/27647356
has body: I'm facing a strange issue where where popstate returns null, regardless, even if pushState has fired seven or eight times. window.addEventListener('popstate', function(event) { console.log(event.state); }); I have also tried: window.onpopstate = function(event) { console.log(event.state); }; But no luck. I'm using Chrome.
type: Question
has comment: http://stackoverflow.com/comment/43706385
tagged with: javascript
linked to: http://stackoverflow.com/q/4688164

http://stackoverflow.com/comment/43887729
type: AnswerComment
comment on: http://stackoverflow.com/a/27737765
score: 0
type: Comment
has text: oh ok my bad lol... i thought you meant set something else to isPlaying. thanks for the help.

http://stackoverflow.com/comment/43981069
type: QuestionComment
has text: looks like angular does not run on the page. what do you have in the browser console?
score: 0
comment on: http://stackoverflow.com/q/27785280
type: Comment

http://stackoverflow.com/q/27760096
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28708916
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has body: I am working on a fairly typical image "reveal" effect using jQuery UI’s draggable() method; I’m having a lot of trouble making it work in a responsive environment: http://codepen.io/ProfessorSamoff/pen/qEaNMM As you’ll see, the reveal functionality works correctly at full size as well as when the browser window size is reduced. But the draggable handle doesn’t always snap to the proper position when the browser window is resized. (Although it does so when it’s clicked and dragged.) Likewise, you’ll see that I have some commented code that checks against the browser window size: if($(this).width() != width) { } This works in order to get the draggable handle to the correct place when resizing the browser window, but it breaks the draggable functionality. I have tried a few of the suggestions on Stack Overflow concerning draggable() and resizable(), but none of them work.
upvote count: 1
tagged with: css
type: AnsweredQuestion
score: 1
has title: Using jQuery draggable() in a responsive environment…
type: Question
has answer: http://stackoverflow.com/a/28708916
tagged with: jquery-ui
downvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/43941480
has text: is there a way to open in a new tab? not a new window?
comment on: http://stackoverflow.com/a/27765390
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27643714
tagged with: settimeout
has comment: http://stackoverflow.com/comment/43706251
has title: setTimeout calls function immediately instead of after delay
linked to: http://stackoverflow.com/q/15682524
downvote count: 1
type: Question
upvote count: 5
has answer: http://stackoverflow.com/a/27643744
has comment: http://stackoverflow.com/comment/43721096
tagged with: javascript
score: 4
has body: I want to make a value on an HTML page that will be updated every 5 seconds so as to not overwhelm the server. It turns out that setTimeout() inside my function is not delaying properly, but is instead being called immediately. Can someone help me find a clue? I really don't want to give my server too much work because I have to implement a lot more AJAX. Here's the code: window.onload = function GetUsersNumber() { aside = document.getElementById("users"); if (XMLHttpRequest) var x = new XMLHttpRequest(); else var x = new ActiveXObject("Microsoft.XMLHTTP"); x.open("GET", "users_count.php", true); x.send(); x.onreadystatechange = function () { if (x.readyState == 4) { if (x.status == 200) aside.innerHTML = x.responseText; setTimeout(GetUsersNumber(), 50000); } } }
answer count: 2
has comment: http://stackoverflow.com/comment/43709029
favorite count: 0
possible better answer: http://stackoverflow.com/a/27643742
tagged with: function-pointers
linked to: http://stackoverflow.com/q/19714453
accepted answer: http://stackoverflow.com/a/27643744
has answer: http://stackoverflow.com/a/27643742
has comment: http://stackoverflow.com/comment/43706262
type: AnsweredQuestion

http://stackoverflow.com/comment/43713708
type: QuestionComment
comment on: http://stackoverflow.com/q/27648113
score: 0
has text: Yes but what if user enters +
type: Comment

http://stackoverflow.com/comment/109714828
type: QuestionComment
has text: Thanks to your question.
score: 0
comment on: http://stackoverflow.com/q/27772802
type: Comment

http://stackoverflow.com/a/27743437
answers question: http://stackoverflow.com/q/27743287
type: AcceptedAnswer
score: 4
has comment: http://stackoverflow.com/comment/43898554
has comment: http://stackoverflow.com/comment/43898005
has body: the url should be the path to your controller method you would like to hit. you do not have to include the basepath in the url (but you can if you want to). so something like: url: "howeverYourStructureIs/Action_index", to hit method action_index(). You can think of ajax like "as if you were to hit the page, but not actually navigating to that page" kinda thing. So however you would normally hit that method, is the url you put in the ajax call. hope this helps
has comment: http://stackoverflow.com/comment/43898472
type: Answer
has comment: http://stackoverflow.com/comment/43898233
upvote count: 4
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27743287

http://stackoverflow.com/comment/107118911
type: Comment
has text: initialize() only gets whitelisted options defined in View.viewOptions list. constructor() still gets non-whitelisted options as an argument, but it is called after initialize().
comment on: http://stackoverflow.com/a/27758144
score: 0
type: AnswerComment

http://stackoverflow.com/q/27736141
upvote count: 2
tagged with: java
downvote count: 2
has comment: http://stackoverflow.com/comment/43883744
possible better answer: http://stackoverflow.com/a/27736327
type: Question
has comment: http://stackoverflow.com/comment/43883765
has title: How to get the value of a wildcard in a string Java?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27736207
has body: This code works in javascript, is it possible to do something similar in java? (get the value of a wildcard in a string) var a = "HI MY NAME IS BOB" var b = /HI MY NAME IS (.*)/ alert("HI " + b.exec(a)[1])
has comment: http://stackoverflow.com/comment/43884228
has comment: http://stackoverflow.com/comment/43884250
has comment: http://stackoverflow.com/comment/43884208
score: 0
has comment: http://stackoverflow.com/comment/43883798
tagged with: string
tagged with: parsing
favorite count: 0
has answer: http://stackoverflow.com/a/27736476
tagged with: regex
has answer: http://stackoverflow.com/a/27736172
has answer: http://stackoverflow.com/a/27736327
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27736207

http://stackoverflow.com/q/27734801
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27735293
accepted answer: http://stackoverflow.com/a/27735293
has title: onload triggering too early for ajax content in IE
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I have a page where the images are supplied dynamically and are scaled with javascript to fit within the appropriate dimensions. This was initially being done with an onload attribute in the img tag, but then I noticed that in IE, the height being returned for the image was much less in some cases than the actual height, which ended up distorting the image. I solved this by finding and resizing all the images after $(window).load() was done, which worked fine for the initial page load, but I also have the page set up to add more content with an ajax call. For the ajax content, I tried some code I found on here that improved the problem, but didn't completely solve it. Here is an example of one of my image tags &lt;img id="img&lt;?php echo $prodModObj-&gt;rolloverID; ?&gt;" class="mbImg unsized" src="&lt;?php echo $prodModObj-&gt;img; ?&gt;" alt="&lt;?php echo $prodModObj-&gt;name; ?&gt;" onerror="swapImage(&lt;?php echo $prodModObj-&gt;rolloverID; ?&gt;)" /&gt; The swapImage function just swaps out the image with a placeholder if there is an error while loading. Here is my JS function swapImage(thisImgID) { var imgID = 'img#img' + thisImgID; $(imgID).attr('src', '/images/NoImageAvail.jpg'); } function checkImage(thisImgID, fitDimension, spaceDimension) { var imgID = 'img#img' + thisImgID; var imgHeight = $(imgID).height(); var imgWidth = $(imgID).width(); var displayHeight, displayWidth, newMargin; if (imgHeight &gt; imgWidth) { displayHeight = fitDimension; displayWidth = imgWidth*(displayHeight/imgHeight); } else if (imgHeight &lt; imgWidth) { displayWidth = fitDimension; displayHeight = imgHeight*(displayWidth/imgWidth); } else { displayWidth = fitDimension; displayHeight = fitDimension; } $(imgID).css('height', displayHeight); $(imgID).css('width', displayWidth); newMargin = ((spaceDimension - displayHeight)/2); $(imgID).css('margin-top', newMargin); $(imgID).removeClass('mbImg unsized').addClass('mbImg sized'); } And then on the page I have $(window).load(funct…
tagged with: ajax
score: 0

http://stackoverflow.com/q/27678349
downvote count: 1
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27678451
accepted answer: http://stackoverflow.com/a/27678422
has answer: http://stackoverflow.com/a/27678451
has answer: http://stackoverflow.com/a/27678396
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27678422
has answer: http://stackoverflow.com/a/27678399
has title: JavaScript bug, battleships game
answer count: 4
has body: I recently started learning JS and I made a very simple game. It's a simple battleships game with no animations. Here's the code: &lt;html&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;link rel="stylesheet" href="CSS/Game.css" type="text/css" charset="utf-8"&gt; &lt;/head&gt; &lt;body&gt; &lt;marquee id="output"&gt;&lt;/marquee&gt; &lt;script&gt; var loc1,loc2,loc3; var guess; var hits = 0; var guesses = 0; var isSunk = false; var locRandom = Math.floor(Math.random() * 9); loc1 = locRandom; loc2 = loc1 + 1; loc3 = loc2 + 1; while(isSunk == false){ guess = prompt("Enter a number from 1-10"); if(guess == null){ alert("Bye"); promt.close; } else if(guess &lt; 0 || guess &gt; 10 || guess == "" || guess == " "){ alert("Write a valid number"); } else { guesses = guesses + 1; if(guess == loc1 || guess == loc2 || guess == loc3) { alert("HIT!"); hits = hits + 1; if(hits == 3){ isSunk = true; alert("You sank my battleship!"); } } else { alert("MISS"); } } } var stats = "You took " + guesses + " guesses to sink the battleship, " + "which means that your accuracy is " + (3/guesses) + " hit(s) per guess"; alert(stats); alert("Thanks for playing!"); document.getElementById("output").innerHTML = "Refresh to play again!"; document.write("&lt;br&gt;&lt;br&gt;This game was created by Swegre Designs"); &lt;/script&gt; &lt;/body&gt; But the thing is, when I for example get a "HIT" on the number 1, then I could type 1 three times in the promt and the battleship is sunk, but that's not what should be happening, I hope you understand the bug, can somebody help me? Thank you!
score: 0
upvote count: 1

http://stackoverflow.com/comment/43733166
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27658507
has text: Use `var firstRServerIP = t.closest('form').find('.firstRServerIP').val()`, then add a class to your input ` ` and set your button inside the form ` ... ` (not outside like in your example).
type: Comment

http://stackoverflow.com/q/27652504
favorite count: 0
type: UnansweredQuestion
has body: im looking to make a web player from scratch so I can control my music from my phone. I've got a listing of all files within a folder done, but I need to get it to list the files within the subfolders of the main folder. So sort of something like \Path\ - Shows all in \Path\ and \Path\subs\ shows the contents of all subfolders. This is the code that I have written to allow me to search a folder for .mp3 files, but I cannot pin the way to search in subfolders as well. $.ajax({ url: "music/", success: function(data){ $(data).find("a:contains(.mp3)").each(function(){ var files = $(this).text().replace(/ /g, ''); files = $(this).text().replace(/.mp3/,''); $('&lt;p&gt;&lt;/p&gt;').html(files).appendTo('#displayer'); $('#displayer &gt; p:nth-child(odd)').css('background-color','#DDD'); }); } }); Many thanks in advance
upvote count: 1
score: 1
has title: Search for .mp3 files in main folder and subfolders
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: web
tagged with: jquery
tagged with: media
tagged with: ajax
has comment: http://stackoverflow.com/comment/43722210
has answer: http://stackoverflow.com/a/27653405

http://stackoverflow.com/q/27740783
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/27740871
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27740859
tagged with: css
has title: Return id on next "page" in single page site based on current page id using javascript
answer count: 4
has answer: http://stackoverflow.com/a/27740865
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27740859
has answer: http://stackoverflow.com/a/27740976
has body: I am creating a simple website which should have multiple pages showing a different background and main text, but with the same logo and menu. The next page should slide in from the right when a button is pressed and selecting a page from the menu should transition directly to that page. I have decided to make this a single page site to make use of CSS3 transitions. Example code for the next button (minus transitions) is here: http://jsfiddle.net/xoa029jz/1/ I am currently working out which background and text to display using the following javascript: function getNextPage(pageid) { if (pageid == "page-1") { return $('#page-2'); } else if (pageid == "page-2") { return $('#page-3'); } else if (pageid == "page-3") { return $('#page-1'); } } The site will have 7 pages, so this seems cumbersome. Is there a better way of using sequential ids in javascript? The site will only have one image and one sentence per "page", so I don't think it is necessary to use Ajax, but I am willing to be corrected on this.
possible better answer: http://stackoverflow.com/a/27740865
type: Question

http://stackoverflow.com/q/27789732
favorite count: 0
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/44013946
has comment: http://stackoverflow.com/comment/43989621
has body: Please take a look here at what I'm trying to achieve: http://jsfiddle.net/3m6r7ud2/4/ I have the following html page that looks like this: And so on. I also have a fixed button that shows up on hover: This is the jQuery I'm using: $(document).on("click", ".rotate_button", function(){ var direction = $(this).attr("id"); var page_num = ? rotate_file(page_num,direction) }) The buttons are in fixed locations on the page, and show on hover. When clicking on this button, I want to get which div was behind that div while clicking so I could know which of the pages I need to rotate. How can I do this?
upvote count: 1
has title: How to get the div behind the div i clicked
has comment: http://stackoverflow.com/comment/43989590
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/51510016
has answer: http://stackoverflow.com/a/27790849
tagged with: javascript
has comment: http://stackoverflow.com/comment/43991402
has comment: http://stackoverflow.com/comment/43989585
score: 0
has comment: http://stackoverflow.com/comment/43989640
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/43989455

http://stackoverflow.com/comment/43757231
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27671242
score: 1
has text: Use a custom number format function, rather that relying on the default to string conversion ;-)

http://stackoverflow.com/a/27750248
has body: Inside a click handler this is the actual element clicked: $('.product-quantity').on('click','.input-group',function(){ alert($(this).find('#product-quantity').data("area")); }); but the actual problem is having duplicate IDs. That is invalid HTML and jQuery can only see the first. Replace id="product-quantity" with a class and use .product-quantity
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27750208
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27750208
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43911637

http://stackoverflow.com/q/27698485
tagged with: security
downvote count: 2
favorite count: 0
upvote count: 0
accepted answer: http://stackoverflow.com/a/27698504
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43810035
has title: Ajax callback breakpoint security issue
has answer: http://stackoverflow.com/a/27698504
type: Question
tagged with: debugging
has body: Say I have this code here (somewhat pseudocode) $.ajax({ url: "/api/user", success: function(resp) { var data = JSON(resp) if (data.user.is_admin) // do admin thing else // do something else } }); Basically the endpoint returns some info about the user and the callback handles the rest. Can I put a breakpoint before the if statement and change data.user.is_admin to be true before the statement is ran? Is that possible?
score: -2
answer count: 1
tagged with: javascript
tagged with: ajax

http://stackoverflow.com/q/27756070
tagged with: css
has answer: http://stackoverflow.com/a/27756768
has answer: http://stackoverflow.com/a/27756114
has title: change css of single cell(td) in table angularjs
type: Question
has body: Problem: Using AngularJS, I need to change the color(or we can say CSS) of a single cell(td) on which user has clicked. For now to simplify the use case, just want to change color of all table cells where we have zero Below is the code which I have tried, but its changing the color of all the cells in table. {{col}} Contoller app.controller('MainCtrl', function($scope) { $scope.tableType = { data: { rows: [ ["69123", 20, 20, 40, 0, 0, 0, 0, 20, 20, 20, 0, 20, 20, 0, 20], ["69121", 20, 20, 40, 0, 0, 0, 20, 20, 40, 20, 0, 20, 20, 0, 20], ["69124", 20, 20, 40, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 0, 0], ["69221", 20, 20, 40, 20, 0, 20, 0, 0, 0, 20, 0, 20, 20, 20, 40] ] } }; $scope.cellColor = "blue"; $scope.updateCellColor = function(col){ if(parseInt(col)===parseInt(0)){ alert('changing color to red'); $scope.cellColor = "red"; }else{ alert('changing color to yellow'); $scope.cellColor = "yellow"; } }; }); CSS .red{ color:red; } .blue{ color:blue; } .yellow{ color:yellow; }
tagged with: javascript
score: 0
answer count: 2
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/a/27796178
answers question: http://stackoverflow.com/q/27795952
score: 1
has body: You can use your application controller for this purpose :) &lt;h1&gt;{{controllers.application.user.name}}&lt;/h&gt; However you will need your ApplicationController in the controllers :) Another way is to make a custom Component qand then extend it like App.MyComponent = Ember.Component.extend({ user : user }); AppFooComponent = App.MyComponent.extend({ //user is gotten from MyComponent });
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27795952
has comment: http://stackoverflow.com/comment/44081716
type: AcceptedAnswer
type: Answer
upvote count: 1

http://stackoverflow.com/comment/43726035
has text: summary is some id or class ???
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27654650

http://stackoverflow.com/q/27710434
tagged with: php
score: 1
type: Question
upvote count: 1
has body: I've got a mobile site that use a .JS file to adapt image, font etc. On browser it works well, but when I use my app I need to reload a page 3 times to see my site correctly. I don't understand the reason. I think that javascript doesn't work well in my app. this is my Mainactivity.js import android.app.Activity; import android.graphics.Bitmap; import android.os.Bundle; import android.view.Menu; import android.webkit.WebChromeClient; import android.webkit.WebView; import android.webkit.WebViewClient; import com.parse.Parse; import com.parse.ParseInstallation; import com.parse.PushService; public class MainActivity extends Activity { private WebView mWebView; /** * Dichiariamo l'attributo di classe url in cui * salviamo l'indirizzo web che aprirà la webview */ private String url = "http://www.bestparty.altervista.org/Mobile"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //carichiamo la webview dentro il layout specificato mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setLoadsImagesAutomatically(true); //carichiamo finalmete la url mWebView.setWebViewClient(new WebViewClient()); mWebView.loadUrl(url); } } this is my func.js (in my site) $(document).ready( function(){ if ($(window).width() &gt; 1001 &amp;&amp; $(window).width() &lt; 10000 ) { $("#menubar").css("font-size", ((($(window).height()*8)/100))); $(".fotoevento").css("height", ((($(window).height()*45)/100))); $(".fotoevento").css("width", ((($(window).height()*100)/100))); $(".pub").css("margin-left", ((($(window).height()*13)/100))); $(".testievento").css("font-size", ((($(window).width()*3)/100))); $("#footer").css("font-size", ((($(window).width()*1)/100))); //MOBILE $(".logonavig").css("height", ((($(window).height()*3)/100))); $(".logonavig").css("width", ((($(window).width()*19)/100))); } else if ($(window).width() &lt; 1000) { $("#men…
tagged with: javascript
favorite count: 0
tagged with: android
tagged with: http://stackoverflow.com/tag/html
has title: Calling javascript in my android webview app
tagged with: css
has comment: http://stackoverflow.com/comment/45322582
downvote count: 0
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/135567636
comment on: http://stackoverflow.com/a/27748638
score: 0
type: AnswerComment
has text: Nice work buddy.
type: Comment

http://stackoverflow.com/comment/43933861
comment on: http://stackoverflow.com/a/27708857
type: AnswerComment
has text: Solved my problem! I appended not only the file but an object like { key: "lorem", img: input.files[0] }, and The files didn't show up in the req.files. Thank you for your help ;)
score: 0
type: Comment

http://stackoverflow.com/comment/43839730
has text: IMHO This approach will work for the sake of making it work, but it really makes the controllers tightly coupled and can seriously affect re-usability and testability.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27713064
type: AnswerComment

http://stackoverflow.com/q/27727821
score: 0
type: Question
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/27727883
tagged with: highcharts
has body: Here is a jQuery fiddle I'm trying to port into an Angular directive: http://jsfiddle.net/rhtr1w04/ And here is my app.js angular.module('app',[]).directive('angular-arc', function() { return { restrict: 'E', link: function(scope, element, attrs) { var renderer; renderer = new Highcharts.Renderer( $('angular-arc')[0], 400, 300 ); renderer.arc(200, 150, 100, 50, -Math.PI, 0).attr({ fill: '#FCFFC5', stroke: 'black', 'stroke-width': 1 }).add(); } }; }) and my index.html (with all proper includes to app.js and jquery) <angular-arc /> However, of course, it doesn't render. Have I used the DDO correctly? What should I include to make this render? Thanks in advance.
tagged with: javascript
tagged with: jquery
answer count: 1
has title: Basic jquery fiddle to Angular Directive
accepted answer: http://stackoverflow.com/a/27727883
tagged with: angularjs
type: AnsweredQuestion

http://stackoverflow.com/q/27747525
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43907069
upvote count: 1
has comment: http://stackoverflow.com/comment/43907461
has body: I am trying to get text from a table cell class. The script works great in the console. However, when I implement the code it only grabs part of the text. The TD I am trying to get the text Yellow Unicorn Award Trophy - 2014 / The Weird Animal Awards / Presented To: adsf / For: asdf2 / Additional Text: asdf3 The Text that I am actually getting Yellow Unicorn Poo Trophy - 2014 / The Weird Animal Awards Notes 'Presented To' and all text thereafter are getting called from somewhere. I have not been able to figure that out yet. This leads me to believe that the call to presented to is happening after my script is being loaded. How I have tried to make my script load last I have placed it right before and after the closing body tag. I have placed the code in it's own file and called on it using. The script got called, but it didn't get any text though. var theScript = document.createElement("script"); theScript.setAttribute("type","text/javascript"); theScript.setAttribute("src","//www.mysite.com/script.js"); document.getElementsByTagName("head")[0].appendChild(theScript); Questions Is there any other reason why the text is getting cut off other than that it is loading last? If not, what is a sure fire way for my script to be loaded absolutely last?
has title: .text not getting all text, but works in console
type: Question
has answer: http://stackoverflow.com/a/27747593
has comment: http://stackoverflow.com/comment/43906372
has answer: http://stackoverflow.com/a/27748107
has comment: http://stackoverflow.com/comment/43906257
has comment: http://stackoverflow.com/comment/43906923
answer count: 3
has comment: http://stackoverflow.com/comment/43906241
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27747586
has comment: http://stackoverflow.com/comment/43907374
has comment: http://stackoverflow.com/comment/43906675

http://stackoverflow.com/q/27755334
has body: I want to hide an element which is not a certain class via jQuerys not() : Content 1 Content 2 and var thisContent; jQuery('.content-btn').click(function() { thisContent = this.id; jQuery('.post_item').not('.'+thisContent).fadeOut(); } am I using .not() method wrong in this context, because it seems not to work!
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27755390
has answer: http://stackoverflow.com/a/27755431
has comment: http://stackoverflow.com/comment/43921355
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27755456
type: Question
has title: Hide element which is not a certain class
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27755390
possible better answer: http://stackoverflow.com/a/27755431

http://stackoverflow.com/q/27760932
accepted answer: http://stackoverflow.com/a/27761702
tagged with: javascript
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43932930
has comment: http://stackoverflow.com/comment/43933084
has comment: http://stackoverflow.com/comment/43932984
has comment: http://stackoverflow.com/comment/43934746
has comment: http://stackoverflow.com/comment/43933213
has comment: http://stackoverflow.com/comment/43932946
tagged with: regex
has answer: http://stackoverflow.com/a/27761702
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27761194
has answer: http://stackoverflow.com/a/27761194
has body: I want to remove all html tags except and from document using this code: var regex = "<(?!a )(?!img )(?!iframe )([\s\S]*?)>"; var temp; while (source.match(regex)) { temp = source.match(regex)[0]; source = source.replace(temp, ""); } return source; It works in online regex testers, but for some reason it doesn't work on my page. For example it returns an original string when the input is: " test<o:p></o:p> " Please help!
type: Question
has title: Remove html tags using regex in javascript

http://stackoverflow.com/a/27927720
has body: Yes, this is perfectly safe. You will just need to ensure the security is part of the php code when needed, by limiting or filtering what it can select (already fine there) and how .json files are validated and stored, once that is addressed you will be fine and your existing solution is perfectly safe. You can also modify .htaccess file to hide folder content if you have a concern about others viewing directories on your website.
score: 1
answers question: http://stackoverflow.com/q/27773723
accepted answer of: http://stackoverflow.com/q/27773723
type: AcceptedAnswer
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/comment/43862709
comment on: http://stackoverflow.com/q/27725250
score: 0
type: Comment
type: QuestionComment
has text: All i am seeing in the web is nextTick() typically runs before any other I/O events fire and setImmediate runs after I/O events. I am not really getting this part visually.

http://stackoverflow.com/a/27735112
has comment: http://stackoverflow.com/comment/43882152
has body: I assume you are talking about QtScript . In that case you should take in to account that setTimeout and setInterval are not defined in ECMAScript specification because they are not JavaScript features. These functions are part of browser environments. Which means QtScript does not support them . This is the way to do it : var timer = new QTimer(); timer.interval = 3000; timer.singleShot = false; timer.timeout.connect(this, function handleClick(xAxis , yAxis, ccc){ if (ccc.checker === true){ messageDialog.text = "X Value equals " + xAxis + " Y = " + yAxis; messageDialog.visible = true; } }); timer.start(); I did not try loading third parity libraries, but my guess would be that most of them will fail to do so .
type: Answer
has comment: http://stackoverflow.com/comment/43890923
answers question: http://stackoverflow.com/q/27735037
score: 0
has comment: http://stackoverflow.com/comment/43895297

http://stackoverflow.com/comment/43969120
comment on: http://stackoverflow.com/a/27779636
has text: No. It is not possible
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27647742
tagged with: javascript
linked to: http://stackoverflow.com/q/15349733
answer count: 3
accepted answer: http://stackoverflow.com/a/27648394
has comment: http://stackoverflow.com/comment/43713184
has comment: http://stackoverflow.com/comment/43713553
has comment: http://stackoverflow.com/comment/43713276
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/43713317
has comment: http://stackoverflow.com/comment/43713472
has answer: http://stackoverflow.com/a/44877628
tagged with: node.js
type: AnsweredQuestion
has title: Promise.resolve().then vs setImmediate vs nextTick
has answer: http://stackoverflow.com/a/27648394
score: 44
upvote count: 44
has body: NodeJS 0.11 as well as io.js and the Node 0.12 branch all ship with native promises. Native promises have a .then method which always executes on a future event loop cycle. So far I've been using setImmediate to queue things to the next iteration of the event loop ever since I switched from nextTick: setImmediate(deferThisToNextTick); // My NodeJS 0.10 code process.nextTick(deferThisToNextTick); // My NodeJS 0.8 code Since we now have a new way to do this: Promise.resolve().then(deferThisToNextTick); Which should I use? Also - does Promise.resolve.then act like setImmediate or like nextTick with regards to code running before or after the event loop?
type: Question
possible better answer: http://stackoverflow.com/a/27649183
has answer: http://stackoverflow.com/a/27649183
has comment: http://stackoverflow.com/comment/43713450
downvote count: 0
tagged with: es6-promise

http://stackoverflow.com/q/27656283
has body: I have a text field named description in my django Model. I have stored a string in it that is Early cricket was at some time or another described as "a club striking a ball (like) the ancient games of club-ball, stool-ball, trap-ball, stob-ball". [3] Cricket can definitely be traced back to Tudor times in early 16th-century England. Written evidence exists of a game known as creag being played by Prince Edward, the son of Edward I (Longshanks), at Newenden, Kent in 1301 [4] and there has been speculation, but no evidence, that this was a form of cricket. I want to clean this string, want to remove all the HTML tags, double quotes and single quotes so that i can assign this string to a javascript variable. for this i wrote a template tag which returns the string after striping al html tags and replacing all the single and double quotes with None. def clean_text(html_text): html=strip_tags(html_text) html=html.replace('"','') html= html.replace("'",'') print html return str(html) but when I am trying to assign this string to a javascript variable i am getting error SyntaxError: missing ) after argument list console.log(Early cricket was at some time or another described as a club stri I tried toString() method also but same result. I tried to assign this to a variable but got the same error var description = SyntaxError: missing ; before statement A number of other words have been suggested as sources for the register.filter('clean_text',clean_text)
score: 0
tagged with: python
has comment: http://stackoverflow.com/comment/43728603
tagged with: regex
has answer: http://stackoverflow.com/a/27656372
accepted answer: http://stackoverflow.com/a/27656372
tagged with: django
type: Question
type: AnsweredQuestion
has title: Clean the tags and quotes from a python/django string and make it a valid javascript string
answer count: 1
tagged with: javascript
tagged with: string

http://stackoverflow.com/a/27652600
answers question: http://stackoverflow.com/q/27652520
upvote count: 2
score: 1
downvote count: 1
type: Answer
has body: As the Mozilla documentation states: It's a common practice to abbreviate Components.classes and Components.interfaces by storing a reference to the object as a constant: const Cc = Components.classes, Ci = Components.interfaces; var os = Cc["@mozilla.org/observer-service;1"] .getService(Ci.nsIObserverService); What you're seeing here is this common practice compacted further with ES6 object destructuring.

http://stackoverflow.com/q/27688536
type: Question
has comment: http://stackoverflow.com/comment/43794731
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: css
tagged with: qtscript
tagged with: c++
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: I'm totally new in javascript so maybe my question is stupid. I want to use LESS to create CSS file. And I want to do it from my c++ code. So I'm using Qt and QtScript for it. 1) I can execute less.js in c++ using QScriptEngine. 2) I studied less.js and found function loadInitialFileCallback(loadedFile) which takes contents of the file that I want to treat as an argument. So I can call this function from my c++ code with contents of my *.less file. After that I will get something (I think it must be CSS-file). But I don't know where I can found my CSS-file (maybe it can be variable in less.js or something another). Also I don't know how I can pull the contents of my CSS-file. Thanks for any help:)
tagged with: qt
has title: LESS - get CSS using Qt
has comment: http://stackoverflow.com/comment/43795516
score: 1

http://stackoverflow.com/comment/43743306
comment on: http://stackoverflow.com/q/27663731
score: 0
has text: Can you put a jsfiddle or something with the html also?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27759168
score: 0
has comment: http://stackoverflow.com/comment/43929573
tagged with: jinja2
has comment: http://stackoverflow.com/comment/43929320
type: Question
has comment: http://stackoverflow.com/comment/43929404
tagged with: javascript
tagged with: jquery
has body: I need to call some python function and show its results (actually a couple of list objects) in the div id="places" section. I'm trying to do this in Javascript function show_sec() but i can't find out how to catch the data from server and process it on client. My task is really simple and basic but since it's my first web project I need some help with ajax. Please, help me. This is a part of my code: .html {% include "header.html" ignore missing %} Разрешить приложению определить Ваше место расположения для нахождения ближайших банков? Курс ближайших банков на сегодня в радиусе метров {{output}} Приложение не имеет возможности определить близ лежащие банки. python function i try to call: *def get(self): default_radius = 1000 radius = get_radius(self) exceptions = [u'', 'error', 0] # invalid values for radius if any([radius in exceptions]): radius = default_radius #warning = "Вы ввели неверный радиус. Система автоматически заменила его на стандартный." output = radius # заменить на вывод банков else: #warning = '' output = radius # заменить на вывод банков names, location = Findplaces(self, radius) body_values = { 'names': names, 'location': location, 'radius': radius, 'output': output, #'warning': warning, } template = jinja_env.get_template('nearest_banks.html') self.response.out.write(template.render(body_values))* In short my goal is to display names and location in the tag div id="places" after clicking on Yes button. Or maybe i can initiate displaying specific tags from server side by using jinja2 in my python function. Please, help me. I've spent time on it still can't get it working nicely. Thanks in advance ! EDIT: When I click on Yes button the show_sec function loads section with id allowed. The problem: the action in form is not processed. So Only html is shown but data from server is not received.
tagged with: ajax
has answer: http://stackoverflow.com/a/27759340
has comment: http://stackoverflow.com/comment/43929875
answer count: 1
type: UnansweredQuestion
has title: Send data from server to client - ajax

http://stackoverflow.com/comment/76060478
comment on: http://stackoverflow.com/a/40098594
score: 8
has text: `preserveDrawingBuffer: true` has no relationship to `gl.flush`. It only has a relationship to swapping buffers vs copying buffers. It was specifically added to the spec at the request of Apple who claimed swapping buffers would be much faster on iOS. Also `gl.flush` should have no effect on framerate. It's `gl.finish` that might have an effect. `gl.flush` just means "be aware of all the commands I've issued so far" where as `gl.finish` means "execute all the commands I've issued so far and don't return until they are complete"
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27694967
has comment: http://stackoverflow.com/comment/43805726
has comment: http://stackoverflow.com/comment/43803586
has comment: http://stackoverflow.com/comment/43803515
score: 0
has comment: http://stackoverflow.com/comment/43803782
answers question: http://stackoverflow.com/q/27694776
type: Answer
has body: Please don't compare Java Strings like that, use .equals("...") instead.

http://stackoverflow.com/a/27855840
downvote count: 0
answers question: http://stackoverflow.com/q/27658280
has body: You need different layer groups. I do it this way: var layersOSM = new ol.layer.Group({ layers: [ new ol.layer.Tile({ source: new ol.source.OSM() }) ] }); var layersMQ = new ol.layer.Group({ layers: [ new ol.layer.Tile({ source: new ol.source.MapQuest({layer: 'osm'}) }) ] }); function setMapType(newType) { if(newType == 'OSM') { map.setLayerGroup(layersOSM); } else if (newType == 'MAPQUEST_OSM') { map.setLayerGroup(layersMQ); } } where setMapTypeis a function that I call with the necessary string attribute when I want to change the style. mapis my ol.Map variable. You might arrange the layer groups in an array, and access them by name as you did already with the layers instead of the if/else construct I used. But I have only 2 different layer groups.
score: 4
type: Answer
upvote count: 4

http://stackoverflow.com/a/27745623
has body: Correct way to echo PHP variable would be to JSON encode it first (and use echo): $.post('&lt;?php echo base_url(); ?&gt;homepage/postanswer', { username: &lt;?php echo json_encode($ques[0]-&gt;username); ?&gt; });
accepted answer of: http://stackoverflow.com/q/27745441
answers question: http://stackoverflow.com/q/27745441
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/27768470
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/31293733
tagged with: plupload
type: Question
tagged with: javascript
tagged with: ng-dialog
score: 0
answer count: 1
has body: I'm trying to make plupload work in modal window, generated by ng-dialog. The code is: $scope.showManager = function(){ ngDialog.open({ template: '/template/fmanager.html', controller: 'FileManagerController' }); } app.controller('FileManagerController', function($scope){ $scope.plupload = new plupload.Uploader({ browse_button: 'browseFileButton', url: '/upload/path', init: { FilesAdded: function(uploader, files) { uploader.start(); } } }); $scope.plupload.init(); }); The browse button not working. I've tried to create init function, with no success. $scope.init = function(){ $scope.plupload.settings.browse_button = 'browseFileButton'; $scope.plupload.refresh(); $scope.plupload.init(); } Please, any suggestions.
has title: Plupload not work with ng-dialog
tagged with: angularjs

marker
tag name: marker
tags question: http://stackoverflow.com/q/27679975
tags question: http://stackoverflow.com/q/27786394
type: Tag

http://stackoverflow.com/q/27756024
has answer: http://stackoverflow.com/a/27756150
tagged with: underscore.js
has body: I want to the replace the first array with value of second array: First array: {link: [ 'hacking', 'license' ]} Second array {internalLink: [{orignal:'hacking', replace:'123456'}, {orignal:'license', replace:'654321'}]} Into: {link: [ '123456', '654321' ]} Hoe can I do this with underscore?
type: Question
tagged with: javascript
score: -1
has title: replace first array with second array
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43922912
favorite count: 0
has comment: http://stackoverflow.com/comment/43922875
has comment: http://stackoverflow.com/comment/43922819
has comment: http://stackoverflow.com/comment/43922909
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43922745
upvote count: 0

http://stackoverflow.com/comment/43981205
type: AnswerComment
has text: I have not tried the "auto view more" plugin with this script but either way I would sacrafice that plugin to use this script if I have to. I plan on setting this script to fire off about 10 min after there's no user activity so hopefully that will help if anyone's using screen reading software. I am going to replace the script I originally posted on Oxwall's forum with the one you have provided me. Would it be OK if I give you and stackoverflow credit for this, when I post this on Oxwall's forum?
comment on: http://stackoverflow.com/a/27770922
score: 0
type: Comment

http://stackoverflow.com/q/27784072
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27784642
has comment: http://stackoverflow.com/comment/43978338
has answer: http://stackoverflow.com/a/27784180
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/27784642
downvote count: 0
has answer: http://stackoverflow.com/a/27784803
tagged with: javascript
tagged with: jquery
answer count: 3
has comment: http://stackoverflow.com/comment/43978283
upvote count: 1
possible better answer: http://stackoverflow.com/a/27784180
has comment: http://stackoverflow.com/comment/43978658
favorite count: 0
tagged with: angularjs
has title: From jquery to angularjs
has body: i am using the below format to get a JSON object from my localhost. The JSON is pretty complicated and lengthy so , using jquery to populate the HTML is getting complicated. function processmsg(msg) { var jobj = JSON.parse(msg); if (typeof jobj === 'object') { // Parse the JSON } document.getElementById("messages").innerHTML = globalTag; } } function waitForMsg() { $.ajax({ type: "GET", url: "1.json", cache: false, timeout: 50000, success: function (data) { processmsg(data); if (!data) { setTimeout( waitForMsg, 1000 ); }; }, error: function (XMLHttpRequest, textStatus, errorThrown) { setTimeout(waitForMsg, 15000); processmsg("error"); } }); }; $(document).ready(function () { waitForMsg(); processmsg("loading"); }); I would like to use the format like {{jobj.entries}}. something like this. This can be done on angularJS. can you guys please suggest me how to do the same in angular ? i want to query the JSON every 1 min and when the data is found i want to cancel the interval. I dono how to do it in angularjs. ==================update================ i got below code snippet. It is working fine, But how do i stop the url query once the json object is obtained.. var app = angular.module('urlanalyzer', []); app.controller('jsonController', function($scope, $http) { $scope.getData = function(){ var url = "{% static "" %}tmp/{{url_hash}}/{{url_json}}"; $http.get(url) .success(function(data, status, headers, config) { console.log(data); }); }; if (!$scope.data){ setInterval($scope.getData, 2000); } The issue here is the json object will be available after 3 sec only.

http://stackoverflow.com/q/27661306
score: 384
has comment: http://stackoverflow.com/comment/43738402
has comment: http://stackoverflow.com/comment/55967587
has comment: http://stackoverflow.com/comment/67875059
has comment: http://stackoverflow.com/comment/47619040
has comment: http://stackoverflow.com/comment/69863136
has comment: http://stackoverflow.com/comment/55968821
accepted answer: http://stackoverflow.com/a/27661420
has comment: http://stackoverflow.com/comment/55968886
has comment: http://stackoverflow.com/comment/55969172
tagged with: generator
has comment: http://stackoverflow.com/comment/55967687
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/51799937
tagged with: syntax
has answer: http://stackoverflow.com/a/41015763
has comment: http://stackoverflow.com/comment/47932919
type: Question
answer count: 8
has comment: http://stackoverflow.com/comment/55967638
has comment: http://stackoverflow.com/comment/43738606
has comment: http://stackoverflow.com/comment/76839450
has answer: http://stackoverflow.com/a/54482949
linked to: http://stackoverflow.com/q/23848113
linked to: http://stackoverflow.com/q/32535110
has answer: http://stackoverflow.com/a/27661420
has answer: http://stackoverflow.com/a/75177320
tagged with: ecmascript-6
has answer: http://stackoverflow.com/a/49986740
linked to: http://stackoverflow.com/q/20862621
has answer: http://stackoverflow.com/a/60380785
tagged with: arrow-functions
has comment: http://stackoverflow.com/comment/55965748
upvote count: 384
possible better answer: http://stackoverflow.com/a/34108006
downvote count: 0
has title: Can I use ES6's arrow function syntax with generators? (arrow notation)
tagged with: javascript
has answer: http://stackoverflow.com/a/34108006
has body: That is, how do I express function *(next) {} with arrow syntax? I've tried all the combinations I could think of, and I can't find any documentation on it. (I am currently using Node.js v0.11.14.)
has comment: http://stackoverflow.com/comment/55965765
has comment: http://stackoverflow.com/comment/55965826
favorite count: 0
has comment: http://stackoverflow.com/comment/55965858
has comment: http://stackoverflow.com/comment/43738549

http://stackoverflow.com/q/27727024
downvote count: 0
tagged with: cryptography
favorite count: 0
tagged with: bouncycastle
type: UnansweredQuestion
tagged with: encryption
score: 6
has comment: http://stackoverflow.com/comment/43898429
upvote count: 6
answer count: 4
has answer: http://stackoverflow.com/a/28385715
has answer: http://stackoverflow.com/a/55045768
has answer: http://stackoverflow.com/a/27727277
has title: Encrypt in JavaScript will not decrypt in C#
type: Question
tagged with: c#
has answer: http://stackoverflow.com/a/27743892
tagged with: javascript
has body: I am trying to use RSA encryption in JavaScript and then decrypt it in C#. In JavaScript I am using the library jsencrypt. In C# I using the API "bouncy castle". When I do the encryption/decryption within the same language everything works. I get back the correct text when I decrypt it. When I try to decrypt in C# what was encrypted in JavaScript I get nothing close. I am sure the keys are the same between the two. An example of the code is below. Any help on how to solve this would be greatly appreciated. JavaScript //using jsencrypt.min.js var encrypt = new JSEncrypt(); encrypt.setPublicKey($('#pubkey').val()); var encrypted = encrypt.encrypt($('#input').val()); take the value I get from JavaScript "encrypted" and use it in C# for "encyp" AsymmetricCipherKeyPair KeyParameterPrivate; byte[] cipheredBytes = Convert.FromBase64String(encyp); string privateKeyFileName = @"C:\private.pem"; using (var fileStream2 = File.OpenText(privateKeyFileName)) { PemReader pemReader2 = new Org.BouncyCastle.OpenSsl.PemReader(fileStream2); KeyParameterPrivate = (Org.BouncyCastle.Crypto.AsymmetricCipherKeyPair)pemReader2.ReadObject(); } IAsymmetricBlockCipher cipher2 = new Org.BouncyCastle.Crypto.Engines.RsaEngine(); RsaKeyParameters privateKey2 = (RsaKeyParameters)KeyParameterPrivate.Private; //cipher.Init(false, publicKey4); cipher2.Init(false, privateKey2); byte[] deciphered = cipher2.ProcessBlock(cipheredBytes, 0, cipheredBytes.Length); string decipheredText = utf8enc.GetString(deciphered);

http://stackoverflow.com/a/27726722
score: 1
downvote count: 1
has body: status Is a (sort of) reserved word1, so assign the array to another variable name, or assign it within a non global context: // [status] assigned within the global (window) context var status = ["POR ENTREGAR","POR ENTREGAR","POR ENTREGAR"]; var mystatus = ["POR ENTREGAR","POR ENTREGAR","POR ENTREGAR"]; Helpers.log2Screen('`status` is array? ', (status instanceof Array).yn()); Helpers.log2Screen('`mystatus` is array? ', (mystatus instanceof Array).yn()); statusStatus(); function statusStatus() { // [status] assigned within the statusStatus context var status = ["POR ENTREGAR","POR ENTREGAR","POR ENTREGAR"]; Helpers.log2Screen('`status` (in `statusStatus` context) is array? ', (status instanceof Array).yn()); } &lt;script src="http://kooiinc.github.io/JSHelpers/Helpers-min.js"&gt;&lt;/script&gt; 1 If status is not assigned in the global (i.e. window) context, you're fine, see statusStatus within the snippet. Otherwise, you are overwriting the predefined existing window.status. Actually, window.status changes the text on the status bar of the browser, that's why it is always autoboxed to a string value (note: newer browsers seem to have ditched the status bar (chrome, firefox) or made it readonly (IE), but the thereby useless window property still exists).
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27726705

http://stackoverflow.com/q/27656123
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I did sample application for Video communication in webRTC.Its working fine for Chrome but in Firefox its giving iceCandidatefailed error. Can you please suggest me. This is the code having some problem. Thanks in advance. function onicecandidate(iceCandidate) { debugger; console.log("ice candidate send to room ", iceCandidate); // send candidates to other guy if (!peerConnection || !event || !event.candidate) return; var candidate = event.candidate; debugger; var data = { 'type': 'candidate', 'label':candidate.sdpMLineIndex, 'sdpMid':candidate.sdpMid, 'candidate':candidate.candidate }; socket.emit('message', data); };
answer count: 0
has title: iceCandidate got failed for webRTC in Mozilla Firefox
has comment: http://stackoverflow.com/comment/43733030
tagged with: videochat
type: Question
tagged with: javascript
tagged with: chat
score: 0
tagged with: webrtc
has comment: http://stackoverflow.com/comment/43781749

http://stackoverflow.com/a/27860835
score: 1
answers question: http://stackoverflow.com/q/27694320
has comment: http://stackoverflow.com/comment/44134857
has body: You are repeatedly calling the .test method on the same regular expression which was created with g flag. When you do that, subsequent .testing continues from the lastIndex. Here is the matching process for the string a: lastIndex String Substring to match test() returns Position --------- ---------------- ------------------ -------------- -------- 0 " Volvo" " Volvo" false 0 " Saab" " Saab" true 2 3 " Volvo" "lvo" false 0 " Saab" " Saab" true 2 3 " Mercedes" "rcedes" false 0 " Audi" " Audi" true 1 2 " All Resident" "ll Resident" false 0 " All Comercial" " All Comercial" true 1 This explains why "All Resident" header is not shown. The solution is to remove the g flag since you want to test each string only once.
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/comment/43845999
comment on: http://stackoverflow.com/q/27717025
type: Comment
type: QuestionComment
score: 0
has text: have checked it in inspect element regarding any js error?

http://stackoverflow.com/comment/138391910
score: 0
has text: Welcome to SO! Please take a look at the other answers that were given before. Your approach is mentioned there already. In order to keep the site clear and make it easy to find answers, we try to avoid double answers.
type: Comment
comment on: http://stackoverflow.com/a/78490013
type: AnswerComment

http://stackoverflow.com/a/50374535
answers question: http://stackoverflow.com/q/27641731
has comment: http://stackoverflow.com/comment/114701258
has body: If you're just trying to replace one property, lodash _.find and _.set should be enough: var arr = [{id: 1, name: "Person 1"}, {id: 2, name: "Person 2"}]; _.set(_.find(arr, {id: 1}), 'name', 'New Person');
upvote count: 16
type: Answer
downvote count: 0
score: 16

http://stackoverflow.com/q/27720750
tagged with: image
has comment: http://stackoverflow.com/comment/43853211
has body: The UPDATED DEMO works quite well except for the fact that the background image is getting resized when I change: background-size: 20px 20px; Is it possible to keep the original image size and make background images overlap (hide the part of image that exceeds the top-left box (20px 20px) )? The B plan would be to to crop the image with JS in set base64 image content...
answer count: 3
has comment: http://stackoverflow.com/comment/43853379
downvote count: 0
has comment: http://stackoverflow.com/comment/43853319
has title: Display background grid by using image with CSS
has answer: http://stackoverflow.com/a/27721255
favorite count: 0
accepted answer: http://stackoverflow.com/a/27721255
score: 6
has answer: http://stackoverflow.com/a/27721346
tagged with: css
upvote count: 6
has comment: http://stackoverflow.com/comment/43853200
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43853354
has comment: http://stackoverflow.com/comment/43853359
has comment: http://stackoverflow.com/comment/43853313
possible better answer: http://stackoverflow.com/a/27721424
type: Question
has answer: http://stackoverflow.com/a/27721424
tagged with: javascript
has comment: http://stackoverflow.com/comment/43853405

http://stackoverflow.com/comment/43811983
score: 0
type: Comment
type: QuestionComment
has text: You sure you don't mean `add.bind(null,3)`? `add.apply()` executes immediately with the arguments and given `this`
comment on: http://stackoverflow.com/q/27699493

http://stackoverflow.com/comment/43902351
has text: Note you can't have item's with the same **id**. Also you are going to need to prevent the default behavior of an anchor tag (make a click event and return false).
comment on: http://stackoverflow.com/q/27745701
score: 3
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27674072
answers question: http://stackoverflow.com/q/27673074
accepted answer of: http://stackoverflow.com/q/27673074
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0
has body: Try looking for the following events if you want to cover your bases for handling that kind of input: 'input change paste keyup mouseup'
type: Answer

http://stackoverflow.com/q/27776552
downvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/27776737
has title: Cross Origin Policy error
type: AnsweredQuestion
tagged with: amazon-s3
score: 1
upvote count: 1
type: Question
has body: I am reading images from S3 and i am using angularjs, when i open the page i am getting error Image from origin 'https://feazt-static.s3.amazonaws.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. When i reload the page again the images are loading properly.please help me. The code i implemented: $timeout(function() { var canvas = document.createElement("canvas"); var context = canvas.getContext("2d"); var img_obj = document.getElementById("img_file_"+index); img_obj.addEventListener('load', function() { canvas.width = this.width*2; canvas.height = this.height*2; context.drawImage(this, 0, 0, canvas.width, canvas.height); this.setAttribute("src",canvas.toDataURL()); }); img_obj.setAttribute('crossOrigin', 'anonymous'); img_obj.setAttribute("src",arg); }, 2000);
accepted answer: http://stackoverflow.com/a/27776737
tagged with: javascript

http://stackoverflow.com/comment/43879963
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27734161
has text: Yeah it works.. i have an online example, try take a look [example](http://arcane-swift.dk/form.php)

http://stackoverflow.com/q/27730840
has title: Express.js getting address and port while still executing
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27731442
tagged with: express
favorite count: 0
type: UnansweredQuestion
has body: I've read many posts on Nodejs and Expressjs for that matter but I still don't understand how this works: This is the basic Hello World application with Express.js (taken from http://expressjs.com/starter/hello-world.html). var express = require('express') var app = express() app.get('/', function (req, res) { res.send('Hello World!') }) var server = app.listen(3000, function () { var host = server.address().address var port = server.address().port console.log('Example app listening at http://%s:%s', host, port) }) How are we able to get host and port using server when we are still in the process of getting what we'll eventually bind to the var server?
tagged with: node.js
score: 3
upvote count: 3

http://stackoverflow.com/q/27741134
has comment: http://stackoverflow.com/comment/43893271
has comment: http://stackoverflow.com/comment/43893174
has answer: http://stackoverflow.com/a/27741242
has answer: http://stackoverflow.com/a/27741284
has answer: http://stackoverflow.com/a/27741213
type: AnsweredQuestion
has title: How to detect mouse is now over child element and not its parent , when they have same class names
has answer: http://stackoverflow.com/a/27741269
possible better answer: http://stackoverflow.com/a/27741222
has answer: http://stackoverflow.com/a/27741222
type: Question
has comment: http://stackoverflow.com/comment/43893510
has body: I use jquery to find currently hovered element. my html is like this: &lt;div class="parent myclass"&gt; parent &lt;div class="child myclass"&gt; child &lt;/div&gt; &lt;/div&gt; Now i want insert border on currently hovered element with class myclass . But when mouse is over child element jquery not detects that mouse is not over the parent. Maybe it is asked before but i don't know how to search about it. and here is a fiddle : http://jsfiddle.net/uxa38xjz/1/ How i can change that code, so if mouse is over the child, only child element receive class .hovered. currently when mouse is over child script not removes .hovered from parent. edit: This is my script: $('.myclass').mouseover( function(){ $(this).addClass('hovered'); } ) .mouseout( function(){ $(this).removeClass('hovered'); }); And this is the css : .parent{ width: 100px; height:100px; display:block; background-color:#eee; margin:80px; } .child{ width: 70px; height:70px; display:block; background-color:#00f; } .hovered{ -webkit-box-shadow: inset 0px 0px 0px 2px #f00; -moz-box-shadow: inset 0px 0px 0px 2px #f00; box-shadow: inset 0px 0px 0px 2px #f00; } edit2: Only thing that i know is that this elements has class myclass. and i don't know what is the element names or what classes they have. Thanks.
tagged with: javascript
answer count: 6
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27741269
has answer: http://stackoverflow.com/a/27741506
score: 0

http://stackoverflow.com/a/27801524
upvote count: 1
type: AcceptedAnswer
has body: I don't think you can override system functionalities, however you can get your camera to show in a canvas element which can allow you to do various "canvassey" things such as streaming the image to the server or making it greyscale etc. This is just taking some code I was messing around with: HTML &lt;video id="myvideo" controls&gt;&lt;/video&gt; &lt;canvas id="mycanvas"&gt;&lt;/canvas&gt; JS var isStreaming = false, video = $('#myvideo')[0], canvas = $('#mycanvas')[0], ctx = canvas.getContext('2d'), w = 800, h = 400; navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; $(window).load(function() { if (navigator.getUserMedia) { navigator.getUserMedia({video: true, audio: true}, function(stream) { var url = window.URL || window.webkitURL; var src = url ? url.createObjectURL(stream) : stream; video.src = src video.play(); }, function(error) { alert('Error: ' + error); return; }); } else { alert('not supported in your browser'); } }); video.addEventListener('canplay', function(e) { if (!isStreaming) { // videoWidth isn't always set correctly in all browsers if (video.videoWidth &gt; 0) h = video.videoHeight / (video.videoWidth / w); canvas.setAttribute('width', w); canvas.setAttribute('height', h); // Reverse the canvas image //ctx.translate(w, 0); //ctx.scale(-1, 1); isStreaming = true; } }, false); video.addEventListener('play', function() { // Every 33 milliseconds copy the video image to the canvas setInterval(function() { if (video.paused || video.ended) return; ctx.fillRect(0, 0, w, h); ctx.drawImage(video, 0, 0, w, h); }, 33); }, false); This simply just streams a camera into a canvas. Hope that helps :)
has comment: http://stackoverflow.com/comment/44016483
has comment: http://stackoverflow.com/comment/44015883
type: Answer
has comment: http://stackoverflow.com/comment/44015540
accepted answer of: http://stackoverflow.com/q/27800188
has comment: http://stackoverflow.com/comment/44014382
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27800188
has comment: http://stackoverflow.com/comment/44015249

http://stackoverflow.com/a/27751483
answers question: http://stackoverflow.com/q/27751409
has comment: http://stackoverflow.com/comment/43914105
has comment: http://stackoverflow.com/comment/43914484
has comment: http://stackoverflow.com/comment/43942855
has comment: http://stackoverflow.com/comment/43914141
has comment: http://stackoverflow.com/comment/43914228
score: 5
upvote count: 5
has comment: http://stackoverflow.com/comment/43914518
has body: Other alternative would be to build a stylesheet for the page. Something like this: var styles='input:focus {background-color:red}'; var styleTag=document.createElement('style'); if (styleTag.styleSheet) styleTag.styleSheet.cssText=styles; else styleTag.appendChild(document.createTextNode(styles)); document.getElementsByTagName('head')[0].appendChild(styleTag); This way you will have clean separation of css styles from the scripts and so the better maintenance.
downvote count: 0
has comment: http://stackoverflow.com/comment/118658266
type: Answer
has comment: http://stackoverflow.com/comment/43914438
has comment: http://stackoverflow.com/comment/43914086

http://stackoverflow.com/comment/43859092
type: Comment
comment on: http://stackoverflow.com/a/27715363
has text: Thank you so much! You're solution smacked me in the head - DOH!
type: AnswerComment
score: 0

http://stackoverflow.com/a/27746057
has comment: http://stackoverflow.com/comment/43903809
score: 0
has comment: http://stackoverflow.com/comment/43905665
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43903730
type: Answer
has comment: http://stackoverflow.com/comment/43904251
accepted answer of: http://stackoverflow.com/q/27745701
has comment: http://stackoverflow.com/comment/43905289
has comment: http://stackoverflow.com/comment/43904593
has body: Firstly you need to deal with your duplicate id here: You are in Note we cannot have the same id otherwise we don't know how to get an element by it's id. So remove the uneeded one on the h2: You are in Then add event's to your a tags: item1 item2 item3 item4 Note: This can be done purely in JavaScript or be done easily in jQuery. But since you did not mention it I will not be using jQuery. We could iterate through by ClassName and have the links be a class, but that's no more simple then the way above. For the JavaScript we need to return false to prevent the default behavior of a anchor tag: function update(text) { document.getElementById("zoneName").innerHTML = text; return false; } Here is a working Fiddle Would there be a way to keep the updated text in the even if the page reloads? Yes there is a way to do this without having to use a server-sided language. What I will do is use HTML 5 web storage, note this will only work for browsers that support HTML 5 (which is all of the modern ones), you can use cookies if you need support for older browsers that work similarly for the following example. In this case I will be using sessionStorage which saves the information even until the browser is closed. I will emulate a href to the same page for the tags, we need to do this because we need to save out information before we move to a new page. After I save I will call location.reload() that will act as a refresh. Note that you could make this move to an entirely new page as well, just include the script on the new page and use window.location.href = "newPageUrl" ( jsfiddle prevents me from moving to a new page ). The HTML will be the same but the JavaScript will be updated as followed: window.onload = function() { // When the page loads if(sessionStorage.zoneName) { // Check if the session exist // update the page with the session info document.getElementById("zoneName").innerHTML = sessionStorage.zoneName; } } function update(text) { sessionStorage.zoneName = text; …
answers question: http://stackoverflow.com/q/27745701
has comment: http://stackoverflow.com/comment/43906001
has comment: http://stackoverflow.com/comment/43903388
has comment: http://stackoverflow.com/comment/43904168
has comment: http://stackoverflow.com/comment/43903639

http://stackoverflow.com/a/27750840
has body: You're not returning anything from the reduce function. accumulatedPremise.then(function (response) { should be: return accumulatedPremise.then(function (response) {
accepted answer of: http://stackoverflow.com/q/27750537
has comment: http://stackoverflow.com/comment/43917818
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/27750537
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/a/27823828
has comment: http://stackoverflow.com/comment/44565259
accepted answer of: http://stackoverflow.com/q/27677692
score: 12
upvote count: 12
has comment: http://stackoverflow.com/comment/44575991
answers question: http://stackoverflow.com/q/27677692
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/83216623
has body: Each architecture decision does have a performance impact as you have suggested: Callback (fastest) one to one binding has a direct reference to the function 315,873 ops/sec Pub-Sub Events too many binding requires a loop to call multiple callbacks, more callbacks = worse performance 291,609 ops/sec Promises (slowest) use a delay to ensure each item in the chain is not invoked at the same time, more chains = worse performance 253,301 ops/sec I would choose callbacks for most cases unless you have a load of interconnected modules, then pub/sub is useful. And remember these can work in tandem with each other. I usually allow a callback and a pub/sub event within the same module, letting the developer choose which one they would prefer to use: var module = { events: [], item: { 'name': 'Test module' }, updateName: function(value, callback) { this.item.name = value; if (callback) { callback(this.item); } this.dispatchEvent('update', this.item); }, addEvent: function(name, callback) { if (!this.events[name]) { this.events[name] = []; } this.events[name].push(callback); }, removeEvent: function(name, callback) { if (this.events[name]) { if (callback) { for (var i=0; i&lt;this.events[name].length; ++i) { if (this.events[name][i] === callback) { this.events[name].splice(i, 1); return true; } } } else { delete this.events[name]; } } }, dispatchEvent: function(name, data) { if (this.events[name]) { for (var i=0; i&lt;this.events[name].length; ++i) { this.events[name][i]({ data: data, target: this, type: name}); } } } }; module.updateName('Dan'); // no callback, no event module.updateName('Ted', function (item) { console.log(item); }); // callback, no event module.addEvent('update', function (item) { console.log(item); }); // add an event module.updateName('Sal'); // no callback, event callback module.addEvent('update', function (item) { console.log('event2', item); }); // add a second event module.updateName('Jim'); // no callback, two event callbacks
type: Answer

http://stackoverflow.com/a/27665011
score: 1
upvote count: 1
has body: var randUnicode = String.fromCharCode("0x" + getRandomInt(1000, 9999).toString()) ;
accepted answer of: http://stackoverflow.com/q/27664651
answers question: http://stackoverflow.com/q/27664651
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43745701
type: Answer
has comment: http://stackoverflow.com/comment/43745748

http://stackoverflow.com/comment/43991798
type: Comment
has text: @YuryTarabanko I know, but it says in the docs that `status` is not part of the browser build, so I got suspicious.
score: 0
comment on: http://stackoverflow.com/q/27790950
type: QuestionComment

http://stackoverflow.com/comment/43723123
comment on: http://stackoverflow.com/q/27653018
type: QuestionComment
score: 0
has text: So just add the target="_blank" attribute. Check out @dr_dev answer.
type: Comment

http://stackoverflow.com/comment/43964952
type: QuestionComment
type: Comment
has text: Which version of Angular are using? This case works fine with 1.3.x. Please add full error that you are getting.
score: 0
comment on: http://stackoverflow.com/q/27777046

http://stackoverflow.com/q/27711552
tagged with: parsley.js
has answer: http://stackoverflow.com/a/29475565
score: 1
tagged with: forms
has comment: http://stackoverflow.com/comment/73465710
type: Question
answer count: 2
upvote count: 1
tagged with: validation
has answer: http://stackoverflow.com/a/29735262
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43835296
has title: Parsley.JS form validation not working
has comment: http://stackoverflow.com/comment/43835093
downvote count: 0
type: UnansweredQuestion
has body: I am trying to use parsley.js validation using simple form but is not working. My cdn is working correctly but I am not getting any validation. The code is: Parsley.js form validation Parsley.JS Name Email Website

http://stackoverflow.com/comment/43815132
type: Comment
comment on: http://stackoverflow.com/q/27690342
type: QuestionComment
has text: @ArtjomB. ah yes... that part I was missing... no sessionStorage is just empty object... any idea why?
score: 0

http://stackoverflow.com/comment/43940942
has text: @charlietfl What do you mean by output? You mean inspect the elements that appear in my browser?
type: Comment
comment on: http://stackoverflow.com/q/27757666
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43718418
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27650603
has text: `setInterval` gives a timer id back to `img_change`. You need to wrap the interval in a function. `img_change` is now a string
type: Comment

http://stackoverflow.com/a/27651294
has comment: http://stackoverflow.com/comment/43719780
downvote count: 0
has comment: http://stackoverflow.com/comment/43719697
type: Answer
score: 1
upvote count: 1
has body: Use drag event to control boundaries, it's the simplest way I think. Here is a demo jsFiddle Consider @Roko C. Buljan advice in comments to deal with window resije and images dynamic upload you better to have our right boundary inside drag function: var images = document.getElementById('imgWrap'); var leftBoundary = 5; //5px for nice margin $("#imgWrap").draggable({ axis: "x", drag: function (event, ui) { var rightBoundary = window.innerWidth - images.clientWidth - 5; //right boundary if (ui.position.left &gt; leftBoundary) ui.position.left = leftBoundary; else if (ui.position.left &lt; rightBoundary) ui.position.left = rightBoundary; } }); And a little bonus with kind of animation
answers question: http://stackoverflow.com/q/27651130
has comment: http://stackoverflow.com/comment/43727908
has comment: http://stackoverflow.com/comment/43727879

http://stackoverflow.com/a/27761082
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27761066
has body: var max = document.getElementById("maxOfTwo"); You have a locally scoped variable with the same name. If you don't explicitly access the property of the window object, then the scope chain will find your HTML Element Object first.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27761066
type: Answer

http://stackoverflow.com/comment/43817154
type: Comment
score: 0
type: AnswerComment
has text: It's mine, not the default one.
comment on: http://stackoverflow.com/a/27701296

http://stackoverflow.com/a/27725675
has comment: http://stackoverflow.com/comment/43863418
score: 1
has body: As noted in the comments the following code works fine on jsfiddle: HTML: posted 33 seconds ago posted 33 seconds ago JS: setInterval(function(){ $('.updateMinutes').each(function(){ var minute = $(this).text().match(/\d+/); $(this).html((parseInt(minute[0]) + 1).toString() + ' minutes'); }); }, 1000); (Set on second interval for demo purposes) Fiddle is here: http://jsfiddle.net/e5och57u/ In your original post min[0] was an error, should have been minute[0], otherwise it works fine
upvote count: 1
answers question: http://stackoverflow.com/q/27725606
downvote count: 0
type: Answer

http://stackoverflow.com/q/27795033
has comment: http://stackoverflow.com/comment/44000349
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27795739
has comment: http://stackoverflow.com/comment/44000518
has comment: http://stackoverflow.com/comment/44000306
tagged with: javascript
answer count: 2
has body: I use totango for some usage tracking. Now, while we try to rework the way we track, I want to send trackings into 2 different totango accounts, for a transition period. I've managed to split the objects into window.totango_old and window.totango_beta. Now instead of replacing all the old usages of window.totango, I was wondering whether I can make window.totango simply apply any arbitrary method I use on it onto the 2 different objects specified above. I've tried figuring out the usage with .apply(), but I can't fully grasp how it would work in my case. I want to avoid doing this: window.totango = function() { return { track: function(event, value) { window.totango_old.track(event, value); window.totango_beta.track(event, value); } } } Because it means I have to map the usable functions one by one. Is there a "catch-all" way that would pass any method I call on an object, and let me get its name and arguments, to pass on to different objects dynamically? I tried running a test, like so: window.test2 = function() { return { testFunc: function(a, b) { console.log([a, b]); } } }; window.test = function() { this.apply(window.test2, arguments) // also tried: window.test2.apply(window.test2, arguments) }; window.test.testFunc("1", "2"); But I received the following exception: Uncaught TypeError: undefined is not a function
has answer: http://stackoverflow.com/a/27795992
has answer: http://stackoverflow.com/a/27795739
has title: How can I map one object usage to route to 2 objects?
possible better answer: http://stackoverflow.com/a/27795992
tagged with: call
score: 0

http://stackoverflow.com/comment/43735767
type: AnswerComment
has text: @A.B oops your code created a mess ! , all the elements go haywire. But anyway , thanks for an answer
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27659941

http://stackoverflow.com/comment/43836792
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27712231
has text: I added your code to the page, and it listens to the toggling now, and I added the pre-checking of the checkbox. But, it doesn't show the button when checked, only when unchecked. Where am I going wrong now?
score: 0

http://stackoverflow.com/comment/43958839
type: QuestionComment
has text: What are you expecting to happen? href=“javascript:;” will do nothing
comment on: http://stackoverflow.com/q/27774027
score: 0
type: Comment

http://stackoverflow.com/q/27732363
favorite count: 0
tagged with: ajax
possible better answer: http://stackoverflow.com/a/27732410
has answer: http://stackoverflow.com/a/27732409
has answer: http://stackoverflow.com/a/27732410
has title: AJAX request firing 4 times instead of once
upvote count: 2
downvote count: 2
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27732409
type: Question
score: 0
answer count: 2
tagged with: javascript
has body: My code should only fire once on receiving a request from the server via AJAX, however it seems to be firing off about 4 times. Can anyone explain why this is happening and how to prevent it? I have tested this on Chrome and IE index.html AJAX Test Test client.js var xmlhttpSend; xmlhttpSend = new XMLHttpRequest(); xmlhttpSend.onreadystatechange=function(){ //The code in this area should only fire once on receiving a response //from the server (but it seems to run 4 times) var getText = xmlhttpSend.responseText; document.getElementById('divOne').innerHTML = getText; alert(getText); } xmlhttpSend.open("POST", "server.php?q="+encodeURIComponent("test"), true); xmlhttpSend.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttpSend.send(); server.php <?php $q = $_REQUEST["q"]; echo 'ok'; ?>

http://stackoverflow.com/q/27678000
type: Question
score: 0
has comment: http://stackoverflow.com/comment/43770603
has comment: http://stackoverflow.com/comment/43770460
tagged with: javascript
has answer: http://stackoverflow.com/a/27678051
answer count: 3
has title: !! sytactic sugar to check undefined in javascript for boolean values
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43770328
has answer: http://stackoverflow.com/a/27678061
has body: var x = false; if (!!x) { // syntactic sugar for x ! =undefined alert('I will not be shown'); } here we do have the value "false" for x and so it is defined . Question here is that is it a proper way to check undefined?
has answer: http://stackoverflow.com/a/27678054
has comment: http://stackoverflow.com/comment/43770389

http://stackoverflow.com/a/27778508
answers question: http://stackoverflow.com/q/27778426
has comment: http://stackoverflow.com/comment/43967308
has body: Typo? a = Number(document.getElementByID("a").value); b = Number(document.getElementByID("b").value); Try: a = Number(document.getElementById("a").value); b = Number(document.getElementById("b").value);
score: 0
has comment: http://stackoverflow.com/comment/43967275
has comment: http://stackoverflow.com/comment/43967178
type: Answer

http://stackoverflow.com/a/27707396
upvote count: 4
has comment: http://stackoverflow.com/comment/43826713
has comment: http://stackoverflow.com/comment/43826835
has comment: http://stackoverflow.com/comment/43946417
has body: UPDATE: As of v0.1.5, Ember-CLI has fixed the issue with not generating the routing map correctly. Running the commands below should now generate the correct code in router.js. It also added a path option for nested routes (rather than resources). You can see the changelog here. It looks as if the changelog notes are currently the only documentation of that feature, but they're easy enough to understand. Right now, there is no way to fully generate nested routes or resources with Ember-CLI (as far as I can tell). You can have it generate the files for you, but you'll have to edit router.js yourself. For instance, if I run the following lines: ember generate resource settings ember generate route settings/overview You'll get the following router.js: Router.map(function() { this.resource('settings', { path: 'settings/:settings_id' }, function() { }); this.route('settings/overview'); }); This is probably just a limitation in the way Blueprints currently works. Go ahead and generate your routes as you see above, then just modify router.js by hand to nest the route calls instead of making them top-level: Router.map(function() { this.resource('settings', { path: 'settings/:settings_id' }, function() { this.route('overview'); }); }); Also, if you want to create a nested route, not a nested resource, I'm not sure there is a blueprint for that yet. I would just generate a resource and then change it to a route manually.
type: AcceptedAnswer
score: 4
accepted answer of: http://stackoverflow.com/q/27705701
answers question: http://stackoverflow.com/q/27705701
downvote count: 0
type: Answer

http://stackoverflow.com/a/27670721
downvote count: 0
upvote count: 2
has body: You have to pass a reference to the function, right now you just call the function right away using (). Also to add the event using addEventListener you have to use select instead of onselect. document.getElementById("description").addEventListener("select", getSelection); function getSelection(event) { var ele = event.target; var txt = "Text Selected"; alert(txt); } &lt;textarea id="description"&gt;&lt;/textarea&gt;
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27670656
answers question: http://stackoverflow.com/q/27670656
type: Answer
score: 2

http://stackoverflow.com/a/27700071
has body: So you should save a pointer to the user to the task. var Task = Parse.Object.extend("Tasks"); var task = new Task(); task.set("user", user); task.set("title", "taskTitle"); task.set("date", taskDue); task.save(null, { success : function(task) { // Execute any logic that should take place after the object is saved. console.log('New object created with objectId: ' + task.id); }, error : function(gameScore, error) { // Execute any logic that should take place if the save fails. // error is a Parse.Error with an error code and message. console.log('Failed to create new object, with error code: ' + error.message); } }); By default, when fetching an object, related Parse.Objects are not fetched. These objects' values cannot be retrieved until they have been fetched like so: var user = task.get("user"); user.fetch({ success: function(user) { //fetch user is here } }); This is explained here: https://parse.com/docs/js_guide#objects-pointers The problem with your script is when you are querying in Parse it is done asynchronously so you can't return the user immediately. Instead you need to return the promise and then handle it when you call getUserFromUsername: function getUserFromUsername(username) { var User = Parse.Object.extend("_User"); var query = new Parse.Query(User); query.equalTo("username", username); return query.first(); } getUserFromUsername('testUsername').then(function(result) { //use User here }, function(error) { alert("Error: " + error.code + " " + error.message); }); Take a look at this document on promise chaining for more information about promises:
has comment: http://stackoverflow.com/comment/43814995
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43815875
accepted answer of: http://stackoverflow.com/q/27699368
has comment: http://stackoverflow.com/comment/43815332
answers question: http://stackoverflow.com/q/27699368
type: Answer
has comment: http://stackoverflow.com/comment/43815539
has comment: http://stackoverflow.com/comment/43815571
has comment: http://stackoverflow.com/comment/43816435
has comment: http://stackoverflow.com/comment/43815075
has comment: http://stackoverflow.com/comment/43813819
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43813844
has comment: http://stackoverflow.com/comment/43815234
has comment: http://stackoverflow.com/comment/43813864

http://stackoverflow.com/comment/43925752
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27757570
has text: Apologies if my JS code looks *awfully* like Java :) Be warned that above code is not the most memory efficient and may be insufficient for very large inputs.
score: 0

http://stackoverflow.com/q/27773088
has title: what difference does 'apply' makes when sending array as arguments to a variable arity function
type: UnansweredQuestion
downvote count: 1
type: Question
score: -1
has body: Here i have a function which can take any number of arguments.Sending an array as argument to this function without apply creates an Array which contains an Array having 3 elements. function a(){ console.log(arguments); } a([1,2,3]); When it is called with apply() method it gives an output with only a single array having its elements function a(){ console.log(arguments); } a.apply(null,[1,2,3]); We can see a significant change in output.I only know we have My question is what difference does apply make when we send array as arguments??I mean why we need to use 'apply' when we have to send an array to a variadic?
has comment: http://stackoverflow.com/comment/43957075
upvote count: 0
tagged with: arrays
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27773113
favorite count: 0
has comment: http://stackoverflow.com/comment/43957056

http://stackoverflow.com/comment/43758106
has text: @Teemu - will this make vertical aligning work? I don't think so. I googled for a long time and all solutions I found are related with settings fixed sizes or using `display: table-cell;` that leads to even more bugs.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27671406
score: 0

http://stackoverflow.com/q/27669780
type: Question
tagged with: javascript
upvote count: 2
answer count: 1
favorite count: 0
has body: When I try it embedding just a video it works, but when I disable autoplay in "embed playlist code" it doesn't work. In first video it doesn't play automatically but when video ends, it plays the next video, I want it to stop after each video. any idea?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27697566
tagged with: youtube
has title: can't disable youtube embed playlist autoplay
score: 2
downvote count: 0
tagged with: youtube-api

http://stackoverflow.com/q/27723596
tagged with: javascript
has comment: http://stackoverflow.com/comment/43859075
has title: Flexible Custom Layout with CSS (possibly JS if needed)
has answer: http://stackoverflow.com/a/27724184
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43859247
linked to: http://stackoverflow.com/q/27715958
favorite count: 0
score: 4
has comment: http://stackoverflow.com/comment/43859484
accepted answer: http://stackoverflow.com/a/27724093
has comment: http://stackoverflow.com/comment/43860701
possible better answer: http://stackoverflow.com/a/27723730
tagged with: css
has answer: http://stackoverflow.com/a/27723730
has answer: http://stackoverflow.com/a/27724354
has comment: http://stackoverflow.com/comment/43859230
has body: As per the attached image. I am trying to make a &lt;ul&gt; that contains multiple items. However, I want the first five items to always fill the viewport height and if there are more than five items I need the rest to have the same height as the first five &lt;li&gt;'s. As per li number 4 in the image, there maybe be a nested &lt;ul&gt; that can fill the width having multiple &lt;li&gt;'s. The text inside all &lt;li&gt;s needs to be vertically centered and supports multi-line while retaining the same height as the other elements. NOTE: Any other lis below the fold need to have the same height as the initial first five. (Even if there are less than five elements at first, they shouldn't fill the full height. Only when there are five they complete the full page height. Any help is greatly appreciated! My previous question was not full and I missed some explanations: Vertically Stretch List Items I am using the CSS only solution (for now) which doesn't work as needed. Thanks. CODE Used: ul.navigation { list-style-type: none; margin: 0; padding: 0; display: table; width: 100%; height: 100%; } ul.navigation li { display: table-row; } ul.navigation li a { font-size:1.8em; display: table-cell; vertical-align: middle; padding: 1em 1.1em; text-transform: uppercase; color: white; text-decoration: none; }
upvote count: 4
answer count: 4
downvote count: 0
has answer: http://stackoverflow.com/a/27724093

http://stackoverflow.com/a/27715475
answers question: http://stackoverflow.com/q/27715424
type: Answer
score: 6
upvote count: 6
has comment: http://stackoverflow.com/comment/43843066
has body: name is a property of window. Your function won't work at global scope. The simpler example which reproduces the problem would be... var name = {} name.blah = "blah" document.write(name.blah); // undefined Wrap it in a function, or choose a different variable name. names is more appropriate any way, since it's an array of multiple objects, you should choose a plural name for the variable: var names = new Array(); var sales = new Array(); var total = prompt("How many total salesmen does your department employ?"); for(i = 0; i &lt; total; i++) { names[i] = prompt("What is his/her (the salesman's) name?"); sales[i] = prompt("How much (in dollars) did he/she sell?"); } for(j = 0; j &lt; i; j++) { document.write(names[j]+" had $"+ sales[j]+" in sales!&lt;br&gt;"); }
downvote count: 0

http://stackoverflow.com/q/27712453
linked to: http://stackoverflow.com/q/4831741
type: Question
duplicate of: http://stackoverflow.com/q/4831741
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43837053
tagged with: css
has body: I don't remember when I started seeing URLs without the protocols. &lt;script src="//jquery.com/jquery.js"&gt;&lt;/script&gt; ... but I immediately understood. It's great not to have to list the protocol when we don't know what it will be. Unfortunately I don't know what the rules are here. Is this okay too? &lt;link href="//stylesheet.com/stylesheet.css" /&gt; What about this? /* stylesheet.css */ @import url(//fonts.googleapis.com/css?family=Questrial); I'm not just looking for the answers here, but where to look to read the definitive guide. And I don't even know what this technique is called. I don't know what the browser support is or what would happen in a case where the browser didn't support it. Thanks for the help! Update A lot of the answers I was looking for are found on this question.
has answer: http://stackoverflow.com/a/27712501
upvote count: 2
has title: What are the rules on URLs written without the protocol?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43837040
downvote count: 1
score: 1

http://stackoverflow.com/comment/44012133
type: QuestionComment
has text: http://stackoverflow.com/a/1736422/965907
comment on: http://stackoverflow.com/q/27801712
score: 0
type: Comment

http://stackoverflow.com/comment/43961279
has text: from the code you provided above, var optionValue = $(this).find(":selected").val() this works. I might as well use this.
type: Comment
comment on: http://stackoverflow.com/a/27774904
score: 0
type: AnswerComment

http://stackoverflow.com/a/27763805
accepted answer of: http://stackoverflow.com/q/27763737
answers question: http://stackoverflow.com/q/27763737
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: As simple as one line with toggleClass: $('.sp-right, .sp-left').toggleClass("sp-right sp-left"); No need to check for classes and remove/addClass manually, as toggleClass does exactly this. You can also provide multiple space separated classes to toggle.

http://stackoverflow.com/comment/43881427
type: AnswerComment
score: 0
has text: Nicely done, here's a version of your approach rewritten in plugin form: [JS Fiddle demo](http://jsfiddle.net/davidThomas/v4gr1ykg/1/).
type: Comment
comment on: http://stackoverflow.com/a/27733847

http://stackoverflow.com/comment/43729969
has text: A function to validate the date is much simpler than that regular expression: `function validateDMY(s) {s = s.split(/\D/); return (new Date(s[2], --s[1], s[0])).getMonth() == s[1];}`.
comment on: http://stackoverflow.com/q/27656134
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27730277
has comment: http://stackoverflow.com/comment/43872183
answer count: 1
has comment: http://stackoverflow.com/comment/43872622
has comment: http://stackoverflow.com/comment/43872467
tagged with: javascript
has comment: http://stackoverflow.com/comment/43872321
has comment: http://stackoverflow.com/comment/43872142
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43872074
tagged with: php
tagged with: include
has body: I have a main index.php and it has an external js included. The navigation in my site is always stays in index and including the relevant php file. I also have a js file that i want it to only affect a certain php file (if i include it in the index.php it affects all the php files). when i try to include in a file called 'welcome.php' it doesn't work. The js is right because i tried putting the code in the index.php and it worked. this is how i included it in 'welcome.php' &lt;/div&gt; &lt;/div&gt; &lt;script src="../js/content.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/body&gt;
downvote count: 2
has answer: http://stackoverflow.com/a/27730514
upvote count: 1
has title: can't include javascript in included php
type: Question
score: -1

http://stackoverflow.com/comment/43842047
type: Comment
comment on: http://stackoverflow.com/a/27714902
score: 0
type: AnswerComment
has text: it doesn't work , i get the same error message if i delete

http://stackoverflow.com/q/27793855
tagged with: jquery
has comment: http://stackoverflow.com/comment/43996981
has comment: http://stackoverflow.com/comment/43997085
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43997027
has comment: http://stackoverflow.com/comment/43997105
tagged with: php
score: 0
has comment: http://stackoverflow.com/comment/43997133
has answer: http://stackoverflow.com/a/27793958
has comment: http://stackoverflow.com/comment/43997132
type: Question
has comment: http://stackoverflow.com/comment/43997082
has comment: http://stackoverflow.com/comment/43997057
has body: I am trying to dynamically have JavaScript object properties to send through ajax. Here is what I have done: var checkBoxName = $(this).attr('name'); var postData = { Module: ModuleID, Group:GroupID }; if($(this).is(":checked")){ postData.checkBoxName = 1; }else{ postData.checkBoxName = 0; } $.ajax({ url: "<?php echo base_url(); ?>user_site/user_group_add_pri/updatePrivilege", data:postData, type: "POST", success: function (output) { console.log(output); } I have multiple checkboxes. every checkbox has different name so what I am trying to do is post data to controller with checkbox name and its value. But instead it is sending checkBoxName for all checkboxes. I mean CheckBoxName is a variable but I used it like this because I thought it would send its value but it is not sending. I tried like this postData.checkBoxName = but instead of value of variable it is sending as Text? Update The event Occurs when checkbox value is changed. $("input[type='checkbox']").on('change',function(e){ ///Above Code Inside Here }
has comment: http://stackoverflow.com/comment/43997088
tagged with: javascript
has comment: http://stackoverflow.com/comment/43997107
has comment: http://stackoverflow.com/comment/43997009
has title: Dynamically assign object properties in jQuery/JavaScript to post through ajax
answer count: 1

http://stackoverflow.com/q/27711156
tagged with: regex
has answer: http://stackoverflow.com/a/27711369
has answer: http://stackoverflow.com/a/27711372
has comment: http://stackoverflow.com/comment/43834444
upvote count: 1
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27711290
has comment: http://stackoverflow.com/comment/43834480
type: Question
score: 0
has body: RegExes give me headaches. I have a very simple regex but I don't understand how it works. The code: var str= "startBlablablablablaend"; var regex = /start(.*?)end/; var match = str.match(regex); console.log( match[0] ); //startBlablablablablaend console.log( match[1] ); //Blablablablabla What I ultimately want would be the second one, in other words the text between the two delimiters (start,end). My questions: How does it work? (each character explained please) Why does it match two different things? Is there a better way to get match[1]? If I want to get all the text's between all the start-end instances, how would I go about it? For the last question, what I mean: var str = "startBla1end startBla2end startBla3end"; var regex = /start(.*?)end/gmi; var match = str.match(regex); console.log( match ); // [ "startBla1end" , "startBla2end" , "startBla3end" ] What I need is: console.log( match ); // [ "Bla1" , "Bla2" , "Bla3" ]; Thanks :)
has answer: http://stackoverflow.com/a/27711290
has title: How does this regexp work?
possible better answer: http://stackoverflow.com/a/27711369
linked to: http://stackoverflow.com/q/5642315
tagged with: javascript
favorite count: 0
answer count: 3

http://stackoverflow.com/comment/43852699
type: QuestionComment
score: 1
has text: UPDATE: you should get the html page back in the browser displayed, after calling localhost:3000. 1. Do you? if not, specify routes for express at the server 2. after that, socketio.js should be downloaded from url you specified in html. Then js at the client should be executing and calling io.connect(). 3. then you should get at the piece of code at the server. Check the previous steps. (alerts, console.log into browser console windows can also help, and find out, what's wrong. The client code should be run after page is loaded at all. (e.g. with jquery - $(document).ready(function () {... )
comment on: http://stackoverflow.com/q/27719945
type: Comment

http://stackoverflow.com/q/27741024
type: Question
has title: Jasmine test using spyon with $httpBackend not working
type: AnsweredQuestion
score: 3
tagged with: spyon
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27742827
answer count: 1
downvote count: 0
tagged with: jasmine
favorite count: 0
tagged with: httpbackend
tagged with: angularjs
has answer: http://stackoverflow.com/a/27742827
has body: I am trying to write a jasmine test on some javascript using spyon over a method that uses $http. I have mocked this out using $httpBackend and unfortunately the spy doesn't seem to be picking up the fact the method has indeed been called post $http useage. I can see it being called in debug, so unsure why it reports it hasn't been called. I suspect I have a problem with my scope usage ? or order of $httpBackend.flush\verify ?: Code under test function FileUploadController($scope, $http, SharedData, uploadViewModel) { Removed variables for brevity ..... $scope.pageLoad = function () { $scope.getPeriods(); if ($scope.uploadViewModel != null &amp;&amp; $scope.uploadViewModel.UploadId &gt; 0) { $scope.rulesApplied = true; $scope.UploadId = $scope.uploadViewModel.UploadId; $scope.linkUploadedData(); } else { $scope.initDataLinkages(); } } $scope.initDataLinkages = function () { $http({ method: "GET", url: "/api/uploadhistory" }). success(function (data, status) { $scope.status = status; $scope.setUploadHistory(data); }). error(function (data, status) { $scope.data = data || "Request failed"; $scope.status = status; }); } $scope.setUploadHistory = function (data) { if ($scope.UploadId &gt; 0) { $scope.currentUpload = data.filter(function (item) { return item.UploadId === $scope.UploadId; })[0]; //Remove the current upload, to prevent scaling the same data! var filteredData = data.filter(function (item) { return item.UploadId !== $scope.UploadId; }); var defaultOption = { UploadId: -1, Filename: 'this file', TableName: null, DateUploaded: null }; $scope.UploadHistory = filteredData; $scope.UploadHistory.splice(0, 0, defaultOption); $scope.UploadHistoryId = -1; $scope.UploadTotal = $scope.currentUpload.TotalAmount; } else { $scope.UploadHistory = data; } } Test setup beforeEach(module('TDAnalytics')); beforeEach(inject(function (_$rootScope_, $controller, _$httpBackend_) { $rootScope = _$rootScope_; $scope = $rootScope.$new(); $httpBackend = _$httpBackend_; var sharedData …
upvote count: 3

http://stackoverflow.com/comment/43973075
score: 1
comment on: http://stackoverflow.com/q/27781403
type: Comment
type: QuestionComment
has text: You can't set the content-type of a GET request, there is no request body to describe the content of.

http://stackoverflow.com/q/27748042
tagged with: ruby
has comment: http://stackoverflow.com/comment/44307574
has comment: http://stackoverflow.com/comment/44313933
type: UnansweredQuestion
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/44223112
score: 2
downvote count: 0
has title: Sortable Save Position
has comment: http://stackoverflow.com/comment/44294966
has comment: http://stackoverflow.com/comment/44266637
has comment: http://stackoverflow.com/comment/43907434
has body: I'm using nested model forms in Rails, with a Questions and answers app, similar to the Ryan Bates one, here: http://railscasts.com/episodes/196-nested-model-form-revised. Now, I want to make the questions sortable, and then save their position when I go to show them in show.html.erb. So my views look like: _form.html.erb: &lt;%= f.fields_for :questions do |builder| %&gt; &lt;ul class='sortable'&gt; &lt;%= render 'question_fields', f: builder %&gt; &lt;/ul&gt; &lt;% end %&gt; &lt;%= link_to_add_fields "Add Question", f, :questions %&gt; _question_fields.html.erb: &lt;li&gt; &lt;%= f.label :content, "Question" %&gt;&lt;br /&gt; &lt;%= f.text_area :content %&gt;&lt;br /&gt; &lt;%= f.check_box :_destroy %&gt; &lt;%= f.label :_destroy, "Remove Question" %&gt; &lt;/li&gt; my jquery is just a simple: $(".sortable").sortable(); the helper is: def link_to_add_fields(name, f, association) new_object = f.object.send(association).klass.new id = new_object.object_id fields = f.fields_for(association, new_object, child_index: id) do |builder| render(association.to_s.singularize + "_fields", f: builder) end link_to(name, '#', class: "add_fields", data: {id: id, fields: fields.gsub("\n", "")}) end I've found similar SO questions about saving via Ajax (using Sortable's serialize()), but I'm really just looking for a solution to save without having to use AJAX.
type: Question
has comment: http://stackoverflow.com/comment/44243259
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44285972
upvote count: 2
has answer: http://stackoverflow.com/a/27961579
has comment: http://stackoverflow.com/comment/43907530
has comment: http://stackoverflow.com/comment/44222491
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/43882226
type: Comment
has text: Got my fiddles a bit muddled but I think the links are right now
comment on: http://stackoverflow.com/a/27734733
score: 0
type: AnswerComment

http://stackoverflow.com/q/27645133
favorite count: 0
has title: Why can't I use js2coffee to convert `$`?
type: AnsweredQuestion
upvote count: 0
tagged with: coffeescript
possible better answer: http://stackoverflow.com/a/28255333
type: Question
has answer: http://stackoverflow.com/a/28255333
score: -1
accepted answer: http://stackoverflow.com/a/27645182
answer count: 2
has body: I tried to convert the following code from javascript to coffeescript using js2coffee website as well as js2coffee package $(document).ready(function () { if (isPhoneDevice) { //mobile } else { //desktop // Initialize WOW.js wow = new WOW({ offset: 50 }) wow.init(); } }); but unfortunately both of them throws an error in the first line. Does anyone have ideas about this?
downvote count: 1
tagged with: js2coffee
tagged with: javascript
has answer: http://stackoverflow.com/a/27645182

http://stackoverflow.com/comment/43927275
has text: Glad to hear localstorage isn't a problem with modern browsers; I'll experiment with that so I don't have to worry about where the focus goes after the popup closes.
type: AnswerComment
comment on: http://stackoverflow.com/a/27757995
score: 0
type: Comment

http://stackoverflow.com/q/27700982
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43815143
has comment: http://stackoverflow.com/comment/43815291
has comment: http://stackoverflow.com/comment/43815254
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion
has body: ​We have a requirement which displays file name with its extension This file has to be shown in a popup as placed mouse hover on it.For example in a GridView the more number of Parent files, when we place a pointer on the parent file, it shows a preview of the "Child files" also. can we have a possible in Asp.net Mvc. please give me any solution.
has title: Can Mousehover points a preview of the files in gridview
has comment: http://stackoverflow.com/comment/43814932
answer count: 0
has comment: http://stackoverflow.com/comment/43815189
score: 0
upvote count: 1

http://stackoverflow.com/comment/43759128
type: AnswerComment
comment on: http://stackoverflow.com/a/27671980
has text: Thanks! I could actually follow along with this. Is there a difference between using substr and slice to get the answer? They seem pretty similar. I would vote up if I had the reps.
type: Comment
score: 0

http://stackoverflow.com/a/51668920
answers question: http://stackoverflow.com/q/27708579
has body: I noticed this error in Firefox using their developer tool. I use MVC, and was able to resolve this issue by moving &nbsp; my @Scripts.Render() calls Before calling @RenderBody() in my Layout Page.
score: 0
type: Answer

http://stackoverflow.com/comment/43803322
comment on: http://stackoverflow.com/q/27694314
has text: You have some extra curly braces that do not make sense. They are causing syntax errors along with some missing semi-colons. Have you checked your console for these errors and eliminated them?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/74278216
type: Comment
comment on: http://stackoverflow.com/a/38149789
has text: why we need obj === 'function' condition btw?
score: 4
type: AnswerComment

http://stackoverflow.com/q/27752441
has answer: http://stackoverflow.com/a/46069433
has comment: http://stackoverflow.com/comment/43916038
answer count: 3
upvote count: 21
has title: What is the difference between class and classname in javascript?
favorite count: 0
has answer: http://stackoverflow.com/a/27752568
accepted answer: http://stackoverflow.com/a/27752568
has answer: http://stackoverflow.com/a/27752488
type: AnsweredQuestion
downvote count: 0
has body: In order to find children objects of a certain class name, I had to create my own helper function findChildrenByTagName = function(obj, name){ var ret = []; for (var k in obj.children){ if (obj.children[k].className === name){ ret.push(obj.children[k]); } } return ret; } An example of how it works is var li = document.createElement('li'); var input = document.createElement('input'); input.setAttribute('class','answer_input'); li.appendChild(input); console.log(findChildrenByTagName(li,"answer_input")); However when I replace className above by class in the function above, the code doesn't work. So I am naturally wondering what the difference is between class and className. A quick search on google doesn't reveal anything. Also what's the best way to return a list of children of a particular class name for a generic object? If such doesn't exist, is there a way to add a method to all objects so that I can call li.findChildrenByTagName("answer_input"); instead of the global function above?
possible better answer: http://stackoverflow.com/a/27752488
has comment: http://stackoverflow.com/comment/43915901
linked to: http://stackoverflow.com/q/1728984
type: Question
has comment: http://stackoverflow.com/comment/43915972
linked to: http://stackoverflow.com/q/7524618
score: 21
has comment: http://stackoverflow.com/comment/43916002
tagged with: javascript

http://stackoverflow.com/a/27658331
downvote count: 0
type: Answer
upvote count: 1
has body: Just figured out (as I think) the right way. In my case, I have to pass my own object to template, including the needed functions or data: var rowsTpl = _.template("&lt;span class='&lt;% func.checkClass(val.oldValue, val.newValue) %&gt;'&gt;"); Notice, that I am accessing checkClass function from func object and oldValue and newValue from val object. Here is the declaration: _.each(pData, function (vals, name) { outPut += rowsTpl({ name: name, val: vals, func: { checkClass: checkClass, anyOtherThing: thing } }); });
score: 1
answers question: http://stackoverflow.com/q/27656993

knockout-components
type: Tag
tags question: http://stackoverflow.com/q/27729730
tag name: knockout-components

http://stackoverflow.com/comment/44027243
comment on: http://stackoverflow.com/a/27792153
score: 0
type: AnswerComment
has text: @Nathan Perhaps, but unfortunately this is beyond my knowledge. If you happen to do some research and figure it out, please come back and post your findings!
type: Comment

http://stackoverflow.com/q/27755622
has comment: http://stackoverflow.com/comment/43922216
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/43921925
score: 0
has body: I am trying to create an array, that will be MAASSSIVVEE...i read somewhere that javascript can create an array of up to 4.xx Billion or so. The array i am trying to create will likely be in the quadrillions or higher. I don't even know where to go from here. I am going to assume that JS is not the proper solution for this, but i'd like to give it a try...it is for client side, and i would prefer not to bog down my server with this if there are multiple people using it at once. Also, not looking to learn a new language as i am just getting into JS, and code in general. could i possibly use setTimeout(),0 breaks in the totalcombos function? Time is not really an issue, i wouldn't mind if it took a few minutes to calculate, but right now it just crashes. i have tried this using a dedicated worker, but it still crashes the host. the worker code is what i am posting, as the host code is irrelevant to this question (it only compiles the original objects and posts them, then receives the messages back). The code: (sorry for the mess...im coding noob and just an enthusiast) onmessage = function(event){ //this has been tested on the very small sample size below, and still runs out of memory //all the objects in these first arrays are formatted as follows. // {"pid":"21939","name":"John Smith","position":"QB","salary":"9700","fppg":"23"} // "PID" is unique to each object, everything else could appear in another object. // There are no repeated objects. var qbs = **group of 10 objects like above** var rbs = **group of 10 objects like above** var wrs = **group of 10 objects like above** var tes = **group of 10 objects like above** var ks = **group of 10 objects like above** var ds = **group of 10 objects like above** //This code works great and fast with small sets. ie (qbs, rbs, wrs) function totalcombos() { var r = [], arg = arguments, max = arg.length-1; function helper(arr, i) { for (var j=0; j&lt;arg[i].length; j++) { var a = arr.slice(0); // clone arr if(a.indexOf(arg[i]…
has comment: http://stackoverflow.com/comment/43921948
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43921908
upvote count: 2
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/43922069
has comment: http://stackoverflow.com/comment/43922074
has title: Javascript runs out of memory major browsers due to array size
tagged with: loops
tagged with: memory
type: Question
has answer: http://stackoverflow.com/a/27755681
has comment: http://stackoverflow.com/comment/43922017

http://stackoverflow.com/comment/43882131
comment on: http://stackoverflow.com/a/27735285
type: AnswerComment
score: 0
type: Comment
has text: If you want the first tree elements then simply adapt the arguments you are passing to the splice method: `cData.someitems.splice(3);`. By the way did you read the documentation of the splice method I have linked to in my answer? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice If you haven't I invite you to do so. The arguments of this method are explained pretty well along with their purpose and exact meaning.

http://stackoverflow.com/comment/44504721
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27828235
has text: I haven't got any further so yes please

http://stackoverflow.com/a/27734061
has body: Since you don't need it remove the text "Activity" and the paragraph item, leave just the : Activity ... To: ... Then in the CSS hide the class activity: .activity{ display: none; } You could also add a class to the an hide that. Here is a fiddle example
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27733924
downvote count: 0
answers question: http://stackoverflow.com/q/27733924
score: 1
upvote count: 1

http://stackoverflow.com/a/27737765
has comment: http://stackoverflow.com/comment/43887666
downvote count: 0
has comment: http://stackoverflow.com/comment/43914462
has comment: http://stackoverflow.com/comment/43918175
has comment: http://stackoverflow.com/comment/43887574
has comment: http://stackoverflow.com/comment/43887729
answers question: http://stackoverflow.com/q/27737674
has comment: http://stackoverflow.com/comment/43888258
type: Answer
has comment: http://stackoverflow.com/comment/43908456
has comment: http://stackoverflow.com/comment/43892965
upvote count: 1
has comment: http://stackoverflow.com/comment/43913097
score: 1
has comment: http://stackoverflow.com/comment/43886936
has body: THe problem should comes from the splice. it returns an array, when you push to the oldSounds, it would be array in array which is not what you want? Correct one would be >> var removed = sounds.splice(randomSound, 1); oldSounds.push(removed[0]); question number 2, you can make a variable to hold the state. for example state of playing. Init a state with default false like var isPlaying = false. then in your playSound() fiunction, you will check the state, if it is playing, just return. if (isPlaying) {return;} else {isPlaying = true}.. remember at the end of function playSound, set the flag back to false isPlaying= false var isPlaying = false; function playSound() { if (isPlaying) { return; } isPlaying = true; // set the state to true, if using click the image again, this function will not be called because returned on the `if` on top // ur original codes var randomSound = sounds[Math.floor(Math.random() * sounds.length)]; document.getElementById("player").innerHTML= "&lt;embed src=\""+randomSound+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" /&gt;"; .... isPlaying = false; // set the state back to false, so the music will be played }

http://stackoverflow.com/q/27661938
has body: There's a list of items IDs gameIds[i]_container that are displayed in a FOR loop. On These are being displayed without a problem. I want the console to log the item's gameIds[i] on that items click. I believe this is supposed to be accomplished with a callback, but currently nothing occurs when items are clicked on. Please help! Code: //CLICKING ON GAMES //Active Game - bring user to game //Newly Invited Game - ask user to accept invite, then either bring to game or delete from players list //Rematch Game - recreate previous game //Function function gameAccess(i) { //REMATCH GAME if (currentRound[i] == roundWinners[i].length &amp;&amp; currentRound[i] != 0 &amp;&amp; currentRound[i] == numberOfRounds[i]){ console.log("You clicked " + gameIds[i]); } //NEWLY INVITED GAME if (currentRound[i] == 0 &amp;&amp; currentUserId != creator[i]) { console.log("You clicked " + gameIds[i]); } //ACTIVE GAME else{ console.log("You clicked " + gameIds[i]); } } //Callback function gameAccessCallback(i){ return function(){ gameAccess(i); }; } //Iterate Through for (i = 0; i &lt; numberOf; i++) { document.getElementById(gameIds[i] + "_container ").click(gameAccessCallback(i)); };
tagged with: callback
has answer: http://stackoverflow.com/a/27662013
has comment: http://stackoverflow.com/comment/43739816
has comment: http://stackoverflow.com/comment/43739855
linked to: http://stackoverflow.com/q/8623088
linked to: http://stackoverflow.com/q/21487187
accepted answer: http://stackoverflow.com/a/27662013
tagged with: loops
type: Question
linked to: http://stackoverflow.com/q/11488014
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/18880895
tagged with: javascript
has comment: http://stackoverflow.com/comment/43739888
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/22273839
has title: Javascript FOR Loop Callback

http://stackoverflow.com/q/27696406
possible better answer: http://stackoverflow.com/a/39058706
has comment: http://stackoverflow.com/comment/43806067
upvote count: 2
has answer: http://stackoverflow.com/a/39058706
answer count: 2
tagged with: canvas
downvote count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43806132
favorite count: 0
has body: I'm searching the web for quite sometime for the name of this effect... I've seen it on many sites but can't find a guide or a name to look for it and learn how to do it. The effect I'm talking about is in this website header: http://diogodantas.com/demo/elegant-index#0
has comment: http://stackoverflow.com/comment/43806402
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: HTML5 canvas following mouse effect jquery
score: 1
type: Question
has answer: http://stackoverflow.com/a/27696497
accepted answer: http://stackoverflow.com/a/27696497
tagged with: javascript

http://stackoverflow.com/a/27722239
score: 3
answers question: http://stackoverflow.com/q/27722216
downvote count: 0
has body: getElementsByClassName and getElementsByTagName return arrays. So you need to add indexes as well: var x = document.getElementsByClassName("request"); var pText = x[0].getElementsByTagName("P")[0].innerHTML; ^ ^ alert(pText);
type: Answer
upvote count: 3

http://stackoverflow.com/comment/43864405
has text: Firebug doesn't really trigger events, but the window gets smaller, it's probably the `window.onresize` event that is doing it !
type: QuestionComment
type: Comment
score: 3
comment on: http://stackoverflow.com/q/27726153

http://stackoverflow.com/comment/43770406
comment on: http://stackoverflow.com/q/27677911
score: 0
type: Comment
type: QuestionComment
has text: @ShaifulIslam - No i'm not comparing. I'm checking if the file being uploaded is larger than max_filesize. I'm newbie PHP developer. Let me know the correct method.

http://stackoverflow.com/comment/43851587
has text: Hi Peter, This sounds like it would work for me. I am not aware though, as to how to make a page aware of what page called it. I'll try and figure out what code need to written. If you could suggest any command/code that could help me, it'd be great.
comment on: http://stackoverflow.com/a/27714169
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27722370
has title: Sails.js model unique property doesn't work in production env
upvote count: 4
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43904365
has comment: http://stackoverflow.com/comment/43860967
has comment: http://stackoverflow.com/comment/43870159
has body: I am fairly new to sails and have followed a simple tutorial to create a REST api. I have created a model: module.exports = { schema: true, attributes: { name: { type: "string", unique: true, required: true }, role: { type: "string", required: true }, group: { type: "string", required: true }, email: { type: "string", unique: true, required: true }, telephoneNumber1: { type: "string", required: true }, telephoneNumber2: { type: "string", } } }; The model contains some unique fields. I tested this out locally using both the sails localDisk and a real mongo DB running locally and everything was working i.e. when trying to add a duplicate it was rejecting it. I then deployed to heroku and put in all the heroku config for the MongoLab and Redis. When testing I found that I could view all the entries using the index endpoint that I had created and I could also create new documents using the create endpoint. I then added a duplicate entry to the DB through the create url and found that it was allowing it and I was ending up with a load of documents that were identical. I am using the 'sails-mongo' adapter. Is there something I need to do with the prod DB to apply the rules? Thanks Alex
tagged with: node.js
downvote count: 0
tagged with: orm
type: Question
tagged with: sails.js
tagged with: javascript
score: 4
favorite count: 0
tagged with: sails-mongo

youtube-javascript-api
type: Tag
tag name: youtube-javascript-api
tags question: http://stackoverflow.com/q/27655328

http://stackoverflow.com/q/27703855
score: 0
has comment: http://stackoverflow.com/comment/43820692
tagged with: http://stackoverflow.com/tag/html
has title: calling function that is in the parent page from inside an iframe
answer count: 0
type: UnansweredQuestion
tagged with: iframe
linked to: http://stackoverflow.com/q/3076414
has body: I have deployed an app that is using iframes. In one of the pages I have called parent.functionname() The problem is, this application is shown in an iframe in a different domain. So this line parent.functionname() is trying to call the main iframe's function which is not possible due to cross domain security policy. How can i have this parent.functionname() call the function that is in the main home page of my application? I need not access function in the parent iframe that is in the other domain, but I need to specify that the function is in immediate iframe and not the iframe containing that
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43819878

http://stackoverflow.com/comment/43851135
has text: I can see the html in source that rows are inserted but it's not reflecting in browser screen
comment on: http://stackoverflow.com/a/27719823
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43828878
type: Comment
type: QuestionComment
has text: kind of got that with my experimentation, but hoping there would be a simpler solution then just using bunch of different ID's all over the place.
comment on: http://stackoverflow.com/q/27708509
score: 0

http://stackoverflow.com/a/27708798
downvote count: 0
answers question: http://stackoverflow.com/q/27707111
accepted answer of: http://stackoverflow.com/q/27707111
has comment: http://stackoverflow.com/comment/43851513
score: 1
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43851562
has body: Promises represent a single value bound by time. You can't conceptually "reuse" a deferred or reset it - once it transitions it sticks. There are constructs that generalize promises to multiple values (like observables) but those are more complicated in this case - it's probably better to just use one deferred per request. jQuery's AJAX already provides a promise interface. Your code is mostly redundant - you can and should consider using the existent tooling. Let's look at $.get: It already returns a promise so you don't need to create your own deferred. It already uses the browser cache, unless your server prohibits HTTP caching or the browser refuses it only one request will be made to the server after a correct response arrived (assuming you did not explicitly pass {cache: false} to its parameters. If making post requests you can use $.post or more generally $.ajax for arbitrary options. This is how your code would roughly look like: $("button").click(function(){ var first = $.get("/"); var second = first.then(function(){ return $.get("/asd"); }); var third = second.then(function(){ return $.get("/qqq"); }); }); The reason I put them in variables is so that you will be able to unwrap the result yourself later by doing first.then etc. It's quite possible to do this in a single chain too (but you lose access to previous values if you don't explicitly save them. For the record - it wasn't a stupid question at all :)
type: Answer

http://stackoverflow.com/q/27736740
answer count: 2
has title: Loop through visible input elements in a form in Javascript?
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27736746
has body: I'm trying to loop through all visible inputs within a form and set their value to be empty. What I have doesn't seem to work for text inputs, it returns undefined. Any ideas how to do this?
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27736761
has comment: http://stackoverflow.com/comment/43884979
possible better answer: http://stackoverflow.com/a/27736761
accepted answer: http://stackoverflow.com/a/27736746
type: Question
type: AnsweredQuestion
tagged with: children

http://stackoverflow.com/q/27742070
has answer: http://stackoverflow.com/a/40387455
has answer: http://stackoverflow.com/a/33508453
has answer: http://stackoverflow.com/a/29959052
has answer: http://stackoverflow.com/a/39815575
tagged with: http://stackoverflow.com/tag/html
tagged with: xmlhttprequest
has answer: http://stackoverflow.com/a/47858499
has answer: http://stackoverflow.com/a/57248837
has answer: http://stackoverflow.com/a/33820084
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/76947164
downvote count: 0
has answer: http://stackoverflow.com/a/45627659
linked to: http://stackoverflow.com/q/10752055
has answer: http://stackoverflow.com/a/40610530
upvote count: 131
has answer: http://stackoverflow.com/a/27743373
accepted answer: http://stackoverflow.com/a/27743373
type: Question
has answer: http://stackoverflow.com/a/29839114
has answer: http://stackoverflow.com/a/47834493
has comment: http://stackoverflow.com/comment/51430825
has answer: http://stackoverflow.com/a/42710105
possible better answer: http://stackoverflow.com/a/29959052
tagged with: javascript
has answer: http://stackoverflow.com/a/29350475
has answer: http://stackoverflow.com/a/29629104
has answer: http://stackoverflow.com/a/28517095
score: 131
answer count: 17
has title: AngularJS Error: Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https
favorite count: 0
has answer: http://stackoverflow.com/a/30188619
has comment: http://stackoverflow.com/comment/64056901
tagged with: angularjs
has body: I have three files of a very simple angular js application index.html {{product.name}} product-color.html Hello Brother app.js (function() { var app = angular.module('gemStore', []); app.controller('StoreController', function($http){ this.products = gem; } ); app.directive('productColor', function() { return { restrict: 'E', //Element Directive templateUrl: 'product-color.html' }; } ); var gem = [ { name: "Shirt", price: 23.11, color: "Blue" }, { name: "Jeans", price: 5.09, color: "Red" } ]; })(); I started getting this error as soon as I entered an include of product-color.html using custom directive named productColor: XMLHttpRequest cannot load file:///C:/product-color.html. Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https, chrome-extension-resource. angular.js:11594 Error: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///C:/product-color.html'. What may be going wrong? Is it a path issue for product-color.html? All my three files are in the same root folder C:/user/project/

http://stackoverflow.com/comment/43704733
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27641738
has text: The link in Ted Hoop's answer explains that. The value of a primitive is the simply the value of the primitive, while value of an object is a reference to the object. Therefore it CAN be accessed by the function.

http://stackoverflow.com/q/27646559
has title: How to check jQuery find return true or false?
duplicate of: http://stackoverflow.com/q/4592493
type: Question
has answer: http://stackoverflow.com/a/27646576
upvote count: 45
tagged with: javascript
answer count: 6
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/27646584
has answer: http://stackoverflow.com/a/27646582
has answer: http://stackoverflow.com/a/27646584
has answer: http://stackoverflow.com/a/27646587
score: 44
accepted answer: http://stackoverflow.com/a/27646576
has comment: http://stackoverflow.com/comment/43710996
has answer: http://stackoverflow.com/a/27646577
downvote count: 1
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/4592493
has body: HTML Code Child1 Child2 Child3 Child1 Child2 jQuery Code alert($(".parent1").find(".child3").text()); alert($(".parent2").find(".child3").text()); My question is how to check find function return true or false? In above code it return blank value, where parent1 class have child3 class where parent2 class do not have child3 class. JS Fiddle
has answer: http://stackoverflow.com/a/27646601

http://stackoverflow.com/a/27716194
type: Answer
answers question: http://stackoverflow.com/q/27716155
score: 0
has body: The function fires because you are calling it. You need to use a closure img.onmousedown= function() { playShout(img) };

http://stackoverflow.com/comment/43703363
comment on: http://stackoverflow.com/a/27641955
type: AnswerComment
type: Comment
has text: I got it now, just had to add window[] and some quotes in the onclick, thanks. I tried to answer this but the website somehow doesn't let me.
score: 0

http://stackoverflow.com/comment/43982450
score: 0
type: AnswerComment
has text: Move the closing ' ' tags out of the for loop.
comment on: http://stackoverflow.com/a/27786160
type: Comment

http://stackoverflow.com/q/27781213
tagged with: typeahead.js
answer count: 3
score: 7
favorite count: 0
has answer: http://stackoverflow.com/a/27783068
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/55333077
has comment: http://stackoverflow.com/comment/43978112
upvote count: 7
has body: how could I clear a typeahead field in a focusout event? The following jQuery code doesn´t seem to work in a typeahead field: $( "#field" ).focusout(function() { $(this).val(""); });
has answer: http://stackoverflow.com/a/45881480
type: Question
has comment: http://stackoverflow.com/comment/43972943
accepted answer: http://stackoverflow.com/a/27783068
downvote count: 0
possible better answer: http://stackoverflow.com/a/45881480
tagged with: javascript
tagged with: jquery
has title: Clear typeahead field

http://stackoverflow.com/a/27783006
has body: The submit(this) is called when you click "Add" so return false; is never called. You need to return false from function and call return from onsubmit: function otherSubmit(form) { /* ............ */ alert('form submited'); return false; } &lt;form action='ingredient_xml.php' onsubmit='return otherSubmit(this);'&gt; &lt;input type="text" name="name" /&gt; &lt;input type='submit' value="Add" /&gt; &lt;/form&gt; JSFiddle Example Edit: change to something else besides submit, like otherSubmit() Edit 2: You should really read more about XMLHttp and wrap in functions, something like this: var xmlhttp, table, xmlDoc; function addIngredient(form) { // XMLHttp function if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("post", form.action, true); xmlhttp.onreadystatechange = OnStateChange; // use OnStateChange function to get response xmlhttp.send(new FormData(form)); // send form return false; } function OnStateChange(){ // from onreadystatechange check if readyState is 4 or 0 if (xmlhttp.readyState == 0 || xmlhttp.readyState == 4) { parseXMLResult(xmlhttp.responseXML); // send result to parse function } } function parseXMLResult(xmlDoc){ // parse your results table = document.getElementsByName("ingredients"); // if table exists, clear contents if(table.length &gt; 0){ while (table[0].firstChild) { table[0].removeChild(table[0].firstChild); } table = table[0]; // if table doesn't exist, create it } else { table = document.createElement("table"); table.setAttribute('name', 'ingredients'); } // create table head var row = document.createElement('tr'); var thname = document.createElement('td'); thname.appendChild(document.createTextNode('Name')); row.appendChild(thname); table.appendChild(row); // append results from XMLHttp response var x = xmlDoc.getElementsByTagName("ingredient"); for (i = 0; i &lt; x.length; i++) { name = x[i].getElementsByTagName("name")[0].childNodes[0].nodeValue; row = …
has comment: http://stackoverflow.com/comment/43994759
has comment: http://stackoverflow.com/comment/43976088
accepted answer of: http://stackoverflow.com/q/27782811
upvote count: 1
has comment: http://stackoverflow.com/comment/43976506
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43976697
answers question: http://stackoverflow.com/q/27782811
has comment: http://stackoverflow.com/comment/43997813
type: Answer
has comment: http://stackoverflow.com/comment/43979715
has comment: http://stackoverflow.com/comment/43997112
downvote count: 0
has comment: http://stackoverflow.com/comment/43994415
has comment: http://stackoverflow.com/comment/43976485
has comment: http://stackoverflow.com/comment/43976240
has comment: http://stackoverflow.com/comment/43976198
has comment: http://stackoverflow.com/comment/43975999
score: 1

http://stackoverflow.com/comment/43919216
comment on: http://stackoverflow.com/q/27754103
has text: @BogdanKuštan It's not. I made the background light blue so you could see the problem since the background is dark grey.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27803518
score: 0
has body: Solved it myself :) the problem caused due to not defining the correct height and minimum value. I fixed it this way: [http://jsfiddle.net/154z0wvt/1/][1] I hope it is useful for someone.
answers question: http://stackoverflow.com/q/27801184
type: Answer

http://stackoverflow.com/q/27673351
score: 1
upvote count: 1
type: Question
tagged with: mobile
has answer: http://stackoverflow.com/a/28574946
tagged with: javascript
has body: is there anyway to detect the beat of an mp3 or wav file using javascript's web audio api on mobile devices? I've seen it work on Desktop chrome but not on iOs
has answer: http://stackoverflow.com/a/27675134
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43761634
favorite count: 0
tagged with: html5-audio
type: UnansweredQuestion
has title: Javascript beat detection using Web Audio API on mobile device

http://stackoverflow.com/a/62823938
answers question: http://stackoverflow.com/q/27670051
downvote count: 0
score: 1
has body: const AWS = require("aws-sdk"); const fs = require("fs"); const path = require("path"); const async = require("async"); const readdir = require("recursive-readdir"); // AWS CRED const ID = "<accessKeyId>"; const SECRET = "<secretAccessKey>"; const rootFolder = path.resolve(__dirname, "../"); const uploadFolder = "./sources"; // The name of the bucket that you have created const BUCKET_NAME = "<Bucket_Name>"; const s3 = new AWS.S3({ accessKeyId: ID, secretAccessKey: SECRET }); function getFiles(dirPath) { return fs.existsSync(dirPath) ? readdir(dirPath) : []; } async function uploadToS3(uploadPath) { const filesToUpload = await getFiles(path.resolve(rootFolder, uploadPath)); console.log(filesToUpload); return new Promise((resolve, reject) => { async.eachOfLimit( filesToUpload, 10, async.asyncify(async file => { const Key = file.replace(`${rootFolder}/`, ""); console.log(`uploading: [${Key}]`); return new Promise((res, rej) => { s3.upload( { Key, Bucket: BUCKET_NAME, Body: fs.readFileSync(file) }, err => { if (err) { return rej(new Error(err)); } res({ result: true }); } ); }); }), err => { if (err) { return reject(new Error(err)); } resolve({ result: true }); } ); }); } uploadToS3(uploadFolder) .then(() => { console.log("upload complete!"); process.exit(0); }) .catch(err => { console.error(err.message); process.exit(1); });
upvote count: 1
type: Answer

http://stackoverflow.com/q/27755168
has comment: http://stackoverflow.com/comment/43921040
upvote count: 0
has body: How do I extract the image src from this string by pattern matching? var str = " \n Current Conditions: \nFog, 16 C \n "; ?
tagged with: javascript
score: -4
linked to: http://stackoverflow.com/q/1732348
has answer: http://stackoverflow.com/a/27755286
has answer: http://stackoverflow.com/a/27755182
duplicate of: http://stackoverflow.com/q/1732348
favorite count: 0
has comment: http://stackoverflow.com/comment/43920996
has comment: http://stackoverflow.com/comment/43921025
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27755242
linked to: http://stackoverflow.com/q/6038061
has comment: http://stackoverflow.com/comment/43921000
has comment: http://stackoverflow.com/comment/43921058
answer count: 4
has comment: http://stackoverflow.com/comment/43921015
type: Question
has answer: http://stackoverflow.com/a/27755193
has title: javascript extract src from string
downvote count: 4

http://stackoverflow.com/q/27788966
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/27789011
accepted answer: http://stackoverflow.com/a/27789011
has body: I have a controller that lets a user edit an object. Part of this decrements an attribute of the object – the quantity of my model. When the model's quantity reaches 0 or below, ideally I'd like to delete the whole object. HTML {{ product.name }} Count: {{ product.quantity }} Remove JS (function(){ var app = angular.module('basket', []); var cart; app.controller('BasketController', function($scope, $http){ $scope.getTimes=function(n){ return new Array(n); }; $scope.cart = {}; $scope.cart.products = [{ 'name':'item 1', 'quantity':3 },{ 'name':'item 2', 'quantity':3 },{ 'name':'item 3', 'quantity':3 }]; }); })(); Live demo http://codepen.io/EightArmsHQ/pen/bNBmXm So for instance, in the above if you click 'remove' again and again on the first object, when you get to 0 I'd like to just have an array like the following: $scope.cart.products = [{ 'name':'item 2', 'quantity':3 },{ 'name':'item 3', 'quantity':3 }];
has title: Remove object from array when attribute 0 or below - Angular
score: 0
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/27789066
tagged with: angularjs
tagged with: angularjs-ng-repeat
possible better answer: http://stackoverflow.com/a/27789066

http://stackoverflow.com/comment/43764760
type: AnswerComment
score: 0
type: Comment
has text: how to handle negative numbers?
comment on: http://stackoverflow.com/a/27674939

http://stackoverflow.com/comment/43896390
type: Comment
comment on: http://stackoverflow.com/q/27742066
has text: I know but it's not mandatory to use exactly the html and the css i used, the point is to get those children aligned on center but every time it exceeds the parent width to start a new from left, not the center. As i've showed in my answer but in CSS
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45311597
has text: PSSR, have replaced the datatable tag with the jquery-datatables tag. Guess thats why your question not achieved more attention.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27800323
score: 0

http://stackoverflow.com/comment/43918175
type: Comment
has text: http://jsbin.com/wuqadetohi/3/edit i've been overlooked that we need to listen to the event of the embedded element. the `isPlaying` shouldnot set in the `playSound` function but through the play ended callback. i changed the `embed` to `audio` which is the HTML5 element, this doc shows more the [event information](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events)
comment on: http://stackoverflow.com/a/27737765
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43909236
has text: When I tried this, it didn't even connect. That's why I changed it to _query
type: AnswerComment
comment on: http://stackoverflow.com/a/27727566
score: 0
type: Comment

http://stackoverflow.com/q/27704918
downvote count: 1
has comment: http://stackoverflow.com/comment/43844774
tagged with: javascript
type: Question
linked to: http://stackoverflow.com/q/13709482
upvote count: 0
answer count: 1
favorite count: 0
tagged with: console
has comment: http://stackoverflow.com/comment/43821790
score: -1
has answer: http://stackoverflow.com/a/27706902
type: UnansweredQuestion
has title: How to read local files
has body: So I was looking around but I couldn't find an answer for this. I'm not talking about reading them from a website, but when you type code in to the browsers console how can you make it read a certain local file and output its contents in the console?

http://stackoverflow.com/comment/43975599
type: Comment
comment on: http://stackoverflow.com/a/27782516
has text: @Jason oops, typo, fixed :)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43804890
comment on: http://stackoverflow.com/a/27695580
score: 0
type: Comment
has text: Do I understand correctly? this is not needed as such. We need to pass an array of arguments for the use of this method apply. Method syntax has the required parameter "call context." Therefore, specify a null. This for g will be the same as that for f global object.
type: AnswerComment

http://stackoverflow.com/comment/43932479
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27760633
has text: SEND EMAIL CODE made my eyes bleeding :(

http://stackoverflow.com/comment/43895927
score: 1
has text: possible duplicate of [How to disable /\* autocomplete in Visual Studio 2012 (or Resharper)](http://stackoverflow.com/questions/12936215/how-to-disable-autocomplete-in-visual-studio-2012-or-resharper)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27742412

http://stackoverflow.com/comment/43970261
type: Comment
has text: How do I use the returned value?
comment on: http://stackoverflow.com/a/27779997
score: 0
type: AnswerComment

node-request
tags question: http://stackoverflow.com/q/27735919
type: Tag
tag name: node-request
tags question: http://stackoverflow.com/q/27736747

http://stackoverflow.com/comment/46590137
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27706650
has text: Anyone got any further on this?

http://stackoverflow.com/q/27744625
type: Question
tagged with: c#
has title: Uncaught TypeError: undefined is not a function Calling JavaScript Function
has comment: http://stackoverflow.com/comment/43902464
tagged with: javascript
tagged with: listview
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27744845
tagged with: asp.net
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43900165
has answer: http://stackoverflow.com/a/27744683
has comment: http://stackoverflow.com/comment/43902645
has body: I am get the error: Uncaught TypeError: undefined is not a function when I am trying to call my Javacsript function displayValue(). Here is my Javascript code: var HoC = 0; var Rate = 0; function getHoursOrCubes(input, control) { HoC = input; var answer = HoC * Rate; displayValue(answer); } function getRate(input, control) { Rate = input; var answer = HoC * Rate; displayValue(answer); } function displayValue(finalValue) { var listViewRef = document.getElementById('LV_Tickets'); var elementArray = listViewRef.getElementsByTagName('Label'); alert('this worked.'); for (var i = 0; i &lt; elementArray.length; i++) { var elementRef = elementArray[i]; elementRef.value = finalValue; alert(elementRef.value); } } I believe the line that is throwing the error is var elementArray = listViewRef.getElementsByTagName('Label');. I have a listview inside a listview and I want to set the value of a label in the nested listview. So that is what I am trying to do here. Here is my asp code for the ListView I am trying to access: &lt;asp:ListView ID="LV_Tickets" runat="server" DataSourceID="SQL_Tickets" InsertItemPosition="FirstItem" OnPreRender="LV_Tickets_PreRender" DataKeyNames="TicketNum"&gt; The getHoursOrCubes() function is called in a nested ListView's insertingitem template: &lt;asp:TextBox ID="HoursOrCubesTextBox" runat="server" style="height: 20px; width: 165px;" Text='&lt;%# Bind("HoursOrCubes") %&gt;' onchange="getHoursOrCubes(this.value)" /&gt;
has comment: http://stackoverflow.com/comment/43908805
has comment: http://stackoverflow.com/comment/43928021

security
tags question: http://stackoverflow.com/q/27769465
tags question: http://stackoverflow.com/q/27698485
tags question: http://stackoverflow.com/q/27761362
tags question: http://stackoverflow.com/q/27645834
tags question: http://stackoverflow.com/q/27663858
tags question: http://stackoverflow.com/q/27681445
type: Tag
tag name: security
tags question: http://stackoverflow.com/q/27736061

http://stackoverflow.com/a/38335987
has body: cheap-module-source-map is much better for a production build. inline-source-map is used to make quick and dirty builds when testing
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27671390
score: 1
upvote count: 1

http://stackoverflow.com/q/27658593
type: Question
has answer: http://stackoverflow.com/a/27658795
has title: Using the ng-checked value to add to a link
has comment: http://stackoverflow.com/comment/43732960
answer count: 1
tagged with: javascript
score: 0
tagged with: angularjs
has body: It's pretty complicated to explain, but I will try to do my best. What I want to achieve is, using the checkbox value (which is my ID) and when one of them (there are many since they are items in a list) is checked I want to use that value and be able to trigger my anchor tag to edit that item. The checkbox itself The edit link Edit My Edit Controller var EditCtrl = function ($scope, $location, $routeParams, Item) { $scope.action = "Update"; var id = $routeParams.editId; $scope.item = Item.get({ id: id }); $scope.save = function () { Item.update({ id: id }, $scope.item, function () { $location.path('/'); }); }; };
has comment: http://stackoverflow.com/comment/43732983
type: UnansweredQuestion

http://stackoverflow.com/comment/43819038
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27703394
has text: check this http://jsfiddle.net/mmfansler/cp67J/ it uses bootstraps modal.hope it helps

http://stackoverflow.com/a/27660755
has comment: http://stackoverflow.com/comment/43795225
answers question: http://stackoverflow.com/q/27642531
score: 0
type: Answer
has body: It's very, very difficult (I'm a cofounder of Divshot). We wrote a proprietary component recognition engine that allows for two-way syncing between an ACE Editor instance and a rendered HTML canvas. It involves lots and lots of DOM traversal, selector recognition, source cleaning, and ACE hacking.

http://stackoverflow.com/a/27693798
type: Answer
answers question: http://stackoverflow.com/q/27681445
has body: This answer makes the assumption that you are using Twitter's "application-only authentication" to make API requests on behalf of the application itself (https://dev.twitter.com/oauth/application-only). Your server side code is the preferred location to store any API keys you do not wish to make public. The developer guidance from Twitter states "These values should be considered as sensitive as passwords and must not be shared or distributed to untrusted parties." Yes, using an authentication model like Twitter's "application-only authentication" would require that all third party API requests be proxied through your server side code in order to protect the API token. The same is true for any third party API that requires a simple, static API key to be passed with each request. Although it may not technically be necessary, use of asynchronous operations on the server side when making third party API requests is preferred. This will give you a more robust architecture for dealing with the instability of internet requests as one benefit. If you intend to read or post Twitter data on behalf of visitors to your website, be sure to read more about other methods of obtaining access tokens for use with Twitter: https://dev.twitter.com/oauth/overview. For example the "3-legged authorization" method is better suited to this scenario as it provides a secure way for the end-user to supply their Twitter credentials and authorize use of their data by the requesting application.
score: 2
accepted answer of: http://stackoverflow.com/q/27681445
downvote count: 0
has comment: http://stackoverflow.com/comment/43826883
upvote count: 2
has comment: http://stackoverflow.com/comment/43827220
type: AcceptedAnswer

http://stackoverflow.com/a/27745251
downvote count: 0
has body: It's quite simple: functionName just returns the function body, while functionName() executes the function and returns its return value (or undefined, if there's no explicit return). The same principle works for when a function is an object property, like you had obj.add.
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27745218
type: Answer

http://stackoverflow.com/comment/43885942
score: 0
type: AnswerComment
has text: It seems based on my testing that the `$('td', 'tbody').each(function(){` section of the code is the part that I need to make sure completes before continuuing.
type: Comment
comment on: http://stackoverflow.com/a/27737186

http://stackoverflow.com/q/27744539
upvote count: 3
accepted answer: http://stackoverflow.com/a/27744880
has body: I seem to have an issue getting ui-router to actually route things. I am sure that all of my javascript files are being loaded and angular isn't throwing any errors. I have an HTML file that declares the app and base controller and then I load the js file that has the router. You can see a sample of my code below. index.html Yellr Moderator ... yellr.routes.js (compiled into scripts.min.js) 'use strict'; angular .module('Yellr', ['ui.router']) .config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/notfound'); $stateProvider .state('feed', { url: '/feed', templateUrl: '/templates/feed.html', controller: 'rawFeedCtrl' }); }]); console.log('Yellr routes'); Am I missing something obvious here? You can find the whole code base here
type: Question
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs
answer count: 3
has comment: http://stackoverflow.com/comment/43900718
possible better answer: http://stackoverflow.com/a/27744916
has answer: http://stackoverflow.com/a/27745024
has answer: http://stackoverflow.com/a/27744880
has answer: http://stackoverflow.com/a/27744916
has comment: http://stackoverflow.com/comment/43900586
has title: Angular ui-router not loading controller or template
has comment: http://stackoverflow.com/comment/43900941
type: AnsweredQuestion
score: 3
tagged with: angular-ui-router

http://stackoverflow.com/q/27733731
possible better answer: http://stackoverflow.com/a/29577067
has answer: http://stackoverflow.com/a/29577067
has answer: http://stackoverflow.com/a/60594278
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27733960
tagged with: selenium
has title: Passing require('chromedriver).path directly to selenium-webdriver
type: Question
score: 20
upvote count: 20
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27733960
answer count: 3
has body: tl;dr: Does anyone know how to pass the path of chromedriver to selenium-webdriver in code without setting the PATH environment variable? I'm attempting to use selenium-webdriver with chrome, but would prefer to not physically install chromedriver and manipulate the path. I have the following code: var webdriver = require('selenium-webdriver'); var driver = new webdriver.Builder(). withCapabilities(webdriver.Capabilities.chrome()). build(); Without chromedriver set in the path, this throws the error: Error: The ChromeDriver could not be found on the current PATH. Please download the latest version of the ChromeDriver from http://chromedriver.storage.googleapis.com/index.html and ensure it can be found on your PATH. I'd prefer not have to setup my path, so I've installed chromedriver from npm and added to my package.json: "scripts": { "preinstall-chromedriver": "npm install", "install-chromedriver": "node node_modules/chromedriver/install.js", "pretest_e2e": "npm run install-chromedriver", "test_e2e": "node release/test/rune2e.js" }, Now I have chromedriver installed and can get the path with require('chromedriver').path, but I have no way of passing this to the selenium-webdriver. Anyone know?
favorite count: 0
tagged with: selenium-chromedriver

http://stackoverflow.com/comment/43939607
type: Comment
has text: This is amazing. Without wasting your time anymore I would like to just ask you that please guide me to learn the javascript the way you did it and help me to enhance my coding skills. :) Please :P
comment on: http://stackoverflow.com/a/27764331
type: AnswerComment
score: 0

http://stackoverflow.com/q/27728663
has body: Is it possible to generate a PDF using fetched Data in SAPUI5 form? If yes, Do we have to use any API or something to achieve that?
tagged with: sapui5
type: Question
tagged with: javascript
has title: How to Create PDF in SAPUI5
has answer: http://stackoverflow.com/a/50621080
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/50624322
has answer: http://stackoverflow.com/a/27733378
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/27688473
answers question: http://stackoverflow.com/q/27679291
accepted answer of: http://stackoverflow.com/q/27679291
type: Answer
score: 31
upvote count: 31
has body: You need to run the initialize function after the page's DOM is loaded. Currently initialize is run inline before the DOM is rendered. Use either the onload event or the Google Maps Javascript API v3 addDomListener on window to run that function: google.maps.event.addDomListener(window, 'load', initialize); working code snippet: var map; // Global declaration of the map var iw = new google.maps.InfoWindow(); // Global declaration of the infowindow var lat_longs = new Array(); var markers = new Array(); var drawingManager; function initialize() { var myLatlng = new google.maps.LatLng(40.9403762, -74.1318096); var myOptions = { zoom: 13, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map-canvas"), myOptions); drawingManager = new google.maps.drawing.DrawingManager({ drawingMode: google.maps.drawing.OverlayType.POLYGON, drawingControl: true, drawingControlOptions: { position: google.maps.ControlPosition.TOP_CENTER, drawingModes: [google.maps.drawing.OverlayType.POLYGON] }, polygonOptions: { editable: true } }); drawingManager.setMap(map); google.maps.event.addListener(drawingManager, "overlaycomplete", function(event) { var newShape = event.overlay; newShape.type = event.type; }); google.maps.event.addListener(drawingManager, "overlaycomplete", function(event) { overlayClickListener(event.overlay); $('#vertices').val(event.overlay.getPath().getArray()); }); } function overlayClickListener(overlay) { google.maps.event.addListener(overlay, "mouseup", function(event) { $('#vertices').val(overlay.getPath().getArray()); }); } google.maps.event.addDomListener(window, 'load', initialize); $(function() { $('#save').click(function() { //iterate polygon vertices? }); }); html, body, #map-canvas { height: 90%; margin: 0px; padding: 0px }
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27686132
has comment: http://stackoverflow.com/comment/43787026
has title: Kendo directives not working
has answer: http://stackoverflow.com/a/40485347
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27686661
has comment: http://stackoverflow.com/comment/43786787
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/35193308
tagged with: kendo-ui
type: Question
score: 3
has comment: http://stackoverflow.com/comment/43786968
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/35193308
accepted answer: http://stackoverflow.com/a/27686661
tagged with: angularjs
upvote count: 3
answer count: 3
has body: I'm starting in the world of kendoUI and I need to create a GUI using a panelBar and a toolBar. I must be making something badly because my code doesn't work. Here's the code: View in HTML: &lt;!DOCTYPE html&gt; &lt;!--[if lt IE 7]&gt; &lt;html class="no-js lt-ie9 lt-ie8 lt-ie7"&gt; &lt;![endif]--&gt; &lt;!--[if IE 7]&gt; &lt;html class="no-js lt-ie9 lt-ie8"&gt; &lt;![endif]--&gt; &lt;!--[if IE 8]&gt; &lt;html class="no-js lt-ie9"&gt; &lt;![endif]--&gt; &lt;!--[if gt IE 8]&gt;&lt;!--&gt; &lt;html class="no-js"&gt; &lt;!--&lt;![endif]--&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"&gt; &lt;title&gt;&lt;/title&gt; &lt;meta name="description" content=""&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"&gt; &lt;style&gt; body { padding-top: 50px; padding-bottom: 20px; } &lt;/style&gt; &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap- theme.min.css"&gt; &lt;link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.318/styles/kendo.common.min.css"&gt; &lt;link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.318/styles/kendo.default.min.css"&gt; &lt;link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.318/styles/kendo.dataviz.min.css"&gt; &lt;link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.318/styles/kendo.dataviz.default.min.css"&gt; &lt;/head&gt; &lt;body ng-controller="controller as control"&gt; &lt;!--[if lt IE 7]&gt; &lt;p class="browsehappy"&gt;You are using an &lt;strong&gt;outdated&lt;/strong&gt; browser. Please &lt;a href="http://browsehappy.com/"&gt;upgrade your browser&lt;/a&gt; to improve your experience.&lt;/p&gt; &lt;![endif]--&gt; &lt;nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"&gt; &lt;div class="container"&gt; &lt;div class="navbar-header"&gt; &lt;/div&gt; &lt…

http://stackoverflow.com/a/29210165
type: Answer
accepted answer of: http://stackoverflow.com/q/27786658
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/27786658
type: AcceptedAnswer
has body: Touch events are currently disabled in the desktop version of Firefox (36.0.4), though they will work while running Firefox in Metro mode or by explicitly enabling them via the dom.w3c_touch_events.enabled setting. See the MDN article on Touch events for more information.
score: 0

http://stackoverflow.com/comment/43701627
has text: Thanks, log shows: ForbiddenAttributesError and line is: @character = Character.new(params[:character])
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27641191
type: Comment

http://stackoverflow.com/q/27759349
answer count: 0
has title: on.change() event doesn't run when manually setting value of
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43935839
score: 0
has comment: http://stackoverflow.com/comment/43929708
has comment: http://stackoverflow.com/comment/43930296
tagged with: onchange
has comment: http://stackoverflow.com/comment/43929753
type: UnansweredQuestion
has body: As the title describes, I'm having a problem with a function running using the $("element_name").on("change", some_function) event on a select when manually setting the element's value like $("element_name").val("") I read something about a "chosen" and I don't understand what that has anything to do with the issue. Anybody know why the on.change() handler isn't catching the manual value change? EDIT: I am including additional information as the solutions suggested do not work. trigger("change"), bind("change", and on("change") do not work. This is the code for the recreated select that controls the value setting: (function($) { $.extend({ fancySelect: function(options) { var defaults = { autoClose: true } var options = $.extend(defaults, options); $("select").hide(); $("select").each(function() { var $select = $(this); var $fancyselect = $('&lt;div class="fancyselect"/&gt;'); $select.after($fancyselect); var $ul = $('&lt;ul/&gt;').appendTo($fancyselect); $ul.hide(); var $options = $select.find("option"); var $span = $("&lt;div/&gt;").addClass("fancyselect-label").prependTo($fancyselect); var $arrow = $("&lt;div&gt;&amp;#x25BC;&lt;/div&gt;").addClass("fancyselect-arrow").appendTo($fancyselect); var selected = $select.find("option[selected=selected]"); var toUse = 0; if (selected.length == 0) { toUse = $options.first(); } else { toUse = selected.first(); } $span.text(toUse.text()); $options.each(function() { var $option = $(this); var label = $option.text(); var value = $option.val(); if ($option.is(":selected")) { $span.text(label); } var $li = $('&lt;li value="' + value + '"&gt;' + label + '&lt;/li&gt;').appendTo($ul).bind("click", function() { $select.val(value); if ($option.index() == $(this).index()) { $options.removeAttr("selected"); $option.attr("selected", "selected"); } $span.html(label); if (options.autoClose) { $ul.hide(); $fancyselect.removeClass("active"); } $ul.find("li").removeAttr("class"); $(this).addClass("selected"); }); if ($option.is(":selected")…
tagged with: bind
has comment: http://stackoverflow.com/comment/43929749
linked to: http://stackoverflow.com/q/11165987

http://stackoverflow.com/q/27640947
has body: Before the problem: What we are trying to do is: I will give a script tag and a piece of javascript to another domain. It will be kind of a widget project. When other site puts my javascript into their website, my javascript will be loaded and inject widget's html. Widget's html is built with Angular and it's working fine when i directly call that html but it's not working when injected to another page. Here is some code. This is how i inject widget's html: var widget = { initialize : function(containerId) { $("#" + containerId).load("widget.html"); } } My widget's html {{phone.name}} {{phone.snippet}} {{2+2}} Aand my controller: var phonecatApp = angular.module('phonecatApp', []); phonecatApp.controller('PhoneListCtrl', function ($scope) { $scope.phones = [ {'name': 'Nexus S', 'snippet': 'Fast just got faster with Nexus S.'}, {'name': 'Motorola XOOM™ with Wi-Fi', 'snippet': 'The Next, Next Generation tablet.'}, {'name': 'MOTOROLA XOOM™', 'snippet': 'The Next, Next Generation tablet.'} ]; }); The exception in the console: Uncaught Error: [$injector:modulerr] Failed to instantiate module phonecatApp due to: Error: [$injector:nomod] Module 'phonecatApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. Edit: There is {{2+2}} code in my html, just to test Angular. It's not evaluated by Angular and printed into html as it is.
has comment: http://stackoverflow.com/comment/43701116
has answer: http://stackoverflow.com/a/27642189
has comment: http://stackoverflow.com/comment/43701061
score: 3
has comment: http://stackoverflow.com/comment/43700848
upvote count: 3
has title: AngularJs- Failed to instantiate module
has comment: http://stackoverflow.com/comment/43701000
type: Question
has comment: http://stackoverflow.com/comment/43700965
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43700641
has comment: http://stackoverflow.com/comment/43700692
has comment: http://stackoverflow.com/comment/43701194
has comment: http://stackoverflow.com/comment/43700682
has comment: http://stackoverflow.com/comment/43701146
has comment: http://stackoverflow.com/comment/43700903
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/43714322
comment on: http://stackoverflow.com/q/27644965
score: 0
has text: You should take an AngularJs tutorial before starting AngularJs.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27678126
favorite count: 0
has comment: http://stackoverflow.com/comment/43772347
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has comment: http://stackoverflow.com/comment/43770632
tagged with: css
has title: CSS attribute selector not working when the attribute is applied using javascript?
has body: .variations_button[style*="display: none;"] + div This is my CSS selector which works fine if the style attribute is already in the DOM on page load: http://jsfiddle.net/xn3y3hu0/ However, if i hide the .variations_button div using javascript, the selector is not working anymore: $(document).click(function(){ $('.variations_button').hide(); }); http://jsfiddle.net/55seee1r/ Any idea whats wrong? Looks like the CSS is not refreshing, because if i edit another property using the inspector, the color changes red instantly.
has comment: http://stackoverflow.com/comment/125716114
accepted answer: http://stackoverflow.com/a/27678363
has comment: http://stackoverflow.com/comment/43771742
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27678363
has comment: http://stackoverflow.com/comment/43770604
type: Question
tagged with: css-selectors
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/27720862
answer count: 2
has answer: http://stackoverflow.com/a/27720927
has comment: http://stackoverflow.com/comment/43853489
has comment: http://stackoverflow.com/comment/43853521
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43853484
score: 0
has comment: http://stackoverflow.com/comment/43853453
has comment: http://stackoverflow.com/comment/43853450
has body: I've got the following code snippet: $Core.box = function($sRequest, $sWidth, $sParams) { tb_show('', $.ajaxBox($sRequest, 'width=' + $sWidth + ($sParams ? '&amp;' + $sParams : ''))); return false; }; but I'm not understanding what does $Core stand for. What's the meaning of the dollar sign in $Core and the other variables? Why is the function code stored into $Core.box?
favorite count: 0
duplicate of: http://stackoverflow.com/q/10787342
has comment: http://stackoverflow.com/comment/43853422
has comment: http://stackoverflow.com/comment/43853407
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/10787342
has comment: http://stackoverflow.com/comment/43853498
upvote count: 1
downvote count: 1
has title: What does $ sign mean in jQuery code?
has comment: http://stackoverflow.com/comment/43853430
has answer: http://stackoverflow.com/a/27720993
has comment: http://stackoverflow.com/comment/43853481
type: Question

http://stackoverflow.com/comment/43967122
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27646470
has text: Hi all, thank you for your reply. @QMaster, I would be happy to try if I have an example of code to consume REST service with Authentication. REST is quitely easy. It is only Ajax. It is not the issue. What I found on the web is some explanations concerning the interest of authentication. Useless without example to post data with username/password. Regards
score: 0

http://stackoverflow.com/comment/44004921
type: Comment
type: QuestionComment
score: 1
has text: Any errors in console? And what Angular version you are using? With 1.3.x you have to use modules.
comment on: http://stackoverflow.com/q/27798170

http://stackoverflow.com/q/27754544
upvote count: 17
type: Question
has comment: http://stackoverflow.com/comment/43919915
has comment: http://stackoverflow.com/comment/43919867
tagged with: javascript
has answer: http://stackoverflow.com/a/27773201
has comment: http://stackoverflow.com/comment/43920186
downvote count: 0
tagged with: html2canvas
tagged with: jquery
score: 17
favorite count: 0
has comment: http://stackoverflow.com/comment/43920052
possible better answer: http://stackoverflow.com/a/66966944
has comment: http://stackoverflow.com/comment/53256356
has answer: http://stackoverflow.com/a/68149363
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/66966944
accepted answer: http://stackoverflow.com/a/27773201
answer count: 4
type: AnsweredQuestion
has body: html2canvas.js not capturing image. it leaves white space where the image occurs. function capture() { html2canvas(document.body, { allowTaint: true, logging:true, onrendered: function(canvas) { imagestring = canvas.toDataURL("image/png"); console.log(imagestring); document.body.appendChild(canvas); } }); } I have tried a lot but i cannot find solution . Help is appreciated :)
has title: html2canvas not capturing image
has answer: http://stackoverflow.com/a/70397556

http://stackoverflow.com/comment/43972380
has text: Well... If you created two directives and put them both on the same element, you would have **access to both** controllers even though on the same element...
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27781253

http://stackoverflow.com/q/27655827
tagged with: angularjs
has answer: http://stackoverflow.com/a/39960848
type: UnansweredQuestion
has body: The error I get, which means that it wont execute my delete method from angular: DELETE http://localhost:49717/api/Item?iid=D1 405 (Method Not Allowed) My app.js 'use strict'; var SalesApp = angular.module('SalesApp', ['ngRoute', 'ngResource']). config(['$routeProvider', function ($routeProvider) { $routeProvider. when('/', { controller: ItemCtrl, templateUrl: 'item.html' }). when('/new', { controller: CreateCtrl, templateUrl: 'details.html' }). when('/edit/:editId', { controller: EditCtrl, templateUrl: 'details.html' }). otherwise({ redirectTo: '/' }); }]); SalesApp.factory('Item', function ($resource) { return $resource('/api/Item/:id', { id: '@id' }, { update: { method: 'PUT' } }); }); var ItemCtrl = function ($scope, $location, Item) { $scope.delete = function () { var id = this.item.iid; Item.delete({ iid: id }), function () { $('#item_' + id).fadeOut(); }; }; }; The appropiate part of the html of the index.html {{item.iid}} {{item.name}} {{item.price}} X Edit And my script imports: It may be some silly misstake of me, I'm not quite sure, the add and update works? My first thought was that it could be some foreign key spooking, but I tried deleting an item using sql server and it worked just fine. Added back-end: // DELETE api/Item/5 [ResponseType(typeof(Item))] public IHttpActionResult DeleteItem(string id) { Item item = db.Item.Find(id); if (item == null) { return NotFound(); } db.Item.Remove(item); db.SaveChanges(); return Ok(item); }
has comment: http://stackoverflow.com/comment/43727671
has comment: http://stackoverflow.com/comment/43727715
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
score: 0
answer count: 1
favorite count: 0
has title: DELETE in angularjs - 405 Method not allowed

http://stackoverflow.com/a/27702982
has body: Assuming the HTML looks somewhat like this : You get get the list of all iframes inside the div with class "playAll" (no matter the depth), and iterate: var iframes = $(".playAll iframe"); for (i = 0; i < iframes.length; i++) { // do something with iframes[i] } http://api.jquery.com/descendant-selector/
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27702527
has comment: http://stackoverflow.com/comment/43819639
has comment: http://stackoverflow.com/comment/43820536

http://stackoverflow.com/q/27795167
upvote count: 3
has comment: http://stackoverflow.com/comment/43999657
type: Question
has comment: http://stackoverflow.com/comment/44000158
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
accepted answer: http://stackoverflow.com/a/27795877
tagged with: proxy
has title: Posting to Capsule CRM and an "AJAX Proxy"
favorite count: 0
tagged with: php
has body: I am trying to post a Capsule CRM page using http://support.capsulecrm.com/customer/portal/articles/1639817-website-contact-form-integration which I can get working quite easily. However, I wanted to post this using AJAX, but kept running into a CORS error. The Capsule CRM guys have this turned off on their side so you cannot submit using AJAX with out running into this error. After reaching out to them, I got this response: To do your requests using AJAX your website will need an additional page that will process your webform POST on your site instead of sending it directly to Capsule. This is sometimes called an AJAX Proxy. This page just forwards the post onto the Capsule webform url for processing, if you don't specify a "COMPLETE_URL" on your post the form will return an HTTP 200 response instead of a redirect to make it a bit easier for you to handle. Having spent a significant portion of my time on the internet looking for an "AJAX proxy" I cannot seem to find an example and beginning to struggle to get it working. Hopefully some code will help with my question. form.html Name: Email: Telephone: form.js $(document).ready(function() { $('.form').submit(function(event){ event.preventDefault(); var messages = $('#result'); var formData = $('.form').serialize(); $.ajax({ type : "POST", url : capsule.php, data : formData }) .done(function(response) { console.log("Success: " + response); } }) .error(function(response) { console.log("Error: " + response); } }); }); capsule.php <?php ?> I kind of almost need to do a double post. I need to post the data to the Capsule.php and then I need that to post. If that response is successful reverse it all and update the form.html without refreshing. Or does any one know how I should be forming the "AJAX proxy"? This is my first solo delve into AJAX so please be gentle :). EDIT After trying out the answer below and with the debugging on I have this back in the console in developer tools. It is difficult to debug as I don't have…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44001260
score: 3
has answer: http://stackoverflow.com/a/27795877

http://stackoverflow.com/comment/43972240
type: Comment
comment on: http://stackoverflow.com/a/27746683
score: 0
type: AnswerComment
has text: what about trying $.each(applicationScope.statuses, function ... Assuming applicationScope is a global variable, this should work

http://stackoverflow.com/q/27725011
tagged with: javascript
has answer: http://stackoverflow.com/a/27725059
has comment: http://stackoverflow.com/comment/43862126
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43862337
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43863032
score: 1
accepted answer: http://stackoverflow.com/a/27726691
favorite count: 0
has comment: http://stackoverflow.com/comment/43862118
type: Question
upvote count: 2
linked to: http://stackoverflow.com/q/4275356
has answer: http://stackoverflow.com/a/27725051
has comment: http://stackoverflow.com/comment/43865951
has title: One HTML form with multiple submit buttons for different tasks
has comment: http://stackoverflow.com/comment/43866226
answer count: 3
has body: I have found many posts that do the opposite of what I am attempting, but none for this situation. What I currently have (working): This allows me to enter a first and last name into each of two forms and submit. I want to have only one form and two different submit buttons that will each have a separate task. I appreciate any help. EDIT: Peter advises to go with onclick, which makes sense. I have the following, which will not work, any thoughts on my error(s)? /> />
tagged with: forms
downvote count: 1
has answer: http://stackoverflow.com/a/27726691
possible better answer: http://stackoverflow.com/a/27725059

twitter-bootstrap-3
tags question: http://stackoverflow.com/q/27655372
tags question: http://stackoverflow.com/q/27700990
tag name: twitter-bootstrap-3
tags question: http://stackoverflow.com/q/27700435
tags question: http://stackoverflow.com/q/27701864
tags question: http://stackoverflow.com/q/27708509
type: Tag
tags question: http://stackoverflow.com/q/27692259
tags question: http://stackoverflow.com/q/27661612
tags question: http://stackoverflow.com/q/27737707
tags question: http://stackoverflow.com/q/27699884
tags question: http://stackoverflow.com/q/27779470
tags question: http://stackoverflow.com/q/27763801
tags question: http://stackoverflow.com/q/27759167
tags question: http://stackoverflow.com/q/27778442

http://stackoverflow.com/a/27660524
accepted answer of: http://stackoverflow.com/q/27659328
has body: You might want to use jsBCrypt for javascript. This is based on JBCrypt and as expected works well with it. The snippet on jsBCrypt can help you get started with trying this. (note: JBCrypt has default 10 rounds).
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27659328

http://stackoverflow.com/a/27794224
downvote count: 0
score: 7
has comment: http://stackoverflow.com/comment/44005900
upvote count: 7
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44004535
has comment: http://stackoverflow.com/comment/44037501
has comment: http://stackoverflow.com/comment/44001736
type: Answer
has comment: http://stackoverflow.com/comment/86834410
answers question: http://stackoverflow.com/q/27782774
has body: You could add a custom toJSON method to the Product model: instanceMethods: { toJSON: function () { var values = this.get(); if (this.Menu) { values.icon = this.Menu.icon; } return values; } }
accepted answer of: http://stackoverflow.com/q/27782774

data-structures
tags question: http://stackoverflow.com/q/27732433
tag name: data-structures
tags question: http://stackoverflow.com/q/27734252
type: Tag

http://stackoverflow.com/comment/43893428
score: 0
comment on: http://stackoverflow.com/a/27741132
type: Comment
type: AnswerComment
has text: Exactly I tried this.. but i got the same code when i Selected the click button. Now how should I connect it with my app.js file?

http://stackoverflow.com/q/27673074
favorite count: 0
possible better answer: http://stackoverflow.com/a/41746194
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/41746194
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/43761786
has answer: http://stackoverflow.com/a/27674072
upvote count: 3
accepted answer: http://stackoverflow.com/a/27674072
has comment: http://stackoverflow.com/comment/43761039
type: Question
has body: Here is my template: &lt;template name="textGoesHere"&gt; {{#if currentUser}} &lt;div id="boxdiv"&gt; &lt;textarea id="box"&gt;{{user.text}}&lt;/textarea&gt; &lt;/div&gt; {{/if}} &lt;/template&gt; Here is my Meteor event: 'change #box': function (e) { Meteor.call('click', $("#box").val()); } For some reason, this event only gets fired after you click out of the text area after you've changed it's contents. But apparently, the event is suppose to be called when the text area is changed which is the functionality I'm looking for.
has title: METEOR on change event only get's fired on a text area after you click out of the text area
tagged with: javascript
tagged with: jquery
answer count: 2
has comment: http://stackoverflow.com/comment/43761655
downvote count: 0
tagged with: meteor

http://stackoverflow.com/q/27747319
has answer: http://stackoverflow.com/a/27747422
has answer: http://stackoverflow.com/a/27747852
tagged with: arrays
tagged with: javascript
has title: Javascript splice removing wrong items
downvote count: 0
has comment: http://stackoverflow.com/comment/43905846
has answer: http://stackoverflow.com/a/27747381
tagged with: angularjs-ng-repeat
accepted answer: http://stackoverflow.com/a/27747852
favorite count: 0
has comment: http://stackoverflow.com/comment/56223296
has comment: http://stackoverflow.com/comment/43905632
tagged with: angularjs
answer count: 5
has answer: http://stackoverflow.com/a/27747515
has comment: http://stackoverflow.com/comment/43905658
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/27747392
upvote count: 2
has body: I have following array of objects. [{"name":"Rain"},{"name":"Storm"},{"name":"Forest"}] Which has indexes [0, 1, 2]. I'm trying to delete the item on the given position using code: $scope.selectedSounds.splice(index, 1); But it is removing items wrong way, for example the last item cannot be deleted. If I'm trying to remove item with index 1, it removes item with index 2.. What can be wrong please? I tried both ways: $scope.removeSoundFromSelection = function(index) { try { // First $scope.selectedSounds.splice(index, 1); var indexNew = $scope.selectedSounds.indexOf(index); console.log(indexNew); if (indexNew > -1) { $scope.selectedSounds.splice(indexNew, 1); } // Second if ($scope.selectedSounds.hasOwnProperty(index)){ delete $scope.selectedSounds[index]; } //delete $scope.selectedSounds[index]; } catch(e) { $scope.showAlert(); } }; ADDED TEMPLATE: {{sound.name}} TEST
possible better answer: http://stackoverflow.com/a/27747422
tagged with: angularjs-scope
type: Question

http://stackoverflow.com/comment/43879536
has text: Take a look at the documentation as well. https://docs.angularjs.org/api/ng/filter/date
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27734037

http://stackoverflow.com/comment/43978264
comment on: http://stackoverflow.com/a/27781253
type: AnswerComment
score: 0
type: Comment
has text: Oh, but the angular code uses `scope: true` for `ng-controller` directive that means it creates an isolated scope.

http://stackoverflow.com/comment/138051118
score: 0
type: Comment
type: QuestionComment
has text: Should be `// eslint-disable-next-line no-console, max-len`
comment on: http://stackoverflow.com/q/27732209

http://stackoverflow.com/comment/100489684
has text: @Barmar yeah `async :true` is fine and this doesn't answer what if he wants sync
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27736383

http://stackoverflow.com/a/27884567
type: AcceptedAnswer
has body: I moved to using selectize instead. It even supports bootstrap!
type: Answer
accepted answer of: http://stackoverflow.com/q/27762807
answers question: http://stackoverflow.com/q/27762807
score: 0

http://stackoverflow.com/a/27778354
answers question: http://stackoverflow.com/q/27778076
has body: Using Moment js we can achieve var dateObj= moment('15:00:00', 'HH:MM:SS').toDate(); console.log(dateObj); Out put Mon Dec 01 2014 15:00:00 GMT+0530 (India Standard Time)
score: 0
type: Answer

http://stackoverflow.com/a/27725163
type: Answer
answers question: http://stackoverflow.com/q/27725141
score: 2
upvote count: 2
downvote count: 0
has body: Your .emails elements get replaced so you would need to bind the hover action again or use dynamic binding: $('.comms').on('mouseover', '.emails', function(){ alert('this is an email'); });

http://stackoverflow.com/a/27760568
has body: You are better off using a single delegated event handler, connected to a parent element. This is more efficient than connecting loads of handlers: $(function () { $('.calculator').on("click", "button", function () { // Do something with the value of the clicked button... $(".draft").val($(".draft").val() + $(this).val()); }); }); JSFiddle: http://jsfiddle.net/TrueBlueAussie/cf8csjw1/ It works by listening for events to bubble up to the ancestor element, then applying the jQuery selector, then calling your function for the element that caused the event in the first place.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27760242
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27760242
has comment: http://stackoverflow.com/comment/43932293

http://stackoverflow.com/a/27690668
upvote count: 1
score: 1
has body: You don't provide an explanation of your new format, and I'm not sure how your previous format was working (given the x attribute setting) but adjusting to the new format should be as simple as .attr("x", function(d) { return x(d.category); }) .attr("y", function(d) { return y(d[d.category]); }) And similar changes elsewhere. (e.g. for the height) Or maybe I'm missing something?
answers question: http://stackoverflow.com/q/27690410
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43813989

cakephp
tags question: http://stackoverflow.com/q/27799015
tags question: http://stackoverflow.com/q/27753393
type: Tag
tag name: cakephp

http://stackoverflow.com/a/27756159
score: 0
answers question: http://stackoverflow.com/q/27756059
has body: you need to save the reference to that context as context changes here , see here how this stored in ref and passed into arguments and then called using ... new Bla().start(); function Bla(){ this.start = function(){ alert("starting"); x(this.done ,this); } this.done = function(){ alert("done"); try{ var st = arguments[0]; console.log(st); st.postDone(); } catch(e){ alert(e); } } this.postDone = function(){ alert("postdone"); } } function x(callback,ref){ alert("x"); try{ callback(ref); } catch(e){ alert(e); } } hope that helps...
type: Answer
has comment: http://stackoverflow.com/comment/43923073

http://stackoverflow.com/a/27793691
type: Answer
has body: Use jquery and it has mobile events like on touchstart, swipe etc. $("p").on("swipe",function(){ $("span").text("Swipe detected!"); }); Read this documentation for more help http://www.w3schools.com/jquerymobile/jquerymobile_events_touch.asp
score: 0
answers question: http://stackoverflow.com/q/27793594

http://stackoverflow.com/comment/44009964
has text: `MyEditor.prototype.notify = function(message = ''){` is not valid JavaScript, are you using a preprocessor?
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27800580

http://stackoverflow.com/a/27711538
answers question: http://stackoverflow.com/q/27710787
has body: I found the solution : String[] myJsonData = request.getParameterValues("json[]");
score: 0
type: Answer

http://stackoverflow.com/comment/43921490
type: QuestionComment
comment on: http://stackoverflow.com/q/27754760
score: 0
has text: I was able to get the results by executing your javascript code using selenium (it needed some tweaks). The result is the `data` dict with all its members (including categoryId, etc). It will require Firefox installed on the server side for running the Javascript. Does it work for you?
type: Comment

http://stackoverflow.com/comment/43846022
has text: okay but you should add textareas with append function , after that you should try to get values
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27716928
type: Comment

drop-down-menu
tags question: http://stackoverflow.com/q/27729822
tags question: http://stackoverflow.com/q/27642662
tags question: http://stackoverflow.com/q/27724345
tags question: http://stackoverflow.com/q/27778317
tags question: http://stackoverflow.com/q/27693961
tags question: http://stackoverflow.com/q/27708509
tags question: http://stackoverflow.com/q/27656139
type: Tag
tags question: http://stackoverflow.com/q/27779470
tags question: http://stackoverflow.com/q/27756850
tags question: http://stackoverflow.com/q/27683051
tag name: drop-down-menu
tags question: http://stackoverflow.com/q/27792779
tags question: http://stackoverflow.com/q/27697103
tags question: http://stackoverflow.com/q/27765440
tags question: http://stackoverflow.com/q/27744392

http://stackoverflow.com/a/27766189
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27762891
upvote count: 2
has comment: http://stackoverflow.com/comment/74375716
accepted answer of: http://stackoverflow.com/q/27762891
has body: I know this css works: body { background: #ffffff url("data:image/jpg;base64,/9j/4...") no-repeat top left; } Thus maybe you should: try the background property. add the " between your url brackets
score: 2
has comment: http://stackoverflow.com/comment/43948508

http://stackoverflow.com/comment/121006802
has text: Can I fetch all reviews from google map api..? I mean there is no any limits...?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/64391936

http://stackoverflow.com/q/27736236
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27736297
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
has body: View not updating when checkbox is checked. Should I used $scope.$apply? I need the Current state to change between YES and NO depending on whether the checkbox is checked or not. Here's the code on JSbin Notes App What are your favorite sports? Current state: {{sport.selected}} And here's the JS: angular.module('notesApp', []) .controller('MainCtrl', [function() { var self = this; self.sports = [ {label: 'Basketball', selected: 'YES'}, {label: 'Cricket', selected: 'NO'}, {label: 'Soccer', selected: 'NO'}, {label: 'Swimming', selected: 'YES'} ]; }]);
has answer: http://stackoverflow.com/a/38022333
accepted answer: http://stackoverflow.com/a/27736297
upvote count: 1
possible better answer: http://stackoverflow.com/a/38022333
type: Question
has title: angular view not updating when checkbox clicked
score: 1
answer count: 2

http://stackoverflow.com/comment/43788305
type: Comment
comment on: http://stackoverflow.com/q/27687111
has text: @MelanciaUK yeah, off course... SO is supposed to help people.. But the behave we generally get from some users is that of arrogance and pride.... instead of making people learn or help, they just concentrate their attention on punishing every "not upto mark question"...
score: 0
type: QuestionComment

http://stackoverflow.com/a/27795638
has body: Use java.net.URLDecoder. But pay attention that there are several differences between java and javascript implementations. For details take a look on: Difference in URL decode/encode UTF-8 between Java and JS/AS3 (bug!?) Java equivalent to JavaScript&#39;s encodeURIComponent that produces identical output?
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/27795596
type: Answer
accepted answer of: http://stackoverflow.com/q/27795596

http://stackoverflow.com/a/27793086
answers question: http://stackoverflow.com/q/27793022
score: 0
type: Answer
has body: It is possible, but I am not sure how this is called. You may try this script. var c = document.querySelector("#C"); document.querySelector("#X").appendChild(c);

http://stackoverflow.com/q/27758168
upvote count: 6
answer count: 4
type: AnsweredQuestion
has title: JQUERY ON('change') get checkbox value and state
has answer: http://stackoverflow.com/a/27758354
has answer: http://stackoverflow.com/a/27758195
has comment: http://stackoverflow.com/comment/43927047
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/43926971
has answer: http://stackoverflow.com/a/62440452
tagged with: asp.net-mvc
tagged with: javascript
possible better answer: http://stackoverflow.com/a/62440452
accepted answer: http://stackoverflow.com/a/27758195
downvote count: 0
tagged with: jquery
favorite count: 0
has body: How can I "get" the checkbox that changed inside div "containerDIV"? View: @model MyModel &lt;div id="containerDIV"&gt; &lt;ul id="CheckBoxList"&gt; @foreach (XObject t in MyModel.XCollection) { &lt;li&gt; &lt;input type="checkbox" value="@t.id"/&gt; &lt;/li&gt; } &lt;/ul&gt; On the JavaScript (Jquery) side, I have this: $('#containerDIV').on('change', '#CheckBoxList', function (event) { var id = $(this).val(); // this gives me null if (id != null) { //do other things } }); It's clear that $this is not the checkbox, it's the div containerDIV or checkBoxList How can I get to the checkbox's state and value?
score: 6
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27758221

http://stackoverflow.com/comment/43815821
type: Comment
comment on: http://stackoverflow.com/a/27699665
has text: do not allow time in texboxes only allow date.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43716948
type: Comment
comment on: http://stackoverflow.com/q/27643582
has text: I recommend only adding the spritesheet to the stage once, when it is created. Adding it again will cause the children array to be modified, even though nothing is changing.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43956846
comment on: http://stackoverflow.com/q/27773000
score: 0
has text: it means exactly that, "/r/". you didnt tell us what "action" is, but if action = "images/bla.jpg" for example, then url = "/r/images/bla.jpg"
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43930629
type: AnswerComment
has text: NB: the former will end up using CSS scaling to rescale the canvas, without redrawing its contents. This will probably look poor.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27759792

http://stackoverflow.com/q/27692647
has comment: http://stackoverflow.com/comment/43815697
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27698484
score: 0
has comment: http://stackoverflow.com/comment/43810515
has comment: http://stackoverflow.com/comment/43810235
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/43810460
linked to: http://stackoverflow.com/q/1997901
has answer: http://stackoverflow.com/a/27698484
type: AnsweredQuestion
has body: Say my page has loaded successfully. There is an img element in the document like this: &lt;div class="pro_list_imgbox"&gt; &lt;img src="http://XXXX.com/bazinga.jpg" /&gt; &lt;/div&gt; And I have backbone.js code like this: events: { 'click .pro_list_imgbox': 'loadPic', }, loadPic: function (e) { var target = $(e.target), pic = target[0].nodeName === 'IMG' ? target : target.find('img'); if (!pic.data('loadState')) { pic.attr('src', pic[0].src += '?t' + new Date().getTime()); } }, My question is how can I re-render this img element after I clicked it? Will my loadPic function works? with a random num as suffix of src And maybe something else I should do?
has comment: http://stackoverflow.com/comment/43810274
has title: How can I re-render a specific element with backbone.js(or maybe do not need it) after whole page been loaded?
has comment: http://stackoverflow.com/comment/43810029

http://stackoverflow.com/q/27770757
tagged with: javascript
has title: make onmouseover change innerHTML content for containers AND nested elements
score: 0
has answer: http://stackoverflow.com/a/27770843
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27770843
type: AnsweredQuestion
upvote count: 2
tagged with: innerhtml
tagged with: onmouseover
downvote count: 2
has body: please see this jsBin http://jsbin.com/jimenohare/2/edit?html,output. My goal is to update the innerHTML of the status div with an onmouseover event on other divs. The problem is, the "status" div is always displaying that i am hovering over the body div, even when i hover over other divs nested inside of the body div. How can i make it so that it recognizes I am hovering over child divs inside the body div and not always display the onmouseover event for the body div? hope that makes sense. status bar
type: Question

http://stackoverflow.com/comment/43806837
has text: I tried that first but ended up with over 2GB of memory usage after only a few requests of the exact same data so was forced to use .load(), it actually broke node-webkit, even setting zipObj to null didn't free up the memory using that method.
type: Comment
comment on: http://stackoverflow.com/a/27695696
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43872141
type: Comment
has text: thank you for your code, but the problem is when i select all the drop downs, after that its not working properly. if i select the drop downs and then i want to re change the order then it creates problem please suggest.
comment on: http://stackoverflow.com/a/27729860
score: 0
type: AnswerComment

http://stackoverflow.com/a/27784812
type: Answer
score: 2
downvote count: 0
has body: You are probably better off transforming the data yourself than overriding part of the json2csv package. Then you can pass the flat data structure to json2csv for formatting. var xform = []; for (var i=0, max=data.issuelinks.length; i&lt;max; i++ ) { xform[xform.length] = { id:data.id, progress:data.progress.percent, issuelinkid:data.issuelinks[i].id, issuelinktypeid:data.issuelinks[i].type.id } } console.log(xform);
answers question: http://stackoverflow.com/q/27782140
upvote count: 2

http://stackoverflow.com/q/27671241
has comment: http://stackoverflow.com/comment/43757290
has title: Show/Hide Function(s)
answer count: 0
has comment: http://stackoverflow.com/comment/43757495
type: UnansweredQuestion
tagged with: hide
has comment: http://stackoverflow.com/comment/43757384
has comment: http://stackoverflow.com/comment/43757646
has comment: http://stackoverflow.com/comment/43757288
type: Question
has comment: http://stackoverflow.com/comment/43757523
score: 0
has comment: http://stackoverflow.com/comment/43757286
tagged with: javascript
tagged with: show
tagged with: show-hide
has comment: http://stackoverflow.com/comment/43757612
has comment: http://stackoverflow.com/comment/43757428
has body: Fixed Solution //Hide and Show Divs function hideContent(d) { document.getElementById(d).style.display = "none"; } function showInlineContent(d) { document.getElementById(d).style.display = "inline"; } function showBlockContent(d) { document.getElementById(d).style.display = "block"; } function reverseDisplay(d) { if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; } else { document.getElementById(d).style.display = "none"; } } //Hide and Show Divs // Show Div Click to show. function researchStick() { if (stick >= 1 && research1Progress < 100) { // Want to be able to show progress stick = stick - 1; // each time you click me I want to use 1 stick research1Progress = research1Progress + 5; // each stick brings research progress up 5 document.getElementById("stick").innerHTML = stick; // Show the player the update } if (research1Progress == 100) { // When reaches 100 showInlineContent('crafting2'); // show crafting2 } // when research hits 100 unlocks blunt object for crafting // this clickable button should hide after completion // add achievement for first research project } Here is the fixed solution after applying some fixes. being able to call more then one if function is helpful to know, especially since all the tutorials I took did not specifically indicate it otherwise. maybe is was meant to be obvious but knowing this has helped me a newcomer to java create more code on my own
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43852194
type: Comment
has text: can you give me a jsfiddle
type: AnswerComment
comment on: http://stackoverflow.com/a/27720326
score: 0

http://stackoverflow.com/a/27755072
has body: This code should function properly. $('page').on('pageinit', function() { var global_id; var global_data; var fields = []; $.ajax({ type: "POST", url: "http://192.168.1.120/yiibootstrap_old/index.php/userregistration/makedrink", cache: false, success: function(data) { var obj = $.parseJSON(data); $.each(obj, function() { fields.push({id:this['id'],name:this['name'],image:this['image'],Description:this['description']}); }); var count = parseInt(fields.length); for (var r = 0; r &lt; count; r++) { $('#DrinkGridView').append('&lt;li id="' + fields[r]['id'] + '"&gt;&lt;a id="inline" href=#data&gt;&lt;img src="http://192.168.1.120/yiibootstrap_old/uploads/' + fields[r]['image'] + '"/&gt; &lt;h3&gt;&lt;b&gt;' + fields[r]['name'] + '&lt;/h3&gt; &lt;p id="sss"&gt;' + fields[r]['Description'] + '&lt;/p&gt;&lt;/a&gt;&lt;/li&gt;').children().last().trigger("create"); // Switched the a and the li, but that didn't prevent the code from working. } } }); }); In the posted code there was a } missing that should close the ajax success event. But I think that was just a copy paste error.
score: 0
has comment: http://stackoverflow.com/comment/43920941
type: Answer
answers question: http://stackoverflow.com/q/27754413

http://stackoverflow.com/a/27641833
type: Answer
has body: Try something like this ... function pad(n, width, z) { z = z || '0'; n = n + ''; return n.length &gt;= width ? n : new Array(width - n.length + 1).join(z) + n; } ... then use it as ... pad(num.toString(2), 8);
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/27641812
downvote count: 0

http://stackoverflow.com/comment/43990615
comment on: http://stackoverflow.com/q/27790374
type: Comment
type: QuestionComment
has text: what is `testData` and `jsonData`? `event.preventDefault();` will prevent the form submission.. is that intentional? If you're using jQuery, why are you adding eventlisteners rather than using the jQuery submit event? (http://api.jquery.com/submit/)
score: 0

http://stackoverflow.com/comment/43895058
score: 0
comment on: http://stackoverflow.com/a/27717721
type: Comment
has text: It works now, forgot to add the closing tag. Thanks!!
type: AnswerComment

http://stackoverflow.com/q/27783575
has answer: http://stackoverflow.com/a/29807250
accepted answer: http://stackoverflow.com/a/27790129
upvote count: 6
tagged with: node.js
type: AnsweredQuestion
has body: Is there a way to do bulk updates on a collection in mongoose? The strategy I had found used the raw collection driver as follows: var bulk = Person.collection.initializeOrderedBulkOp(); bulk.find(query).update(update); ... bulk.execute(callback) However, bulk is undefined when I do this. Is it just not supported by mongoose?
has answer: http://stackoverflow.com/a/46381682
type: Question
tagged with: mongodb
tagged with: javascript
score: 6
has answer: http://stackoverflow.com/a/27790129
answer count: 3
has title: Mongoose bulk update operation
downvote count: 0
tagged with: mongoose
favorite count: 0
possible better answer: http://stackoverflow.com/a/29807250

http://stackoverflow.com/comment/43986777
type: Comment
score: 0
type: AnswerComment
has text: But that would leave potentially a lot of "undefined" values in the resulting array. But it's a creative solution nonetheless.
comment on: http://stackoverflow.com/a/27788331

http://stackoverflow.com/comment/43805821
has text: If you know that it's possible with scrollTop, the only thing that you need is to know that there's also something like [scrollLeft](http://api.jquery.com/scrollleft/).
comment on: http://stackoverflow.com/q/27696201
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43824049
type: Comment
has text: Anything that can be used with line chart (in highstock)?
type: AnswerComment
comment on: http://stackoverflow.com/a/27705520
score: 0

http://stackoverflow.com/q/27778426
accepted answer: http://stackoverflow.com/a/27778506
upvote count: 1
has body: I tried to make this simple JS calculator following a tutorial I found but it doesn't seem to be working at all. When I press one of the buttons nothing happens. I probably made a really stupid mistake so I'm sorry if I'm wasting your time. I've troubleshooted it but I can't find a solution. Correction: It works now! var a,b,result; function setValues() { a = Number(document.getElementById("a").value); b = Number(document.getElementById("b").value); } function sum() { setValues(); result = a+b; alert("The sum is equal to"+result); } function rest() { setValues(); result = a-b; alert("The rest is equal to"+result); } function mult() { setValues(); result = a*b; alert("The mult is equal to"+result); } function div() { setValues(); result = a/b; alert("The div is equal to"+result); } &lt;div&gt; &lt;input id="a" type="text"&gt; &lt;input id="b" type="text"&gt; &lt;input type="button" onclick="sum()" value="sum"/&gt; &lt;input type="button" onclick="rest()" value="rest"/&gt; &lt;input type="button" onclick="mult()" value="multiply"/&gt; &lt;input type="button" onclick="div()" value="divide"/&gt; &lt;/div&gt;
possible better answer: http://stackoverflow.com/a/27778508
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27778508
type: Question
has title: Simple Javascript Calculator, something went wrong?
answer count: 2
has comment: http://stackoverflow.com/comment/43966983
tagged with: javascript
has comment: http://stackoverflow.com/comment/43967079
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: calculator
favorite count: 0
has answer: http://stackoverflow.com/a/27778506

http://stackoverflow.com/q/27711670
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27720265
tagged with: actionscript-3
downvote count: 0
type: Question
has body: I have a rather large and complicated Flash project that I've been tasked with converting to html5 and javaScript. The main issue I am encountering (aside from the myriad of unsupported features) is that it is heavily reliant on external .as files and I am not sure how to approach it. Everything I have found suggests manually re-scripting in javaScript but I do not have the time or budget for that and of course I am looking for an easier and softer way to get this done. When I "Convert to HTML5 from AS3 document formats" in Flash CC are the external .as files converted and compiles as well? I cant tell as I am a total noob and wandering through this nearly blind with ignorance. Thanks in advance for the help and guidance
score: 1
has comment: http://stackoverflow.com/comment/43835390
answer count: 2
has answer: http://stackoverflow.com/a/27712030
accepted answer: http://stackoverflow.com/a/27712030
tagged with: flash
upvote count: 1
has comment: http://stackoverflow.com/comment/43835378
tagged with: javascript
has title: How to do an AS3 to HTML5 conversion with external AS files
favorite count: 0
has answer: http://stackoverflow.com/a/27720265

http://stackoverflow.com/q/27784081
has comment: http://stackoverflow.com/comment/43978117
has body: I tried making a regex expression to search for in the string named 'patt'. Unfortunately the following gives an error in dreamweaver: patt.search(/.*://.*waw\d.omegle.com/); I need to get this pattern working. What am i doing wrong here?
downvote count: 1
type: Question
has title: How to fix my regex?
score: -1
linked to: http://stackoverflow.com/q/16657152
has comment: http://stackoverflow.com/comment/43978105
answer count: 2
duplicate of: http://stackoverflow.com/q/16657152
has answer: http://stackoverflow.com/a/27784106
upvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43978031
tagged with: regex
has comment: http://stackoverflow.com/comment/43978081
has answer: http://stackoverflow.com/a/27784103
type: UnansweredQuestion

http://stackoverflow.com/comment/43813803
has text: checkout the browser console for any JS errors.
score: 0
comment on: http://stackoverflow.com/q/27700306
type: Comment
type: QuestionComment

http://stackoverflow.com/a/79419601
has body: If nothing here helps, try also /* stylelint-disable &lt;linter name here&gt; */
answers question: http://stackoverflow.com/q/27732209
score: 0
type: Answer

http://stackoverflow.com/comment/43898256
comment on: http://stackoverflow.com/a/27733693
has text: @Mejaniks Instead of an inline click event handler, you should catch the form submit event in javascript and prevent the default action: `$('form').on('submit', function(e) { e.preventDefault(); // rest of code }`. That way you can separate your javascript from your html.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/27796362
answer count: 2
has comment: http://stackoverflow.com/comment/44002063
tagged with: node.js
has body: I enabled communication between parent and child process in order to send JSON as follows: Child: try { var price1 = parseInt(process.argv[2]); if (!price1) { throw new Error('Price in calculations.js undefined'); } var result = { 'timeStamp' : Date(), 'prices' : { 'player1' : price1, 'player2' : 666} }; process.send(result); } catch (e) { // In case of an error, I get here as expected. process.send(e); } Parent: var spawn = require('child_process').spawn; var child = spawn('node', ['calculations.js', 333], {stdio: [null,null,'pipe','ipc']}); child.on('message', function(data) { if (data instanceof Error) { // In case of an error, this is never reached. } else { // do sthing with JSON object. } }); The JSON thing works fine. But if I provoke an error, it doesn't work. I want to send the entire error-object (with message and stack-trace) from child to parent. But it doesn't seem to be an instance of error what I am sending.
has answer: http://stackoverflow.com/a/27824593
upvote count: 7
possible better answer: http://stackoverflow.com/a/27798175
has answer: http://stackoverflow.com/a/27798175
tagged with: inter-process-communicat
tagged with: javascript
has title: Sending an Error Object from a spawned child-process over an IPC-channel
has comment: http://stackoverflow.com/comment/44003429
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27824593
downvote count: 0
score: 7
has comment: http://stackoverflow.com/comment/44002925
favorite count: 0
has comment: http://stackoverflow.com/comment/44003016
type: Question

http://stackoverflow.com/comment/43891981
score: 3
type: Comment
type: QuestionComment
has text: Why to use `id`s, `tr`s have `rowIndex` property, and `td`s have `cellIndex` property.
comment on: http://stackoverflow.com/q/27740525

http://stackoverflow.com/q/27693801
has body: i was trying to build a application that demonstrate the use of ajax. as i am a newbie in ajax i couldnt able to find the error for my code. xmlhttp object is creating, rest of the things are not working, the ready state is not changing to 1 or more than that, i have tried by printing all status values. Home Login Username php code is below <?php echo "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>"; echo "<response"; $food=$_GET['food']; if($food=="ajith") echo "Successs"; else echo "Invalid"; echo "</response>"; ?>
has title: xmlhttp.readyState is not changing
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: xmlhttprequest
tagged with: php
has answer: http://stackoverflow.com/a/27693826
downvote count: 2
type: Question
score: -2

http://stackoverflow.com/comment/43838431
score: 0
type: Comment
has text: I hate flash solution becouse somany people use flash blocking for adds, and other reaseons (I also use it, becouse I hate porn ads on torrent sites etc). I hope, we can get a good api from google int the future for this.
comment on: http://stackoverflow.com/a/27712970
type: AnswerComment

http://stackoverflow.com/q/27768959
accepted answer: http://stackoverflow.com/a/27769055
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27772202
has title: Issue getting first item from JSON array
has answer: http://stackoverflow.com/a/27772202
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 2
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27769055
has body: $('#data').change(function () { $.ajax({ url: 'richiesta.php', type: 'POST', dataType: 'json', data: { value: this.value }, }).done(function (data) { $('#textfield').val(JSON.stringify(data)); $('#results').val('Descrizione codice: ' + data[0].descrizione_codice); }); }); richiesta.php is just a file that triggers some functions to get the JSON. #textfield is correctly populated with the raw JSON, so everything is working properly. I can't figure out how to output the first item of the JSON identified by the name descrizione_codice in #results. The JSON is valid, here's an example selecting one option (truncated): { "data":[ { "codice_comparto":"PRO", "descrizione_codice":"Competenze fisse per il personale a tempo indeterminato", "codice_siope":"1101", "descrizione_ente":"", "ricerca":false, "idtable":"000717409-1101", "cod_ente":"000717409", "anno":"2014", "periodo":"12", "codice_gestionale":"1101", "imp_uscite_att":"756", "importo_2013":"37718576", "importo_2014":"32810124", "importo_2015":null } ], "cosa":false } I'm doing something wrong is that data(0).descrizione_codice as Firebug tells me "data is not a function".. I'm not using $.parseJSON because jQuery already parses data correctly thanks to the datatype. I put up a test page here. You can request the JSON response selecting an option from the dropdown menu.
upvote count: 2
linked to: http://stackoverflow.com/q/9688870

http://stackoverflow.com/q/27802928
downvote count: 2
has comment: http://stackoverflow.com/comment/44015456
accepted answer: http://stackoverflow.com/a/27802972
type: Question
possible better answer: http://stackoverflow.com/a/27802962
score: -2
has body: Hey guys am new to javscript..I have heard of javascript .disabled property and i have decided to do with it ..So the code i have writen is &lt;html&gt; &lt;body&gt; &lt;input name="I_can_fly"&gt; var c = document.getElementById('I_can_fly'); var m = c.disabled ? true : false; console.log(c); &lt;/body&gt; &lt;/html&gt; When i run the above code i got an error like Uncaught TypeError: Cannot read property 'disabled' of null. I dont know what am doing wrong.. Any help would be really appreciated ..Thanks in advance
tagged with: javascript
has answer: http://stackoverflow.com/a/27802962
answer count: 3
upvote count: 0
favorite count: 0
has title: Cant read property disabled in javascript
has answer: http://stackoverflow.com/a/27802963
has answer: http://stackoverflow.com/a/27802972
has comment: http://stackoverflow.com/comment/44015003
type: AnsweredQuestion

http://stackoverflow.com/a/27695747
answers question: http://stackoverflow.com/q/27695694
score: 3
downvote count: 0
type: Answer
upvote count: 3
has body: There is no scope property named foos, it should be obj according to your scope definition scope: { obj: '=' }: template: ' Hello, {{foo.prop}}! ' Or you can change scope config to: scope: { foos: '=obj' },

http://stackoverflow.com/q/27785285
has answer: http://stackoverflow.com/a/27785617
type: Question
tagged with: http-redirect
has body: So I went here : http://www.surfline.com/id/?id=118055 response was HTTP/1.1 200 OK but it is redirecting me to http://www.surfline.com/surf-news/kilian-garland-wins-volcom-unsound-pro_118055/ So I guess it's a Javascript redirection ? but I can't find a piece of script loaded. It's only loading : http://www.surfline.com/id/?id=118055 and <a href="http://pagead2.googlesyndication.com/activeview?id=osdim&amp;avi=BBK405s6qVILqGoSbZNPCgKgMAKOh896VAQAAEAE4AcgBAsgDwQSgBgKoE4AB&amp;ti=1&amp;adk=2260143795&amp;p=1685,348,1775,1076&amp;tos=0,0,0,0,0&amp;mtos=0,0,0,0,0&amp;rs=1&amp;ht=0&amp;fp=client%3Dca-pub-9827052404895414%26url%3Dhttp%253A%252F%252Fwww.surfline.com%252Fsurf-news%252Fkilian-garland-wins-volcom-unsound-pro_118055%252F%26correlator%3D8792909434881%26ifk%3D1763496634%26eid%3D317150304%26oid%3D3&amp;afp=%26output%3Dhtml%26slotname%3D3846851877%26flash%3D16.0.0%26dt%3D1420480230400%26adx%3D348%26ady%3D1684%26ifi%3D1&amp;tdl=253&amp;abd=1-0-26&amp;r=u&amp;bs=1423,839&amp;bos=1440,900&amp;ps=1423,1941&amp;ss=1440,900&amp;tt=17089&amp;pt=431&amp;deb=1-1-1-4-27-9&amp;tvt=17273&amp;iframe_loc=http%3A%2F%2Fwww.surfline.com%2Fsurf-news%2Fkilian-garland-wins-volcom-unsound-pro_118055%2F&amp;is=728,90&amp;uc=26" rel="nofollow">http://pagead2.googlesyndication.com/activeview?id=osdim&amp;avi=BBK405s6qVILqGoSbZNPCgKgMAKOh896VAQAAEAE4AcgBAsgDwQSgBgKoE4AB&amp;ti=1&amp;adk=2260143795&amp;p=1685,348,1775,1076&amp;tos=0,0,0,0,0&amp;mtos=0,0,0,0,0&amp;rs=1&amp;ht=0&amp;fp=client%3Dca-pub-9827052404895414%26url%3Dhttp%253A%252F%252Fwww.surfline.com%252Fsurf-news%252Fkilian-garland-wins-volcom-unsound-pro_118055%252F%26correlator%3D8792909434881%26ifk%3D1763496634%26eid%3D317150304%26oid%3D3&amp;afp=%26output%3Dhtml%26slotname%3D3846851877%26flash%3D16.0.0%26dt%3D1420480230400%26adx%3D348%26ady%3D1684%26ifi%3D1&amp;tdl=253&amp;abd=1-0-26&amp;r=u&amp;bs=1423,839&amp;bos=1440,900&amp;ps=1423,1941&amp;ss=1440,900&amp;tt=17089&amp;pt=431&amp;deb=1-1-1-4-27-9&amp;tvt=17273&amp;iframe…
score: 0
accepted answer: http://stackoverflow.com/a/27785617
answer count: 1
tagged with: javascript
has title: HTTP 200 + empty response + redirection
type: AnsweredQuestion

http://stackoverflow.com/q/27743867
has comment: http://stackoverflow.com/comment/43899117
has comment: http://stackoverflow.com/comment/43898569
has answer: http://stackoverflow.com/a/27743877
upvote count: 1
has comment: http://stackoverflow.com/comment/43898795
has comment: http://stackoverflow.com/comment/43898539
type: AnsweredQuestion
score: 1
has body: I have the following javaScript object: var theData = { "data": [ { "name": "Event1", "start_time": "2015-01-15T22:00:00-0200", "end_time": "2015-01-16T07:00:00-0200", "timezone": "America/Sao_Paulo", "location": "Somewhere", "id": "824583590897935" }, { "name": "Event2", "start_time": "2015-01-14T22:00:00-0200", "timezone": "America/Sao_Paulo", "location": "Somewhere", "id": "1522505051359796" } ], "paging": { "cursors": { "after": "MzA0MjY5OTI5NzgwODIz", "before": "ODI0NTgzNTkwODk3OTM1" }, "next": "https://graph.facebook.com/v2.2/217733628398158/events?access_token=CAACEdEose0cBAAW4SjUBnZB9x1Y6euJS6Bbmky2ZBfyMJ7eq4hPyy0g6lrk9itZCS2Rf2vmAmlYS6qcwIBLVs8Vm5ZBnDYbW7ldni3LdmwAqrZAjVXQrloT0nunu6brW21tBzRXyZAyLR7L2oaF14cmusoXzndsadsakvsZyAYSkjQ52g57BW3VqbAHEMQnTtq5uYb4NOHN5xa1IvdecZCgSHNHzKPWYq1VsWZB7qvQgHXvoRAZD&amp;limit=25&amp;after=MzA0MjY5OTI5NzgwODIz" } } So i want to iterate over this object. I have the following code that is working. But I'm new to Javascrip and this way i'm doing is a high complexity way. How could i do it as simple as possible once this will be called for a huge amount of times? for (var key in theData) { var obj = theData[key]; for (var prop in obj) { var eventObj = obj[prop]; for (var attribute in eventObj){ if(eventObj.hasOwnProperty(attribute)){ console.log(attribute + " = " + eventObj[attribute]); } } } }
has comment: http://stackoverflow.com/comment/43898540
type: Question
has comment: http://stackoverflow.com/comment/43898647
accepted answer: http://stackoverflow.com/a/27743877
downvote count: 0
answer count: 1
tagged with: javascript
has title: What is the best way to iterate properties inside a JavaScript Object?
favorite count: 0
has comment: http://stackoverflow.com/comment/43898969

http://stackoverflow.com/q/27733885
has title: Jqgrid inline edit displays nbsp; instead of spaces for one column
type: Question
has body: jqgrid column contains phone number. For one row, if inline edit has started, &amp;nbsp; characters appear instead of spaces: Before: After edit has started: After saving nbsp; is also saved in phone number. How to fix or diagnose this ? Those characters appear also if form edit is used. Other rows where phone number also contains spaces appear properly. Other columns in this row also appear properly. This column colmodel: {"label":"Telefon","name":"Telefon","index":"Telefon","editoptions":{"maxlength":25,"size":25,"dataEvents":[{"type":"change","fn":function(e) {dataChanged(e.target)} },{"type":"focus","fn":function(e) {if(typeof e.target.ischanged=='undefined') {e.target.ischanged=false}} }],"readonly":null,"class":null,"disabled":null},"editable":true,"width":66,"classes":null,"hidden":false,"searchoptions":{"sopt":["cn","eq","ne","lt","le","gt","ge","bw","ew","nc"]},"stype":"text"}, jqgrid is populated from json data in server: {"total":1,"page":1,"rows":[{"id":"7","cell":[null,"","7","XXXanval Mll OÜ","Tarnija","","","","","","","","","","3 725 141 100","","","Ursel","","","","","","","","","","02","",""]}]} Other rows which are populated properly contain similar data, maybe some more columsn are filled. jqgrid settings: $.extend($.jgrid.defaults, { mtype: 'POST', toppager: true, viewrecords: false, recordpos: 'center', pagerpos: 'right', rowList: [50, 500, 1000], rowNum: 50, rownumbers: true, onSelectRow: grid_onSelectRow, onSelectAll: grid_onSelectAll, multiselect: true, ajaxRowOptions: { async: true }, scrollrows: true, prmNames: { id: "_rowid", page: "_page", rows: "_rows", oper: "_oper", sort: "_sidx", order: "_sord", nd: "_nd" }, loadui: 'block', cmTemplate: { fixed: true }, autoencode: true, gridview: true, ...
has answer: http://stackoverflow.com/a/27757214
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/27757214
type: AnsweredQuestion
tagged with: jqgrid

http://stackoverflow.com/comment/43958391
comment on: http://stackoverflow.com/q/27773667
score: 0
type: Comment
type: QuestionComment
has text: It may be a bit too late to do. But you could ask Brendan Eich: http://en.wikipedia.org/wiki/Brendan_Eich . None of us can really do anything about it...

http://stackoverflow.com/a/27786660
type: Answer
has body: Parse values to float. var xval = parseFloat(res[0]); var yval = parseFloat(res[1]); var zval = parseFloat(res[2]);
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27785453
answers question: http://stackoverflow.com/q/27785453

http://stackoverflow.com/comment/43922331
type: QuestionComment
has text: This states that your `bjqs` script wasn't loaded by the time slider.js ran. Have you tried using plugins separately? Does it work?
comment on: http://stackoverflow.com/q/27754108
score: 0
type: Comment

http://stackoverflow.com/comment/43863220
score: 0
type: Comment
has text: Post the rest of your code, module definition.
type: QuestionComment
comment on: http://stackoverflow.com/q/27725427

date
tags question: http://stackoverflow.com/q/27759132
tags question: http://stackoverflow.com/q/27798530
tag name: date
tags question: http://stackoverflow.com/q/27699598
tags question: http://stackoverflow.com/q/27690897
tags question: http://stackoverflow.com/q/27754077
tags question: http://stackoverflow.com/q/27687088
tags question: http://stackoverflow.com/q/27753628
tags question: http://stackoverflow.com/q/27669019
tags question: http://stackoverflow.com/q/27728219
tags question: http://stackoverflow.com/q/27794805
tags question: http://stackoverflow.com/q/27763086
tags question: http://stackoverflow.com/q/27660117
tags question: http://stackoverflow.com/q/27703659
tags question: http://stackoverflow.com/q/27752194
tags question: http://stackoverflow.com/q/27707967
tags question: http://stackoverflow.com/q/27718407
type: Tag
tags question: http://stackoverflow.com/q/27748127
tags question: http://stackoverflow.com/q/27756020
tags question: http://stackoverflow.com/q/27647918
tags question: http://stackoverflow.com/q/27751096
tags question: http://stackoverflow.com/q/27714469
tags question: http://stackoverflow.com/q/27640753
tags question: http://stackoverflow.com/q/27734780
tags question: http://stackoverflow.com/q/27723470
tags question: http://stackoverflow.com/q/27666819
tags question: http://stackoverflow.com/q/27775241
tags question: http://stackoverflow.com/q/27784136
tags question: http://stackoverflow.com/q/27751327

http://stackoverflow.com/a/27794325
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27794074
has body: In the given code scan method is actually inside the cashRegister object and as this is a method of object "cashRegister", we can invoke like "cashRegister.scan()". Otherwise this will give error. And in the given code error will come on calling "this.add()" method also if "scan()" method will be outside the cashRegister object.

http://stackoverflow.com/a/27752690
answers question: http://stackoverflow.com/q/27752624
type: Answer
has body: Check this JSFiddle. As pointed out in the comment, both styles will be applied, whereas the overlapping styles (for instance, font-size, text-align etc... that are common for both CSS styles) will be overwritten by the other (based on their ordering in the style sheet). For simplification and demo, I have applied the styles to a tag and used the following HTML code, Test link Below is the style applied for the anchor tag based on your style. You can check this in your page using developer tools from browser (I have used FireBug) Note: If you are targeting devices based on their screen size, you should consider using the max-device-width instead. Refer this
score: 0

http://stackoverflow.com/q/27777984
has comment: http://stackoverflow.com/comment/43966249
accepted answer: http://stackoverflow.com/a/27778114
has comment: http://stackoverflow.com/comment/43966343
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27778114
has comment: http://stackoverflow.com/comment/43966296
type: Question
tagged with: nodelist
has comment: http://stackoverflow.com/comment/43966361
has title: NodeList operations
tagged with: javascript
has comment: http://stackoverflow.com/comment/51704050
score: 0
answer count: 1
has body: I got set of divs with integer values (always) unfortunately only with class (cannot add id because they are generated in a loop by other app i cannot mess with) 3 4 5 30 30 30 So i'm creating two nodelists (good that both lists got exact length). aalist = document.getElementByClassName('aaposition'); bblist = document.getElementByClassName('bbposition'); What i need to do is to sum results of multiplying aaitem[i] with bbitem[i] and show it somewhere sumlist = 0; for (i = 0; i < aalist.length; i++) { sumlist += aalist[i] * bblist[i]; } showdiv.innerHTML = sumlist; But i don't know how to pick those values from nodelist, how can i pick the value i'm interested in? Is it .innerHTML, .value or what? All i found was style examples (.style.background ... etc.). Also do i need to parse into integer? Do i need to convert NodeList to array?
has comment: http://stackoverflow.com/comment/43966187

http://stackoverflow.com/comment/136173777
type: Comment
has text: As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
comment on: http://stackoverflow.com/a/77219486
type: AnswerComment
score: 0

http://stackoverflow.com/q/27679604
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Why are the text sticking below the image inside a CSS unordered list menu
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27679643
tagged with: php
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27679643
has body: I have this JSFiddle which works correctly (the CSS is just a barebone): http://jsfiddle.net/b6w9yfq3/1/ HTML: Portfolio About Contact Forum Also, How do I make it so the extra space at the end of the menu isn't there. I originally had 5 entries but when I shortened it to 4, the 5th space is still showing up. How do I resolve the issue.

http://stackoverflow.com/comment/43829037
type: Comment
has text: Much cleaner way to do this animation. +1
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27708577

http://stackoverflow.com/q/27678614
has comment: http://stackoverflow.com/comment/43772275
score: 0
has comment: http://stackoverflow.com/comment/43772029
tagged with: javascript
tagged with: jquery
has title: text under input text in appearance of autocomplete
has comment: http://stackoverflow.com/comment/43772732
has comment: http://stackoverflow.com/comment/43772359
tagged with: http://stackoverflow.com/tag/html
tagged with: input
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43772443
type: Question
has comment: http://stackoverflow.com/comment/43772370
has body: Im trying to do something similar to autocomplete in my site with jquery, but i dont even know from where to start do that. It is hard for me to explane (my english is bad), so i will show you in pictures(A picture is worth a thousand words?). This is input: And after the user is typing a window will Appear like that: And when user press on the "search 'bla'..." it will be same as pressing 'send'. Im only need that under the input will be: "search" + the value on the input + "..." - thats it. Here a try, but it need to be in window like auto complete, not in label. $('#search').keyup(function() { var inputValue = $(this).val(); if(inputValue == "") { $('#label').text("");}else{ $('#label').text("search "+inputValue+"...");} }); #label { cursor:pointer; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;form&gt; &lt;input type="text" id="search"&gt;&lt;input value="send" id="submit" type="submit"&gt; &lt;br&gt; &lt;label for="submit" id="label"&gt;&lt;/label&gt; &lt;/form&gt; Im realy hope that you understand! Thank you and sory about my english ! :)
tagged with: autocomplete
has comment: http://stackoverflow.com/comment/43773034

http://stackoverflow.com/q/27640753
tagged with: jquery
has comment: http://stackoverflow.com/comment/43700896
tagged with: date
has comment: http://stackoverflow.com/comment/43700819
score: 0
has comment: http://stackoverflow.com/comment/43700722
has comment: http://stackoverflow.com/comment/43700697
has body: I'm new to all this and I'm a hard time trying to do what appears to be a simple thing. This is what I'm trying to do. I'm using jquery datapicker to create two dates. A beginning date (beginningdate) and an end date (enddate). I need to use these dates for the following things: Use the 2 dates in a where statement in a mySQL query. Calculate the difference between the dates and use them in the same where statement in the mySQL query. Use the mySQL statement to populate a chart using AMCharts. Use the same page to draw that chart. So basically, I'm trying to input the two dates and use those two dates to populate a chart without using two pages to do it. So this is what I have done so far. Created a php page called mealplanner.php Created a form on this page and added the two dates fields After posting, the two dates work in the where statement (number 1 above) using where m.date >= ('" . $_POST['beginningdate'] . "') and m.date <= ('" . $_POST['enddate'] . "') The chart populates on the same mealplanner.php page since I am refreshing the page after post (number 3 and 4). After or during the posting, I need to calculate the difference between the 2 dates and use that number in a php variable named $diffdate. This is where I run into issues. I can manually hard code a javascript variable var diffdate = 9; I can then pass that variable to php during post using window.location.href = "?p=mealplanner&diffdate=" + diffdate; and use $diffdate = $_GET["diffdate"]; in my php section to use the variable in my mySQL statement but I obviously can't use a hard coded variable and need to calculate the two dates. this is my html form Beginning Date: End Date: and this is how I'm converting the jquery element into a variable var BeginningDate = document.getElementById("BeginningDate").value; var EndDate = document.getElementById("EndDate").value; The problem is that the date is now a string and I can't seem to convert it to a date. I would think that using var newdate = new Date('…
has comment: http://stackoverflow.com/comment/43700961
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43700667
tagged with: php
has title: Datepicker conversion issues
has comment: http://stackoverflow.com/comment/43700550
has comment: http://stackoverflow.com/comment/43700275
has comment: http://stackoverflow.com/comment/43700747
tagged with: mysql
has comment: http://stackoverflow.com/comment/43700562
type: Question
has comment: http://stackoverflow.com/comment/43701103
tagged with: javascript

http://stackoverflow.com/comment/43990035
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27789973
has text: well there is no "arraylist" in JavaScript. And I think you need to learn what JSON is. What is the final result that you are after?
type: Comment

http://stackoverflow.com/comment/43983829
comment on: http://stackoverflow.com/q/27786815
score: 1
has text: @acontell To save someone 4 minutes.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43884165
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27736229
has text: It is on line 14 inside the "gallery" div. @PM77-1

http://stackoverflow.com/q/27669347
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/43754016
has title: Polymer filter doesn't work
type: UnansweredQuestion
has body: This polymer filter isn't working: The content inside the span is blank. What's wrong?
has answer: http://stackoverflow.com/a/27669580
type: Question
tagged with: polymer

http://stackoverflow.com/comment/43968154
type: QuestionComment
has text: Yes I said like that. If you post the input and expected output, I can help.
score: 0
comment on: http://stackoverflow.com/q/27775591
type: Comment

http://stackoverflow.com/q/27642221
downvote count: 0
tagged with: javascript
has title: Having trouble calculating select dropbox options together
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/27642247
favorite count: 0
upvote count: 2
has body: I am trying to build a simple site that will multiply three numbers from select drop boxes together. However my code only displays the number 1 when I try to calculate. I have searched for answers several hours and have been unable to come up with any changes that work. Thanks in advance. Test Project <div id="div_1" align="center" Test Project 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 Calculate
has answer: http://stackoverflow.com/a/27642250
type: AnsweredQuestion
score: 2
possible better answer: http://stackoverflow.com/a/27642250
type: Question
has answer: http://stackoverflow.com/a/27642247
answer count: 2

http://stackoverflow.com/a/27715972
has comment: http://stackoverflow.com/comment/43854193
upvote count: 4
has comment: http://stackoverflow.com/comment/43908409
type: AcceptedAnswer
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/43859444
accepted answer of: http://stackoverflow.com/q/27714959
has body: Answer & Demo So it turns out there isn't a legit way of doing this, truth be told there isn't a lot of documentation about the subject and the plugin itself doesn't provide such functionability, or at least not in a user friendly way. But I went down to the guts of the code and managed to make it work. Here is a JSFiddle where I demonstrate what I understood you wanted. HTML Start Set 60s Set 120s Reset JavaScript start = document.querySelector("#start"); set60 = document.querySelector("#set60"); set120 = document.querySelector("#set120"); reset = document.querySelector("#reset"); div = $("#countdown"); pingSound = new Audio("http://www.sounddogs.com/previews/2220/mp3/402763_SOUNDDOGS__mu.mp3"); pingSound.preload = "auto"; //<- Optional but recommended countdown = div.countdown360({ radius: 50, seconds: 30, fontColor: '#FFFFFF', autostart: false, onComplete: function () { pingSound.play(); } }); countdown.start(); //This right here is for showing the clock on load. countdown.stop(); start.onclick = function () { startCountdown(countdown); } set60.onclick = function () { setSeconds(countdown, 60); } set120.onclick = function () { setSeconds(countdown, 120); } reset.onclick = function () { setSeconds(countdown, 0); } function startCountdown(countdown) { countdown.start(); } function setSeconds(countdown, seconds) { countdown.stop(); countdown.settings.seconds = seconds; countdown.start(); } Explanation Variables start, set60, set120, reset : Link to their respective button elements. div : Link to the countdown div element. pingSound : Audio element that contains the "ping" sound. countdown : The countdown object itself, you need to declare it like this, passing the initial properties and saving it in a variable. Functions startCountdown(countdown) : Takes any countdown object and start's it's execution, this will get the countdown running. setSeconds(countdown,seconds) : Takes any countdown object and set's it second (it can be used in mid-excecution). It works by fi…
has comment: http://stackoverflow.com/comment/43909974
answers question: http://stackoverflow.com/q/27714959
type: Answer
has comment: http://stackoverflow.com/comment/43855667
has comment: http://stackoverflow.com/comment/43902331

http://stackoverflow.com/a/27756550
has body: your code is working fine for me. The IFRAME Sandbox mode is new and has some bugs, try removing it or setting to NATIVE. Also please share if you can find any error if you see the execution transcript. Cheers. PS: Sorry, I know this should be inserted as a comment, but don't yet have reputation to do so :(
type: Answer
answers question: http://stackoverflow.com/q/27752213
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/comment/43710656
score: 0
has text: When it's expanded, where is the full text added? in the span after the a tag ?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27646284

http://stackoverflow.com/comment/43903221
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27745819
has text: Ok, so I added the following jQuery in the header of the page and nothing seems to be happening.

http://stackoverflow.com/comment/43758911
score: 0
has text: Those should be ` `s, not ``s. You've even used the word "button" yourself.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27670458

http://stackoverflow.com/q/27797142
has answer: http://stackoverflow.com/a/27797272
type: UnansweredQuestion
tagged with: django
has comment: http://stackoverflow.com/comment/44004411
score: 2
has title: Update High Charts every Minute?
type: Question
tagged with: highcharts
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 1
has body: I Am using jquery High Charts for displaying my data which are temperatures. I am getting updated data every minute and the graph has to show the latest data (update) every minute. I can do this by simply refreshing the pages but its not the way I want, Is there any other possible way to do it? Below you can see my graph, scripts and functions. &lt;script&gt; time= machine_temp= console.log(machine_temp); engine_temp= $(function () { $('#container').highcharts({ title: { text: 'Engine and Machine Temperature', x: -20 //center }, subtitle: { x: -20 }, xAxis: { categories: time }, yAxis: { title: { text: 'Temperature (°C)' }, plotLines: [{ value: 0, width: 1, color: '#808080' }] }, tooltip: { valueSuffix: '°C' }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle', borderWidth: 0 }, series: [{ name: 'Engine', data: machine_temp }, { name: 'Machine', data: engine_temp },] }); }); &lt;/script&gt; Views.py: def weather_chart_view(request): template='graph1.html' temperature=Temperature.objects.filter(date=datetime.date.today()).order_by('id') time=[] machine_temp=[] engine_temp=[] for temp in temperature: time.append(str(temp.Time)) machine_temp.append(float(temp.machine_temp)) engine_temp.append(float(temp.engine_temp)) return render_to_response(template,{'time':time,'machine_temp':machine_temp,'engine_temp':engine_temp},context_instance=RequestContext(request),)
favorite count: 0
upvote count: 2

http://stackoverflow.com/comment/43784068
comment on: http://stackoverflow.com/q/27684960
type: Comment
type: QuestionComment
score: 0
has text: Could you show where you define the /logout route? I cannot see it.

http://stackoverflow.com/a/27697886
has body: I'm not sure what sort of answer you're expecting here but React is not concerned with how you fetch the data. React is just virtual DOM and components, it's completely unrelated to that part of your app. Facebook do have some ideas on how data should flow throughout your app with react but you have no obligation to their ideas of design. So yes - you can for instance call your API using AJAX and pass the JSON data to react.
upvote count: 3
has comment: http://stackoverflow.com/comment/45213397
type: Answer
has comment: http://stackoverflow.com/comment/45223463
downvote count: 1
answers question: http://stackoverflow.com/q/27697808
score: 2
has comment: http://stackoverflow.com/comment/45139918
accepted answer of: http://stackoverflow.com/q/27697808
has comment: http://stackoverflow.com/comment/45245628
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45142535

http://stackoverflow.com/q/27740801
tagged with: compilation
tagged with: javascript
has answer: http://stackoverflow.com/a/27740853
accepted answer: http://stackoverflow.com/a/27740853
has body: I'm wondering is there is any reason why sourcemap (for SCSS compiling or JS uglifier) should not be available on live environment ? We are setting this up to help the developers team to debug compiled JS en CSS on our live application. Thanks!
score: 0
answer count: 1
has title: Safety issue exposing sourcemap on live web-application
tagged with: css
type: AnsweredQuestion
tagged with: source-maps
type: Question
tagged with: debugging

http://stackoverflow.com/q/27738912
type: Question
has title: how to Access javascript Varibale in Angular js with HTML
upvote count: 0
tagged with: javascript
score: -1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27738938
tagged with: angularjs
type: UnansweredQuestion
has body: I have following code and following HTML Now my Source URL is not coming here.. Any idea how to do this Thanks
downvote count: 1

http://stackoverflow.com/a/27774949
answers question: http://stackoverflow.com/q/27773278
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27773278
type: Answer
score: 2
upvote count: 2
has body: Try setting :- tdAttrs: { style: { width: '50%' } } jsFiddle

http://stackoverflow.com/q/27714781
tagged with: javascript
tagged with: ckeditor
has body: I'm having difficulty disabling certain CKEditor buttons. Basically, I'd like to loop through all of the loaded commands and disable them at runtime so that they are represented as greyed out buttons. Here is my code for doing this: for (var key in CKEDITOR.instances.editor1.commands) { if (CKEDITOR.instances.editor1.commands.hasOwnProperty(key)) { console.log("disabling command " + key); CKEDITOR.instances.editor1.commands[key].disable(); } } My CKEditor setup uses the Image, Background Colour, Bold, Italic, Underline, Insert/Remove Bulleted List, Copy and Paste plugins. However, the only button that is actually disabled via this method is the Image button; the others remain enabled, even though I see no errors and my console.log is firing for each of them. Any advice would be greatly appreciated.
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/27743681
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has title: Disabling Commands in CKEditor
score: 1
tagged with: wysiwyg
upvote count: 1
type: Question

http://stackoverflow.com/q/27715202
has answer: http://stackoverflow.com/a/28228891
tagged with: dreamweaver
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28228891
has title: How to apply both add() and remove() method?
has body: I require 2 dropdown list name it Parent n child. I have made by child a hidden field to only appear as parent value is clicked. Im trying to apply both add and remove method concurrently. Here is an example from w3schools on the respective add() and remove() method. How do i integrate them both in one? //Add() method Apple Pear Banana Orange Click the button to add a "Kiwi" option at the end of the dropdown list. Insert option //remove() method Select a fruit: Apple Pear Banana Orange Remove selected fruit Here is the websites to test the codes: http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_select_add http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_select_remove
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43842451
score: 0
answer count: 1
tagged with: asp.net

http://stackoverflow.com/q/27739684
has comment: http://stackoverflow.com/comment/43890270
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/18904697
has comment: http://stackoverflow.com/comment/43893312
has comment: http://stackoverflow.com/comment/43894118
has comment: http://stackoverflow.com/comment/43891830
has comment: http://stackoverflow.com/comment/43892173
accepted answer: http://stackoverflow.com/a/27739753
has title: how to set cookie for display notification bar at only once
type: AnsweredQuestion
downvote count: 0
tagged with: cookies
has comment: http://stackoverflow.com/comment/43891651
has answer: http://stackoverflow.com/a/27739753
type: Question
has comment: http://stackoverflow.com/comment/43892351
has comment: http://stackoverflow.com/comment/43892243
score: 1
tagged with: javascript
has body: I had set notification on my site, This is the jquery for notification bar: function showNotification(params){ // options array var options = { 'showAfter': 0, // number of sec to wait after page loads 'duration': 0, // display duration 'autoClose' : false, // flag to autoClose notification message 'type' : 'success', // type of info message error/success/info/warning 'message': '', // message to dispaly 'link_notification' : '', // link flag to show extra description 'description' : '' // link to desciption to display on clicking link message }; // Extending array from params $.extend(true, options, params); var msgclass = 'succ_bg'; // default success message will shown if(options['type'] == 'error'){ msgclass = 'error_bg'; // over write the message to error message } else if(options['type'] == 'information'){ msgclass = 'info_bg'; // over write the message to information message } else if(options['type'] == 'warning'){ msgclass = 'warn_bg'; // over write the message to warning message } // Parent Div container var container = ' '; container += options['message']; container += ' '; container += ' '; $notification = $(container); // Appeding notification to Body $('body').append($notification); var divHeight = $('div#info_message').height(); // see CSS top to minus of div height $('div#info_message').css({ top : '-'+divHeight+'px' }); // showing notification message, default it will be hidden $('div#info_message').show(); // Slide Down notification message after startAfter seconds slideDownNotification(options['showAfter'], options['autoClose'],options['duration']); $('.link_notification').live('click', function(){ $('.info_more_descrption').html(options['description']).slideDown('fast'); }); } // function to close notification message // slideUp the message function closeNotification(duration){ var divHeight = $('div#info_message').height(); setTimeout(function(){ $('div#info_message').animate({ top: '-'+divHeight }); // removing the notification from body setTime…
has comment: http://stackoverflow.com/comment/43892164
has comment: http://stackoverflow.com/comment/43894066
upvote count: 1
has comment: http://stackoverflow.com/comment/43891718
answer count: 1

http://stackoverflow.com/comment/43807481
type: Comment
score: 0
has text: KmlLayer zooms to fit by default (or when the preserveViewport option is set to false).
type: AnswerComment
comment on: http://stackoverflow.com/a/27696783

http://stackoverflow.com/comment/43976016
has text: jQuery `.css()` method doesn't handle `!important` statement
type: QuestionComment
comment on: http://stackoverflow.com/q/27782975
score: 0
type: Comment

http://stackoverflow.com/comment/66834344
score: 0
comment on: http://stackoverflow.com/a/27641760
type: Comment
has text: @CanÜrek - what do you mean it's not working? It filters out anyone with an age of 60 or more, and in the last fiddle there are no rows whith persons older than 59, so it's working just fine ?
type: AnswerComment

http://stackoverflow.com/comment/43749937
has text: @Dr.Molle I see, but it keep not showing polyline, what should I do?
comment on: http://stackoverflow.com/q/27665902
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43849371
comment on: http://stackoverflow.com/a/27713434
score: 0
type: Comment
has text: Thanks jarga ! I will go forward with your changes. Also your last comment regarding applyBindings, could you please tell me how I can achieve it ?
type: AnswerComment

http://stackoverflow.com/q/27766029
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43942731
upvote count: 0
has comment: http://stackoverflow.com/comment/43961239
has body: I have created a parent div. Inside that div there are multiple child divs: the first one is holding a background image, the second one, the website name, and the third one, some text. Using jQuery, when a user hovers on the second div, i.e. website name div, the third div i.e text div is visible. Now what I want is, when the text div becomes visible, to also replace the image in the first div. Here is my HTML and jQuery code so far: HTML: {Div holding the image as a background} Website Name text Div JS: $(".contentBlock3").mouseenter(function () { $('.contentText3').fadeIn(1500); $('.contentImg').css("background-image", "images/gurus_bw.jpg)"); $('.contentImg').css("background-position", "top 30px)"); }); The CSS line is not working... What am I doing wrong ?
has answer: http://stackoverflow.com/a/27766059
type: Question
has title: Replacing background image using jQuery not working
duplicate of: http://stackoverflow.com/q/253689
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/43943168
answer count: 1
downvote count: 1
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/253689

http://stackoverflow.com/comment/43894848
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27741825
has text: @kumardhubi Look there is no need to use :last-of-type you can remove it while you specified selector by .gm_wrapper but anyway :last-of-type is a selector to select last type of element you may need it later
type: AnswerComment

http://stackoverflow.com/a/27758559
has body: HTML list 1-1 list 1-2 list 1-3 list 2-1 list 2-2 list 2-3 JavaScript $('.foo ul').each(function(){ if ($(this).hasClass('myClass')){ $(this).css('background-color', 'yellow'); } }) Working Example FIDDLE
score: 0
answers question: http://stackoverflow.com/q/27758139
type: Answer
has comment: http://stackoverflow.com/comment/43929432

http://stackoverflow.com/a/27663299
answers question: http://stackoverflow.com/q/27663161
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/43742444
has body: I don't know if this could help, but I solved this issue removing type attribute of the script, like this:
accepted answer of: http://stackoverflow.com/q/27663161
score: 0

http://stackoverflow.com/comment/44003754
has text: Please define "seems to fail"
score: 2
comment on: http://stackoverflow.com/q/27797530
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27650638
has body: Using Google Maps JavaScript API v3, I have a map where I can position a marker based on LatLng. var marker = new google.maps.Marker({ position: new google.maps.LatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random()), What I want to do is place a marker on a City based on a PHP variable E.G $town_1 = "London"; $town_2 = "Reading"; And my desired result would be two markers, on their town respectively. Which theoretically could look something like this: for (var i = 0; i &lt; 3; i++) { var marker = new google.maps.Marker({ position: &lt;?php echo $town_1; ?&gt; map: map, title: 'Town ' + i }); But my map disappears which isn't very desirable at all How does one place multiple markers on embedded Google Maps per a city (Not Lat/Long)?
score: -1
has title: How to set multiple markers based on PHP variables?
type: Question
tagged with: google-maps
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: google-maps-api-3
type: UnansweredQuestion
tagged with: php
downvote count: 1
has answer: http://stackoverflow.com/a/27651153

http://stackoverflow.com/comment/43709076
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27644598
score: 1
has text: That `label`'s `for` attr should reference an `id`, _not_ a `name`. Each radio input needs its own label and the labels should be on the *right* of the inputs.

http://stackoverflow.com/q/27664361
type: UnansweredQuestion
type: Question
tagged with: ember.js
tagged with: ember.js-view
favorite count: 0
has comment: http://stackoverflow.com/comment/43744393
upvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/43746189
has body: I have an Ember.View that handles both the click and touchEnd events, for both desktop and mobile interactions. Unfortunately, touchEnd also gets fired when scrolling, which is not intended. How do I handle the click and tap, but avoid the scroll event? Ember.View.extend({ click: function() { // not handled in a mobile browser }, touchEnd: function() { // handled in a mobile browser, but unfortunately also on scroll } });
has title: Handling a click and a tap but not a scroll
has answer: http://stackoverflow.com/a/27670085
has comment: http://stackoverflow.com/comment/43753920
score: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/27759880
has comment: http://stackoverflow.com/comment/43930808
tagged with: node.js
has answer: http://stackoverflow.com/a/27762171
tagged with: http://stackoverflow.com/tag/json
possible better answer: http://stackoverflow.com/a/27762171
has title: Foreach error if only one object in array on post
tagged with: mongodb
accepted answer: http://stackoverflow.com/a/27760019
tagged with: javascript
tagged with: express
linked to: http://stackoverflow.com/q/359494
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43932388
has body: I have a server in nodejs with this schema in json: var UserSchema = new Schema({ nick: String, deviceId: String, visivel: Boolean, checks: [{date: {type:String},log: {type:Number},lng: {type:Number}}] }); In the Post code I have something , like this: .post(function(req, res){ var user = new User(); user.deviceId = req.body.deviceId; console.log("ID: " + req.body.deviceId); User.findOne({'deviceId': user.deviceId},'deviceId nick visivel checks',function(err, useritem){ user.nick = req.body.nick; user.visivel = req.body.visivel; if(req.body.checks != undefined){ req.body.checks.forEach(function(items){ console.log(items); user.checks.push(items); }); } user.save(function(err){ if (err) res.send(err); res.json({ message: 'user save!' }); console.log('user save 1!'); }) } } when i make a post with a only one object in check array, the server have a exception: Object # has no method 'forEach' at Promise. (/RalyAPP/server.js:268:22) at Promise. (/RalyAPP/node_modules/mongoose/node_modules/mpromise /lib/promise.js:162:8) at Promise.emit (events.js:95:17) at Promise.emit (/RalyAPP/node_modules/mongoose/node_modules/mpromise/lib/pr omise.js:79:38) at Promise.fulfill (/RalyAPP/node_modules/mongoose/node_modules/mpromise/lib /promise.js:92:20) at /RalyAPP/node_modules/mongoose/lib/query.js:1833:13 at model.Document.init (/RalyAPP/node_modules/mongoose/lib/document.js:251:1 1) at completeOne (/RalyAPP/node_modules/mongoose/lib/query.js:1831:10) at /RalyAPP/node_modules/mongoose/lib/query.js:1799:11 at /RalyAPP/node_modules/mongoose/lib/utils.js:414:16 But if i make a post with more that one, run well and not have a exception. Can help resolve this problem? bests.
type: Question
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27760019

http://stackoverflow.com/a/27698893
has comment: http://stackoverflow.com/comment/43810862
upvote count: 1
has comment: http://stackoverflow.com/comment/43811026
answers question: http://stackoverflow.com/q/27698855
score: 1
has body: Maybe you can detach the node before clearing the page then append it back. $('.page').on('click',function(){ var content = $(this).next('.content').detach(); $('body').html('').append(content.css('display','block')); });
accepted answer of: http://stackoverflow.com/q/27698855
has comment: http://stackoverflow.com/comment/43810967
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43810885
downvote count: 0
type: Answer

http://stackoverflow.com/a/27779305
type: AcceptedAnswer
has body: If I don't intend to inherit my controller class, is there any difference between defining an AngularJS Controller's methods as prototype methods over instance methods? Instance methods come with a performance impact. Other than that it's perfectly fine to use them. I just use prototype members. This video explains why you might want to use instance methods : https://m.youtube.com/watch?v=tvocUcbCupA (mainly to capture this)
answers question: http://stackoverflow.com/q/27777499
type: Answer
accepted answer of: http://stackoverflow.com/q/27777499
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/27801601
upvote count: 2
has body: Okay. I guess I figured it out on my own. I started out with the test found here: https://github.com/angular-translate/angular-translate/blob/master/test/unit/service/translate.spec.js#L409 And I was able to slowly morph this passing test into what I wanted to do: (function() { var app = angular.module("theApp", ["pascalprecht.translate"]); var theService = function($translate) { var theFunction = function(data) { return $translate("FOO", { input: data.in }).then(function(trans) { data.out = trans; }); }; return { theFunction: theFunction }; }; app.factory("theService", ["$translate", theService]); }()); describe("theService", function() { var $rootScope; beforeEach(module("theApp", function($translateProvider, $provide) { $translateProvider.useLoader("customLoader"); $provide.service("customLoader", function($q) { return function() { var deferred = $q.defer(); deferred.resolve({ "FOO": "foo {{input}}" }); return deferred.promise; }; }); })); beforeEach(inject(function ($translate, _$rootScope_) { $rootScope = _$rootScope_; $translate.use("en_US"); $rootScope.$apply(); })); it("function translates input", inject(function(theService) { var data = { in: "bar", out: "fail" }; theService.theFunction(data); $rootScope.$apply(); expect(data.out).toBe("foo bar"); })); }); A JSFiddle with the solution can be found here: http://jsfiddle.net/danBhentschel/yLt3so14/ Please feel free to point out any stupid mistakes I made. I'm still kinda new at this.
accepted answer of: http://stackoverflow.com/q/27799728
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27799728
type: Answer
score: 2

http://stackoverflow.com/comment/58776771
score: 0
type: Comment
type: QuestionComment
has text: I am having a similar issue with Chrome on development of angularJS. Sometimes, but not always, when I refresh the page after making some changes, the GET for index.html is stalled for up to 1.6 minutes and then everything flies by. It doesn't happen every time and I haven't had it happen in other browsers and it's uaually after I have made some changes. This means that the page on display has been idle for some time while I was editing. Any ideas? This all takes place on localhost.
comment on: http://stackoverflow.com/q/27740692

http://stackoverflow.com/q/27782302
has body: I am creating a level selection screen to my game, and I found that I get the following error. Uncaught TypeError: Cannot read property 'Tween' of undefined, the error comes a line that can be found in the "arrowClicked" function at the bottom of the script. UshanGame.Selection = function(game){}; var thumbRows = 2; var thumbCols = 3; var thumbWidth = 128; var thumbHeight = 128; var thumbSpacing = 3; var levelThumbsGroup; var currentPage = 0; var leftArrow; var rightArrow; var pages; UshanGame.Selection.prototype = { create: function(){ console.log("%c ✔✔ Level Selection Ready! ✔✔", "color:red;"); // array with finished levels and stars collected. var starsArray = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]; // how many pages are needed to show all levels? pages = starsArray.length /(thumbRows * thumbCols); leftArrow = this.add.button(50, 420, "level_arrows", this.arrowClicked); leftArrow.anchor.setTo(0.5); leftArrow.frame = 0; leftArrow.alpha = 0.3; rightArrow = this.add.button(270, 420, "level_arrows", this.arrowClicked); rightArrow.anchor.setTo(0.5); rightArrow.frame = 1; // creation of the thumbails group levelThumbsGroup = this.add.group(); // determining level thumbnails width and height for each page var levelLength = thumbWidth * thumbCols + thumbSpacing * (thumbCols - 1); var levelHeight = thumbWidth * thumbRows + thumbSpacing * (thumbRows - 1); // looping through each page for(var l = 0; l &lt; pages; l++){ // horizontal offset to have level thumbnails horizontally centered in the page var offsetX = (this.width-levelLength)/ 2 + game.width * l; // I am not interested in having level thumbnails vertically centered in the page, but // if you are, simple replace my "20" with // (game.height-levelHeight)/2 var offsetY = 20; // looping through each level thumbnails for(var i = 0; i &lt; thumbRows; i ++){ for(var j = 0; j &lt; thumbCols; j ++){ var levelNumber = i * thumbCols + j + l *(thumbRows * thumbCols); var levelThumb = this.add.button(offsetX + j * (thumbWidth …
possible better answer: http://stackoverflow.com/a/27800964
has answer: http://stackoverflow.com/a/27800964
score: 0
answer count: 2
has title: Uncaught TypeError: Cannot read property 'Tween' of undefined Phaser.io
tagged with: phaser-framework
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27782622
type: Question
accepted answer: http://stackoverflow.com/a/27782622
tagged with: javascript

http://stackoverflow.com/a/27695299
type: Answer
has body: There is no obvious error in the code you posted. I only not quite sure when you call getStore. That can be important because view model exists only together with its view, binding is asynchronous, etc. Thus, it may be (theoretically) that the store really does not yet exist the first time. Ideally, prepare a showcase and post it to https://fiddle.sencha.com. Then it would be possible to sort out if it is a problem in your app or in Ext. (Btw, which version?)
score: 0
answers question: http://stackoverflow.com/q/27680910

http://stackoverflow.com/q/27681096
tagged with: javascript
has body: Let's say I have an event I'm waiting for in Javascript, where we'll have something like this: fileSystem.readFile('done', function(err, data){ //do something with the file }); In this situation, the parameters err and data are arbitrarily named and ordered, so they could have been in another order function(data, err) {/*do something*/ } How does data get passed the data and err get passed any errors? I notice this pattern to be pervasive everywhere through out javascript callbacks, and it is largely a mystery to me how function parameters are passed in a predictable order without following some convention I must not be aware of. How does this work?
tagged with: callback
type: Question
accepted answer: http://stackoverflow.com/a/27758342
has comment: http://stackoverflow.com/comment/43776920
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43777081
has title: How are callback functions' parameters dependent on ordering?
has comment: http://stackoverflow.com/comment/43776973
has comment: http://stackoverflow.com/comment/43776999
tagged with: parameters
has comment: http://stackoverflow.com/comment/43777325
has answer: http://stackoverflow.com/a/27758342
tagged with: functional-programming
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43777228
has comment: http://stackoverflow.com/comment/43777035

http://stackoverflow.com/comment/43960401
has text: If u see ur output, it's not generating the output in array format
comment on: http://stackoverflow.com/a/27774752
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27708545
answer count: 4
has answer: http://stackoverflow.com/a/27709236
has title: how to disable a link from special url jquery
upvote count: 1
possible better answer: http://stackoverflow.com/a/27709236
accepted answer: http://stackoverflow.com/a/27708604
type: AnsweredQuestion
score: 1
has body: I want to disable links which it's link to product. My links like follows. &lt;a href="http://www.example.com/?product=product01"&gt; &lt;a href="http://www.example.com/?product=sample-product02"&gt; &lt;a href="http://www.example.com/?product=product03"&gt; I want disable if url like http://www.example.com/?product=****** using jquery Help me Thanks
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43828927
favorite count: 0
has answer: http://stackoverflow.com/a/27709339
has answer: http://stackoverflow.com/a/27708604
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27708735

http://stackoverflow.com/q/27793522
has answer: http://stackoverflow.com/a/27793665
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27793807
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43996432
has body: Need to setup an HTML Form, if entered value match given value then ACTION1 else ACTION2 i have 2 pages m1.htm &amp; m2.htm, my value is 12345, if form submit 12345 open m1.htm if wrong open m2.htm. &lt;form name="input" action="m1.htm" method="post"&gt; &lt;input type="text" name="q"&gt;&lt;input type='submit' value='Search'/&gt;
downvote count: 2
has title: Html form submit Check string
tagged with: forms
type: Question
upvote count: 0
score: -2
has answer: http://stackoverflow.com/a/27793730
tagged with: javascript

http://stackoverflow.com/a/27759216
answers question: http://stackoverflow.com/q/27754896
has body: Angular is a framework primarily designed for building single page web applications (SPAs). What that means is that the applications you write will only ever perform a full page load once - everything after that is incremental. To be honest I haven't read that tutorial, and despite using express for my own server side apps, haven't seen the directory structure you are talking about before. Express doesn't require a particular directory structure, so I guess that's a suggestion from the tutorial or from some other 'best practice' type article - you should be able to incorporate my next couple of points into that structure but I won't address it directly. So this is my approach: Routing As you mentioned, angular can handle view routing very well, either with the out of the box stuff (soon to be updated), or using the excellent ui.router module. Also remember that because the web page only loads once (SPA), your app won't actually request pages from the server if you link to other views using relative urls or angular's $location service. As such if returning a full web page, it should always (generalisation of course) be index.html. If you enable HTML5 mode on angular's $locationProvider then it will do the rest magically. But the chances are, you do still need express routing too: your app will very likely make AJAX requests for data - creating and deleting it as well as just fetching it. Those routes will need to run database operations and all of your server-side app logic that makes it do what it does. The way I differentiate between a request that should just return index.html and one that should be caught and dealt with by express is by putting all of the REST API style data transactions under /api/[route]. In other words: myserver.com/about will return index.html. Angular then loads and looks at the URL, realises it's in the about route, and displays the appropriate view. Conversely, if I request myserver.com/api/users, my express sever knows it shouldn't send m…
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27754896

http://stackoverflow.com/q/27646347
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27646568
favorite count: 0
upvote count: 6
type: AnsweredQuestion
has body: I recently started using React and Flux for a project of mine, and I'm using jQuery too, for some parts of the GUI. Via jQuery, I sometimes add CSS classes and styles and even DOM nodes to elements created and updated by React. This seems to work just fine. React doesn't complain, and, when render() re-runs, React doesn't modify the classes and styles and the DOM nodes that has been added somewhere deep inside a react root. Can I rely on React ignoring DOM nodes I've added side by side with React DOM nodes inside a React tree? — I understand that the non-React nodes will be removed, if React decides to remove the node into which I inserted them. This is fine with me. But I do wonder if React some day in the future will get upset on these additional nodes not managed by React, and refuse to work? If React doesn't manage any styles of a DOM node (I haven't added any style attribute to the nodes generated by render()), then can I via jQuery safely add my own styles to this DOM node? E.g. look up a node by #id in jQuery and then set its width. If there's no className on a DOM node generated by React, can I then safely via jQuery add and remove classes to this node? (For example, add a class on mouse hover.) One reason I'm currently doing these possibly weird things, is that I have some jQuery soup legacy code that I don't want to port to React right now. Another is that I'm using some jQuery plugins that sometimes add DOM nodes inside the React tree.
score: 6
type: Question
has answer: http://stackoverflow.com/a/27646568
has title: Is it okay to do all these jQuery things to a React.js DOM tree?
tagged with: reactjs
answer count: 1

http://stackoverflow.com/a/27799250
answers question: http://stackoverflow.com/q/27799207
type: AcceptedAnswer
downvote count: 0
has body: \b[a-zA-Z0-9 ]+\d+\b Try this.See demo. https://regex101.com/r/wZ0iA3/6 var re = /\b[a-zA-Z0-9 ]+\d+\b/gi; var str = 'Enter Room/Area^_^Area 100#_#Enter Grid^_^Grid2#_#Enter Level / Building^_^Building1#_#Enter Drawing^_^Drawing1#_#Enter Spec section^_^Spec2#_#Enter BOQ^_^BOQ1#_#'; var m; while ((m = re.exec(str)) != null) { if (m.index === re.lastIndex) { re.lastIndex++; } // View your result using the m-variable. // eg m[0] etc. }
accepted answer of: http://stackoverflow.com/q/27799207
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/comment/43947278
type: QuestionComment
comment on: http://stackoverflow.com/q/27759249
score: 0
has text: Hey, thanks for the comment. Could you send links for the min.js, mobile.min.js and the .js for 1.4? When I download from the website it doesn't find it in my directory.
type: Comment

http://stackoverflow.com/comment/43836420
has text: Try this (I used JQuery since JSFiddle didn't seem to like my non-jquery code): http://jsfiddle.net/7ku10n0t/25/
type: Comment
comment on: http://stackoverflow.com/a/27711514
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43993454
comment on: http://stackoverflow.com/q/27772737
type: Comment
type: QuestionComment
score: 0
has text: Thank you guys for your answers! I was having some Windows OS issues, reinstalled Linux OS and now everything works. Now I am a linux user! :)

http://stackoverflow.com/q/27779557
type: Question
has comment: http://stackoverflow.com/comment/43971349
has comment: http://stackoverflow.com/comment/43971656
tagged with: javascript
has comment: http://stackoverflow.com/comment/43971886
has title: How to test content of html element with qunit
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43971757
has comment: http://stackoverflow.com/comment/43971517
has comment: http://stackoverflow.com/comment/43971437
tagged with: jquery
has comment: http://stackoverflow.com/comment/43968991
favorite count: 0
has comment: http://stackoverflow.com/comment/43969073
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27779636
tagged with: qunit
score: 2
has body: I have an html element that contains other elements (a, span) which contain text like "this is a text". As some words are inside a or span or both the result of jqueries text() is something like " this\n is a\n text ". I'm not interested in all those whitespace. I just want to test if "this is a text" is the readable text in the element. I could workaround this by using regex, e.g. assert.ok(string.match(/^\s*this\s+is\s+a\s+text\s*^/)) but this is kinda ugly plus I'd loose the "expected: ... , result: ...." stuff in the test report. Is there a better way to test the text contents of html elements with qunit/jquery? Update: There seems to be no other way/convenience method in qunit to solve that, except for manually messing with the whitespaces like in https://stackoverflow.com/a/27779636/1250436
upvote count: 2

http://stackoverflow.com/a/27786339
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27785810
score: 3
has body: The reason is because $scope.posts has the items with original order when compared to ng-repeated item with orderBy. Orderby filter rearranges the item, returns a new array and repeats on it instead of the original $scope.posts array. So the index will be different if the original order is different from the sorted order. And i believe you are just overdoing stuff, just pass the object as is and get its index for splicing from the original list. just pass post from ng-click: ng-click="deletePost(post)" and in the controller: $scope.deletePost = function(post) { //Get post object var posts = $scope.posts; /*Delete with the _id property*/ Blog.Post.delete({ id:post._id }, function(success) { /*Get the original index with the object reference and splice it*/ posts.splice(posts.indexOf(post), 1); }); } angular.module('app', []).controller('ctrl', function($scope) { $scope.posts = [{ _id: 'id1', name: 'Post1' }, { _id: 'id2', name: 'Post2' }, { _id: 'id3', name: 'Post3' }, { _id: 'id4', name: 'Post4' }] $scope.deletePost = function(post) { var posts = $scope.posts; posts.splice(posts.indexOf(post), 1); } $scope.addPost = function() { var posts = $scope.posts; posts.push({ _id: 'id' + (posts.length + 1), name: 'Post' + (posts.length + 1) }); } }); Add {{post.name}}
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27785810

http://stackoverflow.com/q/27667253
has comment: http://stackoverflow.com/comment/43750154
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43749393
has body: Hello i have this code to load php file into div. Its working but i need load next file into this div. zzz If i click "zzz" link loading file into my div (file table with images) i need hide this page and load next by click image. UPDATE Now working
has comment: http://stackoverflow.com/comment/43753208
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
type: AnsweredQuestion
has title: Loading several .php file into one div
has comment: http://stackoverflow.com/comment/43750269
has answer: http://stackoverflow.com/a/27669659
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43749851
has comment: http://stackoverflow.com/comment/43749840
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27669659
score: 0
has comment: http://stackoverflow.com/comment/43749340

http://stackoverflow.com/a/27754608
has body: Since you are using jQuery, change the JavaScript code to: $("#flip_content").on("click", function() { $('#f1_card').toggleClass('flip'); $(".btn-skip").addClass('hide'); $('.btn-hide').removeClass('hide'); $("#gmp-heading").html("Answer"); }); Updated Fiddle $("#flip_content").on("click", function() { $('#f1_card').toggleClass('flip'); $(".btn-skip").addClass('hide'); $('.btn-hide').removeClass('hide'); $("#gmp-heading").html("Answer"); }); #f1_container { position: relative; margin: 10px auto; width: 450px; height: 281px; z-index: 1; -webkit-position: relative; -webkit-margin: 10px auto; -webkit-width: 450px; -webkit-height: 281px; -webkit-z-index: 1; } #f1_container { perspective: 1000; -webkit-perspective: 1000; } #f1_card { width: 100%; height: 100%; transform-style: preserve-3d; transition: all 1.0s linear; -webkit-width: 100%; -webkit-height: 100%; -webkit-transform-style: preserve-3d; -webkit-transition: all 1.0s linear; } /* #flip { */ /* transform: rotateX(180deg); */ /* box-shadow: -5px 5px 5px #aaa; */ /* } */ .flip { transform: rotateX(180deg); box-shadow: -5px 5px 5px #aaa; -webkit-transform: rotateX(180deg); -webkit-box-shadow: -5px 5px 5px #aaa; } .face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; -webkit-position: absolute; -webkit-width: 100%; -webkit-height: 100%; -webkit-backface-visibility: hidden; } .face.back { display: block; transform: rotateX(180deg); box-sizing: border-box; padding: 10px; color: white; text-align: center; background-color: #aaa; -webkit-display: block; -webkit-transform: rotateX(180deg); -webkit-box-sizing: border-box; -webkit-padding: 10px; -webkit-color: white; -webkit-text-align: center; -webkit-background-color: #aaa; } This is a sample question This is a sample question This is a sample question This is a sample question This is a sample question This is a sample question This is sample answer This is sample answer This is sample answer This is sample answer This is sample answer This …
accepted answer of: http://stackoverflow.com/q/27754355
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27754355
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27769270
has comment: http://stackoverflow.com/comment/43949802
has comment: http://stackoverflow.com/comment/43949845
has comment: http://stackoverflow.com/comment/43950229
has comment: http://stackoverflow.com/comment/43950202
accepted answer: http://stackoverflow.com/a/27769332
has comment: http://stackoverflow.com/comment/43950128
answer count: 5
tagged with: javascript
tagged with: jquery
has title: How do I add up values of buttons in jquery
has comment: http://stackoverflow.com/comment/43949756
has answer: http://stackoverflow.com/a/27769518
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27769350
type: Question
has answer: http://stackoverflow.com/a/27769378
possible better answer: http://stackoverflow.com/a/27769350
has body: I'm trying to sum up values of buttons if the buttons are clicked on. For example, there is "Button1". If this button is clicked, it should add its value to a sum which will be displayed at the bottom of the page. If "Button1" is clicked a second time it should substract its value from the sum. Here is my attempt to do this but it's not doing anything at all: var value_Buttons = 0; var total = 0; $("button[name=Button1],[name=Button2],[name=Button3],[name=Button4],[name=Button5],[name=Button6]").click(function() { if($(this).hasClass('active') == false) { value_Buttons += parseInt($(this).val()); } else if($(this).hasClass('active') == true) { value_Buttons -= parseInt($(this).val()); } total += value_Buttons; alert(total); }); total = value_Buttons + value_Optional_Button; $("input[name=value_sum]").val(total); Additionally, here is the code for an examplary button (Like "Button1"): &lt;div class="form-group col-md-2"&gt; &lt;button type="button" class="form-control btn btn-primary" name="Button1" value="300" title="300 €" data-toggle="button" aria-pressed="false" autocomplete="off"&gt;Button 1&lt;/button&gt; &lt;/div&gt; There will be more buttons, but they will only differ in their name and value. Also, the box which will display the sum of the button-values currently looks like this: &lt;div&gt; &lt;label class="control-label"&gt;Sum&lt;/label&gt; &lt;div class="input-group"&gt; &lt;input class="form-control" name="value_sum" style="text-align:right" id="costs" value="" type="text" readonly&gt; &lt;span class="input-group-addon"&gt;&amp;euro;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; I've searched all over Stackoverflow, as well as via Google, etc. yet I can't find anything or anyone with a similar problem
has answer: http://stackoverflow.com/a/27769486
score: 0
has comment: http://stackoverflow.com/comment/43949484
has answer: http://stackoverflow.com/a/27769332

http://stackoverflow.com/comment/43704523
type: AnswerComment
score: 0
type: Comment
has text: if it's possible to use the latest version of jquery you can use this: ` ` i've tested it. then it works.
comment on: http://stackoverflow.com/a/27642854

http://stackoverflow.com/q/27684956
has body: I'm trying to create a location tracing POC,where there will be multiple points and each of these points would be connected a path. I want to draw a path between two points first and then move on to the next two points. I don't want to include all the points in the same path.Each two points should have a unique path since i want to control the transition duration of each path drawn. var ss = d3.select('#chart') .append('svg') .attr('width', 760) .attr('height', 690) .style('background', "#93A1A1") //The data for my line var lineData = [ { "x": 10, "y": 5 , "t":7000}, { "x": 200, "y": 20, "t":8000}, { "x": 400, "y": 10, "t":9000}, { "x": 250, "y": 40, "t":1000}, { "x": 350, "y": 200, "t":10000},{ "x": 200, "y": 500, "t":11000}, { "x": 120, "y": 80, "t":9000},{ "x": 100, "y": 500, "t":9000},{ "x": 100, "y": 50, "t":8000}]; //Function to draw line var lineFunction = d3.svg.line() .x(function(d) { return d.x; }) .y(function(d) {return d.y; }) var temp = []; var time = 0; for(var i = 0; i &lt; lineData.length-1; ++i) { temp[0] = lineData[i]; temp[1] = lineData[i+1]; time = lineData[i].t; var lineGraph = ss.append("path") .attr("d", lineFunction(temp)) .attr("stroke", "grey") .attr("stroke-width", 3) .attr("fill", "none"); var totalLength = lineGraph.node().getTotalLength(); console.log(totalLength); console.log(i+" "+temp[0].x+" "+temp[1].x+" "+time); lineGraph .attr("stroke-dasharray", totalLength + " " + totalLength) .attr("stroke-dashoffset", totalLength) .transition() .duration(time) .ease("linear") .attr("stroke-dashoffset", 0); } This is my code so far,when i run this all the lines are being drawn but i need each path to be drawn one after the other. Here is the Demo JSFiddle
tagged with: javascript
has title: Drawing D3 paths one after the other
upvote count: 1
answer count: 1
favorite count: 0
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
accepted answer: http://stackoverflow.com/a/27685823
downvote count: 0
tagged with: d3.js
score: 1
type: Question
has answer: http://stackoverflow.com/a/27685823

http://stackoverflow.com/comment/43799413
type: AnswerComment
type: Comment
has text: My submit input:
comment on: http://stackoverflow.com/a/27691080
score: 0

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/27748265
tags question: http://stackoverflow.com/q/27705990
tags question: http://stackoverflow.com/q/27673591
tags question: http://stackoverflow.com/q/27715070
tags question: http://stackoverflow.com/q/27712859
tags question: http://stackoverflow.com/q/27727959
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/27737872

http://stackoverflow.com/comment/43950840
type: Comment
comment on: http://stackoverflow.com/a/27769793
score: 0
has text: Hmm... You don't like coffeescript at all, do you? Your last suggestion is identical to the corresponding JavaScript code. The point with coffeescript is to write short codes, I would go with Chip Castles suggestion.
type: AnswerComment

http://stackoverflow.com/a/31367114
type: Answer
upvote count: 0
has body: I'm pretty sure this should be: &lt;div ng-repeat="item in dataArray | orderBy:'item.order.allListPosition'"&gt;
answers question: http://stackoverflow.com/q/27779082
downvote count: 3
score: -3

http://stackoverflow.com/comment/43806780
type: Comment
comment on: http://stackoverflow.com/a/27696699
score: 0
type: AnswerComment
has text: and is this generally true for all stream types in Node? are transforms separated to their own area of concern?

http://stackoverflow.com/comment/43808179
comment on: http://stackoverflow.com/q/27697229
has text: Woa, that's quite a lot of code in your question. Any chance you could trim it down to a more minimal repro?
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/27748853
has body: Invoke the push() function to add the retrieved value to the array. sav.push( prompt("Enter value")); Working Example: http://jsfiddle.net/uz5s2vpL/ If you want to use the value elsewhere within the code, store it within a variable. var sav = []; var result = prompt("Enter value")); sav.push(result);
answers question: http://stackoverflow.com/q/27748839
type: Answer
has comment: http://stackoverflow.com/comment/43909203
score: 0

http://stackoverflow.com/comment/43925215
type: AnswerComment
has text: @orlea Have you defined `$filelink` as `$filelink = fopen('/root/wget/test.txt',a);` and is the directory from this file correct to use in `/www/test.php`?
type: Comment
comment on: http://stackoverflow.com/a/27757035
score: 0

http://stackoverflow.com/comment/43818657
type: Comment
type: QuestionComment
has text: @EugeneP. My bad. Didn't read question properly.
score: 0
comment on: http://stackoverflow.com/q/27702274

http://stackoverflow.com/comment/43707404
has text: @JonathanNewmuis This app is for use of our tem, means we are owners and users!
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27644374

http://stackoverflow.com/comment/43976005
has text: `total += count` in a loop is `total = 1 + 2 + 3 + ... + 10`, which is 55.
score: 4
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27783016

http://stackoverflow.com/comment/43934819
type: Comment
comment on: http://stackoverflow.com/a/27761783
score: 0
type: AnswerComment
has text: How can I use this inside my controller?

http://stackoverflow.com/q/27803010
has body: I have three div's, when user clicks on "1", div1 with id divOne12 should be displayed, when user clicks on 2 div2 with id divTwo12 should be displayed and div1 should be hidden, when user clicks 3 div3 with id divThree12 should be displayed and previous shown div should be hidden. Again if user clicks Div2 previous shown div should be hidden and div2 with id divTwo12 should be displayed. Please find the fiddle :http://jsfiddle.net/0p7djjnc/7/ . Please suggest javascript changes.Thanks. HTML code: Column1 Column2 Col1- data1 Col2 - data1 col1 - data2 col2 - data2 col3 - data3 col3 - data3 Div 2 Div 3 Static Row 1 2 3 Css code to hide div's: #divTwo12{ display: none; } #divThree12 { display: none; } --EDIT-- DIV id are dynamic in my application, how can i retrieve dynamic div id in javascript function, please suggest.
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/27803136
type: AnsweredQuestion
has title: hide and show Div on click
upvote count: 3
possible better answer: http://stackoverflow.com/a/27803123
type: Question
has answer: http://stackoverflow.com/a/27803252
accepted answer: http://stackoverflow.com/a/27803252
has answer: http://stackoverflow.com/a/27803549
has comment: http://stackoverflow.com/comment/44016332
downvote count: 9
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/26546885
has comment: http://stackoverflow.com/comment/44015157
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27803123
score: -6
favorite count: 0

http://stackoverflow.com/q/27744197
has comment: http://stackoverflow.com/comment/43899771
has body: I'm using jasmine for my unit tests. I have a function that contains: var startDate = $("#startDate").data("kendoDatePicker").value(); But when the unit test hits that line it errors out saying: TypeError: Cannot read property 'value' of null I've tried stuff like setting it $("#startDate").data("kendoDatePicker").value = '12/25/2014'; but that results in "cannot set value of null"(or something along those lines) and I've tried to spy on it, but in all honesty, my knowledge here is limited. I'm hoping I'm just missing some basic terminology in my google searches and someone will be able to help me. How do I mock this or spy on it? Thanks in advance! EDIT: I was able to "fix" it but I consider this "hacky" and would still like a better solution. I created a new html page called "tests.html" which contains: &lt;div style="visibility: hidden; height: 0"&gt; &lt;input id="startDate" /&gt; &lt;/div&gt; Then I referenced the file: /// &lt;reference path="tests.html" /&gt; Then at the top of my unit test I added: $('#startDate').kendoDatePicker({ min: new Date() }); And now it "works", but it's reading from an actual input box, which it shouldn't need...
has comment: http://stackoverflow.com/comment/43899359
answer count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43900208
tagged with: kendo-ui
type: Question
has comment: http://stackoverflow.com/comment/43899525
has comment: http://stackoverflow.com/comment/43900467
has comment: http://stackoverflow.com/comment/43900390
tagged with: jasmine
has comment: http://stackoverflow.com/comment/43899306
tagged with: unit-testing
linked to: http://stackoverflow.com/q/25337509
has title: Unit testing kendoDatePicker value
score: 0
has comment: http://stackoverflow.com/comment/43899612

http://stackoverflow.com/q/27682054
score: 0
tagged with: rest
answer count: 3
has answer: http://stackoverflow.com/a/27703623
has body: I'm trying create my own application based on rails (not equal, but similar). So, i'm creating this basic stuff to send to github, so i can use in any project, and i have a problem with my routes. I am using the express-resource to create the cruds routes. This is my app. Controller/example.js: exports.index = function(req, res, next){ res.send('forum index'); next(); }; exports.new = function(req, res, next){ res.send('new forum'); next(); }; exports.create = function(req, res, next){ res.send('create forum'); next(); }; exports.show = function(req, res, next){ res.send('show forum'); next(); }; exports.edit = function(req, res, next){ res.send('edit forum'); next(); }; exports.update = function(req, res, next){ res.send('update forum'); next(); }; exports.destroy = function(req, res, next){ res.send('destroy forum'); next(); }; exports.load = function(id, fn){ process.nextTick(function(){ fn(null, { title: 'Ferrets' }); }); }; Them in my routes.js: var express = require('express'); var resource = require('express-resource'); var client = express(); routes.resource('example', require('../controllers/example')); module.exports = routes; and my app.js: // Routes var routes = require('./routes/routes.js'); app.use('/', routes); Now the problem: I can access only the index and the new routes. When i try access: http://localhost:3000/example - will show right, but with a 304 http code. http://localhost:3000/example/new - will show right, but with a 304 http code. http://localhost:3000/example/create - will show the /show/ and a 304 http code. http://localhost:3000/example/show - will show the /show/ and a 304 http code. http://localhost:3000/example/edit - will show the /show/ and a 304 http code. http://localhost:3000/example/update - will show the /show/ and a 304 http code. http://localhost:3000/example/destroy - will show the /show/ and a 304 http code. In the terminal, the following error occur: GET /example/edit 304 1.080 ms - - Error: Can't set headers after they…
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/27682954
has answer: http://stackoverflow.com/a/27683189
type: Question
tagged with: javascript
has title: Creating a MVC-restful application upon express

http://stackoverflow.com/q/27747299
tagged with: css
accepted answer: http://stackoverflow.com/a/27747438
type: AnsweredQuestion
has body: Used jQuery lib: I have this jquery code: The issue I am having is that the background opacity is not delayed along with the expand. My goal is to have the opacity change from .25 to .80 as the div expands instead of jumping from .25 to .80 instantly. And I would like for the .80 opacity to return to .25 when the div collapses and not immediately when mouse is removed. I'm not sure if this code is the best code to be used for what I am intending to do. The overall goal is to have a header that expands on mouseover/hover along with a background opacity change. Other methods I've tried: At first I began with giving #header-out a backgroud using CSS: #header-out { background: rgba(255,255, 255, .25); } And the jquery code I used is as follows: The problem I found with the above method was that the page would load with #header-out at an opacity of .25. After the hover, #header-out seemed to collapse to an opacity of (.80 - .25) or just .25 instead of returning to .80. Which is why I decided to remove the CSS from my #header-out and instead try using it in the jquery code. Final note: The html structure is as follows: Content And the CSS is: #header-out { width:100%; height:75px; position:fixed; top:0; left:0; z-index:999; cursor: pointer; } #header-in { width:90%; margin:0 auto; padding:0; } I would like to have my logo and menu within #header-in. I would like more content to become visible once the header DIV expands.
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/190560
possible better answer: http://stackoverflow.com/a/27747390
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27747390
has comment: http://stackoverflow.com/comment/43906890
has title: jquery div expand with background color opacity change
has answer: http://stackoverflow.com/a/27747438
answer count: 2
score: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/27702873
downvote count: 0
answers question: http://stackoverflow.com/q/27702798
upvote count: 2
type: Answer
score: 2
has body: change you last script tag to &lt;/script&gt;

http://stackoverflow.com/comment/43842143
comment on: http://stackoverflow.com/q/27714977
has text: Exactly but options array that contains null will be overridden not necessarily by the next object in the array, in fact by the object which has values for that field (options)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43884632
type: QuestionComment
has text: Could you elaborate more about the use case? Why do you need it? Thanks.
comment on: http://stackoverflow.com/q/27736568
score: 0
type: Comment

http://stackoverflow.com/q/27706963
tagged with: javascript
has comment: http://stackoverflow.com/comment/43825792
score: 0
answer count: 2
has body: I have a callback in node.js with S3. Here is the code: FS.prototype.myfunc = function (base, url, size, callBackArg) { var s3ForHead = new AWS.S3({httpOptions:{timeout: 5000}}); console.log("Define s3Forhead Object"); s3ForHead.listObjects({ "Prefix" : url, "Bucket" : S3_BUCKET }, function (err, data) { console.log("Callback is done"); if (err != null) { console.log(err); callBackArg("404"); } else { if (data.Contents.length &gt; 0) { callBackArg("200"); } else { callBackArg("404"); } }); } } For some reason, The listObjects freeze sometimes in the stage of listObjects. Meaning, Callback is done isn't printed to the screen. I want that after 5000ms, if the callback doesn't return, I will return "404" with my callBackArg argument. Is there any way to so it with node.js?
tagged with: callback
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/27707812
has answer: http://stackoverflow.com/a/27707896
type: Question
tagged with: amazon-s3
has title: Define time out for node.js callback

http://stackoverflow.com/comment/43767967
comment on: http://stackoverflow.com/q/27673798
score: 0
has text: possible duplicate of [JavaScript closure inside loops – simple practical example](http://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example)
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27736996
score: 0
has body: Few options: -make sure the onclick event is working, add a alert("test") before the ajax call to make sure you are getting there -on your controller, try echo "test" to make sure you get the response -use Chrome console to debug your ajax call and make sure its getting to the controller
answers question: http://stackoverflow.com/q/27736881
type: Answer
has comment: http://stackoverflow.com/comment/43885664

http://stackoverflow.com/q/27773521
downvote count: 0
favorite count: 0
has title: How can I dynamically access a global variable in Node?
has comment: http://stackoverflow.com/comment/43957824
has body: In browser-based JavaScript, you can do something like this: var foo = "foo"; (function() { var foo = "bar"; console.log(foo); // =&gt; "bar" console.log(window["foo"]); // =&gt; "foo" })(); Is there any way to do something similar in Node, which lacks a window object?
has comment: http://stackoverflow.com/comment/43957879
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27773543
upvote count: 3
has comment: http://stackoverflow.com/comment/43957982
tagged with: global-variables
has answer: http://stackoverflow.com/a/27773542
accepted answer: http://stackoverflow.com/a/27773542
type: Question
score: 3
tagged with: javascript
answer count: 2
possible better answer: http://stackoverflow.com/a/27773543

http://stackoverflow.com/a/27788512
upvote count: 3
has comment: http://stackoverflow.com/comment/43988326
type: Answer
accepted answer of: http://stackoverflow.com/q/27788402
answers question: http://stackoverflow.com/q/27788402
has body: The fix is very simple is this case: just call this.whoAmI() instead of mammal.whoAmI() to access current object instead of its prototype property: var Dog = ( function (mammal) { mammal.name = "dog"; mammal.state = function () { this.whoAmI(); console.log("I am happy"); }; return mammal; })(Object.create(Mammal)); will give expected result: I am Shipo I am happy I am Shipo Here is simplified scheme of the inheritance chain: +--------------+ +--------------+ | Mammal | +--&gt; | Dog | +--------------+ | +--------------+ | __proto__ |--+ | __proto__ | +--------------+ +--------------+ | name: mammal | | name: dog | | whoAmI() | | state() | +--------------+ +--------------+ From this table it's easy to see that if an instance of Dog calls state method you want it to be invoked on the current this object so it can pick up this.name, not mammal.name.
score: 3
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/43704334
type: Comment
comment on: http://stackoverflow.com/a/27642606
score: 0
has text: Just a note: would be better to use `.on()` than `.bind()`. The latter has been deprecated.
type: AnswerComment

http://stackoverflow.com/comment/43997177
score: 0
type: Comment
has text: Just learned it myself not too long ago as well. Ok, its working. Gonna have to look at my actual code and examine the differences.
comment on: http://stackoverflow.com/a/27793581
type: AnswerComment

http://stackoverflow.com/q/27792965
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: -5
has comment: http://stackoverflow.com/comment/43995404
has answer: http://stackoverflow.com/a/27793284
type: Question
downvote count: 5
tagged with: javascript
has title: Jquery hover and hover out ellipsis
upvote count: 0
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27793284
favorite count: 0
has comment: http://stackoverflow.com/comment/43995870
has body: I have a long title and I make it ellipsis mean ... when not hover, then when I hover the long title will show full length, from here I already make it using jquery with css ellipsis, so far I have a problem is when I mouseout how to return the long title to ellipsis again ? Thanks Click here for the JS Fiddle

http://stackoverflow.com/q/27709437
tagged with: jquery-plugins
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Enscroll jQuery Plug In
has answer: http://stackoverflow.com/a/27711484
tagged with: twitter-bootstrap
score: 0
type: UnansweredQuestion
has body: I've been trying to implement Enscroll Plug in into a Bootstrap page, but I haven't gotten Facebook Ticker Scrollbar that is shown in their demo's page to function right. I was wondering if anyone will be able to help me out and look at my code, and see what I am doing wrong in my syntax, and explain to me what I am doing wrong. $('#scrollbox3').enscroll({ showOnHover: true, verticalTrackClass: 'track3', verticalHandleClass: 'handle3' }); #scrollbox3 { overflow: auto; width: 400px; height: 360px; padding: 0 5px; border: 1px solid #b7b7b7; } .track3 { width: 10px; background: rgba(0, 0, 0, 0); margin-right: 2px; border-radius: 10px; -webkit-transition: background 250ms linear; transition: background 250ms linear; } .track3:hover, .track3.dragging { background: #d9d9d9; /* Browsers without rgba support */ background: rgba(0, 0, 0, 0.15); } .handle3 { width: 7px; right: 0; background: #999; background: rgba(0, 0, 0, 0.4); border-radius: 7px; -webkit-transition: width 250ms; transition: width 250ms; } .track3:hover .handle3, .track3.dragging .handle3 { width: 10px; } New Scrolling Window Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam a justo erat, volutpat hendrerit dolor. Sed urna nibh, dapibus at egestas non, vulputate ut quam. Morbi a erat tristique tellus varius venenatis. Aenean lacinia sem eget turpis fringilla commodo. Sed lorem nisi, viverra a interdum nec, varius eu enim. Donec ornare, nunc quis eleifend iaculis, nulla eros mollis tellus, quis faucibus risus odio non lectus. Maecenas ac velit non metus rhoncus commodo. Nunc ligula est, ultricies sed mattis sed, dapibus at arcu. Maecenas lacinia nisl ut sem bibendum ac condimentum purus facilisis. Curabitur ut nibh lobortis libero interdum vehicula vel quis nulla. Suspendisse et massa urna. Donec eu lorem nec felis dapibus aliquam viverra in quam. Suspendisse ultrices, nisi ac venenatis porttitor, erat turpis dapibus augue, sed rutrum nunc ante sed enim. Aliquam et tempus mi. Nullam malesuada, nu…

http://stackoverflow.com/a/27706868
answers question: http://stackoverflow.com/q/27706367
has body: As discussed in the comments, grab the originating element inside its click handler: $(document).ready(function() { var currentlyOpenedTd; // name it something more sensible $(".td_test").click(function() { $("#bModal").modal('show'); currentlyOpenedTd = this; }); $("#save").click(function() { $(currentlyOpenedTd).text($("#input").val()); }); }); An aside: also notice that I changed .append to .text, even though they're not exactly the same. Modify to suit your requirements, but keep in mind it's good practice to always sanitize user input.
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27706367

http://stackoverflow.com/q/27745812
answer count: 2
has title: Including gmail.js
tagged with: javascript
has body: I'm trying to include gmail.js from here. But the object gmsrc is invalid, the function get.user_email() fails. I'm trying to develop a Chrome extention, the chrome developer tools (F12) tells me Uncaught TypeError: Cannot read property 'user_email' of undefined Here is my code: var jq = document.createElement('script'); jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"; document.getElementsByTagName('body')[0].appendChild(jq); var gmsrc = document.createElement('script'); gmsrc.src = "https://rawgit.com/KartikTalwar/gmail.js/master/src/gmail.js"; document.getElementsByTagName('body')[0].appendChild(gmsrc); console.log("Scripts loaded, Start playing ..."); var name = gmsrc.get.user_email(); alert(name); Where is my mistake? Update (still not working): I tried this, but it doesnt work either: var jq = document.createElement('script'); jq.src = chrome.extension.getURL("lib/jquery-2.1.1.min.js"); document.body.appendChild(jq) //inject gmail.js var gmsrc= document.createElement('script'); gmsrc.src = chrome.extension.getURL("lib/gmail.js"); document.body.appendChild(gmsrc); var name = gmsrc.get.user_email(); alert(name);
has comment: http://stackoverflow.com/comment/43903819
tagged with: google-chrome-extension
tagged with: content-script
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27745956
has answer: http://stackoverflow.com/a/57565362
type: Question
has comment: http://stackoverflow.com/comment/43903473
has comment: http://stackoverflow.com/comment/69122982
score: 0

http://stackoverflow.com/q/27714666
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43841409
has answer: http://stackoverflow.com/a/27715691
favorite count: 0
type: AnsweredQuestion
tagged with: mysql
upvote count: 1
accepted answer: http://stackoverflow.com/a/27715691
type: Question
score: 1
tagged with: database
has body: I've been trying to add a table to my database, and for some reason it isn't working. Here's the code in question var db = openDatabase('movies', '1.0', 'movies database', 50 * 1024 * 1024); $("#newplayers").submit(function (event) { event.preventDefault(); //The two variables are called from the input of the player, denoting Company Name and Player Name. companyName = document.getElementById("companyname").value; playerName = document.getElementById("playername").value; db.transaction(function(tx) { tx.executeSql('CREATE TABLE userinfo (_id INTEGER PRIMARY KEY, player TEXT, company TEXT)'); tx.executeSql('INSERT INTO userinfo (player,company) VAUES (?, ?)', [playerName,companyName]); }); document.getElementById("company").innerHTML = companyName; }); What baffles me further is that elsewhere in the code I created a table flawlessly, and using what appears to be the same code isn't bringing the same results.
has title: Failing to create new table in Web SQL Database
tagged with: web-sql

http://stackoverflow.com/comment/43741018
type: Comment
comment on: http://stackoverflow.com/a/27662570
type: AnswerComment
score: 0
has text: block statements like if-else to *not* introduce a scope: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Statements

meteor
tags question: http://stackoverflow.com/q/27708284
tags question: http://stackoverflow.com/q/27658774
tags question: http://stackoverflow.com/q/27660218
tags question: http://stackoverflow.com/q/27650932
tags question: http://stackoverflow.com/q/27686168
tags question: http://stackoverflow.com/q/27791742
tags question: http://stackoverflow.com/q/27744869
tags question: http://stackoverflow.com/q/27713331
tags question: http://stackoverflow.com/q/27652430
tags question: http://stackoverflow.com/q/27743079
tags question: http://stackoverflow.com/q/27769508
tags question: http://stackoverflow.com/q/27733795
tags question: http://stackoverflow.com/q/27767030
tags question: http://stackoverflow.com/q/27643391
tags question: http://stackoverflow.com/q/27743649
tags question: http://stackoverflow.com/q/27762385
tags question: http://stackoverflow.com/q/27770442
tags question: http://stackoverflow.com/q/27763520
tags question: http://stackoverflow.com/q/27679812
tags question: http://stackoverflow.com/q/27670672
tags question: http://stackoverflow.com/q/27784646
tags question: http://stackoverflow.com/q/27692259
tags question: http://stackoverflow.com/q/27797595
tags question: http://stackoverflow.com/q/27674443
tags question: http://stackoverflow.com/q/27693247
tags question: http://stackoverflow.com/q/27736415
tags question: http://stackoverflow.com/q/27732897
tags question: http://stackoverflow.com/q/27680544
tags question: http://stackoverflow.com/q/27662796
tags question: http://stackoverflow.com/q/27779783
tags question: http://stackoverflow.com/q/27743794
tags question: http://stackoverflow.com/q/27711901
tags question: http://stackoverflow.com/q/27785003
tags question: http://stackoverflow.com/q/27699884
tags question: http://stackoverflow.com/q/27702162
type: Tag
tags question: http://stackoverflow.com/q/27714618
tags question: http://stackoverflow.com/q/27765708
tags question: http://stackoverflow.com/q/27766349
tags question: http://stackoverflow.com/q/27673074
tags question: http://stackoverflow.com/q/27745727
tags question: http://stackoverflow.com/q/27718725
tags question: http://stackoverflow.com/q/27743623
tags question: http://stackoverflow.com/q/27669482
tags question: http://stackoverflow.com/q/27769919
tags question: http://stackoverflow.com/q/27769228
tags question: http://stackoverflow.com/q/27714085
tags question: http://stackoverflow.com/q/27745310
tags question: http://stackoverflow.com/q/27715005
tags question: http://stackoverflow.com/q/27753848
tags question: http://stackoverflow.com/q/27713030
tags question: http://stackoverflow.com/q/27675766
tags question: http://stackoverflow.com/q/27771318
tags question: http://stackoverflow.com/q/27671272
tags question: http://stackoverflow.com/q/27671208
tags question: http://stackoverflow.com/q/27800257
tags question: http://stackoverflow.com/q/27660026
tags question: http://stackoverflow.com/q/27769750
tags question: http://stackoverflow.com/q/27744260
tag name: meteor
tags question: http://stackoverflow.com/q/27696672
tags question: http://stackoverflow.com/q/27682176
tags question: http://stackoverflow.com/q/27647511
tags question: http://stackoverflow.com/q/27693329
tags question: http://stackoverflow.com/q/27727888

http://stackoverflow.com/a/27672747
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43761167
type: Answer
has body: You could use JavaScript to handle click events on button. 1st Approach: Using .classList.toggle(). content.classList.toggle('flip') will add the class .flip, if it doesn't exist and will remove if it exists. var btn = document.getElementById('flip_content'); var content = document.getElementById('f1_card'); btn.onclick = function() { content.classList.toggle('flip'); } #f1_container { position: relative; margin: 10px auto; width: 450px; height: 281px; z-index: 1; } #f1_container { perspective: 1000; } #f1_card { width: 100%; height: 100%; transform-style: preserve-3d; transition: all 1.0s linear; } .flip { transform: rotateX(180deg); box-shadow: -5px 5px 5px #aaa; } .face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; } .face.back { display: block; transform: rotateX(180deg); box-sizing: border-box; padding: 10px; color: white; text-align: center; background-color: #aaa; } lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen lets see if anything happen This is nice for exposing more information about an image. Any content can go here. Flip 2nd Approach: Using .classList.add() and .classList.remove(). You could keep track of clicks, if the count is divisible by 2, add the class .flip, else remove it. var btn = document.getElementById('flip_content'); var content = document.getElementById('f1_card'); var c = 0; btn.onclick = function() { (c++ % 2 == 0) ? content.classList.add('flip'): content.classList.remove('flip'); } #f1_container { position: relative; margin: 10px auto; width: 450px; height: 281px; z-index: 1; } #f1_container { perspective: 1000; } #f1_card { width: 100%; height: 100%; transform-style: preserve-3d; transition: all 1.0s linear; } .flip { transform: rotateX(180deg); b…
score: 8
downvote count: 0
upvote count: 8
has comment: http://stackoverflow.com/comment/43761046
has comment: http://stackoverflow.com/comment/43761007
accepted answer of: http://stackoverflow.com/q/27672717
answers question: http://stackoverflow.com/q/27672717
has comment: http://stackoverflow.com/comment/43761116

http://stackoverflow.com/a/27745240
score: 5
has comment: http://stackoverflow.com/comment/43901468
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27745218
type: Answer
upvote count: 6
has body: Without parentheses, you're retrieving a reference to the function, you are not calling (executing) the function With parentheses, you're executing the function. function a() { return 2; } var b = a(); // called a, b is now 2; var c = a; // c is referencing the same function as a console.log(c); // console will display the text of the function in some browsers var d = c(); // But it is indeed a function, you can call c(), d is now 2;
answers question: http://stackoverflow.com/q/27745218
has comment: http://stackoverflow.com/comment/43901521
downvote count: 1

http://stackoverflow.com/a/27647175
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43712862
has comment: http://stackoverflow.com/comment/43712381
has comment: http://stackoverflow.com/comment/43712762
has comment: http://stackoverflow.com/comment/43713091
has body: As others already noticed, you forgot an assignment, because currentValue = mirrorIndex; just changes the value of currentValue, not the element within the array itself. Same goes for temp. More general: you can't store an Array element into a variable as a reference to that Arrayelement like that. It also makes your function look overly complex. Here are two alternatives. In the first the swap is done by storing one value, replace the element, and assigning the stored value to the other element. In the sceond the same is done in one line, using Array.splice (see MDN). Here is a test for the performance of 3 in place reverse functions. function reverseInPlace(arr) { var len = arr.length-1, mid = Math.floor(len/2), i = -1; while( i++ &lt; mid ) { var swap = arr[len-i]; // save swapvalue arr[len-i] = arr[i]; // assign current value to swap position arr[i] = swap; // assign swapvalue to current position } } // Swapping in one line (using splice) function reverseInPlace2(arr) { var mid = Math.floor(arr.length/2), i = -1; while( i++ &lt; mid ) { arr[i] = arr.splice(-(i+1), 1, arr[i])[0]; } } // demo var log = Helpers.log2Screen; var arr = [1,2,3,4]; reverseInPlace(arr); log( 'Even length: `reverseInPlace(arr) -&amp;gt; [', arr, ']`' ); arr = [1,2,3,4,5,6,7]; reverseInPlace(arr); log( 'Odd length: `reverseInPlace(arr) -&amp;gt; [', arr, ']`' ); arr = [1,2,3,4,5]; reverseInPlace2(arr); log( 'Use `Array.splice: reverseInPlace2(arr4) -&amp;gt; [', arr, ']`' ); // clarification of what happens in your code log('\n&lt;b&gt;Clarification of what happens in your code&lt;/b&gt;'); var myArr = [1,2,3,4,5]; var el2 = myArr[2]; log('Assigned: `MyArr: ', myArr, ', el2: ', el2, '`'); log( 'Storing: `var el2 = myArr[2];`' ); el2 = myArr[0]; log( 'Assigning: `el2 = myArr[0];`' ); log( '`myArray` did not change `MyArr: ', myArr, '`' ); log( 'But `el2` did: ', '`el2: ', el2, '`' ); &lt;!-- some helpers --&gt; &lt;script src="https://rawgit.com/KooiInc/Helpers/master/Helpers-min.js"&gt;&lt…
upvote count: 2
answers question: http://stackoverflow.com/q/27647032
has comment: http://stackoverflow.com/comment/43726319
has comment: http://stackoverflow.com/comment/43712453

http://stackoverflow.com/comment/43957017
comment on: http://stackoverflow.com/a/27773079
type: AnswerComment
has text: Say if OP has 100 of these properties he would have to go create 100 function to switch between them, just saying ?
score: 0
type: Comment

http://stackoverflow.com/q/27652354
has answer: http://stackoverflow.com/a/27652431
has comment: http://stackoverflow.com/comment/43721692
score: 0
answer count: 1
has body: I'm attempting to order events in my web app by date (in this case 'start' date from my db). I'm running into issues where the dates aren't sorted properly. I believe they are sorting alphanumerically rather than by date because my 'start' field is a string. My question is, how to best convert this field to Date for proper ordering? Relevant code below: html: &lt;div ng-repeat="event in events | orderBy:'start'"&gt;{{event.city}}&lt;/div&gt; Angular Controller: angular.module('MainCtrl', []).controller('MainController', function($scope, $routeParams, Events) { // pull empty event details from API based on routeParams to get all events $scope.id = ''; Events.get($scope.id).success(function(response) { $scope.events = response; }); }); Sample database object: { "_id": { "$oid": "54978d87ac1e3caaeee8452c" }, "event": "New Years Eve - Times Square", "city": "New York", "state": "New York", "date": "December 31, 2014", "start": "December 31, 2014", "end": "January 1, 2015", "radius": "400", "team_1": "", "team_2": "", "object_id": "10897094", "longitude": "-73.9848931", "latitude": "40.7591529", "photos": [] }
has title: Angular orderBy with date string
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27652431
tagged with: datetime
type: Question
type: AnsweredQuestion
tagged with: javascript

http://stackoverflow.com/q/27698308
possible better answer: http://stackoverflow.com/a/27698397
tagged with: javascript
score: -1
has title: Ajax result as an img?
answer count: 2
has body: This script is pulling an img link, which works fine so far, but I have no Idea how to return the link as an img.. Somebody help me!
downvote count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/27698355
accepted answer: http://stackoverflow.com/a/27698355
has comment: http://stackoverflow.com/comment/43809748
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43809751
has answer: http://stackoverflow.com/a/27698397
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
upvote count: 0
type: Question

http://stackoverflow.com/comment/43821534
type: Comment
has text: check this: http://jsfiddle.net/n1p77jnw/
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27704552

http://stackoverflow.com/q/27661154
answer count: 0
has comment: http://stackoverflow.com/comment/43738242
has comment: http://stackoverflow.com/comment/43738613
type: Question
has comment: http://stackoverflow.com/comment/43738314
has body: I am trying to fill in a form in javascript , and also to simulate it as I have typed it by firing all kind of events. Here's what I have done so far : domElement.value = "123123"; fireKeyEvent(domElement); function fireKeyEvent(ele) { fireSpecificKeyEvent(ele,"keyup"); fireSpecificKeyEvent(ele,"keydown"); fireSpecificKeyEvent(ele,"keypress"); } function fireSpecificKeyEvent(ele, eventName) { try { var evObj = document.createEvent('UIEvents'); evObj.initUIEvent( eventName, true, true, window, 1 ); console.log("eleid:"+ele.getAttribute("id")); console.log("eleValue:"+ele.getAttribute("value")); ele.dispatchEvent(evObj); //evObj.keyCode = 93; ele.dispatchEvent(evObj); }catch(e) { console.log(e); } } It works fine most of the times, but sometimes it fails on some input text boxes. Are keyup , keydown , keydown enough to simulate all kinds of events. createEvent('UIEvents') is this the correct implementation, or should i use keyEvent or KeyBoardEvent. I am using chrome BTW. Can anybody show me an example of keyEvent or KeyBoardEvent, after I have already set the value using element.value EDIT: These events don't seem to fill in the form and submit at this link : link What is missing.
tagged with: javascript
has comment: http://stackoverflow.com/comment/43738212
score: 0
has comment: http://stackoverflow.com/comment/43738724
has comment: http://stackoverflow.com/comment/43738696
type: UnansweredQuestion
has title: Fire events after setting element.value

http://stackoverflow.com/comment/43792370
type: AnswerComment
has text: Check this code: `etx.forEach(function(e) { console.log(allowed.indexOf(e)) })` to check every extension from `etx` array.
type: Comment
comment on: http://stackoverflow.com/a/27685993
score: 0

http://stackoverflow.com/comment/44180909
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27802120
has text: @niven300 just remove z-index: -1 from menuBar and make a wrapper position: relative; and sideBar z-index: 998;
score: 0

http://stackoverflow.com/comment/43940102
has text: @KristofferNolgren Questions requiring just some trivial syntax fix get closed as such, because they have close to no value for future readers.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27764453
score: 1

http://stackoverflow.com/comment/43748673
score: 0
has text: Its point where is center of line, where wraps. If you look at second image, line have three points. For better example. In first picture i have only two points, and that makes one line. But i want to make two lines whose made from three points.
type: Comment
comment on: http://stackoverflow.com/q/27666781
type: QuestionComment

http://stackoverflow.com/comment/43956926
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27772723
has text: I apologize, you saw my comment before I deleted it. I got it all figured out. Once again, thanks a bunch for all the help!

http://stackoverflow.com/a/27649356
has comment: http://stackoverflow.com/comment/43716000
score: 5
has body: the postfix increment is indeed evaluated first, before the comparison, and so the preference table is correct. But the value of the postfix increment evaluation is not the incremented value, it's the value before incrementing. This is, as Adam pointed out, the intended behaviour of postfix increment.
answers question: http://stackoverflow.com/q/27649290
upvote count: 5
type: Answer
downvote count: 0

http://stackoverflow.com/comment/43896357
score: 2
comment on: http://stackoverflow.com/q/27742280
has text: @Omar : Agree. Edited my question to have only one question :)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43933524
type: AnswerComment
type: Comment
has text: I figured out how to do this, somewhat and got much further along than I was before. Thanks @Barmar and Roko for the help. :)
comment on: http://stackoverflow.com/a/27736258
score: 0

http://stackoverflow.com/comment/43999049
type: QuestionComment
score: 6
type: Comment
has text: Have you thought about using a web framework (like ASP.NET Web API)? Doing so makes things like accepting and processing POST requests almost trivially easy.
comment on: http://stackoverflow.com/q/27795056

http://stackoverflow.com/comment/43937752
score: 0
type: Comment
type: QuestionComment
has text: What's with the extra tags in xml that don't have matches
comment on: http://stackoverflow.com/q/27763295

http://stackoverflow.com/comment/43991729
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27790942
has text: @PaulG You should be checking to see if the ID belongs to an owner before returning a response anyhow.
type: QuestionComment

http://stackoverflow.com/comment/43713821
comment on: http://stackoverflow.com/a/27648136
score: 0
has text: but how to send them in a request after a sumbit or with ajax request ?
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27728909
tagged with: angularjs
type: UnansweredQuestion
has body: I am using angularjs with java tomcat i have an application that her base url is myapplication/app/index.html Everything works great when i use the # in the url When i try to switch to html 5 mode it goes crazy i added the base url meta tag but with no luck in every option i can with the entire path or with out &lt;base href="index.html" /&gt; and set up the configuration for the app as $locationProvider.html5Mode(true); nothing seems to help me any ideas ? app code : $locationProvider.html5Mode({ enabled: true, requireBase: false }); or $locationProvider.html5Mode(true); for the code base i tried every thing from &lt;base href="/" /&gt; to &lt;base href="myappname/pathtofiles/" /&gt;
upvote count: 1
has comment: http://stackoverflow.com/comment/43870160
has answer: http://stackoverflow.com/a/27729518
has comment: http://stackoverflow.com/comment/43870304
has title: angularjs html 5 mode
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/43869651
tagged with: javascript
tagged with: tomcat8
has comment: http://stackoverflow.com/comment/43870080
has comment: http://stackoverflow.com/comment/43870121
answer count: 1
score: 1
favorite count: 0

http://stackoverflow.com/q/27679900
has comment: http://stackoverflow.com/comment/43774745
tagged with: sliding
has comment: http://stackoverflow.com/comment/43774978
has comment: http://stackoverflow.com/comment/43774857
has comment: http://stackoverflow.com/comment/43774719
type: Question
has comment: http://stackoverflow.com/comment/43774623
has comment: http://stackoverflow.com/comment/43775132
has answer: http://stackoverflow.com/a/31739725
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43774522
score: 0
has comment: http://stackoverflow.com/comment/43775360
has comment: http://stackoverflow.com/comment/43775078
has comment: http://stackoverflow.com/comment/43775184
has comment: http://stackoverflow.com/comment/43774675
has comment: http://stackoverflow.com/comment/43775008
has body: I intent to create a simple layout with a fullscreen header that slides up to reveal a content area with an image grid. However it fails to even slide up when I click the trigger, and I think most likely the error occurs in my java script,http://jsfiddle.net/LwLyht51/ here's my js: &lt;script type = "text/javascript" &gt; (function() { var container = document.getElementById( 'container' ), trigger = container.querySelector( 'button.trigger' ); function toggleContent() { if( classie.has( container, 'container--open' ) ) { classie.remove( container, 'container--open' ); classie.remove( trigger, 'trigger--active' ); window.addEventListener( 'scroll', noscroll ); } else { classie.add( container, 'container--open' ); classie.add( trigger, 'trigger--active' ); window.removeEventListener( 'scroll', noscroll ); } } function noscroll() { window.scrollTo( 0, 0 ); } // reset scrolling position document.body.scrollTop = document.documentElement.scrollTop = 0; // disable scrolling window.addEventListener( 'scroll', noscroll ); trigger.addEventListener( 'click', toggleContent ); })(); &lt;/script&gt; Update of Codes of classie.js: /*! * classie - class helper functions * from bonzo https://github.com/ded/bonzo * * classie.has( elem, 'my-class' ) -&gt; true/false * classie.add( elem, 'my-new-class' ) * classie.remove( elem, 'my-unwanted-class' ) * classie.toggle( elem, 'my-class' ) */ /*jshint browser: true, strict: true, undef: true */ /*global define: false */ ( function( window ) { 'use strict'; // class helper functions from bonzo https://github.com/ded/bonzo function classReg( className ) { return new RegExp("(^|\\s+)" + className + "(\\s+|$)"); } // classList support for class management // altho to be fair, the api sucks because it won't accept multiple classes at once var hasClass, addClass, removeClass; if ( 'classList' in document.documentElement ) { hasClass = function( elem, c ) { return elem.classList.contains( c ); }; addClass = function( elem, c ) { elem.classList.…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43775452
has comment: http://stackoverflow.com/comment/43775291
has title: JS error with sliding header layout

http://stackoverflow.com/q/27749999
has comment: http://stackoverflow.com/comment/43952845
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/27762293
tagged with: nan
favorite count: 0
has title: Javascript date shows nan in ie8
linked to: http://stackoverflow.com/q/9466156
has comment: http://stackoverflow.com/comment/43933232
has comment: http://stackoverflow.com/comment/43911105
upvote count: 3
has body: The code below works well in any browser except IE8. I am taking the time from a server and trying to display date string and server hour in IE8. What I get is for the string,serverHour, is undefined undefined undefined undefined, and for the hours, testHours, I get nan. I have tried using moment.js to get the date to display but I get the same result. Any guidance would be greatly appreciated. I have tried reformatting the date string several different ways, but I am unable to find a combination that works. I must be missing something very basic. var xmlHttp; var offset = 0; var today = new Date(); /* return the standard time timezone offset regardless of whether the current time is on standard or daylight saving time. http://www.webdeveloper.com/forum/showthread.php?228309-Getting-server-date-time-with-no-server-side-script */ Date.prototype.stdTimezoneOffset = function () { var jan = new Date(this.getFullYear(), 0, 1); var jul = new Date(this.getFullYear(), 6, 1); return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset()); } /* Determine if the current time is on daylight saving time or not. We simply compare the current timezone offset with the standard one. If they are equal then the current time is standard time. If they are not then the current time is daylight saving time. This second method will return true when the current time is daylight saving time and false when it is standard time. http://www.webdeveloper.com/forum/showthread.php?228309-Getting-server-date-time-with-no-server- side-script */ Date.prototype.dst = function () { return this.getTimezoneOffset() &lt; this.stdTimezoneOffset(); } // Convert GMT server time to Pacific time and return date. function getServerTime(serverDateMs,offset) { var date = new Date(serverDateMs + offset * 3600 * 1000); return date; } // Function to get server time in GMT function srvTime() { // Create an XML object to collect information from server try { //FF, Opera, Safari, Chrome xmlHttp = new XMLHttpRequest()…
type: Question
type: AnsweredQuestion
score: 3
tagged with: internet-explorer-8
has comment: http://stackoverflow.com/comment/43935256
tagged with: javascript
has answer: http://stackoverflow.com/a/27762293
has comment: http://stackoverflow.com/comment/43911564

http://stackoverflow.com/comment/43844564
comment on: http://stackoverflow.com/q/27716274
type: Comment
type: QuestionComment
has text: Are you sure the jQuery knows it is JSON? `console.log(typeof data);` Does it show string?
score: 1

http://stackoverflow.com/q/27670401
has body: Using ES6 arrow functions with lexical this binding is great. However, I ran into an issue a moment ago using it with a typical jQuery click binding: class Game { foo() { self = this; this._pads.on('click', function() { if (self.go) { $(this).addClass('active'); } }); } } Using an arrow function instead: class Game { foo() { this._pads.on('click', () =&gt; { if (this.go) { $(this).addClass('active'); } }); } } And then $(this) gets converted to ES5 (self = this) type closure. Is a way to have Traceur ignore "$(this)" for lexical binding?
score: 172
upvote count: 172
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/75259518
has answer: http://stackoverflow.com/a/34199426
has answer: http://stackoverflow.com/a/43048380
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/57269690
tagged with: ecmascript-6
tagged with: arrow-functions
has answer: http://stackoverflow.com/a/27670450
has title: Using jQuery $(this) with ES6 Arrow Functions (lexical this binding)
downvote count: 0
has answer: http://stackoverflow.com/a/40894137
tagged with: jquery
favorite count: 0
answer count: 5

http://stackoverflow.com/q/27795730
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/76611594
has answer: http://stackoverflow.com/a/27795958
has comment: http://stackoverflow.com/comment/44000469
has answer: http://stackoverflow.com/a/30814911
has comment: http://stackoverflow.com/comment/44000247
has answer: http://stackoverflow.com/a/55847621
downvote count: 0
has body: I am using Slick for a carousel implementation and everything works fine when the pages loads.What I am trying to achieve is that when i make an Ajax call to retrieve new data I still want the slick carousel implementation, at the moment i lose it. I have put the call for slick into a function function slickCarousel() { $('.skills_section').slick({ infinite: true, slidesToShow: 3, slidesToScroll: 1 }); } and then I call the function within my success callback $.ajax({ type: 'get', url: '/public/index', dataType: 'script', data: data_send, success: function() { slickCarousel(); } }); But the function isn't being called. How can I reinitialize this js?
has answer: http://stackoverflow.com/a/42188544
has answer: http://stackoverflow.com/a/47880688
score: 33
type: Question
has answer: http://stackoverflow.com/a/47070239
has answer: http://stackoverflow.com/a/54669841
has title: Reinitialize Slick js after successful ajax call
has comment: http://stackoverflow.com/comment/44000305
tagged with: javascript
tagged with: jquery
answer count: 13
tagged with: ajax
has answer: http://stackoverflow.com/a/57107017
has answer: http://stackoverflow.com/a/30654633
has answer: http://stackoverflow.com/a/42340743
has answer: http://stackoverflow.com/a/31196164
has comment: http://stackoverflow.com/comment/44000373
tagged with: slick.js
upvote count: 33
favorite count: 0
has answer: http://stackoverflow.com/a/74644827

http://stackoverflow.com/comment/43907930
has text: Welcome to SO. If you are asking some question, it's always good to write some code, because you are increasing chance that other user will better understand and see where is the problem.Thanks.
score: 1
comment on: http://stackoverflow.com/q/27748335
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27682389
has answer: http://stackoverflow.com/a/27682834
tagged with: node.js
score: 0
answer count: 3
has body: I am trying to store string characters received from on data event to k, but it seems like k is only persistent in the .on function and not outside the function: var http = require('http'); var url = process.argv[2]; http.get(url, function(res){ k = []; res.on('data', function(data){ //console.log(data.toString()); k.push(data.toString()); console.log(k); // k stores a list string when .on is called }); console.log(k); // k is empty }); I have trouble understanding this behavior and how to fix it, any help would be appreciated.
accepted answer: http://stackoverflow.com/a/27682834
has answer: http://stackoverflow.com/a/27682816
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27682816
has title: How to maintain persistant data from event loop in nodejs?
type: AnsweredQuestion
tagged with: asynchronous
tagged with: dom-events
has answer: http://stackoverflow.com/a/27682510
type: Question

http://stackoverflow.com/comment/44004860
type: Comment
has text: Ok, I missed that. In this case we can keep track which one is selected by storing result.id in state. Let me update my response. I'm assuming that your id are unique between all radio buttons.
type: AnswerComment
comment on: http://stackoverflow.com/a/27798074
score: 0

http://stackoverflow.com/a/27803655
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44016251
has body: Using filter() will search for child elements, you want to check :first:visible on your original query. var divs = $('.test:visible:first'); You can also use JQuery filter to if you need to get all divs then call its first node [0] console.log(divs.filter(':visible')[0]); Or if you are wanting to keep the jquery selector you can use .first() console.log(divs.filter(':visible').first());
has comment: http://stackoverflow.com/comment/44016316
upvote count: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27803587
answers question: http://stackoverflow.com/q/27803587

http://stackoverflow.com/comment/43903809
has text: Well it's linking to a specific page on the site, which is causing it to refresh. I should have mentioned that earlier, my fault!
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27746057

http://stackoverflow.com/comment/43701063
has text: Yes it is very necessary. Default action is to send the data to same page your are on. Which is exactly what is happening
comment on: http://stackoverflow.com/a/27641159
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/27672014
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43758806
accepted answer: http://stackoverflow.com/a/27672093
favorite count: 0
has comment: http://stackoverflow.com/comment/43758820
has body: Sorry if this not the typical stackoverflow question. However, I believe that there is a "best-practice" answer out there and I am just to inexperienced with nodeJS to know it. I am using the pusher api to receive some data. At the moment I am saving them in mysql and displaying them via express as a table and as a graph in my browser. However, my use case is slightly different. When data arrives through the pusher api, I want update the browser view(table + graphs) of all connected clients. I read a lot about socket.io and guess the "updating the clients" browser can be accomplished by using it. However, I am struggeling with the part of notifying my application that some new data has been inserted in my database. I definitely need some form of Publish/Subscribe pattern in my app. Where the app subscribes to the database and pushes it via socket.io to the view. Any recommendation how to implement in an easy way? I appreciate your answer!
tagged with: sockets
upvote count: 1
tagged with: publish-subscribe
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27672093
score: 1
has title: Web App Architecture - PublishSubscribe Pattern with NodeJS
tagged with: mysql
type: Question

http://stackoverflow.com/comment/43722290
score: 0
comment on: http://stackoverflow.com/q/27652564
type: QuestionComment
type: Comment
has text: Are you sure `$photoid` isn't being set correctly? What do you see if you `View Source`?

http://stackoverflow.com/comment/43882147
type: Comment
comment on: http://stackoverflow.com/a/27735285
has text: Alright, and that's exactly what the splice method does - it will modify the `cData.sometimes` array in-place. After that you can pass the same `cData` instance to whatever you needed to. The only difference will be in the `someitems` array property where you would have removed the required elements. When you call `cData.someitems.splice(...)` you are not modifying the `cData` structure. You are only modifying the number of elements contained in the `someitems` array.
type: AnswerComment
score: 0

http://stackoverflow.com/q/27660957
has comment: http://stackoverflow.com/comment/43737999
has title: select pdf with fileDialog and open pdf javascript
tagged with: javascript
tagged with: jquery
upvote count: 1
tagged with: http://stackoverflow.com/tag/pdf
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43737757
type: UnansweredQuestion
answer count: 0
has body: I am trying to open a pdf file using and input type='file', and trying to open and display the selected file, when i open the file with a filedialog the browser won't let me get the full path of the file, and since the file is generated from another app the only way i have to get the path is to manually select the file. Also i need to send this pdf using angular $http and store it on database. But i can do this using formData api. i create a fiddle with what i have that is almost nothing cuz i'm really clueless on how to do this, is it possible to do it? http://jsfiddle.net/jonathanPinzonM/xy087338/ any help is greatly aprecciated code so far: Import Pdf and the angular: var soccerApp = angular.module('App', []); soccerApp.controller('MainCtrl', function ($scope) { $scope.handleFiles = function (files, tipoDeArchivo) { var file = files[0]; //can i do this with a fileReader? // var reader = new FileReader(); console.log(file); var formData = new FormData(); formData.append(file.name, file); // Send Pdf using angular $http.post // SavePdfToDatabase(formData); // Open the pdf file on a new window or an iframe or anything. //how can this be done? window.open(file); }; function onFileReadComplete(event) { $scope.ImportarArchivoDespiece(event.target.result); } });
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/comment/44061204
type: QuestionComment
has text: It worked! Thanks, please enter that as an answer so I can mark it as correct answer =)
comment on: http://stackoverflow.com/q/27801921
score: 0
type: Comment

http://stackoverflow.com/comment/43769160
type: Comment
type: QuestionComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/67793/discussion-between-katcha-and-artjom-b).
comment on: http://stackoverflow.com/q/27677236
score: 0

http://stackoverflow.com/comment/43918774
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27697747
has text: Did my solution solve your problems? Please let me know.

http://stackoverflow.com/comment/43959288
comment on: http://stackoverflow.com/q/27773983
score: 0
type: Comment
type: QuestionComment
has text: Did you see my example above, doesn't that get the text in the paragraphs ?

http://stackoverflow.com/q/27689816
answer count: 2
has body: You can send DataView through WebRTC DataChannel. Source: https://groups.google.com/forum/#!topic/discuss-webrtc/JlU2ItCJuZU This is great, because since then it isn't necessary to send always whole ArrayBuffer. But.. You can not dynamically change byteLength of DataView (and this is big surprise for me, because DataView is like a pointer to ArrayBuffer with just specialized API). So still you can't send any length of bytes, without creating new DataView each time. (terrible idea because of GC). Any ideas how to send any length of bytes through WebRTC, without creating new DataView each time?
tagged with: webrtc
tagged with: javascript
favorite count: 0
has title: WebRTC and DataView. How to send dynamic amount of bytes?
tagged with: rtcdatachannel
tagged with: typed-arrays
has answer: http://stackoverflow.com/a/28052197
score: 2
downvote count: 0
type: UnansweredQuestion
tagged with: arraybuffer
has answer: http://stackoverflow.com/a/27778545
type: Question
upvote count: 2

http://stackoverflow.com/a/42066538
has body: V1pr, I've improved your code, I think better would be to add validation error message for particular image than alert jQuery('#fileupload').bind('fileuploadadd', function (e, data) { var reader = new FileReader(); data.files.forEach(function (item, index) { reader.readAsDataURL(item); reader.data = data; reader.file = item; reader.onload = function (_file) { var image = new Image(); image.src = _file.target.result; image.file = this.file; image.data = this.data; image.onload = function () { var w = this.width, h = this.height, n = this.file.name; if (w &lt; 800 || h &lt; 600) { data.files.error = true; item.error = "image must be at least 800x600"; var error = item.error; $(data.context[index]).find(".error").text(error); } }; }; }); });
answers question: http://stackoverflow.com/q/27781312
type: Answer
score: 0

http://stackoverflow.com/comment/43979678
score: 0
type: Comment
type: QuestionComment
has text: Change your ` ` to ` `
comment on: http://stackoverflow.com/q/27784547

http://stackoverflow.com/a/27679953
accepted answer of: http://stackoverflow.com/q/27679803
answers question: http://stackoverflow.com/q/27679803
has comment: http://stackoverflow.com/comment/43774809
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/43774729
type: Answer
has comment: http://stackoverflow.com/comment/43774617
has body: The problem is that you have a mistake in your code: private Set&lt;BranchAddress&gt; customerAddresses; it must be: private Set&lt;CustomerAddress&gt; customerAddresses;

http://stackoverflow.com/q/27757172
tagged with: underscore.js
score: 1
has title: Amend results from two collections into an array using _.each()
has comment: http://stackoverflow.com/comment/43927129
has comment: http://stackoverflow.com/comment/43927262
tagged with: mongodb
answer count: 1
tagged with: arrays
downvote count: 0
tagged with: mongoose
tagged with: javascript
has comment: http://stackoverflow.com/comment/43925159
has comment: http://stackoverflow.com/comment/43927235
favorite count: 0
has answer: http://stackoverflow.com/a/28215361
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43927169
has comment: http://stackoverflow.com/comment/43925232
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43925098
has body: My goal: Call an API and inside this API I would like to: Find Bills Find all transactions under each bill (by billId) Return the values in a JSON ARRAY The bill array look like this: { _id: 549bf0597886c3763e000001, billName: 'Leasing', startDate: Thu Dec 25 2014 01:00:00 GMT+0100 (CET), endDate: Sun Oct 15 2017 00:00:00 GMT+0200 (CEST), amount: 16500, type: 4, timestamp: Thu Dec 25 2014 12:09:13 GMT+0100 (CET), __v: 0 }, { _id: 54a014bfac01ca3526000001, billName: 'Test', startDate: Tue Oct 28 2014 01:00:00 GMT+0100 (CET), endDate: Wed Dec 20 2017 00:00:00 GMT+0100 (CET), amount: 1000, type: 4, timestamp: Sun Dec 28 2014 15:33:35 GMT+0100 (CET), __v: 0 } From this array, which I get in the step 1, I would like to query the transactions collections and get each transaction for each bill. The array would have the following transformation: From: { _id: 549bf0597886c3763e000001, billName: 'Leasing', startDate: Thu Dec 25 2014 01:00:00 GMT+0100 (CET), endDate: Sun Oct 15 2017 00:00:00 GMT+0200 (CEST), amount: 16500, type: 4, timestamp: Thu Dec 25 2014 12:09:13 GMT+0100 (CET), __v: 0 }, { _id: 54a014bfac01ca3526000001, billName: 'Test', startDate: Tue Oct 28 2014 01:00:00 GMT+0100 (CET), endDate: Wed Dec 20 2017 00:00:00 GMT+0100 (CET), amount: 1000, type: 4, timestamp: Sun Dec 28 2014 15:33:35 GMT+0100 (CET), __v: 0 } To: { _id: 549bf0597886c3763e000001, billName: 'Leasing', startDate: Thu Dec 25 2014 01:00:00 GMT+0100 (CET), endDate: Sun Oct 15 2017 00:00:00 GMT+0200 (CEST), amount: 16500, type: 4, timestamp: Thu Dec 25 2014 12:09:13 GMT+0100 (CET), __v: 0 , transactions: { { "_id" : ObjectId("549ea8c957b654ef64000003"), "billId" : "5499aece1d7be6c6a3000001", "paymentDate" : ISODate("2014-12-27T12:40:41.311+0000"), "amount" : NumberInt(2400), "timestamp" : ISODate("2014-12-27T12:40:41.311+0000"), "__v" : NumberInt(0) } { "_id" : ObjectId("549ea9446163b3c666000001"), "billId" : "5499aece1d7be6c6a3000001", "paymentDate" : ISODate("2014-12-27T12:42:44.975+0000"), "amount"…
has comment: http://stackoverflow.com/comment/43927255

http://stackoverflow.com/comment/44003772
comment on: http://stackoverflow.com/q/27797150
type: Comment
type: QuestionComment
has text: I'm sorry, but I don't think the question makes sense (at least not without more information). `watchedvalue` is "not changing" almost all of the time, so if you rebuilt the DOM every time it didn't change, you would never stop updating the DOM. Can you give a more clear explanation of _when_ you want to rebuild the DOM?
score: 2

http://stackoverflow.com/comment/43792955
has text: Instead of firing a separate AJAX request for each question, send all of them in a single request. Then the `success` function can process all the results and display what you want.
type: AnswerComment
comment on: http://stackoverflow.com/a/27689607
score: 0
type: Comment

http://stackoverflow.com/comment/43950859
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27769958
has text: Infinite loop I think, anyway, almost crashed my browser :) same iterating variable may not be a good idea
score: 0

http://stackoverflow.com/a/27706093
accepted answer of: http://stackoverflow.com/q/27705977
answers question: http://stackoverflow.com/q/27705977
type: Answer
has comment: http://stackoverflow.com/comment/43824177
score: 8
downvote count: 0
upvote count: 8
has body: Don't set the canvas's size through CSS, that stretches the canvas element, instead of actually making the canvas larger. Use HTML attributes, instead: &lt;canvas id="canvas" width="500" height="500"&gt;&lt;/canvas&gt; Now, since you want to set the canvas to 100% width / height, those pre-set attributes aren't going to do the trick for you, you're going to have to use some JS: var canvas = document.getElementById("canvas"); canvas.width = window.innerWidth; canvas.height = window.innerHeight; var ctx=canvas.getContext("2d"); // etc... If you want to have the canvas resize when the window gets resized, I'd suggest you look at this answer.
type: AcceptedAnswer

http://stackoverflow.com/a/27652431
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/43721850
downvote count: 0
has comment: http://stackoverflow.com/comment/65888066
accepted answer of: http://stackoverflow.com/q/27652354
has comment: http://stackoverflow.com/comment/67291712
answers question: http://stackoverflow.com/q/27652354
type: AcceptedAnswer
has body: Turned out to be a very simple solution. I simply added the following code to my controller inside my Events.get: for (var i = 0, max = response.length; i &lt; max; i++) { $scope.events[i].start = new Date(response[i].start); }
upvote count: 2

http://stackoverflow.com/comment/43949926
type: QuestionComment
score: 1
has text: Do you have a `@ResponseBody` on your Spring MVC controller method?
type: Comment
comment on: http://stackoverflow.com/q/27769535

http://stackoverflow.com/q/27680292
has answer: http://stackoverflow.com/a/27680358
tagged with: http://stackoverflow.com/tag/html
has title: jQuery drop zone effect
type: AnsweredQuestion
score: 1
has body: I'm trying to make so when you drag a file into the browser a drop zone will appear and when you leave the browser (or drop the file) that drop zone effect will disappear. However, it seems that the dragover and dragleave events are not firing as I want, because when you drag a file into the browser that drop zone will keep showing and hiding forever. JSFiddle http://jsfiddle.net/3vxgtkr0/ HTML: Drop files to upload JS: var dropZone = $(document); var dropWindow = $('.drop-window'); function onDragOver (e) { dropWindow.show(); } function onDragEnter (e) { } function onDragLeave (e) { dropWindow.hide(); } function onDrop (e) { e.preventDefault(); } dropZone.on('dragover', onDragOver); dropZone.on('dragenter', onDragEnter); dropZone.on('dragleave', onDragLeave); dropZone.on('drop', onDrop);
possible better answer: http://stackoverflow.com/a/65269994
upvote count: 1
has answer: http://stackoverflow.com/a/65269994
type: Question
accepted answer: http://stackoverflow.com/a/27680358
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/43737762
type: Comment
has text: You could use decorators with 1.2.18 as well. What's wrong?
score: 1
comment on: http://stackoverflow.com/q/27661001
type: QuestionComment

http://stackoverflow.com/comment/43828345
type: AnswerComment
has text: Thanks a ton for your patience and help. Yah, understood the concept now. But how to send my json request parameters and get that download accordingly...?
type: Comment
comment on: http://stackoverflow.com/a/27707875
score: 0

http://stackoverflow.com/comment/43839962
type: AnswerComment
type: Comment
has text: @plainvanilla: `[tag['content'] for tag in soup.find_all(itemprop='datePublished')]` gets you a list of all those dates.
comment on: http://stackoverflow.com/a/27713156
score: 0

http://stackoverflow.com/q/27747243
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43905975
type: Question
tagged with: c#
has body: I have used bootstrap modal which i will show when click a button.. That modal has form elements.. When it is all filled and submitted, it would hit the service and bring the response status. If the Response status is success, modal can be hide, otherwise it should stay as it is.. × Issue Book Book Reference Number: Close Move to Selected Book // mvSelectedBook() function given below // On this function, the above modal will show $(document).on("click", ".modalClick", function (e) { if (document.getElementById("txtERPNo").value != "") { $('#mdlRefId').modal('show'); } else { $('#mdlRefId').modal('hide'); alertify.error("Please enter ERP number").dismissOthers(); } }); function mvSelectedBook() { // here ajax call performed and get response from the server side if (BookObj.Status != "SUCCESS") { if (document.getElementById("hdnBookRefIds").value == "") document.getElementById("hdnBookRefIds").value = BookObj.BookRefId; else document.getElementById("hdnBookRefIds").value += ',' + BookObj.BookRefId; populateSelectedBooks(); } else { $('#mdlRefId').modal('show'); // This is not working now } } When clicking the button, this script $('#mdlRefId').modal('show'); works and show the modal dialog.. But while getting response, it is not stay as it as when calling this script.. Thanks in advance
has comment: http://stackoverflow.com/comment/45495337
tagged with: javascript
tagged with: jquery
score: 0
has title: When Validation failed, How to keep the Bootstrap modal to stay as it is?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43905954
has comment: http://stackoverflow.com/comment/43906090
answer count: 0
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/43745545
has text: I'm trying it, no luck
comment on: http://stackoverflow.com/q/27664894
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43960398
comment on: http://stackoverflow.com/q/27774717
has text: try setting the options properly. read the ajax docs
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27662608
has comment: http://stackoverflow.com/comment/43741087
type: Question
has title: global variable with window object is undefined all time
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27662643
has body: I have 2 js files in my project first.js: (function () { "use strict"; function konumBul() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(konumGoster, konumHata, {enableHighAccuracy: true}); } else { alert("Geolocation is not supported by this browser."); } } function konumGoster(position) { //merkez koordinatları window.merkez = L.latLng(position.coords.latitude, position.coords.longitude); } konumBul(); }()); second.js: (function () { "use strict"; alert(window.merkez); //undefined alert(merkez) //undefned }()); How can i reach "merkez" variable in second.js? Why the way i used isn't working? EDIT: I wrote missing sorry about that. I called someFunction() in first.js file
score: 0
has answer: http://stackoverflow.com/a/27662664
answer count: 3
possible better answer: http://stackoverflow.com/a/27662664
has answer: http://stackoverflow.com/a/27662798
has answer: http://stackoverflow.com/a/27662643
type: AnsweredQuestion

http://stackoverflow.com/a/27660330
upvote count: 4
accepted answer of: http://stackoverflow.com/q/27660272
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43736452
type: Answer
has body: by simply using the right selector $('#icon-blue').mouseleave demo $('#icon-blue').hide(); $('#icon-black').mouseenter(function () { $('#icon-black').hide(); $('#icon-blue').show(); }); $('#icon-blue').mouseleave(function () { // the #icon blue!!! $('#icon-black').show(); $('#icon-blue').hide(); }); Also note that what you need can be done in pure CSS In either cases it's easier to write JS and CSS for such things if you wrap your icons inside a common parent element -- cause than, all you need is to target :hover or in jQ .hover() that parent.
answers question: http://stackoverflow.com/q/27660272
score: 4

http://stackoverflow.com/q/27753849
answer count: 1
has comment: http://stackoverflow.com/comment/43918605
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43918606
has answer: http://stackoverflow.com/a/27753992
tagged with: css
type: Question
has title: Sticky Menu Assistance
has comment: http://stackoverflow.com/comment/43918562
tagged with: javascript
has body: I need help with creating a sticky menu (attaches upon scroll). I need it to attach when I scroll down towards the end of the page! I believe I require help with script here. Here's the code: Home Forum Store Vote Staff Minelands Here's the live menu: http://www.minelandsmc.enjin.com Kind regards, Jleeto
score: 0

http://stackoverflow.com/a/27682798
downvote count: 0
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27673544
has body: The main issue was the path. Since Apache was only proxying the /CAH/. . . path. The trouble with io.connect("http://72.53.66.228/CAH"); was that socket.io does a 'cleaver' trick where it interpreted /CAH as the room rather than as the path. The solution is to set the path option thusly: io.connect({path:'/CAH/socket.io'}) which causes the socket.io client to connect to the correct urls.
answers question: http://stackoverflow.com/q/27673544
type: AcceptedAnswer

http://stackoverflow.com/comment/43704940
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27643091
has text: Yes, you should use `data-page`and yes, there is a way to do this without reloading the page, if the link is `home` you add a filter, see the documentation for jQuery's `load` on how to add a selector as a filter for the content etc.

http://stackoverflow.com/comment/43889452
type: AnswerComment
comment on: http://stackoverflow.com/a/27736822
has text: I understand your problem but I can't give you any ideal because I don't know your system. I think you should review flow, logic and code.
score: 0
type: Comment

http://stackoverflow.com/comment/43991854
comment on: http://stackoverflow.com/q/27791034
score: 0
type: Comment
type: QuestionComment
has text: You have 2 elements with the id - last

http://stackoverflow.com/comment/43956224
has text: Yes, and the UI is working after calling `someFunction()` (which doesn't actually do anything). The call to `updateName()` is probably happening outside the angular event cycle, so the changes aren't being seen until the next call to $apply (which would happen when the button is clicked an ng-click is run)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27772620
score: 0

http://stackoverflow.com/a/27791585
has comment: http://stackoverflow.com/comment/43992909
type: Answer
answers question: http://stackoverflow.com/q/27791429
has body: This has nothing to do with parent/child object instantiation. It has everything to do with hoisting. All declarations in JavaScript are hoisted. Remember that variable declaration and variable definition are two separate things. For example, we can declare a variable x using var x. We define x using x = someValue. We can combine variable declaration and variable definition into a single construct as var x = someValue. However we are still declaring the variable and then defining it. As I said all declarations in JavaScript are hoisted (i.e. they are lifted to the top of the function scope that they are declared in). For example, consider: alert(x); // declared but not defined (undefined) var x = null; alert(x); // declared and defined (null) Here the variable declaration var x has been hoisted to the top of the scope. Variables that have been declared but have not been defined have the value undefined by default. Compare the above code with: try { alert(x); x = null; alert(x); } catch(e) { alert(e); // ReferenceError: x is not defined } Here we have not declared x. Hence x is not hoisted. Thus when we try to print the value of x we get a ReferenceError. Note that it is not undefined because we haven't even declared it. What's happening in your code Now let's consider your code: var parent = { child: { field1: "value1", field2: "value2" }, someOtherField: parent.child.field1 // =&gt; Error someOtherField: this.child.field1 // =&gt; Error }; This is the same as: var parent; // hoisted; undefined parent = { child: { field1: "value1", field2: "value2" }, someOtherField: parent.child.field1 // =&gt; Error someOtherField: this.child.field1 // =&gt; Error }; Before defining parent, it is undefined. Hence parent.child.field1 is undefined.child.field1 which is an error. Also this does not point to the object literal. Your mistake is that parent is not defined until after the object literal has been assigned to the variable (which is after parent.child.field1 is evaluated). …
score: 0

http://stackoverflow.com/comment/43899551
has text: Auto-promise unwrapping feature used to be available with http promise earlier. Later it got deprecated (1.2.x) and you could only turn it off by doing `.config(function ($parseProvider) { $parseProvider.unwrapPromises(true); });`. With the newer version this feature is completely removed. Try your luch with the version of angular you are using. [See here for more details](https://github.com/angular/angular.js/commit/fa6e411da26824a5bae55f37ce7dbb859653276d). However right way would be to chain through the promise itself. Another way is to use resolve in your route.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27742763
score: 0

http://stackoverflow.com/comment/44184837
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27673293
has text: Yes, it works when you set asDropDownList to false, but I wanted to use it as DropDownList. Never mind, I use it in tagging mode now and it is ok:-) How did you switched to hidden input?

http://stackoverflow.com/comment/43781193
type: Comment
comment on: http://stackoverflow.com/a/27683052
score: 0
type: AnswerComment
has text: php.ini: `upload_max_filesize = 64M`

http://stackoverflow.com/q/27772542
type: UnansweredQuestion
has body: I have a select element with multiple optgroups, where it is possible for options in different optgroups to have the same value. For example (see the 'Apple' and 'Potato' options): Apple Pear Banana Potato Cabbage Bean With a plain select, attempting to find the selected option with jQuery yields the correct result. $('#food_select').find(:selected) However, when select2 is applied, and 'Potato' is selected, $('#food_select').find(:selected) returns the 'Apple' option, which is the first option with the value of '1'. All other selected options work correctly, so it seems select2 is not handling the duplicate values correctly. I've created a JSFiddle demonstrating this behaviour, at: http://jsfiddle.net/e57m9cax/. Is there a workaround or fix for this behaviour? I could split this into two separate select elements, but would rather not for UX reasons. Any direction would be appreciated. Thanks.
has comment: http://stackoverflow.com/comment/55505957
tagged with: jquery
tagged with: optgroup
tagged with: jquery-select2
type: Question
has title: select2 - incorrect selected option returned if multiple options share a value
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27773022
tagged with: select2-rails
tagged with: javascript

http://stackoverflow.com/comment/43793844
comment on: http://stackoverflow.com/q/27690267
score: 1
has text: FYI, `innerText` isn't available on all browsers.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27776801
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/44072588
has comment: http://stackoverflow.com/comment/44071876
answers question: http://stackoverflow.com/q/27774998
has body: Along with the headers, I think you need to add the crossorigin attribute to your image tag. Example image tag: &lt;img src="www.domain.com/image.jpg" crossorigin="anonymous" /&gt; If you are doing this via javascript, here is the code example in the Mozilla link you provided: var img = new Image, canvas = document.createElement("canvas"), ctx = canvas.getContext("2d"), src = "http://example.com/image"; // insert image url here // Notice that they set the cross origin attribute here img.crossOrigin = "Anonymous"; Here is elevant passage from the docs (Source: https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image): The HTML specification introduces a crossorigin attribute for images that, in combination with an appropriate CORS header, allows images defined by the element loaded from foreign origins to be used in canvas as if they were being loaded from the current origin. And also this passage may be helpful from this page (https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes): By default (that is, when the attribute is not specified), CORS is not used at all. The "anonymous" keyword means that there will be no exchange of user credentials via cookies, client-side SSL certificates or HTTP authentication as described in the Terminology section of the CORS specification.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27774998
has comment: http://stackoverflow.com/comment/44074074
type: Answer

http://stackoverflow.com/comment/43813924
type: Comment
type: QuestionComment
has text: WHere is the emulator console?
comment on: http://stackoverflow.com/q/27700435
score: 0

http://stackoverflow.com/a/27685589
has comment: http://stackoverflow.com/comment/43785245
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/43785464
has comment: http://stackoverflow.com/comment/43785068
score: 7
has body: ng-include directive create a new child scope. here is the DOC when your model in ng-include html as &lt;select ng-model="list" ng-change="changeInsideTemplate()"&gt; then angular will check for a model list in its child scope, then angular will realize there is no model called list in ng-include child scope. then angular will create a new child scope model called list inside of child scope. if u do like &lt;select ng-model="$parent.list" ng-change="changeInsideTemplate()"&gt; then angular will check model list in parent scope. in the parent scope of ng-include scope contains $scope.list which we are concern. here is the working Plunker OR you can use like below as @dfsq suggested in the comment. controller app.controller('MainCtrl', function($scope) { $scope.name = 'World'; $scope.test = "test.html"; $scope.list = {value: 'a'}; $scope.changeInsideTemplate = function() { console.log($scope.list.value); //always returns 'a' } $scope.changeOutsideTemplate = function() { console.log($scope.list.value); //this is the correct way } }); index.html &lt;select ng-model="list.value" ng-change="changeOutsideTemplate()"&gt; test.html &lt;select ng-model="list.value" ng-change="changeInsideTemplate()"&gt; in test.html angular will check for list.value then angular will know value is a property of a object and there is no object called list with in the child scope. then angular will search the object(list) in parent scope like it will search entire hierarchy. here is the Plunker if you have ng-include inside ng-include then second ng-include create a child scope on first ng-include then in test.html &lt;div ng-include="$parent.include"&gt;&lt;/div&gt; // because `$scope.include` in parent scope and in include.html &lt;select ng-model="$parent.$parent.list" ng-change="otherChanging()"&gt; // because `$scope.list` is in parent scope of parent scope (second upper parent scope). here is the Plunker using $parent. here is the Plunker using Object. using object more suitable.
accepted answer of: http://stackoverflow.com/q/27685497
has comment: http://stackoverflow.com/comment/43785180
has comment: http://stackoverflow.com/comment/43785369
answers question: http://stackoverflow.com/q/27685497
upvote count: 7
type: AcceptedAnswer

http://stackoverflow.com/comment/43841241
has text: the "this" your function is referring to the window.
type: Comment
comment on: http://stackoverflow.com/q/27714549
score: 0
type: QuestionComment

http://stackoverflow.com/q/27795321
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27803097
type: Question
has title: Node.js Plumbing my modules together without it becoming a mess
answer count: 1
tagged with: javascript
favorite count: 0
score: 1
upvote count: 2
has body: A simple question really. I have tried to keep my node.js application split out in to relevant modules dependent on features or functionality. E.g. logreading module for reading a log file, IRC module for working with an IRC bot etc. I currently tie everything together using a global event emitter module which does all the plumbing of any messages that need to be passed, such as log entries that I want to push in to my DB. This has been working fine for a while now but I'm getting to the point where it feels as though I will need to start requiring some of my functional modules in order to complete some of the work in others. I wanted to keep away from tightly coupling (hence the event module), but is there really anything bad with that? When reviewing a few other node.js projects I often see a single app.js file with 10 or so other modules being required in which look to be trying to do everything in one place. I am trying to keep mine pretty light and easy to read. Are there any examples of this being done well that you can think of?
has answer: http://stackoverflow.com/a/27803097
downvote count: 1

http://stackoverflow.com/comment/59422126
comment on: http://stackoverflow.com/a/27821586
has text: Do you have a full working example? I've modified the MediaRecorder WebRTC sample to use MediaSource as per your code above, but it's not working. In firefox addSourceBuffer gives the error "operation not supported" (because WebM media sources aren't supported by default). In chrome it just displays one frame of video.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27684055
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27680301
type: Answer
answers question: http://stackoverflow.com/q/27680301
score: 2
has body: Please replace the code wp_enqueue_script( 'skrollr_js', get_template_directory_uri() . '/js/skrollr.min.js', array(), '1.0.0', true ); wp_enqueue_script( 'myscript_js', get_template_directory_uri().'/js/myscript.js', array(), '1.0.0', true); with if ( !wp_is_mobile() ) { wp_enqueue_script( 'skrollr_js', get_template_directory_uri() . '/js/skrollr.min.js', array(), '1.0.0', true ); wp_enqueue_script( 'myscript_js', get_template_directory_uri().'/js/myscript.js', array(), '1.0.0', true); } This will solve your problem.
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/43774260
comment on: http://stackoverflow.com/q/27679534
type: QuestionComment
has text: @MichaelLiu - it does do that if the `diff` setting isn't specific enough to give a difference, but there still is a difference, but the zero still means there's no difference in the comparison you're doing with `diff`. In other words, it's being used wrongly, and if you just need to check if one date comes before the other, you'd do `moment(a).unix() > moment(b).unix()`, not use `diff` at all.
type: Comment
score: 0

http://stackoverflow.com/comment/43960934
type: QuestionComment
comment on: http://stackoverflow.com/q/27770839
has text: IsDocumentEdit wasn't actually returned by the API - it's something I wanted to add to the data.
score: 0
type: Comment

http://stackoverflow.com/q/27670798
has title: Getting JSON from Form
has comment: http://stackoverflow.com/comment/43756570
score: 1
has comment: http://stackoverflow.com/comment/43757344
tagged with: http://stackoverflow.com/tag/json
has body: I am using the following function for converting the form code to JSON, it is pretty much and works awesome $.fn.serializeObject = function() { var o = {}; var a = this.serializeArray(); $.each(a, function() { if (o[this.name]) { if (!o[this.name].push) { o[this.name] = [o[this.name]]; } o[this.name].push(this.value || ''); } else { o[this.name] = this.value || ''; } }); return o; }; Now it gives me results as: [if form fields have different names] and form field names as direction1,direction2,direction3 {direction1: "abc", direction2: "xyz", direction3: "def"} if they have same name say address of all form fields : it combines them as: Object {address: Array[3]} address: Array[3] 0: "dfddf" 1: "dfdfdf" 2: "fewwewe"length: 3 which is correct I am trying to get the results as: {"address": "abc"}, {"address": "xyz"}, {"address": "def"} how can i make this change
has comment: http://stackoverflow.com/comment/43756362
tagged with: forms
type: Question
accepted answer: http://stackoverflow.com/a/27671685
answer count: 2
has comment: http://stackoverflow.com/comment/43756799
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43757200
has answer: http://stackoverflow.com/a/27671058
has comment: http://stackoverflow.com/comment/43757168
favorite count: 0
has answer: http://stackoverflow.com/a/27671685
possible better answer: http://stackoverflow.com/a/27671058
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/a/27652529
downvote count: 0
has body: The groupBy family of operators does not work for the reasons you have already discovered. You want flatMapLatest: var count = inputs.flatMapLatest(function (input) { // some code that returns an // Rx observable that will eventually // return the count return rxQueryForCount(input.filter); }); count.subscribe(...); You'd write something similar to return the page of data. Edit: if you want to synchronise the results of your 2 queries, then you do something like this: var count = inputs .distinctUntilChanged(null, function (a, b) { // however you decide if your filters have changed... return a.filter === b.filter; }) .flatMapLatest(function (input) { // some code that returns an // Rx observable that will eventually // return the count return rxQueryForCount(input.filter) .startWith(undefined); }); var data = inputs .flatMapLatest(function (input) { return rxQueryForData(input.filter, input.index) .startWith(undefined); }); var results = Rx.Observable .combineLatest(count, data, function (c, d) { if (c === undefined || d === undefined) { return undefined; } return { count: c, data: d }; }); results will be undefined whenever the queries are re-running and will only ever take a value when both queries have updated results. You can use that in your UI logic, or even just add a where clause to filter out undefined values.
type: Answer
answers question: http://stackoverflow.com/q/27641453
accepted answer of: http://stackoverflow.com/q/27641453
has comment: http://stackoverflow.com/comment/43726581
score: 4
upvote count: 4
type: AcceptedAnswer

http://stackoverflow.com/a/27653971
type: Answer
has body: you need to load a.js before you call the function
downvote count: 1
has comment: http://stackoverflow.com/comment/43726628
answers question: http://stackoverflow.com/q/27653657
score: -1
upvote count: 0

http://stackoverflow.com/comment/43780540
comment on: http://stackoverflow.com/q/27682880
has text: @Mouser posted my html
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43704673
score: 0
type: Comment
type: QuestionComment
has text: If nothing ever gets printed in the console, you either have errors, the function never runs, or the page reloads without you noticing.
comment on: http://stackoverflow.com/q/27643049

http://stackoverflow.com/q/27669590
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/45516523
favorite count: 0
tagged with: google-chrome-extension
tagged with: permissions
has comment: http://stackoverflow.com/comment/43851903
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43763449
has body: In a Chrome Extension I want to ask the user for full access to pages through a browser_action's popup's link (aka a toolbar popup with a link). When the user clicks the link, I get this error: runtime.lastError while running permissions.request: This function must be called during a user gesture Yet the user actually clicked the link and the 'user gesture'. Any ideas of how to debug what is considered a user gesture? On the button click, I request full access via chrome's chrome.permissions.request api: $('#button-requestpermissions').click(function(){ requestAmbientPermission(function(granted) { if (granted) { // code never reached as granted === false } }); }); function requestAmbientPermission(callback){ // Permissions must be requested from inside a user gesture, like a button's click handler. chrome.permissions.request({ permissions: ['activeTab'], origins: ['&lt;all_urls&gt;'] }, callback); } The manifest has optional permissions set like so: "permissions": [ "https://www.meethue.com/", "https://colorlovers.herokuapp.com/" ], "optional_permissions": [ "activeTab", "&lt;all_urls&gt;" ],
has answer: http://stackoverflow.com/a/69404071
score: 3
has title: Chrome extension: function must be called during a user gesture
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43760454

http://stackoverflow.com/comment/43741537
type: AnswerComment
comment on: http://stackoverflow.com/a/27661192
type: Comment
has text: How can I make the x's and y's never repeat?
score: 0

http://stackoverflow.com/q/27646351
type: Question
tagged with: google-maps
has answer: http://stackoverflow.com/a/27648345
score: -2
tagged with: javascript
tagged with: jquery
tagged with: google-maps-api-3
answer count: 1
has title: Animate google map markers
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has body: I want to do achieve something like this animation Here when the user clicks/ hovers over any place in the list, the corresponding place is highlighted on the map in an animated fashion. How can i achieve this ? I did some Google but could not find any documentation for it. Can anyone suggest some useful resource or links?
downvote count: 3

http://stackoverflow.com/q/27660781
has body: When you click on the composite field, a fly-out with individual fields will open for you to start filling in the individual fields. Clicking “Done” button on the fly-out or losing focus of the fly-out will apply the changes and then refresh the composite control value. Here's the underlying HTML of the Pop Out: Street 1 111 New Street Street 2 -- Street 3 -- City New Haven State/Province <div tabindex="1220" title="Select to enter data" class="ms-crm-Inline-Chrome nvarchar" id="address1_composite_compositionLinkControl_address1_stateorprovince" aria-describedby="address1_composite_compositionLinkControl_address1_stateorprovince_c" data-layout="0" data-fdeid="PrimaryEntity" data-formid="8448b78f-8f42-454e-8e2a-f8196b0419af" data-attributename="address1_stateorprovince" data-initialized="true"> -- ZIP/Postal Code 06515 Country/Region -- When I programmatically update these individual fields (Street1, 2, 3, City, State etc) This does NOT update the composite field (Address Type), unless I click on it and click away from it: Here's a presentation of what happens: http://screencast.com/t/con2aNNWY How do I force an update on the composite address field? Thank you so much for any insight into this matter.
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
answer count: 1
favorite count: 0
has title: How to refresh data in a composite field
type: UnansweredQuestion
tagged with: dynamics-crm
upvote count: 0
has answer: http://stackoverflow.com/a/27661242
tagged with: dom
type: Question
tagged with: javascript
score: -1
tagged with: ajax

http://stackoverflow.com/q/27672765
type: Question
tagged with: api
downvote count: 0
tagged with: javascript
tagged with: stripe-payments
favorite count: 0
tagged with: ruby
has comment: http://stackoverflow.com/comment/43764577
answer count: 0
upvote count: 2
type: UnansweredQuestion
has body: I am using Stripe for my Rails application with setup taken from Railscasts. It's working perfectly in the development mode; on production when I set up the proper credit card information (credit card number, CVC and expiration date), the amount is successfully taken from the given credit card and the required subscription is created. But the problem is when I put into the form incorrect information and hit the "PAY" button for sending the form, it looks like the entered information are not "checked" through the Stripe API with using Javascript, but the whole form is sent out in a "usual way" (the whole page is redirected) and it ends up with showing an error message Your card number is incorrect.. Why this is not handled by Stripe (it's working in the development mode)? When I check the code, it shows that the problem is here: # subscription.rb def save_with_payment(coupon_id) if valid? ... customer = Stripe::Customer.create(description: description, email: email, plan: plan.plan_code, card: stripe_card_token, trial_end: 'now') ... But how is possible algorithm went into the valid branch if the given CVC code/expiration date is wrong? Shouldn't this be handled by Stripe's JS API? I am on this problem the whole Saturday, but still don't have an explanation for it. Thank you in advance for your time.
tagged with: ruby-on-rails
score: 2
has title: Stripe doesn't verify credit card information on production

http://stackoverflow.com/a/27667969
score: 2
upvote count: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27667921
type: Answer
answers question: http://stackoverflow.com/q/27667921
has body: Just cache the element in a variable and use it var elm = $('[data-image]'); // cache it elm.css({ background: "url("+ elm.data('image') +") no-repeat center", // use it backgroundSize: "cover", height: ($(document).height()/ 3) }); If there are more elements, you could use each elm.each(function(){ $(this).css({ background: "url("+ $(this).data('image')+ ") no-repeat center", backgroundSize: "cover", height: ($(document).height()/ 3) }); });

http://stackoverflow.com/q/27760375
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/27663149
has comment: http://stackoverflow.com/comment/43933352
has answer: http://stackoverflow.com/a/27762203
has title: AngularJS: Access event inside custom directive using element.bind('input')
linked to: http://stackoverflow.com/q/6458840
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/27762203
type: AnsweredQuestion
type: Question
score: 0
has comment: http://stackoverflow.com/comment/43934452
has body: I had to write a custom directive because I need access to user input while composing Korean characters. As explained in another post, I can't use keydown or keypress because they don't get triggered at the right time when composing Korean characters. element.bind('input') does the trick but now I face another problem. How can I access the event inside the element.bind callback to exit/return if the enter key has been hit? HTML &lt;input cst-input="quizzesCtrl.checkAnswer(answer)" name="answer" id="answer" ng-model="quizzesCtrl.answer" type="text" /&gt; Directive .directive('cstInput', function() { return { restrict: 'A', require: '^ngModel', link: function (scope, element, attrs, ngModel) { element.bind('input', function(event) { if (event.which === 13) { return; } // can't access the event unless I bind to keypress etc scope.$apply(function(){ scope.ngModel = element.val(); scope.$eval(attrs.cstInput, {'answer': scope.ngModel}); }); }); } }; })
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/43980944
type: Comment
comment on: http://stackoverflow.com/q/27781625
type: QuestionComment
has text: Is your code bound to a spreadsheet, or run as a Stand Alone App? And how do you ultimately want to trigger the code to run?
score: 0

http://stackoverflow.com/q/27712313
answer count: 0
has comment: http://stackoverflow.com/comment/43838648
type: UnansweredQuestion
tagged with: iframe
has comment: http://stackoverflow.com/comment/43838430
has comment: http://stackoverflow.com/comment/43837745
tagged with: pdf-generation
type: Question
has title: Possible to add javascript to a PDF to communicate with a parent window?
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43837372
tagged with: http://stackoverflow.com/tag/pdf
has comment: http://stackoverflow.com/comment/43836768
has comment: http://stackoverflow.com/comment/43836982
has body: I am currently trying to find a way so that whenever a Link is selected in a specific PDF file to be able to know which URL it points to and do something based on the selection. I've looked online for pdf libraries such as Adobe Acrobat SDK and the Docotic.Pdf Library by bitmiracle, but haven't been able to find a solution to this. Can a PDF document opened in lets say, an Iframe inside an HTML window, communicate with functions defined in the HTML window? In my case I am not constructing the initial PDF using any pdf creator. My pdf is being converted from a word document and then would be opened using some pdf viewers or similar tools.

http://stackoverflow.com/q/27644901
favorite count: 0
has body: &lt;?php $javascript = &lt;&lt;&lt;EOT &lt;script type="text/javascript"&gt; function test () { return 'test test test \n test test test'; } &lt;/script&gt; EOT; echo $javascript; ?&gt; The \n above is parsed as newline by PHP, generates HTML source like the following return 'test test test test test test'; and this results in a JavaScript syntax error: unterminated string literal. I have a big chunk of JavaScript code, so I don't want to wrap them like $javascript = "&lt;script type=\"text/javascript\"&gt;\nfunction test()...\n"; and actually the JavaScript code is not directly echo'd to the page, it is passed to another function, this is why I need a PHP variable. So how can I define a PHP variable that contains a big chunk of JavaScript code whitout causing problems? Is there a way like if / endif? &lt;?php if (condition): ?&gt; html code... &lt;?php endif ?&gt;
tagged with: php
has comment: http://stackoverflow.com/comment/43708866
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/30571006
has comment: http://stackoverflow.com/comment/43708330
tagged with: heredoc
has comment: http://stackoverflow.com/comment/43708334
type: Question
answer count: 2
score: 5
has comment: http://stackoverflow.com/comment/43708376
upvote count: 6
has title: PHP parses JavaScript content inside heredoc
tagged with: javascript
tagged with: variables
has answer: http://stackoverflow.com/a/27645025
has answer: http://stackoverflow.com/a/30571006
accepted answer: http://stackoverflow.com/a/27645025
tagged with: http://stackoverflow.com/tag/html
downvote count: 1

http://stackoverflow.com/comment/43966854
type: QuestionComment
comment on: http://stackoverflow.com/q/27778190
has text: use angular template? `http://www.jptacek.com/2014/02/angularJS-templates/` Not as elegant a solution as Simon has proposed, but would be a possibility for a variety of mixed data content.
score: 0
type: Comment

http://stackoverflow.com/comment/45245628
comment on: http://stackoverflow.com/a/27697886
has text: http://www.slideshare.net/spikebrehm/building-isomorphic-apps-jsconfasia-2014 and a buddy of mine at Yahoo would +1 exactly what I said.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/27727025
type: Answer
answers question: http://stackoverflow.com/q/27726979
has body: Is this what you are looking for? setTimeout(animateUp, 5000); function animateUp() { $(".alert").css({'-webkit-animation' : 'fadeOutUp 5s infinite'}); } or update your .fadeOutUp CSS to .fadeOutUp { -webkit-animation: fadeOutUp 5s infinite; animation: fadeOutUp 5s infinite; } Then you can do setTimeout(animateUp, 5000); function animateUp() { $(".alert").addClass("fadeOutUp"); } JSFiddle
score: 0

http://stackoverflow.com/comment/43892180
type: Comment
type: QuestionComment
has text: nope dear Im getting only one value for all cid data
comment on: http://stackoverflow.com/q/27739723
score: 0

http://stackoverflow.com/comment/43845897
type: AnswerComment
type: Comment
has text: And I would also need for the URL's to be completely different. I don't have access to PHP, nor am I versed in it. I was thinking of displaying a div that would hold various iframes. Is that possible? Thank you so much. Take as much time as you want to reply. I truly appreciate you time, energy, and attention.
comment on: http://stackoverflow.com/a/27716925
score: 0

http://stackoverflow.com/q/27760125
favorite count: 0
has comment: http://stackoverflow.com/comment/43931373
type: AnsweredQuestion
has title: TypeError: undefined is not a function (Phaser JS)
possible better answer: http://stackoverflow.com/a/27761964
downvote count: 1
type: Question
tagged with: phaser-framework
has comment: http://stackoverflow.com/comment/43931347
has answer: http://stackoverflow.com/a/27761964
has answer: http://stackoverflow.com/a/27760258
accepted answer: http://stackoverflow.com/a/27760258
score: -1
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/43931388
has body: Hi everybody i'm just trying executing a method inside a class and it's not working. I got an "Uncaught TypeError: undefined is not a function" error. I'm calling others functions and it's working well so I don't understand. I've tried to change the name and nothing. I think that there is a problem with Phaser that I'm using but I've no idea... Bomb.prototype.collisionBlocs = function() { if (!this.hasBounced) { this.bounce(); this.hasBounced = true; } } Bomb.prototype.bounce = function() { if (this.direction == 'UP') { this.direction = 'DOWN'; } else if (this.direction == 'RIGHT') { this.direction = 'LEFT'; } else if (this.direction == 'DOWN') { this.direction = 'UP'; } else if (this.direction == 'LEFT') { this.direction = 'RIGHT'; } }
tagged with: javascript
has comment: http://stackoverflow.com/comment/43931337

http://stackoverflow.com/comment/43875166
score: 2
has text: You're still not really telling me how to put that into an if else statement, I tried that and I'm just getting syntax errors like "Unexpected token else". Sorry perhaps this isnt the place for beginner questions.
comment on: http://stackoverflow.com/q/27731812
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43736831
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27659818
type: Comment
has text: I need to build timeseries chart like this http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/spline-irregular-time/. Here I can to set any date/value for each line. ` name: 'Blue Line', data: [ [Date.UTC(1970, 9, 27), 0], ] },` How can I do this with c3js?

http://stackoverflow.com/comment/43846386
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27716925
has text: NO. So I'm guessing that's the hard part. I've seen scripts that show whatever divs you'd need, and that seems like what I need. I could be wrong, though.

http://stackoverflow.com/q/27752518
has title: Passing Date to javascript function
has body: $(document).ready(function() { //calling procedure which displays list of items by default. DisplayList(2, '2', '2', 0); }); DisplayList(2, fromDate, toDate, selectedvalue) { //parameter 2 is passed for procedure } function Functioncalling { // fromDate and toDate values from asp textbox DisplayList(2, fromDate, toDate, selectedvalue); } fromdate and todates has 'year' value. loss of day and month values as well as different year which is not selected. when DisplayList from function is called. Please help me out to get . Thank you
type: UnansweredQuestion
score: 0
type: Question
has answer: http://stackoverflow.com/a/27752553
answer count: 1
tagged with: javascript

graph-databases
tags question: http://stackoverflow.com/q/27695557
type: Tag
tag name: graph-databases

http://stackoverflow.com/comment/43939360
type: QuestionComment
has text: If you see the console here, the error is $ is undefined.
comment on: http://stackoverflow.com/q/27763801
type: Comment
score: 0

http://stackoverflow.com/comment/43902307
score: 0
type: Comment
has text: @GabyakaG.Petrioli Yes it does, when the user clicks the start button multiples times it will add more click handlers to the button.
comment on: http://stackoverflow.com/a/27743862
type: AnswerComment

http://stackoverflow.com/a/33030654
has body: What you can do is that you can ask them to add your gmail account to their google analytics account with just report read permission so that you to can have the access and for understanding the whole prospect you need to understand the data and den analyse
score: 0
answers question: http://stackoverflow.com/q/27646486
type: Answer

http://stackoverflow.com/a/27652851
has body: IDs have to be unique. You should change id="element_to_pop_up" to class="element_to_pop_up". Then change the popup JS to use DOM traversal to find the adjacent DIV to pop up: ;(function($) { // DOM Ready $(function() { // Binding a click event // From jQuery v.1.7.0 use .on() instead of .bind() $('.my-button').bind('click', function(e) { // Prevents the default action to be triggered. // e.preventDefault(); // Triggering bPopup when click event is fired $(this).closest(".comment").next('.element_to_pop_up').bPopup(); }); }); })(jQuery);
has comment: http://stackoverflow.com/comment/43743340
has comment: http://stackoverflow.com/comment/43743469
has comment: http://stackoverflow.com/comment/43743406
has comment: http://stackoverflow.com/comment/43743189
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43722739
accepted answer of: http://stackoverflow.com/q/27652564
has comment: http://stackoverflow.com/comment/43743053
has comment: http://stackoverflow.com/comment/43743519
has comment: http://stackoverflow.com/comment/43722774
answers question: http://stackoverflow.com/q/27652564
type: Answer

http://stackoverflow.com/comment/43782031
has text: While this works in your Fiddle and in my console, I plop it into my code and run it and I get "undefined". The responsive HTML comes into play at a certain width, would that be a reason as to why I can't target the ID?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27683756

http://stackoverflow.com/a/53561767
upvote count: 1
has comment: http://stackoverflow.com/comment/97480327
downvote count: 0
answers question: http://stackoverflow.com/q/27784176
type: Answer
has body: Go to Project Properties in Visual Studio and then go to Web, under servers change the project url to a different port number and Create Virtual Directory.
score: 1

http://stackoverflow.com/comment/43727969
score: 0
type: Comment
type: AnswerComment
has text: `XMLHttpRequest cannot load file:///data.csv. Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https, chrome-extension-resource.`
comment on: http://stackoverflow.com/a/27655301

http://stackoverflow.com/q/27664894
downvote count: 0
favorite count: 0
type: UnansweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/43745545
tagged with: calendar
type: Question
has body: I have 2 files, calendar.html and notes.html, and here is a screenshot of the calendar: I want notes.html to open when dates are clicked. Here is my code so far: $.fn.zabuto_calendar = function(b) { var c = $.extend({}, $.fn.zabuto_calendar_defaults(), b); var a = $.fn.zabuto_calendar_language(c.language); c = $.extend({}, c, a); this .each(function() { var j = $(this); j.attr("id", "zabuto_calendar_" + Math.floor(Math.random() * 99999).toString(36)); j.data("initYear", c.year); j.data("initMonth", c.month); j.data("monthLabels", c.month_labels); j.data("weekStartsOn", c.weekstartson); j.data("navIcons", c.nav_icon); j.data("dowLabels", c.dow_labels); j.data("showToday", c.today); j.data("showDays", c.show_days); j.data("showPrevious", c.show_previous); j.data("showNext", c.show_next); j.data("cellBorder", c.cell_border); j.data("jsonData", c.data); j.data("ajaxSettings", c.ajax); j.data("legendList", c.legend); j.data("actionFunction", c.action); j.data("actionNavFunction", c.action_nav); l(); function l() { var y = parseInt(j.data("initYear")); var B = parseInt(j.data("initMonth")) - 1; var C = new Date(y, B, 1, 0, 0, 0, 0); j.data("initDate", C); var D = (j.data("cellBorder") === true) ? " table-bordered" : ""; $tableObj = $('&lt;table class="table' + D + '"&gt;&lt;/table&gt;'); $tableObj = w(j, $tableObj, C.getFullYear(), C.getMonth()); //Custom code var i = document.getElementById('$tableObj'); i = w('notes.html'); $legendObj = g(j); var z = $('&lt;div class="zabuto_calendar" id="' + j.attr("id") + '"&gt;&lt;/div&gt;'); z.append($tableObj); z.append($legendObj); j.append(z); var A = j.data("jsonData"); if (false !== A) { r(j, C.getFullYear(), C.getMonth()) } } Can you help me get on the right direction?
has title: Modifying calendar so that notes will open when dates are clicked
has answer: http://stackoverflow.com/a/28298462
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43745292
score: 3
has comment: http://stackoverflow.com/comment/43745612
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/a/27737527
has body: The easiest way is include it like an image with url parameter as a tex equation: &lt;img src="http://latex.codecogs.com/png.latex?x&amp;space;=&amp;space;{-b&amp;space;\pm&amp;space;\sqrt{b^2-4ac}&amp;space;\over&amp;space;2a}" title="x = {-b \pm \sqrt{b^2-4ac} \over 2a}" /&gt; If you have many formulas and going to manipulate them constantly -- you need append the plugin to the editor. Yes, it going to be JS, and yes, it might be http://www.mathjax.org/
upvote count: 1
answers question: http://stackoverflow.com/q/27737136
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27737136
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/43776421
type: Comment
comment on: http://stackoverflow.com/a/27680735
has text: In the sense that what if 10 PDF document URL were being sent to parse simultaneously, would I have a chance of experiencing a timeout? I have notice that Parse has recently added a new class for file Parse.file, have you had any experience with that - https://parse.com/docs/js_guide#files-classes?
type: AnswerComment
score: 0

http://stackoverflow.com/a/27778837
score: 1
upvote count: 1
has body: That is because clicked element does not have the required class used in if condition. You can rather check for visibility of next ul element to make show/hide decision : $(".expanding_mobile_tab").on('click', function () { if (! $(this).next('ul').is(':visible')) { $(this).removeClass('mobile_tab_closed').addClass('mobile_tab_open'); $(".features_mobile_details_tab").hide(); $(this).next('ul').fadeToggle(); $('html,body').animate({ scrollTop: $(".mobile_detail_tabs").offset().top }, 800); } else { $(this).removeClass('mobile_tab_open').addClass('mobile_tab_closed'); $(this).next('ul').fadeOut(); console.log('close'); }}); Working Demo
answers question: http://stackoverflow.com/q/27778785
type: Answer
downvote count: 0

http://stackoverflow.com/comment/43787275
has text: Ok, it's working but the .swf starts playing 30 seconds after the is clicked.. why so? Is it possible to change this value play="false" in the embed code to play="true" instead?
comment on: http://stackoverflow.com/a/27686265
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27693285
type: Answer
downvote count: 0
score: 1
has body: Change your function to this, and you're all set: function challenge_stuff(url) { // v---return your handler! return function() { $.ajax({ url:url, success:function(result){ $("#challenge_stuff").html(result); } }); } } Now it returns a function that will be assigned as the handler. This is more convenient than manually adding an anonymous function to each call. While this part can stay the same: $("#cancel").click(challenge_stuff("../cancel_challenge")); $("#accept").click(challenge_stuff("../accept_challenge")); $("#decline").click(challenge_stuff("../decline_challenge")); $("#wonMatch").click(challenge_stuff("../won_match")); $("#lostMatch").click(challenge_stuff("../lost_match")); $("#confirm_win").click(challenge_stuff("../confirm_win")); you could shorten it a bit like this: var ids = { cancel: "cancel_challenge", accept: "accept_challenge", decline: "decline_challenge", wonMatch: "won_match", lostMatch: "lost_match", confirm_win: "confirm_win" } $.each(ids, function(id, url) { $("#" + id).click(challenge_stuff("../" + url)); }); Could be even shorter if the ID and the url directory shared the same name. Then you could use an array, and use the same value in both places. // Make sure the ID and path are set up to be identical var id_path = ["cancel","accept","decline","won_match","lost_match","confirm_win"]; $.each(id_path, function(_, id) { $("#" + id).click(challenge_stuff("../" + id)); });
accepted answer of: http://stackoverflow.com/q/27693066
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27693066

http://stackoverflow.com/comment/83155988
type: Comment
has text: Not working for me ..its showing text box separate and drop down seperate @undefined
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27714117

http://stackoverflow.com/q/27779884
has comment: http://stackoverflow.com/comment/43969641
favorite count: 0
has comment: http://stackoverflow.com/comment/44091023
upvote count: 1
tagged with: css
has title: Why does each of these buttons only work once?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43969669
has answer: http://stackoverflow.com/a/27779970
score: 1
has body: I am trying to create a div navigation for some flash banners I have created. The code I have written works in ascending order, but once you have clicked past one, you cannot go back to it. How do I make it like a navigation where each title can be clicked repeatedly in any order and it will work? fiddle is here: http://jsfiddle.net/0fq19a80/ code is here: HTML 120x600 160x600 300x250 728x90 300x600 970x250 PAGE1 PAGE2 PAGE3 PAGE4 PAGE5 PAGE6 ` CSS #main { margin-left: 100px; width: 1000px; height: 700px; border: 1px solid red; overflow: hidden; position: absolute; top: 200px; } #allPages > div { display: none; position: absolute; top: 0px; left: 0px; } #allPages > div.current { display: block; } #page1 { width: 1000px; height: 700px; background-color: red; } #page2 { width: 1000px; height: 700px; background-color: grey; } #page3 { width: 1000px; height: 700px; background-color: pink; } #page4 { width: 1000px; height: 700px; background-color: green; } #page5 { width: 1000px; height: 700px; background-color: orange; } #page6 { width: 1000px; height: 700px; background-color: blue; } JS $(document).ready(function(){ $("#black120").click(function(){ nextPage("#page1","fade"); }); $("#black160").click(function(){ nextPage("#page2","fade"); }); $("#blackMPU").click(function(){ nextPage("#page3","fade"); }); $("#black728").click(function(){ nextPage("#page4","fade"); }); $("#black300").click(function(){ nextPage("#page5","fade"); }); $("#black970").click(function(){ nextPage("#page6","fade"); }); }); function nextPage(to, type){ var to = $(to), from = $("#allPages .current"); to .addClass("current " + type + " in") .one("webkitAnimationEnd msAnimationEnd animationend oAnimationEnd", function(){ from.removeClass("current " + type + " out" ); to.removeClass(type + " in"); }); from.addClass(type + " out "); }
type: Question
has comment: http://stackoverflow.com/comment/43971078
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27779970
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/43771492
comment on: http://stackoverflow.com/a/27678453
type: AnswerComment
score: 0
type: Comment
has text: Thank you very much! But after a couple of failures I realized that it needs to be changed to this: var shaked_times = 1; shaked_times++; if (shaked_times == 1) { some functions here... shaked_times = 2; } else if (shaked_times == 2) { some functions here... shaked_times = 1; }

http://stackoverflow.com/comment/43923960
score: 0
comment on: http://stackoverflow.com/q/27755976
type: Comment
type: QuestionComment
has text: that'd be much appreciated!! Or even if you don't have time then just have some good links that I can read up on more myself would be fantastic. Thanks for the input!

http://stackoverflow.com/a/27803446
accepted answer of: http://stackoverflow.com/q/27803340
has body: Couple of issues, See inline:- var $injector = angular.injector(['ng', 'cfg']); //&lt;-- Add module name here /*Injection is case sensitive it mustbe CFG*/ $injector.invoke(['CFG', '$http', '$rootScope', function (cfg, $http, $rootScope) { $rootScope.$apply(function () { //Do not set an argument here $http.get(cfg.EP + "accounts/csrf").then(function (response) { myApp.constant("CSRF_TOKEN", response.csrf_token); angular.bootstrap(document, ['app']); }); }); }]); 1) You need to get the injector with the module that has the dependency, example: var $injector = angular.injector(['ng', 'cfg']); 2) DI service/provider/etc.. names are case sensitive so: $injector.invoke(['CFG',... 3) Do not pass an argument in the anonymous function of $rootScope.$apply it will create a local variable within that scope. So just: $rootScope.$apply(function () { injected dependency is available as variable (argument cfg) from the upper scope, so just access it as: $http.get(cfg.EP + "accounts/csrf"); Check the network console in the demo: var configMod = angular.module("cfg", []); var config_data = { 'CFG': { 'EP': 'https://mydomain.com/api//web/' } }; var configMod = angular.module("cfg", []); angular.forEach(config_data, function(key, value) { configMod.constant(value, key); }); var myApp = angular.module("app", ["cfg", "ngResource", "ngRoute"]); (function() { var $injector = angular.injector(['ng', 'cfg']); //&lt;-- Add module name here /*Injection is case sensitive it mustbe CFG*/ $injector.invoke(['CFG', '$http', '$rootScope', function(cfg, $http, $rootScope) { $rootScope.$apply(function() { //Do not set an argument here $http.get(cfg.EP + "accounts/csrf").then(function(response) { myApp.constant("CSRF_TOKEN", response.csrf_token); angular.bootstrap(document, ['app']); }); }); } ]); })(); &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt;
answers question: http://stackoverflow.com/q/27803340
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/a/27803034
type: Answer
score: 0
has body: The solution I use is using SessionStorage since all useres in this project have to upgrade they're browser anyway. And actually its binded to Chrome so the is the best way passing some JSON-Strings to a JS-Function in this case. With this I can call JS-Functions on Check-Event that gets/sets data to the Storage and later is easily can get it to decide what to do further. Thanks for your help :)
answers question: http://stackoverflow.com/q/27798114

http://stackoverflow.com/q/27681847
has body: Here is my problem, I would like to upload a file from a local path but i can't change input file value because it is impossible The classical code of simple file upload : HTML-code: &lt;input id="file" type="file" /&gt; &lt;progress id="progress"&gt;&lt;/progress&gt; JavaScript-code: var fileInput = document.querySelector('#file'), progress = document.querySelector('#progress'); fileInput.addEventListener('change', function() { var xhr = new XMLHttpRequest(); xhr.open('POST', 'upload.html'); xhr.upload.addEventListener('progress', function(e) { progress.value = e.loaded; progress.max = e.total; }, false); xhr.addEventListener('load', function() { alert('Upload terminé !'); }, false); var form = new FormData(); form.append('file', fileInput.files[0]); xhr.send(form); }, false); How can we change it?
has comment: http://stackoverflow.com/comment/43778448
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43778508
has comment: http://stackoverflow.com/comment/43778884
has comment: http://stackoverflow.com/comment/43778665
has comment: http://stackoverflow.com/comment/43778930
answer count: 1
has title: How to upload a file from local path?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27682239
score: 0
has comment: http://stackoverflow.com/comment/43778823
has comment: http://stackoverflow.com/comment/43778945
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43778543
has answer: http://stackoverflow.com/a/27682239
has comment: http://stackoverflow.com/comment/43778383

http://stackoverflow.com/q/27702353
has answer: http://stackoverflow.com/a/27702470
answer count: 3
type: AnsweredQuestion
has title: Invoking a function within Javascript's 'sort' method
type: Question
has comment: http://stackoverflow.com/comment/43817171
possible better answer: http://stackoverflow.com/a/27702407
has body: While reading over some tutorial code I found that you could invoke a function within Javascript's sort method. So for example I have an array filled with integers: var a = [8,6,2,4]; To order these integers from greatest to least I created the following: function numSort(num1, num2) { if (num1 &gt; num2) { return 1; } else if (num1 === num2) { return 0; } else { return -1; } } And finally call the sort method to my array a.sort(numSort); There are two things I don't understand. This function in particular only takes two arguments while my array twice that amount. My question are: How does this function iterate through each element despite having only two parameters numm1, num2? How and why are there no arguments passed when invoking this function within the sort method?
score: 0
tagged with: arrays
has answer: http://stackoverflow.com/a/27702407
has answer: http://stackoverflow.com/a/27702400
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27702400
tagged with: sorting

http://stackoverflow.com/comment/43789833
comment on: http://stackoverflow.com/q/27687714
has text: Removing the href attr breaks keyboard accessibility. Don't do it.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43706556
has text: Where did this string of HTML come from, and why does it have extra whitespace in it, and why do you want to get rid of it?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27642494

http://stackoverflow.com/comment/43707675
type: QuestionComment
comment on: http://stackoverflow.com/q/27644473
score: 0
has text: `String#trim()` should already do that
type: Comment

http://stackoverflow.com/a/27751802
has comment: http://stackoverflow.com/comment/43914843
upvote count: 1
type: AcceptedAnswer
has body: Okay I've created the following JSFiddle: http://jsfiddle.net/zLAht/24/ This is what you wanted, correct? The way your code was originally the Ajax request didn't replace the area on the submit, but based on your problem that sounds like the issue. HTML JavaScript: $('textarea').click(function() {alert('ouch!');}); $('#sub').click(function(event) { $.ajax({ cache:false, type: 'POST', url: '/echo/html/', data: { html:" " }, success: function(data) { $('#ajax-response').html(data); $('textarea').click(function() {alert('ouch!');}); }, error:function(error){ alert('there was an error'); }, dataType: 'html' }); });
has comment: http://stackoverflow.com/comment/43914717
type: Answer
accepted answer of: http://stackoverflow.com/q/27751655
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27751655
has comment: http://stackoverflow.com/comment/43915085

http://stackoverflow.com/a/27718238
score: 1
has body: $(".chosen-search").change(function(){ console.log("changinn"); }); This should work
type: AcceptedAnswer
upvote count: 1
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27717406
answers question: http://stackoverflow.com/q/27717406

http://stackoverflow.com/q/27703740
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43820285
has comment: http://stackoverflow.com/comment/43820307
tagged with: ionic-framework
type: Question
has answer: http://stackoverflow.com/a/61335681
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43819831
tagged with: http://stackoverflow.com/tag/html
has title: Ionic tab content with vertical tabs along left side
tagged with: css
has body: I am using ionic in my application, and I am able to use horizontal tabs perfectly. Is it possible to have vertical tabs, something like below
type: UnansweredQuestion

http://stackoverflow.com/q/27734125
tagged with: pageload
type: Question
answer count: 1
tagged with: javascript
has body: I want to set div to "display:none" on pageload in HTML when it haven't been loaded before, which in ASP.NET called if(!IsPostBack), i don't know what's called in HTML. function startUP() { document.getElementById('output').style.display = "none"; } &lt;body onload='startUP();'&gt; &lt;div id='output'&gt; &lt;p&gt;hide me on load and show me onclick&lt;p&gt; &lt;/div&gt; &lt;button id='showOutput'/&gt; I don't know what it's called, so i tried to explain it.
has title: ASP.NET: if(!IsPostback) what is that in HTML?
has comment: http://stackoverflow.com/comment/43879775
tagged with: http://stackoverflow.com/tag/html
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27734161

http://stackoverflow.com/q/27677583
has comment: http://stackoverflow.com/comment/43769700
answer count: 1
tagged with: javascript
tagged with: dom-events
has comment: http://stackoverflow.com/comment/43769466
favorite count: 0
tagged with: google-chrome-extension
has body: Code that does not work: //Add the search textfield var textField = document.createElement("input"); textField.setAttribute("id" , "textF") textField.setAttribute("type", "text"); textField.setAttribute("name", "textField"); textField.addEventListener("keypress" , "keyPressedOnTextField(e)"); //textField.setAttribute("onkeypress", "keyPressedOnTextField(e)"); violates policy document.body.appendChild(textField); //Add the open in Skroutz Button var btn = document.createElement("input"); btn.setAttribute("id" , "btn") btn.setAttribute("type", "button"); btn.setAttribute("value", "Open In Skroutz.gr"); btn.setAttribute("name", "openInSrkoutz"); btn.addEventListener("click" , "openInSkroutzButton()"); //btn.setAttribute("onclick", "openInSkroutzButton()"); violates policy document.body.appendChild(btn); function keyPressedOnTextField(e){ if(e.keyCode == 13){ openInTheWindow(); return false; } } function openInSkroutzButton(){ console.log("test"); var searchText = getCurrentText(); console.log(searchText); if(searchText === null || searchText < 2){//make sure to replace whitespaces with + chrome.tabs.create({ url: "http://www.skroutz.gr/"}); }else{ chrome.tabs.create({ url: ("http://www.skroutz.gr/search?keyphrase=" + searchText).replace(/\s/g, "+")}); } } function getCurrentText(){ return document.getElementById("textField").value; } I am trying to add some elements via JS to the document, in a Chrome extension. The events are not called- although appears openInSkroutzButton() doesn't get called when I click the button
upvote count: 0
has answer: http://stackoverflow.com/a/27683897
downvote count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43769454
score: -5
has comment: http://stackoverflow.com/comment/43769480
has title: Events not called
type: Question

http://stackoverflow.com/q/27785245
answer count: 2
has answer: http://stackoverflow.com/a/27785610
accepted answer: http://stackoverflow.com/a/27785610
possible better answer: http://stackoverflow.com/a/27785790
tagged with: javascript
tagged with: string
score: 0
has body: I really need your help with this. I’d like to be able to compare a string against an array and use it to replace special Unicode codes. var unicode_dictionary = { "\00E9": "é", "\00E0": "à" } var old_str = "rapport couvrant une p\00E9riode de 6 mois (f\00E9vrier \00E0 juillet)" if (\CODE match from the unicode_dictionary is found in the old_str) { then replace every single instance of the \CODE with the corresponding character resulting in the new string: var new_str = "rapport couvrant une période de 6 mois (février à juillet)" } I am really lost with this as my DB outputs unicode characters in the \0000 format. How do I make a custom replace function like the above
has answer: http://stackoverflow.com/a/27785790
type: AnsweredQuestion
has title: Replacing unicode chracters using a custom replacement method using Javascript
type: Question
tagged with: replace

http://stackoverflow.com/comment/43825508
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27705399
has text: You understand me exactly right :) First thanks for your help. If I understand you correctly, meteor/iron router does support scroll to hash by default? So if my url is www.example.com/cpd#events, the browser window should by default scroll to the events anchor? If that is so, my scroll to hash is not working. On an unrelated subject, I like your website. Is there anything specific you did for your website to use low bandwidth, because mine uses 8MB the first time it loads?

http://stackoverflow.com/q/27732113
score: 0
has body: I need to send "M6" value to this http://wap2.mobi/votes/?id=16552 webpage using python. I have some problem to do that because the website submit the vlaue using javascripts. This is the html source for the input: &lt;div id="info"&gt; &lt;input type="text" id="company" name="com" size="20"&gt; &lt;input type="button" value="Send Now" onClick="getData();"&gt;&lt;/div&gt; &lt;div class="clearfix"&gt;&lt;/div&gt; &lt;/div&gt; and the js code is: function getData() { var Send = document.getElementById("company").value; $.ajax({ type: "POST", url: "../votes/comments.php?id=97775547", data: "com="+Send, beforeSend: function() { $("div#info").html("&lt;img src='../loading.gif'&gt;loding..."); }, success: function(result) { $("div#info").html(result); } }); } Please if someone can help me with this. Thank you.
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43875795
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43875726
has comment: http://stackoverflow.com/comment/43994465
tagged with: python
tagged with: web-scraping
upvote count: 1
has comment: http://stackoverflow.com/comment/43875661
downvote count: 1
has answer: http://stackoverflow.com/a/27736682
type: Question
has title: Sending requests to webpages using Python
has comment: http://stackoverflow.com/comment/43875621
tagged with: javascript

http://stackoverflow.com/comment/43793682
type: Comment
comment on: http://stackoverflow.com/q/27690223
score: 1
has text: Just fyi: `<?php echo $_POST['shortby']; ?>` and `<?php echo $_POST['radius']; ?>` are vulnerable to Reflected XSS attacks
type: QuestionComment

http://stackoverflow.com/comment/44037381
type: AnswerComment
comment on: http://stackoverflow.com/a/27753684
type: Comment
has text: var date = new Date(parseInt(jsonDate.substr(6))); var date_string = date.getFullYear()+'-'+date.getMonth()+'-'+date.getDate(); or you can use time.js library for date format
score: 0

conditional-statements
tags question: http://stackoverflow.com/q/27714600
tags question: http://stackoverflow.com/q/27761380
tag name: conditional-statements
tags question: http://stackoverflow.com/q/27756466
tags question: http://stackoverflow.com/q/27695624
type: Tag

http://stackoverflow.com/q/27680123
favorite count: 0
has answer: http://stackoverflow.com/a/27680471
type: Question
downvote count: 1
upvote count: 3
answer count: 3
has body: I have a editor whereby users can input their javascript and it displays their output. But I want a safety condition to stop them being able to accidentally create an infinite loop. The issue is I really don't want to parse the code and look for any loops and then add extra conditions. What I'm hoping for is a prebuilt function that cancels itself after a certain amount of memory, to avoid the browser crashing. I am unsure how to do this however.
has answer: http://stackoverflow.com/a/27680153
linked to: http://stackoverflow.com/q/4460263
score: 2
possible better answer: http://stackoverflow.com/a/27680153
tagged with: javascript
has answer: http://stackoverflow.com/a/27680174
has comment: http://stackoverflow.com/comment/43774928
type: AnsweredQuestion
has title: How do you stop an infinite loop in javascript via memory?
has comment: http://stackoverflow.com/comment/43774948
accepted answer: http://stackoverflow.com/a/27680174

http://stackoverflow.com/comment/43935773
score: 0
type: AnswerComment
has text: if you use jquery, why aren't you implementing it to `document.getElementById("bananas")`? and also `s.style.height = "290px"`. is there a reason?
type: Comment
comment on: http://stackoverflow.com/a/27762291

http://stackoverflow.com/q/27704157
has title: How change tags with javascript
has answer: http://stackoverflow.com/a/27704310
accepted answer: http://stackoverflow.com/a/27704310
possible better answer: http://stackoverflow.com/a/27704197
has answer: http://stackoverflow.com/a/27704284
score: 0
has comment: http://stackoverflow.com/comment/43820601
tagged with: javascript
answer count: 6
tagged with: jquery
has answer: http://stackoverflow.com/a/27704800
linked to: http://stackoverflow.com/q/2610497
has answer: http://stackoverflow.com/a/27704233
tagged with: angularjs
has body: We have a project that demands an single page application. For the moment I have this HTML / carousel page to create questions. As you can see, there is no input at all. this must be made possible through javascript. with an onclick event every H you see, has to be converted to an input tag when you click on the tag itself. Any help? I thought I had figured a way out, but it doesn't work HTML: Click om uw titel op te geven Click om uw vraag in te voeren . click voor uw type vraag te selecteren hier is de content van uw antwoorden Slide {{$index}} Add Slide jQuery: $( "button.CreationVraagBtn" ).click(function() { $( "div.CreationTitel" ).replaceWith( " " ); });
has comment: http://stackoverflow.com/comment/43820542
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43820289
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43820631
has answer: http://stackoverflow.com/a/27704686
has answer: http://stackoverflow.com/a/27704197
type: Question

http://stackoverflow.com/a/27659590
answers question: http://stackoverflow.com/q/27658430
type: Answer
accepted answer of: http://stackoverflow.com/q/27658430
has body: You shouldn't use global variable like this (I encourage you to read more on this theme) and I'm not sure I understand what you're trying to do... but the solution of your issue should be to move the basket = classPicked; line into your showBasket method : basket = classPicked; //This is where the array should be passed function randOrd(){ return (Math.round(Math.random())-0.5); } function showBasket(){ // whatever } should be : function randOrd(){ return (Math.round(Math.random())-0.5); } function showBasket(){ basket = classPicked; //This is where the array should be passed // whatever } This way, each time you call showBasket, this method will use the last value of classPicked. Otherwise, basket will always keep the reference on the first value of classPicked. Why ? because each time you assign a new Array to the basket variable (classPicked = Array(l);) instead of changing directly it's content by : emptying it : while (classPicked.length &gt; 0) { classPicked.pop(); } and then adding new data : classPicked.concat(chosenClass)
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/27702497
has comment: http://stackoverflow.com/comment/43817492
has body: I have the following object in a javascript (Node.js if it matters) application. function myObject (myInput){ this.myValue = myInput; this.myAssociativeArray = {}; this.myAssociativeArrayLen = function() { var k; var l = 0; for (k in this.users){ l = l + 1; } return l; }; } When I call the length function and log it to the console I get this as the output: function () { var k; var l = 0; for (k in this.myAssociativeArray){ l = l + 1; } return l; } I'm really nor sure how this is happening but it appears that the function is being treated as a string property but I don't have quotation marks, so how could this be the case? I've also noticed that the editor I am using (Sublime) is not changing the color of the last this like it does with the others. I'd to have the length function be part of the object so that I can just call myObjectInstance. myAssociativeArray and the get a length. Any help would very appreciated!
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27702600
possible better answer: http://stackoverflow.com/a/27702994
has comment: http://stackoverflow.com/comment/43817495
has answer: http://stackoverflow.com/a/27702994
tagged with: properties
type: AnsweredQuestion
score: 0
tagged with: methods
type: Question
tagged with: object
has title: How to stop a function from being treated as a property in a javascript object?
tagged with: class
has answer: http://stackoverflow.com/a/27702600
answer count: 2

http://stackoverflow.com/comment/43984115
type: AnswerComment
has text: here is the ling to my source.. http://www.arirangcroatia.com/cocohouse/location/CH_location_en.html
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27786723

http://stackoverflow.com/a/27649947
type: Answer
answers question: http://stackoverflow.com/q/27643582
has comment: http://stackoverflow.com/comment/43721926
has comment: http://stackoverflow.com/comment/43732403
has comment: http://stackoverflow.com/comment/43722116
score: 0
has comment: http://stackoverflow.com/comment/43743065
has body: Here is a quick edit. http://jsfiddle.net/lannymcnie/f58mr0Lk/9/ Your Fiddle wasn't very helpful, since it was just your code pasted in. I modified it to drop the body tag (jsfiddle does that for you), import easeljs, and use the full image path. The BitmapAnimation class was renamed to Sprite sometime ago. I am not sure what version of EaselJS you are using, but it might not have that class anymore. I removed the Bitmap. The SpriteSheet data accepts either a string path, or an Image reference, not a Bitmap. As I suggested below, I pulled out the entire update method, added the Sprite one time, and then had the tick just update the stage directly. The fiddle "works" now, but the spritesheet dimensions don't seem right. Have a look. data = new createjs.SpriteSheet({ images: ["http://i943.photobucket.com/albums/ad274/Rah5er0/megaman__jump.png~original"], frames: { width: 79, height: 139, count: 7 }, animations: { jump: [0, 6, "jump"] } }); var sprite = new createjs.Sprite(data);

http://stackoverflow.com/q/27656887
downvote count: 0
has answer: http://stackoverflow.com/a/27690357
tagged with: javascript
tagged with: jquery
has title: Replace specific word in contenteditable
answer count: 3
tagged with: range
has answer: http://stackoverflow.com/a/27656961
favorite count: 0
has body: I have a contenteditable div &lt;div id="divTest" contenteditable="true"&gt; I need to get the last word from caret position and on certain condition I have to test and remove this specific word only. Below is how am I doing $('#divTest').on('keyup focus', function (e) { if (e.keyCode == 32) { var lastWord = getWordPrecedingCaret(this), spanLastWord = $('#lastWord'); } }); function getWordPrecedingCaret(containerEl) { var preceding = "", sel, range, precedingRange; if (window.getSelection) { sel = window.getSelection(); if (sel.rangeCount &gt; 0) { range = sel.getRangeAt(0).cloneRange(); range.collapse(true); range.setStart(containerEl, 0); preceding = range.toString(); } } else if ((sel = document.selection) &amp;&amp; sel.type != "Control") { range = sel.createRange(); precedingRange = range.duplicate(); precedingRange.moveToElementText(containerEl); precedingRange.setEndPoint("EndToStart", range); preceding = precedingRange.text; } var words = range.toString().trim().split(' '), lastWord = words[words.length - 1]; if (lastWord) { var resultValue = 'some'; // this value is coming from some other function if (resultValue == lastWord) { alert('do nothing'); // do nothing } else { alert('replace word'); // delete That specific word and replace if with resultValue } return lastWord; } } Demo: http://codepen.io/anon/pen/ogzpXV I have tried range.deleteContents(); but that will delete all the content in the div. How can I replace specific word only?
has answer: http://stackoverflow.com/a/50826336
tagged with: contenteditable
accepted answer: http://stackoverflow.com/a/27690357
possible better answer: http://stackoverflow.com/a/27656961
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/50817526
score: 12
upvote count: 12

http://stackoverflow.com/q/27675432
tagged with: java
type: Question
tagged with: nashorn
has answer: http://stackoverflow.com/a/28261185
has comment: http://stackoverflow.com/comment/43784656
tagged with: javascript
has body: Is it possible to make an Java object the prototype of a JavaScript object? Like the following: var Person = Java.type("Person"); var hans = new Person(); hans.name = "Hans"; var employeeFactory = function() { var F = function(){}; F.prototype = hans; return new F(); }; var fritz = employeeFactory(); print(fritz.name); Here Person is a Java Bean. The variable hans is set as the instance of this Java class. The line hans.name = "Hans" sets the name field in the Java object as expected. But when the object fritz is created in the factory function, it doesn't get linked to the expected prototype. Is there any reason why the Java instance isn't accepted as prototype?
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/43765616
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43765623
favorite count: 0
has comment: http://stackoverflow.com/comment/43774155
has title: Can a Java Object be a Prototype of an JavaScript Object in Nashorn?
type: UnansweredQuestion

http://stackoverflow.com/a/27715003
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43856908
has comment: http://stackoverflow.com/comment/43843621
answers question: http://stackoverflow.com/q/27714886
upvote count: 3
has body: Don't duplicate your ID. ID should be unique-per-page. Also, why not do it in pure CSS? (no JS required) jsBin demo &lt;div class="imgBox"&gt; &lt;img src="cat.jpg"&gt; &lt;img src="mask.png"&gt; &lt;/div&gt; &lt;div class="imgBox"&gt; &lt;img src="bear.jpg"&gt; &lt;img src="mask.png"&gt; &lt;/div&gt; &lt;div class="imgBox"&gt; &lt;img src="elephant.jpg"&gt; &lt;img src="mask.png"&gt; &lt;/div&gt; CSS: .imgBox{ position:relative; /*width, height etc... */ } .imgBox img{ position:absolute; top: 0; transition: opacity 0.5s; /* yey! */ } .imgBox:hover img + img{ /* on hover target the second image */ opacity: 0; }
accepted answer of: http://stackoverflow.com/q/27714886
score: 3
has comment: http://stackoverflow.com/comment/43859333

http://stackoverflow.com/a/27661242
score: 0
has body: How do you updated the individual fields? After changing the account if click some where else except composite field then it updating or not? Update : Composite field is updating on change event of account field and it is get affected when you click some where else.
type: Answer
has comment: http://stackoverflow.com/comment/43738241
answers question: http://stackoverflow.com/q/27660781
has comment: http://stackoverflow.com/comment/43761151

http://stackoverflow.com/a/27790964
has comment: http://stackoverflow.com/comment/43991830
has body: I'm willing to bet that it's because the element you're searching for (by the way, getElementsByClassName is a thing) is relatively positioned to the element containing it and thus has position 0,2 or what-ev. That getPosition function crawls up the parent tree, so the parent node spits out the right position because it's relative to the document. Finally, the document itself is relative to itself and thus has zero offset.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27790897
score: 1
has comment: http://stackoverflow.com/comment/43992902
answers question: http://stackoverflow.com/q/27790897
has comment: http://stackoverflow.com/comment/43991724
type: Answer
has comment: http://stackoverflow.com/comment/43991779
upvote count: 1
has comment: http://stackoverflow.com/comment/43991838
has comment: http://stackoverflow.com/comment/43991805
has comment: http://stackoverflow.com/comment/43991853

http://stackoverflow.com/a/27692510
has body: Well you could use some template library like handlebars and use jquery to facilitate the element selection, example:
answers question: http://stackoverflow.com/q/27692303
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27692303

http://stackoverflow.com/a/27700165
downvote count: 0
score: 1
has body: Yes. If-Else in JSX. render: function () { var submitButton; if (this.state.imageSelected) submitButton = <SubmitButton />; return ( { submitButton } <CancelButton router={this.props.router} /> <UploadButton callback={this.imageSelectedCallback} /> <Preview imageUri={this.state.imageUri} /> ) }
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27699250

http://stackoverflow.com/a/27787001
has comment: http://stackoverflow.com/comment/43983950
has body: I'd rather check the tagName against a list of known void elements, than rely on innerHTML returning something with &gt;&lt; in it function isSelfEnclosed(element) { return ['area', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param'].indexOf(element.tagName.toLowerCase()) != -1; } FIDDLE
has comment: http://stackoverflow.com/comment/43984085
has comment: http://stackoverflow.com/comment/43984148
has comment: http://stackoverflow.com/comment/43984088
has comment: http://stackoverflow.com/comment/43984175
upvote count: 5
has comment: http://stackoverflow.com/comment/43984240
type: Answer
has comment: http://stackoverflow.com/comment/43984328
has comment: http://stackoverflow.com/comment/43983971
answers question: http://stackoverflow.com/q/27786815
has comment: http://stackoverflow.com/comment/43983967
has comment: http://stackoverflow.com/comment/43984321
downvote count: 0
has comment: http://stackoverflow.com/comment/43984196
has comment: http://stackoverflow.com/comment/43984265
score: 5
has comment: http://stackoverflow.com/comment/43984460
has comment: http://stackoverflow.com/comment/43984065

http://stackoverflow.com/a/27755725
has body: A disabled input button does not trigger onmouseover : http://jsfiddle.net/djwasp4o/ if you remove the disabled attribute from the html manually, the event will be triggered. At that point, you disable the event : document.getElementById('ok').setAttribute("disabled", "disabled"); For reference, see : Fire onmouseover event when element is disabled
upvote count: 0
score: -1
accepted answer of: http://stackoverflow.com/q/27755644
answers question: http://stackoverflow.com/q/27755644
type: AcceptedAnswer
downvote count: 1
type: Answer

http://stackoverflow.com/comment/43933530
score: 5
has text: JSFiddle runs in your browser, so javascript is working in your browser.....
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27761201

http://stackoverflow.com/comment/43792789
has text: What is `**var json = JSON.stringify( obj );** ` supposed to do in the loop?
type: AnswerComment
comment on: http://stackoverflow.com/a/27689628
score: 0
type: Comment

http://stackoverflow.com/comment/43980553
type: Comment
has text: see error in console of your browser
comment on: http://stackoverflow.com/q/27785175
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43761151
type: AnswerComment
comment on: http://stackoverflow.com/a/27661242
score: 0
has text: regarding your update, yes that is correct, so the question is how do i trigger this change?
type: Comment

http://stackoverflow.com/comment/43772264
type: Comment
comment on: http://stackoverflow.com/a/27678830
score: 1
type: AnswerComment
has text: Thanks. Worked great.

http://stackoverflow.com/comment/117324636
type: AnswerComment
has text: > Polymorphism takes advantage of inheritance. OR implementing a common interface using composition is the other way to implement polymorphism
type: Comment
comment on: http://stackoverflow.com/a/27642444
score: 1

http://stackoverflow.com/comment/43801869
has text: What is the url to the web api website? Is it the same as the page you're calling it from?
comment on: http://stackoverflow.com/q/27694258
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27752721
has body: The For in loop gives a way to iterate over an object or array with each value and key. It can be applied over an object or Array. For an Object For an object it gives each key in the object as the ITER variable. Using this variable you can get the corresponding value from object. var options = {a:1,b:2}; for (var key in options) { console.log(o,options[key]); } Will Iterate over the options object and print each key and it's value. a 1 //first key is a and options["a"] is 1 b 2 //first key is a and options["b"] is 2 For an Array For an array it gives each index in the array as the ITER variable. Using this variable you can get the corresponding element from array. var options = ["a","b"]; for (var index in options) { console.log(index,options[index]); } Will Iterate over the options array and print each index and element on given index. Output will be:- 0 a //first index is a and options[0] is a 1 b //second index is a and options[1] is b
type: Answer
accepted answer of: http://stackoverflow.com/q/27752659
downvote count: 0
answers question: http://stackoverflow.com/q/27752659
score: 5
type: AcceptedAnswer
upvote count: 5

http://stackoverflow.com/comment/43861069
has text: Does the RevSlider javascript use the name or class of the column? with that changing it might not be able to find the picture.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27724483
score: 0

http://stackoverflow.com/a/27765957
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: You are trying to set the div src. you need to have an image (img) element inside each div and then to set the image src. &lt;div id="main"&gt; &lt;div&gt; &lt;img id="advert1" alt="" src.../&gt; &lt;/div&gt; &lt;div&gt; &lt;img id="advert2" alt="" src.../&gt; &lt;/div&gt; &lt;/div&gt; Another option will be to set the div background image using the style property or class property (both using CSS sets with JavaScript).
type: Answer
accepted answer of: http://stackoverflow.com/q/27765855
answers question: http://stackoverflow.com/q/27765855

http://stackoverflow.com/q/27650830
has comment: http://stackoverflow.com/comment/43719436
downvote count: 0
has comment: http://stackoverflow.com/comment/43719590
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 2
answer count: 2
favorite count: 0
possible better answer: http://stackoverflow.com/a/27650868
has answer: http://stackoverflow.com/a/27650926
accepted answer: http://stackoverflow.com/a/27650926
has answer: http://stackoverflow.com/a/27650868
tagged with: css
has body: I am wondering if there is a way to use .children on a parent element and then use $(this) to refer to only the specific child element with an event handler. Like this: or see pen here: http://codepen.io/coralsea/pen/JoRrRG / $(document).ready(function() { $('.petals').children().draggable() $(this).mouseup(function() { $(this).animate({ backgroundColor: 'red', top: "+=50" }, 2000, function() { }); }); }); I was able to work by adding a class to each child and targeting that, like so: http://codepen.io/coralsea/pen/emdGmo but it seems being able to do it by targeting the children of the parent would be more efficient.
has title: How to apply $(this) to single child element
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/43953568
type: AnswerComment
score: 0
type: Comment
has text: @fibi It's not whether `freeDay` is observable, but whether any of its *properties* are. If `freeDay` itself were observable, we would simply need to dereference it with `freeDay()`. And, no, deleting selectively is generally tougher than editing, IMO. Could you post your `freeDay` class (object, definition, etc.)?
comment on: http://stackoverflow.com/a/27672860

http://stackoverflow.com/a/74644827
has body: Slick Version: 1.8.0 function getSliderSettings() { return { slidesToShow: 3, slidesToScroll: 1, loop: true, arrows: true, dots: false, } } $.ajax({ type: 'get', url: '/public/index', dataType: 'html', data: some_data, success: function(response) { $('[data-role="slick-slider"]').slick('unslick'); $('[data-role="slick-slider"]').html($(response).html()); $('[data-role="slick-slider"]').slick(getSliderSettings()); } });
score: 0
answers question: http://stackoverflow.com/q/27795730
type: Answer

http://stackoverflow.com/comment/49160142
has text: Sure. You can upvote and accept the answer if it works well for you. ;)
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29834865
type: AnswerComment

http://stackoverflow.com/comment/43897525
has text: PS. Have you considered using a cookie or other kind of persistent storage to store the language preference of current visitor...? I think that would be much more easier.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27743246

http://stackoverflow.com/comment/43875144
comment on: http://stackoverflow.com/a/27731173
type: AnswerComment
has text: on the ng-class documentation
score: 0
type: Comment

http://stackoverflow.com/q/27768752
has comment: http://stackoverflow.com/comment/43948330
tagged with: javascript
has comment: http://stackoverflow.com/comment/43948314
has comment: http://stackoverflow.com/comment/43948363
has comment: http://stackoverflow.com/comment/43948476
has comment: http://stackoverflow.com/comment/43948250
score: 0
has comment: http://stackoverflow.com/comment/43948243
has comment: http://stackoverflow.com/comment/43948199
has comment: http://stackoverflow.com/comment/43948344
has comment: http://stackoverflow.com/comment/43948555
has body: There is the following code: new Date("2000-01-01T18:00:00.000Z") I got: Date {Sat Jan 01 2000 21:00:00 GMT+0300 (MSK)} But I need to get: Date {Sat Jan 01 2000 18:00:00} i.e. time without specific timezone. How can I do it? Thanks!
has title: JS parse time without timezone
has comment: http://stackoverflow.com/comment/43948501
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/9756120
answer count: 0
has comment: http://stackoverflow.com/comment/43948296
has comment: http://stackoverflow.com/comment/43948309
has comment: http://stackoverflow.com/comment/43948280
type: Question

http://stackoverflow.com/q/27771399
tagged with: angularjs
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/43954343
tagged with: checkbox
linked to: http://stackoverflow.com/q/20415704
type: AnsweredQuestion
has title: Adding subjects to a taken list
has comment: http://stackoverflow.com/comment/43954496
has answer: http://stackoverflow.com/a/27772115
has answer: http://stackoverflow.com/a/27771811
type: Question
possible better answer: http://stackoverflow.com/a/27772115
has comment: http://stackoverflow.com/comment/43954543
tagged with: javascript
has comment: http://stackoverflow.com/comment/43954338
has comment: http://stackoverflow.com/comment/43955762
has comment: http://stackoverflow.com/comment/43954187
has comment: http://stackoverflow.com/comment/43954410
score: 0
answer count: 2
has body: I am creating a leaving cert points calculator, which is a SPA website, where the user ticks a checkbox if they have taken the subject and enters in the grade they received and the level at which they took it. I have the interface fully implemented as well as all the calculation functions but I'm struggling to find an easy way to add subjects to a new array (called takenSubjects) based on whether or not the checkbox is ticked. This is what the interface looks like so far. http://i62.tinypic.com/28rjg2d.png I want to take in the grade as a string (which then converts to the correct amount of points). I will also need to take in the level (radio buttons) which will also help calculate the points. And finally the taken (checkbox) boolean which will decide whether or not to add the subject to the array to be calculated into the total points. I don't have a huge amount of experience of angularJS experience but I'm using a factory to hold my functions. Here is the Javascript I have thus far. factory.getSubjects = function () { return subjects; }; /* factory.getTakenSubjects = function () { return }; factory.getGrade = function () { scope.subjects.push( { grade: $scope.newGrade.grade; }); } factory.total = function (subjects, levels,grades) { var total=0; for(var i=0;i&lt;subjects.length;i++){ total+=gradeToPoints(subjects[i],levels[i],grades[i]); } return total; }; factory.gradeToPoints= function(subject,level,grade){ var results = 0; if(level==="Higher"){ results = higherGradeToPoints(grade); if (subject === "Mathematics" &amp;&amp; results&gt;0){//if the subject is maths and they have gotten points then add 25 more to it results += 25; } }else if(level==="Lower"){ results = lowerGradeToPoints(grade); }else{//level is foundation if(subject === "Mathematics" || subject === "Irish"){//only two subject allow for this option so check it. results = foundGradeToPoints(grade); } } return results; }; factory.foundationGradeToPoints = function (grade) { switch (grade){ case "A1":…
has comment: http://stackoverflow.com/comment/43954460
accepted answer: http://stackoverflow.com/a/27771811
has comment: http://stackoverflow.com/comment/43954185
tagged with: user-input

http://stackoverflow.com/q/27736805
tagged with: flask
has body: On my view I have a few different forms. In one you enter a first and last name to search for. If there are results, the page refreshes and a second form to pick a user is displayed as a table where clicking on a row submits the data from that row. For some reason, submitting the second form results in submitting two values for each field: one completely empty and one with the correct information. I have some javascript that will be executed when a row in a table is clicked. It's supposed to fill out and submit a hidden form with the data from the table. The problem I'm running into is that when the form is submitted, two sets of values are submitted. request.form after the form is submitted contains the following: ImmutableMultiDict([('csrf_token', u'1420171907##6ad5346730985191250a52e6432e924ef05c23ee'), ('last_name', u''), ('last_name', u'Smith'), ('first_name', u''), ('first_name', u'John')]) Here's the script: $('table#theTable tr').click(function () { var cells = this.getElementsByTagName('td'); $('#selectuser_last_name').val(cells[0].innerHTML); $('#selectuser_first_name').val(cells[1].innerHTML); document.selectuser.submit(); }); and here is the HTML to go along with it: Last First {% for user in users %} {{ user.last_name }} {{ user.first_name }} {% endfor %} {{ forms.selectuser.hidden_tag() }} {{ forms.selectuser.last_name(id="selectuser_last_name") }} {{ forms.selectuser.first_name(id="selectuser_first_name") }} Test I'm using Python and Flask to handle whatever is posted.
has answer: http://stackoverflow.com/a/27738110
type: AnsweredQuestion
type: Question
tagged with: flask-wtforms
tagged with: python
accepted answer: http://stackoverflow.com/a/27738110
has title: WTForms submitting form twice when multiple forms are in the same page
score: 0
answer count: 1
tagged with: wtforms
tagged with: javascript

http://stackoverflow.com/comment/43704609
score: 0
type: Comment
has text: something like that... $fname = sanitizeString($_POST['fname']); $lname = sanitizeString($_POST['lname']); $username = sanitizeString($_POST['username']); $email = sanitizeString($_POST['email']); $password = sanitizeString($_POST['password']); if($_POST["answer"]) { $DoctorG = sanitizeString($_POST['DoctorG']); $DoctorAge = ($_POST['DoctorAge']); $specialty = sanitizeString($_POST['specialty']); $Doctor_ID = ($_POST['Doctor_ID']);
comment on: http://stackoverflow.com/a/27642571
type: AnswerComment

http://stackoverflow.com/comment/43930484
comment on: http://stackoverflow.com/a/27758758
score: 0
type: Comment
has text: They toggle in Chrome, but not FireFox
type: AnswerComment

http://stackoverflow.com/comment/43899454
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27743800
has text: I have added @Scriptable my basic and very simple implementation on the controller

http://stackoverflow.com/a/27720499
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/27720211
type: Answer
has body: It is protected by closure, You can achieve the same thing like this Function.prototype.bind = function( obj ) { var orig_function = this; return function() { return orig_function.apply(obj, arguments); } } Explanation Understanding Function.prototype.apply Using apply or call you can call a function with a specific context, See the following example: name = 'window'; obj = {name: 'obj'} fn = function() { return this.name; } fn() // =&gt; 'window' fn.apply(obj) // =&gt; 'obj' fn.call(obj) // =&gt; 'obj' The code at beginning returns a new function which binds the context using apply to the passed object. Hope this helps
score: 1

http://stackoverflow.com/comment/43932019
score: 0
type: Comment
type: QuestionComment
has text: @RoboRobok, I tried, but could not get progress (loaded) out of it :(
comment on: http://stackoverflow.com/q/27760327

http://stackoverflow.com/a/27776789
type: Answer
upvote count: 1
score: 1
has body: Try this: a.map(Function.prototype.call.bind(String.prototype.trim )) The reason why this works and just mapping String.prototype.trim doesn't work is because, as others have pointed out, the this will be undefined when the function tries to trim the array element. What this solution does is, it creates a new function, which takes as it's this value as the function String.prototype.trim. Since the new function is a modified version of Function.prototype.call, as map calls this function passing it the array element, what essentially gets executed is: Function.prototype.call.call(String.prototype.trim, element). This runs the function String.prototype.trim on the element passed in and you get the trimmed result. This also would work: a.map(Function.call, "".trim) by taking advantage of the fact that the second argument to map accepts the thisArg. For a little bit of syntactic sugar, you can make a function that looks like this: Array.prototype.mapUsingThis = function(fn) { return this.map(Function.call, fn); }; Then, you could just invoke a.mapUsingThis("".trim) like that.
downvote count: 0
answers question: http://stackoverflow.com/q/27776631

http://stackoverflow.com/q/27659514
has answer: http://stackoverflow.com/a/31697307
favorite count: 0
has comment: http://stackoverflow.com/comment/43747905
type: UnansweredQuestion
score: 6
has comment: http://stackoverflow.com/comment/43747783
upvote count: 6
answer count: 4
tagged with: phantomjs
has comment: http://stackoverflow.com/comment/43790406
has answer: http://stackoverflow.com/a/27659634
has comment: http://stackoverflow.com/comment/43747618
linked to: http://stackoverflow.com/q/26382041
type: Question
has comment: http://stackoverflow.com/comment/43767852
has answer: http://stackoverflow.com/a/32296921
downvote count: 0
tagged with: javascript
has title: Phantomjs Function.prototype.bind
has answer: http://stackoverflow.com/a/32163550
has body: Yes, I know that. Function bind is not supported by Phantomjs. But maybe I can use something else, or say page.open not to use bind? It seems to be OK, but some websites return error TypeError: 'undefined' is not a function (evaluating 'b.bind(a)') After that I wrote a simple script, which just opens a page: var address = phantom.args[0]; if(!address) phantom.exit(1); page = require("webpage").create(); page.open(address, function(status){ setInterval( function () { console.log( page.evaluate(function() { return document.body.innerHTML.length; }) )}, 200) }) But error is still there. Error is not the main problem, but the problem is to get page content, because after error page content is not loading... So, I need help. P.S. Problem website is http://vkrushelnytskiy.wix.com/aaaa

http://stackoverflow.com/a/27750210
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: I would use regex in this order: put space before any capital change special character to space remove all letter after the first letter in every word remove all space
answers question: http://stackoverflow.com/q/27750016

http://stackoverflow.com/q/27725127
type: Question
tagged with: window.location
has answer: http://stackoverflow.com/a/27725331
downvote count: 0
has comment: http://stackoverflow.com/comment/43862363
has comment: http://stackoverflow.com/comment/43862329
tagged with: javascript
has comment: http://stackoverflow.com/comment/43862439
favorite count: 0
has comment: http://stackoverflow.com/comment/43862430
possible better answer: http://stackoverflow.com/a/27725173
has answer: http://stackoverflow.com/a/27725173
accepted answer: http://stackoverflow.com/a/27725331
upvote count: 2
answer count: 5
tagged with: http-redirect
has body: I searched for a related post, but all attempts have not worked. My problem, is that I'm trying to do a simple redirect in Javascript, using path+querystring. My code is below: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Page1.aspx.cs" Inherits="WebApplication1.Page1" %> window.location.href is always set like 'http://localhost:61267/Page1.aspx'. I have tried using window.location.search but still without success. What I'm doing wrong?
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43862467
has comment: http://stackoverflow.com/comment/43862402
has answer: http://stackoverflow.com/a/27725174
has title: Redirect using window.location doesn't work
has answer: http://stackoverflow.com/a/27725283
has answer: http://stackoverflow.com/a/27729041

http://stackoverflow.com/comment/43913867
type: AnswerComment
type: Comment
has text: Thanks. I think I'm getting closer. Just learned about transclude, but the results are still a child of the original custom directive and not a replacement.
comment on: http://stackoverflow.com/a/27751398
score: 0

http://stackoverflow.com/a/27674301
type: Answer
score: 4
answers question: http://stackoverflow.com/q/27674077
upvote count: 4
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27674077
downvote count: 0
has body: You are getting this wrong because you don't understand AngularJS watchers javascript pass by reference AngularJS knows that values have changed in your application because of watchers. Watchers are assigned in many places, but in your case when you use $scope.shouldShow in the template. Changing the value of $scope.shouldShow will be picked up by angular and work, but changing isStateA will not, and that's because they are not the same variable. Here is the correct solution: // Your code app.service('stateAService', function() { this.isStateA = false; }) app.controller('AController', function($scope, stateAService) { $scope.stateAService = stateAService; }) app.controller('BController', function($scope, stateAService) { $scope.stateAService = stateAService; }) // Template, controller A &lt;div ng-show="stateAService.isStateA"&gt; &lt;/div&gt; // Template, controller B &lt;div ng-show="!stateAService.isStateA"&gt;&lt;/div&gt; // Some code, anywhere else in your app app.controller('WhateverController', function($scope, stateAService) { this.hideBAndShowA = function() { stateAService.isStateA = true; // The change to stateAService gets picked up by the watchers, all good } })

http://stackoverflow.com/comment/43712152
type: QuestionComment
type: Comment
has text: No ideas. You should post some more code about it especially the `some class` - I guess nobody here is a clairvoyant.
comment on: http://stackoverflow.com/q/27646952
score: 0

http://stackoverflow.com/a/27690647
answers question: http://stackoverflow.com/q/27690429
score: -1
has body: See this jsfiddle: http://jsfiddle.net/Grezzo/x1qxjx5y/ With &lt;tr&gt;s in &lt;table&gt;s they are ok. It's because you are putting a &lt;tr&gt; in a &lt;div&gt; which isn't valid. Putting unsanitized content in the page like this is a real security risk Update: I updated the jsfiddle to include two &lt;div&gt;s that were not modified by javascript and you can see that the &lt;tr&gt;s are stripped if they are not in a &lt;table&gt; parent: http://jsfiddle.net/Grezzo/x1qxjx5y/1/
has comment: http://stackoverflow.com/comment/43794883
type: Answer
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/43795447

http://stackoverflow.com/comment/43804606
type: Comment
comment on: http://stackoverflow.com/a/27695632
score: 0
has text: I was making this way more complicated then it needed to be.
type: AnswerComment

http://stackoverflow.com/q/27731484
has answer: http://stackoverflow.com/a/27731745
has comment: http://stackoverflow.com/comment/43874499
tagged with: jquery
favorite count: 0
has title: How to switch image if DIV is not hidden
accepted answer: http://stackoverflow.com/a/27731721
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has body: I have the following JQuery which displays a menu if a DIV is pressed: var pull = $('#mmTrigger'); menu = $('.ulMM'); menuHeight = menu.height(); $(pull).on('click', function(e) { e.preventDefault(); menu.slideToggle(); }); HTML: Portfolio About Contact Forum I modified the script to this: $(pull).on('click', function(e) { e.preventDefault(); menu.slideToggle(); if (menu.is(':hidden')) { $(".imgMenu").attr("src", "nav-icon.png"); } else { $(".imgMenu").attr("src", "iconx.png"); } }); But after clicking the DIV, the X stays and doesn't go back to the nav-icon.png once the menu is closed. How can I resolve it so that the X changes to the menu icon. I added this statement: alert (menu.is(':hidden')); it always returns false.
upvote count: 1
has comment: http://stackoverflow.com/comment/43874570
downvote count: 1
has comment: http://stackoverflow.com/comment/43875012
type: Question
has comment: http://stackoverflow.com/comment/43874432
has answer: http://stackoverflow.com/a/27731721
tagged with: javascript
has comment: http://stackoverflow.com/comment/43874956
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27731745

http://stackoverflow.com/comment/44008119
type: Comment
has text: Thank you Benjamin, this is a great answer, so I am accepting it, even though it is a little advanced for me at my current level of javascript. Please see below for my own answer - this is what I went with in the end, based on Zaheer Ahmed's Loops and Closures Walk-through (http://conceptf1.blogspot.co.uk/2013/11/javascript-closures.html).
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27797854

http://stackoverflow.com/comment/43901873
type: QuestionComment
comment on: http://stackoverflow.com/q/27745424
type: Comment
has text: Yeah, the code so far takes a CSV file and parses it in JSON then displays it on a DIV. Sry about not being more clear
score: 0

http://stackoverflow.com/q/27704446
downvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
type: Question
score: 3
has answer: http://stackoverflow.com/a/27704548
has comment: http://stackoverflow.com/comment/43821173
favorite count: 0
tagged with: iframe
has comment: http://stackoverflow.com/comment/43820888
tagged with: php
answer count: 1
upvote count: 3
has body: I want to reload a page after iframe close .. how to do this ?? i cant understand ? please any one can help me in this code ? <iframe src="<?php echo $this->base_url; ?>Profile_pic/index/<?php echo $id; ?>" width="100%" style="border:none; height:52px;">
has comment: http://stackoverflow.com/comment/43821002
has title: I want to Reload page after iframe close bt it reloaded at time of loading?

http://stackoverflow.com/comment/124636165
has text: Though this is not a direct answer to the question, I liked it best. Because my real task was to DETECT the presence of a Promise and then use the result. And since I'm in TypeScript, I should have written a type-guard for this. BUT mere `await res;` actually does the job in both JS and TS. Voilà.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27760489
score: 2

http://stackoverflow.com/a/27746276
upvote count: 1
has body: I feel stupid today... var alert = $alert({ title: 'Connection lost.', content: 'Please reload the page.', placement: 'top-right', type: 'danger', show: false }); socket.on('disconnect', function () { alert.show(); }); socket.on('connect', function () { alert.hide(); });
score: 1
answers question: http://stackoverflow.com/q/27746193
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44005146
type: Comment
comment on: http://stackoverflow.com/q/27798170
score: 0
has text: @DavinTryon yes im running it on a firefox browser using a tomcat server
type: QuestionComment

http://stackoverflow.com/comment/43938314
has text: because my orginal function is like this http://jsfiddle.net/885SQ/ , what do u expect me to do
comment on: http://stackoverflow.com/q/27763690
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27654146
linked to: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/43725975
type: UnansweredQuestion
has body: I am having trouble outputting the result of a MySQL query into being the dataset for a graph. I am not sure how to pass the results I get as a simple array. It echos out fine in php and the ajax request works, but (I am assuming) it is failing to format into the correct jquery/javascript format for an array. Here is the gist of my code: JavaScript part on main page that draws the graph: &lt;script&gt; var randomScalingFactor = function(){ return Math.round(Math.random()*100)}; var lineChartData = { labels : ["January","February","March","April","May","June","July"], datasets : [ { label: "Fast Signal", fillColor : "rgba(220,220,220,0.2)", strokeColor : "rgba(220,220,220,1)", pointColor : "rgba(220,220,220,1)", pointStrokeColor : "#fff", pointHighlightFill : "#fff", pointHighlightStroke : "rgba(220,220,220,1)", data : getFast() }, { label: "Slow Signal", fillColor : "rgba(151,187,205,0.2)", strokeColor : "rgba(151,187,205,1)", pointColor : "rgba(151,187,205,1)", pointStrokeColor : "#fff", pointHighlightFill : "#fff", pointHighlightStroke : "rgba(151,187,205,1)", data : getSlow() } ] } window.onload = function(){ var ctx = document.getElementById("canvas").getContext("2d"); window.myLine = new Chart(ctx).Line(lineChartData, { responsive: true }); } &lt;/script&gt; AJAX on main page that gets called when the graph loads: &lt;script type="text/javascript"&gt; function test(){ alert("test"); } function getAll(){ $.ajax({ type:"POST", url:"dataproc.php", data:{ action: true, all: true }, success:function(data){ $("#dataDiv").html(data); } }); } function getFast(){ $.ajax({ type:"POST", url:"dataproc.php", data:{ action: true, fast: true }, success:function(data){ $("#fastDiv").html(data); return data; } }); } function getSlow(){ $.ajax({ type:"POST", url:"dataproc.php", data:{ action: true, slow: true }, success:function(data){ $("#slowDiv").html(data); return data; } }); } function getHisto(){ $.ajax({ type:"POST", url:"dataproc.php", data:{ action: true, histo: true },…
tagged with: php
has comment: http://stackoverflow.com/comment/43725357
has answer: http://stackoverflow.com/a/27655118
type: Question
has title: Push PHP Array into AJAX response into JQuery array
duplicate of: http://stackoverflow.com/q/14220321
tagged with: arrays
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
answer count: 1

http://stackoverflow.com/q/27648877
tagged with: javascript
has title: How to create multiple markers 100+ on Google Maps
favorite count: 0
score: -1
type: UnansweredQuestion
downvote count: 1
has body: I want to show 100 markers on custom map am i supposed to repeat below single marker code 100 times and have enormous file or is there other more compact way to create multiple markers? var marker = new google.maps.Marker({ position: new google.maps.LatLng(34.052661,-118.269976), title:"Hello World!", map:map, animation: google.maps.Animation.DROP }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); var infowindow = new google.maps.InfoWindow({ content: '&lt;div id="content"&gt;'+ '&lt;div id="siteNotice"&gt;'+ '&lt;/div&gt;'+ '&lt;h1 id="firstHeading" class="firstHeading"&gt;Uluru&lt;/h1&gt;'+ '&lt;div id="bodyContent"&gt;'+ '&lt;p&gt;&lt;b&gt;Uluru&lt;/b&gt;, also referred to as &lt;b&gt;Ayers Rock&lt;/b&gt;, is a large ' + 'sandstone rock formation in the southern part of the '+ 'Northern Territory, central Australia. It lies 335&amp;#160;km (208&amp;#160;mi) '+ 'south west of the nearest large town, Alice Springs; 450&amp;#160;km '+ '(280&amp;#160;mi) by road. Kata Tjuta and Uluru are the two major '+ 'features of the Uluru - Kata Tjuta National Park. Uluru is '+ 'sacred to the Pitjantjatjara and Yankunytjatjara, the '+ 'Aboriginal people of the area. It has many springs, waterholes, '+ 'rock caves and ancient paintings. Uluru is listed as a World '+ 'Heritage Site.&lt;/p&gt;'+ '&lt;p&gt;Attribution: Uluru, &lt;a href="http://en.wikipedia.org/w/index.php?title=Uluru&amp;oldid=297882194"&gt;'+ 'http://en.wikipedia.org/w/index.php?title=Uluru&lt;/a&gt; '+ '(last visited June 22, 2009).&lt;/p&gt;'+ '&lt;/div&gt;'+ '&lt;/div&gt;', });
type: Question
tagged with: google-maps
has answer: http://stackoverflow.com/a/27649457
tagged with: google-maps-markers
upvote count: 0
answer count: 1

http://stackoverflow.com/comment/43705317
comment on: http://stackoverflow.com/a/27643266
score: 0
type: AnswerComment
has text: Hm, it looks ok, have you tried to use var in front of your first XMLHHTP?
type: Comment

http://stackoverflow.com/q/27752674
type: Question
has comment: http://stackoverflow.com/comment/43917214
has title: Creating ember components
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ember.js
tagged with: web
favorite count: 0
has body: I have the following code here for an embeddable component using emberjs which consists of a tab view and different tab panes. It tab-pane has a different handlebars template : App.obj = Ember.Object.create({ "items": data['item-list'] }); var templates = [{ name: 'list', list: ' {{#with App.obj}} {{#each item in items}} {{item.bar}} {{item.title}} {{item.foo}} {{/each}} {{/with}} ' }, { name: 'cal', cal: ' calendar ' }, { name: 'add', add: ' add events ' }, { name: 'dashboard', dashboard: '{{outlet tab}}\ list cal add ' }]; for (var i = 0; i < templates.length; i++) { $('.container').append(' "); }; The templates are appended one after another to the container. Is there a better approach to it the ember-way ? Something like - The code is meant to be embeddable, so minimal no. of templates are required in the html file, that's why I wrapped it in the javascript. Does ember has a better approach to it ?
answer count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43918257
has comment: http://stackoverflow.com/comment/43916731

http://stackoverflow.com/a/27660052
type: Answer
answers question: http://stackoverflow.com/q/27659852
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27659852
score: 1
type: AcceptedAnswer
downvote count: 0
has body: You have made quite a few mistakes: Watch your double quotes, (""script"") should be ("script"), as should all the places you've used double quotes. In myFunc(), alert needs brackets, put brackets around the string "Hi!", so should be: alert("Hi!"); You need to append your script tag to the body: document.body.appendChild(js); So the final code should look more like: var js = document.createElement("script"); js.src = "script2.js"; document.body.appendChild(js); Also, when referring to your script2 functions within the html, wrap them in this code: window.js.onload = function(){ // functions from script 2 go here myFunc(); } This stops the functions from running before myscript2 has loaded. Here's the final code: &lt;head&gt;&lt;script src="myscript1.js"&gt;&lt;/script&gt;&lt;/head&gt; &lt;!-- myscript1.js window.js = document.createElement("script"); js.src = "script2.js"; document.body.appendChild(js); --&gt; &lt;body&gt; &lt;script&gt; window.js.onload = function(){ myFunc(); /* * All your myscript2 functions can go here */ } &lt;/script&gt; &lt;/body&gt;

http://stackoverflow.com/comment/43876900
score: 0
type: Comment
has text: @markE has a valid point. Without a boundary you can get edge cases like. Mr. X is free on 12:21, so is Mr. Y, but Mr. X is going into meeting at 12:22. So he's free for just one minute.
comment on: http://stackoverflow.com/a/27732389
type: AnswerComment

http://stackoverflow.com/comment/43778289
type: Comment
comment on: http://stackoverflow.com/a/27681347
has text: Things worked, I just made the mistake of modifying the secret sauce in the included template that was making it work successfully before. Wouldn't you know it, fixing the code in there made it work... after pretty much after I followed every suggestion on this page. :)
score: 0
type: AnswerComment

cordova
tags question: http://stackoverflow.com/q/27754413
tags question: http://stackoverflow.com/q/27775469
tags question: http://stackoverflow.com/q/27698480
tags question: http://stackoverflow.com/q/27686998
tags question: http://stackoverflow.com/q/27766375
tags question: http://stackoverflow.com/q/27803409
tags question: http://stackoverflow.com/q/27784216
tags question: http://stackoverflow.com/q/27797513
tags question: http://stackoverflow.com/q/27792161
tags question: http://stackoverflow.com/q/27745564
tags question: http://stackoverflow.com/q/27747835
tags question: http://stackoverflow.com/q/27776231
tags question: http://stackoverflow.com/q/27754926
tags question: http://stackoverflow.com/q/27742280
tags question: http://stackoverflow.com/q/27725702
tags question: http://stackoverflow.com/q/27707472
tags question: http://stackoverflow.com/q/27777471
tags question: http://stackoverflow.com/q/27686986
tags question: http://stackoverflow.com/q/27720522
tags question: http://stackoverflow.com/q/27716635
tags question: http://stackoverflow.com/q/27761467
tags question: http://stackoverflow.com/q/27762678
tags question: http://stackoverflow.com/q/27774464
tags question: http://stackoverflow.com/q/27782621
tags question: http://stackoverflow.com/q/27760349
tags question: http://stackoverflow.com/q/27680006
tags question: http://stackoverflow.com/q/27692201
tags question: http://stackoverflow.com/q/27652554
tags question: http://stackoverflow.com/q/27684410
tags question: http://stackoverflow.com/q/27793051
tags question: http://stackoverflow.com/q/27777920
tags question: http://stackoverflow.com/q/27675348
tags question: http://stackoverflow.com/q/27798845
tags question: http://stackoverflow.com/q/27657954
tags question: http://stackoverflow.com/q/27760308
tags question: http://stackoverflow.com/q/27682468
tags question: http://stackoverflow.com/q/27714498
tags question: http://stackoverflow.com/q/27753970
tag name: cordova
tags question: http://stackoverflow.com/q/27668552
tags question: http://stackoverflow.com/q/27715034
tags question: http://stackoverflow.com/q/27767996
tags question: http://stackoverflow.com/q/27799434
tags question: http://stackoverflow.com/q/27682477
tags question: http://stackoverflow.com/q/27690881
tags question: http://stackoverflow.com/q/27770442
tags question: http://stackoverflow.com/q/27801912
tags question: http://stackoverflow.com/q/27771562
tags question: http://stackoverflow.com/q/27675370
tags question: http://stackoverflow.com/q/27657233
tags question: http://stackoverflow.com/q/27666360
tags question: http://stackoverflow.com/q/27742153
tags question: http://stackoverflow.com/q/27696976
tags question: http://stackoverflow.com/q/27748177
tags question: http://stackoverflow.com/q/27743079
tags question: http://stackoverflow.com/q/27727498
type: Tag
tags question: http://stackoverflow.com/q/27794488
tags question: http://stackoverflow.com/q/27730224
tags question: http://stackoverflow.com/q/27740802
tags question: http://stackoverflow.com/q/27653273
tags question: http://stackoverflow.com/q/27771254
tags question: http://stackoverflow.com/q/27649758

http://stackoverflow.com/q/27736519
upvote count: 1
score: 1
type: Question
answer count: 1
downvote count: 0
has body: I am getting this error. Refused to display 'https://www.google.com.au/?gfe_rd=cr&ei=uPilVOfREaGN8QfsvIGABQ&gws_rd=ssl' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. I have made an html5 ad and upload on my Ad server which generates a script and i place that script on the page to test the ad. The page loads ad in an iframe. I have a very simple link to open the google.com page in my orignal index page but i am getting this error in the test page. Testing!
tagged with: javascript
has title: 'X-Frame-Options' to 'SAMEORIGIN'. error
tagged with: jquery
favorite count: 0
tagged with: cross-domain
linked to: http://stackoverflow.com/q/8700636
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27736559
type: UnansweredQuestion

http://stackoverflow.com/comment/44006990
comment on: http://stackoverflow.com/a/27795676
score: 0
type: AnswerComment
type: Comment
has text: I find this pretty complicated to understand but I tried using the formula `t1=((B.x-C.x)/(B.x-A.x) + (B.y-A.y)*(C.y-B.y)/((A.x-B.x)*(B.x-A.x)))/(1-((B.y-A.y)/((A.x-B.x)*(B.x-A.x))))` to get t1 and used the solucation to get x with it but the answer was wrong (probably my mistake) I guess I should start with looking into algebraic solutions.

http://stackoverflow.com/comment/55967687
has text: @Bergi the link to the "doublicate" does not contain an explanation. Should I move my answer to the other post?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27661306

http://stackoverflow.com/comment/43963534
score: 2
comment on: http://stackoverflow.com/q/27775618
type: Comment
type: QuestionComment
has text: I know that asynch doesn't have to mean ajax. But the `d3.json()` method *does* do an ajax call, doesn't it? The d3 doco page seems to say so without ever actually using the word "ajax" (it talks about XMLHttpRequests, which are essentially the same thing). In any case, to solve your problem I'd suggest updating your `loadJson()` function to take a callback function as a parameter and then call `loadJson()` from your page passing a callback.

http://stackoverflow.com/a/27798563
has body: I think a simple nested loop is the simplest way to solve this. As far as i know there is no "json join" feature in javascript. Try this: var colors = {"COLORS":[[1,"red"],[2,"yellow"],[3,"orange"]]}; var fruits = {"FRUITS":[[1,"apple",1],[2,"banana",2],[3,"orange",3], [4,"grenade",1], [5,"apple",2]]}; console.log(fruits); for (var i = 0; i &lt; fruits.FRUITS.length; i++) { var temp = fruits.FRUITS[i]; for (var j = 0; j &lt; colors.COLORS.length; j++) { if (colors.COLORS[j][0] === temp[2]) { temp[2] = colors.COLORS[j][1]; break; } }; fruits.FRUITS[i] = temp; }; console.log(fruits);
score: 2
downvote count: 0
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27798218

http://stackoverflow.com/q/27655348
tagged with: signalr
type: Question
has body: I'm making a chat application using SignalR API. I'm getting error as: 0x800a138f - JavaScript runtime error: Unable to get property 'client' of undefined or null reference Here is my code: SignalR Chat Room Your Name: Welcome to Chat Room []
has comment: http://stackoverflow.com/comment/43727119
score: -2
linked to: http://stackoverflow.com/q/25003039
tagged with: .net
tagged with: javascript
answer count: 2
downvote count: 4
has comment: http://stackoverflow.com/comment/43727093
tagged with: asp.net
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has title: Getting 0x800a138f - JavaScript runtime error: Unable to get property 'client' of undefined or null reference
has answer: http://stackoverflow.com/a/27656468
has comment: http://stackoverflow.com/comment/62236667
has answer: http://stackoverflow.com/a/28465264

http://stackoverflow.com/q/27646486
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/33030654
tagged with: google-analytics-api
type: Question
has body: My customers provide me some ecommerce data I want to analyze by Google Analytics and show them as graph on a page or something. I'm kind of mediator between them and Google Analytics. The point is that they only provide the data to me, they don't communicate with Google Analytics directly, only indirectly via me. Here's a quote from https://support.google.com/analytics/answer/1037249?hl=en https://support.google.com/analytics/answer/1037249?hl=en Use ecommerce tracking to find out what users buy through your site or app, including information about: Products: Which products they buy, in what quantity, and the revenue generated by those products. Transactions: The revenue, tax, shipping, and quantity information for each transaction. Time to Purchase: The number of days and number of sessions it takes to purchase, starting from the most recent campaign through the completed transaction. .... and so on ... What Google Analytics API methods should I call to provide my customers such the data back? Is it possible at all without having them to inject some javascripts scripts from Google Analytics to their websites?
tagged with: google-analytics
tagged with: javascript
tagged with: statistics
has comment: http://stackoverflow.com/comment/75914894
score: 0
tagged with: rest
has title: Google Analytics API ecommerce data

http://stackoverflow.com/comment/43960809
type: AnswerComment
score: 0
type: Comment
has text: Got it work in code behind with `Regex.Escape();`, thank you! :)
comment on: http://stackoverflow.com/a/27758845

http://stackoverflow.com/comment/43749851
type: Comment
has text: hope you got my point
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27667253

http://stackoverflow.com/a/27676040
accepted answer of: http://stackoverflow.com/q/27675849
upvote count: 2
has comment: http://stackoverflow.com/comment/43767018
has body: There's no such thing like an instant application server with PHP. Each and every script needs to load the entire application context in to memory again and again. That's the great disadvantage of PHP. If you have an object, storing context values, like your RoadTaxDataParser, you need to save the state, and within the next script, restore it, sinc after execution of a script, the memory gets cleared and the instance of your RoadTaxDataParser is gone. You may do it like this, using the singleton design pattern (code not tested): class RoadTaxDataParser { public static $__instance = null; private static $data = []; public static function set ($key, $value) { self::$data[$key] = $value; $_SESSION['rtdp'] = self; // could be done better } public static function get ($key) { return self::$data[$key]; } public static function getInstance() { if ( self::$__instance != null ) return self::$__instance; self::$__instance = isset($_SESSION['rtdp']) ? $_SESSION['rtdp'] : new RoadTaxDataParser(); return self::$__instance; } and then RoadTaxDataParser::getInstance()-&gt;set('test', $road_tax_data); Additionally, you need to start a session first in every script: session_start(); see php.net/manual/en/function.session-start.php - as the first statement! Actually, the object only needs to be synchronized in to the session when the script terminates and not every time a value is assigned. But this needs another handler, which complicates structure over here.
score: 2
has comment: http://stackoverflow.com/comment/43766630
has comment: http://stackoverflow.com/comment/43766598
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43766609
type: Answer
answers question: http://stackoverflow.com/q/27675849
has comment: http://stackoverflow.com/comment/43766659

http://stackoverflow.com/comment/43853242
has text: Yus it's shorter ineed :)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27720548

http://stackoverflow.com/comment/43972631
type: Comment
has text: I've implemented this answer (the first part with the "redirection" class on the quote-container div and the quote div) and it seems to be doing the trick. Thanks heaps.
comment on: http://stackoverflow.com/a/27781233
type: AnswerComment
score: 1

http://stackoverflow.com/q/27677315
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27677319
linked to: http://stackoverflow.com/q/20279484
tagged with: closures
type: Question
accepted answer: http://stackoverflow.com/a/27677319
duplicate of: http://stackoverflow.com/q/20279484
score: 0
has body: It is possible to use this javascript variable reffering to myObject in all occurences in the following code? jsFiddle - open console function MyObject() { this.myProperty = "a property"; console.log("1 - this is %o (%s) in MyObject declaration", this, Object.prototype.toString.call(this)); (function poll() { console.log("2 - this is %o (%s) in poll function", this, Object.prototype.toString.call(this)); setTimeout(function() { console.log("3 - this is %o (%s) in setTimeout function", this, Object.prototype.toString.call(this)); $.ajax({ url: "/echo/json/", dataType: "json", success: function(data) { console.log("4 - this is %o (%s) in ajax.success function. We have some data returned: %o", this, Object.prototype.toString.call(this), data); }, complete: poll }); }, 1000); })(); }; $(document).ready(function() { var myObject = new MyObject(); });
answer count: 2
tagged with: this
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27677371
has answer: http://stackoverflow.com/a/27677371
tagged with: long-polling
has title: JS - How to use `this` to reffer to the same object in various scopes?

http://stackoverflow.com/comment/43992449
has text: Dunno, I don't know much about SVG. I hope you've changed to DOM methods, Safari doesn't seem to like *innerHTML* with SVG elements.
score: 1
comment on: http://stackoverflow.com/q/27790128
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27726979
has answer: http://stackoverflow.com/a/27727025
has body: I print success message using PHP like this : Success!! I have this CSS3 Animate: .animated { -webkit-animation-duration: 1s; animation-duration: 1s; -webkit-animation-fill-mode: both; animation-fill-mode: both; } .animated.infinite { -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; } .animated.hinge { -webkit-animation-duration: 2s; animation-duration: 2s; } @-webkit-keyframes fadeOutUp { 0% { opacity: 1; } 100% { opacity: 0; -webkit-transform: translate3d(0, -100%, 0); transform: translate3d(0, -100%, 0); } } @keyframes fadeOutUp { 0% { opacity: 1; } 100% { opacity: 0; -webkit-transform: translate3d(0, -100%, 0); transform: translate3d(0, -100%, 0); } } .fadeOutUp { -webkit-animation-name: fadeOutUp; animation-name: fadeOutUp; } Now, I need to remove success message with my CSS Animate (fadeOutUp) after 5 seconds using jQuery. How do can i create this?!
has title: Remove div message using CSS animate and jQuery
has answer: http://stackoverflow.com/a/27727001
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/27727001
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27727025

http://stackoverflow.com/comment/43924737
type: QuestionComment
has text: ultimately that module runs `coffee --nodejs --debug app.coffee`. I did wonder whether the --nodejs arg might be the key but it only partly works. The repl isn't invoked certainly but the debugger statement pauses the browser...
comment on: http://stackoverflow.com/q/27754053
score: 0
type: Comment

http://stackoverflow.com/comment/44011204
type: QuestionComment
type: Comment
has text: Thank you very much. This is just what I needed. Can you help me with finding a javascript code by when I insert a number and hit a submit button it will have the exponent of that number. Its like 4 to the fourth power.
comment on: http://stackoverflow.com/q/27799921
score: 0

http://stackoverflow.com/a/39878497
has comment: http://stackoverflow.com/comment/84131147
upvote count: 33
type: Answer
has comment: http://stackoverflow.com/comment/118060920
has comment: http://stackoverflow.com/comment/84137527
downvote count: 0
score: 33
has body: If you are remote debugging Chrome on an android device, the Chrome debugger cannot just access any file it wants on the device and that includes separate map files. If you include them inline you don't have this issue.
answers question: http://stackoverflow.com/q/27671390
has comment: http://stackoverflow.com/comment/84115903

http://stackoverflow.com/q/27705765
has body: I need to create this layout in a SPA using AngularJS and a web api. The workflow goes as follows: When the controller loads, two sets of data get fetched from the api (table above and table to the left - e.g. 2 calls to api/data1 and api/data2) As soon as the user clicks a row in the upper table, detail information gets fetched into the box on the right side (api/data1/3434/detail) When the user clicks on certain entries from the detail information box, the related entries are being highlighted in the table to the left. I started creating a view with everything in it, also a controller that exposes properties for all necessary stuff, but now it looks like this (pseudo) myPageController table1Data : Array&lt;IData1Model&gt;; table2Data : Array&lt;IData2Model&gt;; userSelectedFromTable1 : IData1Model; userSelectedFromTable2 : IData2Model; I feel this isn't really good practice. Is there a way to suborganize the parts into some kind of partial views? Subcontrollers? Or is this a common approach? What does the usual controller looks like when he's going to serve for multiple kinds of data / api endpoints? EDIT I should clarify that this is just one particular page (section) of a bigger app. Most parts are just frontends for one kind of data, e.g. one controller, one model, one api call etc. Think of the page as some kind of dashboard where multiple data is shown and interact with each other.
tagged with: angularjs
has answer: http://stackoverflow.com/a/27714218
has title: Angular controller structure for multipart view
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43994585
linked to: http://stackoverflow.com/q/25667660
has comment: http://stackoverflow.com/comment/43828847
has comment: http://stackoverflow.com/comment/43956386
has comment: http://stackoverflow.com/comment/43829319
upvote count: 1
has comment: http://stackoverflow.com/comment/43827730
type: Question
accepted answer: http://stackoverflow.com/a/27714218
tagged with: c#
tagged with: typescript
tagged with: javascript
linked to: http://stackoverflow.com/q/20578840
has comment: http://stackoverflow.com/comment/43823406
linked to: http://stackoverflow.com/q/27696612
downvote count: 0
answer count: 1
tagged with: asp.net-web-api
score: 1
favorite count: 0

http://stackoverflow.com/comment/43750868
comment on: http://stackoverflow.com/a/27668108
has text: Yes. That's right. If I remove that, it won't get triggered at all. Can't I detect change using `.change()` method and avoid condition checks?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27705108
has body: I am new to angular and working on a angular directive which used to trigger a modal show event based on the value from the controller with a isolated function which binds model and view with the correct values. But when i get the textbox value directly using jquery it only returns the old value of the model. I have also used $timeout to wait until digest cycle completes. Am i missing something ? Here's my code HTML <.. ng-repeat='tab in tabs'> Show {{tab.name}} </..> Directive (...).directive('trigger', [..., function($timeout) { return { restrict:'A', scope: { trigger:'&' }, link: function(scope, elem, attrs) { $(elem).click(function() { scope.trigger(); // works fine. model binds and shown in the view $timeout(function(){ $("#modal").show(); // also working.. $("#modal").find('input').each(function(i,e) { console.log($(e).val()); // prints the old model values. }); },100); } } } }]); Thanks in advance. I have added a fiddle for this jsfiddle
tagged with: javascript
type: UnansweredQuestion
answer count: 0
tagged with: jquery
tagged with: angularjs
type: Question
has title: Getting the Angular model value directly from textbox using jquery
has comment: http://stackoverflow.com/comment/43824678
has comment: http://stackoverflow.com/comment/43823515
score: 0
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/43822264

http://stackoverflow.com/comment/43907304
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27747963
has text: look up the terms "type coercion"

http://stackoverflow.com/comment/43857734
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27721804
has text: Using json_encode doesn't work...
score: 0

http://stackoverflow.com/comment/43842452
comment on: http://stackoverflow.com/q/27702274
has text: haha we all done that before ^^
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27682084
tagged with: javascript
has comment: http://stackoverflow.com/comment/43793705
has comment: http://stackoverflow.com/comment/43780752
score: 0
has comment: http://stackoverflow.com/comment/43792080
answer count: 1
has comment: http://stackoverflow.com/comment/43778861
tagged with: jquery
tagged with: asp.net
tagged with: ajax
type: AnsweredQuestion
has body: I have a ASP.Net project(not website). I have added the JQuery autocomplete widget to my master page and use the widget in MyPage.aspx. In the .master I use something like this: $.ajax({ url: "/MyService.asmx/MySearchMethod", data: "{ 'param1': '" + request.term + "' }", dataType: "json", type: "POST", contentType: "application/json; charset=utf-8", dataFilter: function (data) { return data; }, The MyService.asmx points to: CodeBehind="~/App_Code/MyServiceMethods.cs" Class="MySearchMethod" Everything works fine while in VS2010 development. The problem is when I deploy the app to a test web server, I get the below error: System.InvalidOperationException: No web service found at: /MyService.asmx How can I reference my web service in the ajax url: so that the address can be resolved when the app is deployed?
type: Question
has title: How to resolve web service url in JQuery Ajax?
has answer: http://stackoverflow.com/a/27686797
accepted answer: http://stackoverflow.com/a/27686797

http://stackoverflow.com/comment/49615642
type: AnswerComment
type: Comment
score: 1
has text: S3 returns DeleteMarker and VersionId.
comment on: http://stackoverflow.com/a/27984712

http://stackoverflow.com/q/27711394
type: AnsweredQuestion
score: 0
type: Question
has body: I have many select elements like below , When any option is selected I need to get the value of data-cal Per 100g 1 cup, mashed 1 cup, sliced Per 100g 1 cup 1 cup big My jquery code $('select[name="caloriecalculator"]').change(function() { //I need to get the data atribute (data-cal) of select here. });
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27711417
answer count: 2
possible better answer: http://stackoverflow.com/a/27711410
has title: Get custom attribute value in multiple select
has answer: http://stackoverflow.com/a/27711410
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27711417

http://stackoverflow.com/comment/44004045
type: QuestionComment
comment on: http://stackoverflow.com/q/27796920
has text: [SVG arcTo vs Canvas arcTo](http://stackoverflow.com/questions/6729056/mapping-svg-arcto-to-html-canvas-arcto)
score: 0
type: Comment

http://stackoverflow.com/comment/43778543
score: 0
has text: On @PM77-1 question: It is forbidden to retrieve the full path to a file due to security policies by modern browsers. A malicious coder could use this to retrieve information about your machine.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27681847

http://stackoverflow.com/a/27673162
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27667573
has body: $data = "https://maps.googleapis.com/maps/api/place/textsearch/xml?query=".$location."&amp;key=YOUR_KEY_HERE"; $xml = file_get_contents($data); $xml = simplexml_load_string($xml); foreach($xml-&gt;result-&gt;place_id as $key =&gt; $value){ $location_id = $value; } With this code I have returned the correct ID for each location, in this instance my $location = 'London' With Maps JavaScript the final result is
type: Answer
accepted answer of: http://stackoverflow.com/q/27667573

http://stackoverflow.com/a/27786549
type: Answer
downvote count: 0
has body: Change the first line to: $('table:not(".no-collapse") tbody &gt; tr:not(".collapse")').hide(); jsFiddle example
score: 1
accepted answer of: http://stackoverflow.com/q/27786486
answers question: http://stackoverflow.com/q/27786486
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/43739160
comment on: http://stackoverflow.com/a/27661549
has text: Just enqueue the script on necessary pages only. Since your using Wordpress, I assume you're using a custom post type for your coupons?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27776617
upvote count: 2
has comment: http://stackoverflow.com/comment/43963847
has body: You are not clearing the timeout. When you set the timeout use, timeout = setTimeout(check, 1700); when you clear the timeout use, clearTimeout(timeout); See the documentation Also because your timeout is a constant, you can use the function setInterval here and get rid of the recursion, current_money = parseInt($(this).find('.text-white').text()); var current_category_id = $(this).find('.category_id').val(); game.getQuestion(current_category_id, current_money); game.selected_question = $(this); var result = 15; var seconds = 15; var check = function(){ if(seconds &lt; 0) { checkAnswer(-1, 0, null); } else { var percentage = Math.round((seconds / result) * 100); $('#countDownChart').data('easyPieChart').update(percentage); $('#time').text(seconds); seconds--; } } interval = setInterval(check, 1700); Then clear it with, clearInterval(interval); see documentation
has comment: http://stackoverflow.com/comment/43964146
has comment: http://stackoverflow.com/comment/43963881
answers question: http://stackoverflow.com/q/27776482
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43963681
type: Answer
accepted answer of: http://stackoverflow.com/q/27776482
score: 2

http://stackoverflow.com/comment/47567653
has text: @Jonathon: I don't think they ever were. They might be transpiled to `.bind`, but that's not how they are specced in ES6.
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/27661420
type: Comment

http://stackoverflow.com/comment/43959030
comment on: http://stackoverflow.com/q/27773979
type: Comment
type: QuestionComment
has text: @anubhava - are you serious, I closed as a duplicate of this -> http://stackoverflow.com/questions/2202811/converting-straight-quotes-to-curly-quotes
score: 0

http://stackoverflow.com/comment/43720068
has text: I had thought of doing that at first, but then I decided to let the user call the plugin on any event he desires. On top of that, passing event seems much easier than passing {target: "#targetEl"}, but as you mentioned it might not be a good design decision.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27651448

http://stackoverflow.com/comment/43822273
type: Comment
has text: create another object which contains these two values and return it !
comment on: http://stackoverflow.com/q/27705204
type: QuestionComment
score: 5

http://stackoverflow.com/comment/43774170
has text: @RaMs_YearnsToLearn: filter function is applied to each element of the array & return value of 'false' will cause it not to be included in the new array.
comment on: http://stackoverflow.com/a/27679787
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43839234
has text: @JimLockwood The important takeaway here is to keep your identifiers out of the global scope. :)
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/27713492
type: Comment

http://stackoverflow.com/q/27670991
score: 0
answer count: 1
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27671516
has title: Change order of SVG elements using javascript
type: Question
has body: I have an SVG in an HTML doc and would like to make it so that when I click on a rectangle it moves to the top layer. The only thing I found for this was this: return this.parent.removeElement(this).put(this); but this doesn't work.
tagged with: javascript
has comment: http://stackoverflow.com/comment/43756687

http://stackoverflow.com/comment/44298297
type: QuestionComment
comment on: http://stackoverflow.com/q/27783269
has text: what is the exact version of angular you're using? is it 1.2.7 or less than it
score: 0
type: Comment

http://stackoverflow.com/a/27702195
has body: It's quite simple, you just need to iterate over one object and copy its properties/values into the other object: for (key in child) master[key] = child[key];
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27702096
answers question: http://stackoverflow.com/q/27702096
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27666030
has body: This may be the answer. And ContactMgr.Controller = Marionette.Controller.extend({ detail: function (id) { ... var _model = contacts.get(id); ... var view = new MyLayout({model: _model}); App.getRegion('contentRegion').show(view); } }); MyLayout = Marionette.Layout.extend({ ... regions: { mainRegion: '#...', sideRegion: '#...' }, contactView: null, sideView: null, onShow: function () { this.getRegion('mainRegion').show(this.contactView); this.getRegion('sideRegion').show(this.sideView); }, initialize: function (opt) { var _model = opt.model; this.contactView = new Marionette.ItemView({ model: _model }); this.sideView = new Marionette.ItemView({ model: _model }); } });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27653681

http://stackoverflow.com/a/27707327
type: AcceptedAnswer
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43827352
accepted answer of: http://stackoverflow.com/q/27707032
has comment: http://stackoverflow.com/comment/43827662
answers question: http://stackoverflow.com/q/27707032
has comment: http://stackoverflow.com/comment/43828771
has body: Here is a working fiddle. http://jsfiddle.net/dv5cps05/3/ (Or - to see an actual image since one wasn't provided, see http://jsfiddle.net/dv5cps05/4/) There are 2 problems in the code you shared: 1) As others pointed out, you need to leave out the , in the selector. Also, in your comment, you say the &lt;p&gt; elements contain an &lt;img&gt;, which isn't shown in your example code... So change your selector from: $('p:lt(5), [src$="'+a+'"]') to $('p:lt(5) img[src$="'+a+'"]') 2) You didn't tell us what the js variable a was set to. Make sure it's set in your code, and that it matches the end of the src attribute. For this example, I just used the word "card"

http://stackoverflow.com/a/27912398
upvote count: 3
has comment: http://stackoverflow.com/comment/44226351
score: 3
has body: This looks like an excellent use for the Promise object. Promises improve reusability of callback functions by providing a common interface to asynchronous computation. Instead of having each function accept a callback parameter, Promises allow you to encapsulate the asynchronous part of your function in a Promise object. Then you can use the Promise methods (Promise.all, Promise.prototype.then) to chain your asynchronous operations together. Here's how your example translates: // Instead of accepting both a url and a callback, you accept just a url. Rather than // thinking about a Promise as a function that returns data, you can think of it as // data that hasn't loaded or doesn't exist yet (i.e., promised data). function getData(url) { return new Promise(function (resolve, reject) { // Use resolve as the callback parameter. }); } function parseData(data) { // Does parseData really need to be asynchronous? If not leave out the // Promise and write this function synchronously. return new Promise(function (resolve, reject) { }); } getData("someurl").then(parseData).then(function (data) { console.log(data); }); // or with a synchronous parseData getData("someurl").then(function (data) { console.log(parseData(data)); }); Also, I should note that Promises currently don't have excellent browser support. Luckily you're covered since there are plenty of polyfills such as this one that provide much of the same functionality as native Promises. Edit: Alternatively, instead of changing the Function.prototype, how about implementing a chain method that takes as input a list of asynchronous functions and a seed value and pipes that seed value through each async function: function chainAsync(seed, functions, callback) { if (functions.length === 0) callback(seed); functions[0](seed, function (value) { chainAsync(value, functions.slice(1), callback); }); } chainAsync("someurl", [getData, parseData], function (data) { console.log(data); }); Edit Again: The solutions presented above…
answers question: http://stackoverflow.com/q/27709202
downvote count: 0
type: Answer

http://stackoverflow.com/a/27758262
score: 0
has body: jQuery returns an array like object, which contains DOM elements that match your selector (if any). In your case variable=$(.foo); Is equivalent to [&lt;div class="foo"&gt;&lt;/div&gt;, &lt;div class="foo"&gt;&lt;/div&gt; /* ... */] Since your for loop is iterating over the DOM elements in that returned array. You can either re-wrap the element as a jQuery Object like so: for(var k=0;k&lt;variable.length;k++){ $(variable[k]).find('ul').doSomethingWithThese } Or use $.each to iterate over your collection: $.each(variable, function () { $(this).find('ul').doSomethingWithThese });
answers question: http://stackoverflow.com/q/27758139
type: Answer

http://stackoverflow.com/a/29311409
type: Answer
score: 8
answers question: http://stackoverflow.com/q/27654005
downvote count: 1
upvote count: 9
accepted answer of: http://stackoverflow.com/q/27654005
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/86384177
has body: As a matter of fact, in order to show the gallery app to android user, your element must have two properties explicitly defined: type which is file and accept which could be, as mentioned, image/* (or any image-related mime-type) A way to achieve this is by instantiating the Dropzone object yourself rather than relying on the dropzone class of a : // removes the magical auto discovery of dropzone forms Dropzone.autoDiscover=false; // add accepted mimeTypes options (comma separated string) // myDz is the camelCased version of the id of the element that will be "dropzoned" Dropzone.options.myDz = { acceptedFiles: 'image/*'}; $(function(){ // instantiate dropzone on element with #my-dz id // if no action in the form or applying dropzone on a non form (ie a div), // you should at least pass the url in an object as the second parameter dz = new Dropzone('#my-dz' /*, {url:"/my-upload-url"}*/); }); Test Dropzone Android You could find some useful (although a little dated) information here: Uploading photos from mobile web app PS: Thanks to John who helped me to gather those informations

http://stackoverflow.com/comment/43991837
type: AnswerComment
score: 0
type: Comment
has text: Anyway, last night, I uploaded this mailc.php file into my web hosting space (godaddy), which is linux based. I hope php files work in linux-based hostings, or do they not? But still, my contact form isn't working. When I fill in the form and click submit button, I am taken to "http://bandeutkalajanani.in/mailc.php" but it says that the page couldn't be found!
comment on: http://stackoverflow.com/a/27778269

http://stackoverflow.com/a/27674670
score: 0
type: Answer
has body: function takePicture () { pictureSource = navigator.camera.PictureSourceType.CAMERA; processPicture() } takePicture(); Having a quick look at your code, you call the takePicture() function in the instantiation of your controller. That means when your app starts AngularJS has already created the controller and called that function. Comment the line out, and you will see your problem stop. You need to find a way to call the takePicture function when the user navigates, not when the controller is instantiated. EDIT: looking at the angular api for router, you are probably interested in onExit and onEnter functions of state changes: https://github.com/angular-ui/ui-router/wiki
answers question: http://stackoverflow.com/q/27674640
has comment: http://stackoverflow.com/comment/43764359

http://stackoverflow.com/comment/43743406
has text: www.czyjestemladna.pl There is a short registration but email activation is not needed so you can do it very quickly
comment on: http://stackoverflow.com/a/27652851
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27665949
answers question: http://stackoverflow.com/q/27665818
has comment: http://stackoverflow.com/comment/43747063
has comment: http://stackoverflow.com/comment/43746981
has comment: http://stackoverflow.com/comment/43747110
has comment: http://stackoverflow.com/comment/43747123
score: 0
type: Answer
has body: $('#yourbuttonid').on("click" , function() { //your existing above logic comes here });

http://stackoverflow.com/comment/43888722
score: 0
comment on: http://stackoverflow.com/q/27738965
type: Comment
type: QuestionComment
has text: Drop that deprecated `align="center"`; use CSS instead.

http://stackoverflow.com/q/27667160
answer count: 2
has title: HTML - Auto Jump to Named Anchors
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27667210
type: Question
has body: I have a website that has a search box and some options. On the mobile page, this search box and options are visible first, which is really good on the start page. But when user searches something, the result is shown in a page having again the search box and options on top. I would like to write a piece of code, that automatically jumps to content start. Simply, I have created an anchor using: &lt;a name="contentstart"&gt; just before the content. When the user opens this page, it should automatically jump to contentstart without having to press any link/button. How can I achieve that.
has answer: http://stackoverflow.com/a/27667281
tagged with: javascript
score: 0

http://stackoverflow.com/a/27681193
has comment: http://stackoverflow.com/comment/43777553
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27681066
has comment: http://stackoverflow.com/comment/43777389
has comment: http://stackoverflow.com/comment/43777337
type: Answer
upvote count: 1
has body: Apparently Chrome and Safari are wrong: onchange should only be triggered when the user releases the mouse. To get continuous updates, you should use the oninput event, which will capture live updates in Firefox, Safari and Chrome, both from the mouse and the keyboard. However, oninput is not supported in IE10, so your best bet is to combine the two event handlers, like this: &lt;span id="valBox"&gt;&lt;/span&gt; &lt;input type="range" min="5" max="10" step="1" oninput="showVal(this.value)" onchange="showVal(this.value)"&gt; Check out this Bugzilla thread for more information.
score: 1
has comment: http://stackoverflow.com/comment/43777264
accepted answer of: http://stackoverflow.com/q/27681066

http://stackoverflow.com/q/27674400
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43763882
type: Question
has title: Angular create tabs views without loosing data
has body: I need to create 3 tabs, every tab view has its own controller, but all of them connected one to each other. I need the data to stay, when i move from tab to another and comeback, something like form fields texts or whatever. The way i try to do this with ng-include and ng show but it doesnt work, the step two controller dosent run. This is the main page, that start with step one: // step one content Next Step Two tpl - //content Step One controller: $scope.stepOneView = true; $scope.goToStepTwo = function() { $scope.stepOneView = false; $scope.stepTwoView = true; } Step Two controller - console.log('Im in step two'); // This is not working
tagged with: javascript
has answer: http://stackoverflow.com/a/27675170
score: 0
answer count: 1

http://stackoverflow.com/a/27671429
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27671380
type: Answer
answers question: http://stackoverflow.com/q/27671380
has body: Javascript doesn't have variable references or aliases. When you assign a variable to another variable or object, it gets its value at the time of the assignment, it doesn't keep a link to the original location. If you want something that always gets the current value of a variable, you have to use a function: seats = [ { name: function() { return xyz.a; }, address: function() { return xyz.b; } }]; Then you would call the function to get what you want: seats[0].name();

http://stackoverflow.com/comment/43926329
type: AnswerComment
comment on: http://stackoverflow.com/a/27732746
type: Comment
has text: Is there a way to make the function known inside post and get? Where will i need to declare it?
score: 0

selectize.js
tags question: http://stackoverflow.com/q/27757666
type: Tag
tag name: selectize.js

http://stackoverflow.com/comment/43827086
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27707641
has text: `document.getElementById("image").src = data` doesn't quite cut it?

http://stackoverflow.com/comment/43981099
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27785455
has text: Your jsFiddle is working perfectly for me. It's correctly showing `"undefined"` for `attr('value')` because the `value` attribute is missing for this particular `option`.
score: 0

http://stackoverflow.com/comment/43929474
type: Comment
score: 2
comment on: http://stackoverflow.com/a/27758934
type: AnswerComment
has text: The combo of github and SO is mighty impressive, & useful, for being able to take a question like this and join it up to the commit and then the author, who can then answer the question.

http://stackoverflow.com/a/27773223
answers question: http://stackoverflow.com/q/27773174
score: 0
has body: What I get from your question you wan't to store key and value in different data-attributes. What you are doing $("#services").data(key, value); suppose:- key='a' and value= 12 and services is a div it will add a data-attribute which has a value 12 and can be retrieved using key 'a' like bellow. $("#services").data('a'); will give you 12 If you want to insert multiple data-attributes you have to set the data attribute for each item once. Like bellow $("#services").data('key', key); $("#services").data('value', value); DEMO
type: Answer

http://stackoverflow.com/comment/43989543
has text: I like this implementation the best, but I'm having trouble with my Triangle shape. So I have a random color generator creating the background color for the shapes when they appear, but because the triangle doesn't have a true background color, rather the border-bottom is set as the background color. I've tried this solution, document.getElementsByClassName("triangle").style.borderBottom = "200px " + "solid " + getRandomColor(); but it's not working either... any suggestions on this?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27786694
type: Comment

http://stackoverflow.com/a/27820393
has comment: http://stackoverflow.com/comment/44048970
has body: After your previous question about the polygons, I started making something, a javascript object. It will show its use here. I posted it there (I skipped the documentation in this post here, please read the documentation there): Mercator Projection slightly off I first post the code, I explain later. Getting coordinates perpendicular to AB What I did: first I convert the data from coordinates to metres I find point E: the projection of C on AB The distane and angle of CE is the same as BD, so I can use Earth.setHeading(), from B. NOTICE: There is no rectangle in your question, but still, notice: there is no such thing as a rectangle on a curved surface; it is impossible make that rectangle completely accuratly. If you go x distance forward, then turn 90° to the right hand side and repeat that 4 times, you will not get back (exactly) on the point where you started. On a sphere, the sum of the angles of a rectangle will be greater than 360°; the sum of the angles of a triangle will be greater than 180°. Simple example: take points (lat, lng) 0,0 ; 0,90 ; 90,0 (two points on the equator + the North Pole); that's a triangle with a sum of angles = 270°. So, what ever answer you seek, will be an approximation. The bigger the distances, the less accurate the result will be (no matter what genius solves the problem); You cannot simply assume every right angle on your diagram will be a right angle on the earth's surface.
has comment: http://stackoverflow.com/comment/44048241
has comment: http://stackoverflow.com/comment/44046863
type: Answer
has comment: http://stackoverflow.com/comment/44049865
has comment: http://stackoverflow.com/comment/44051451
score: 1
has comment: http://stackoverflow.com/comment/44049750
has comment: http://stackoverflow.com/comment/44049308
has comment: http://stackoverflow.com/comment/44057083
answers question: http://stackoverflow.com/q/27794821
has comment: http://stackoverflow.com/comment/44047335
has comment: http://stackoverflow.com/comment/44051721
has comment: http://stackoverflow.com/comment/44046724
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44053092
has comment: http://stackoverflow.com/comment/44049475

http://stackoverflow.com/comment/43988911
has text: I replicated in this fiddle: http://jsfiddle.net/4f9b3cgz/. It's not working. The function is from jottings.com/obfuscator and is supposed to result in an email address in the span tag.
score: 0
comment on: http://stackoverflow.com/a/27746629
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/43830134
has text: thanx dear & happy new yr in advance :)
comment on: http://stackoverflow.com/a/27657425
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43990584
comment on: http://stackoverflow.com/a/27733505
type: AnswerComment
type: Comment
score: 1
has text: Oops, my bad, missread, but what your asking can be easily done with the method I mentioned in the answer, it's pretty easy to make a form using GAS. See here https://developers.google.com/apps-script/guides/html/ and here https://developers.google.com/apps-script/guides/html/communication. Plus, you can make it look like whatenever you want with HTML/CSS/Javascript.

http://stackoverflow.com/q/27751128
linked to: http://stackoverflow.com/q/359494
type: Question
tagged with: google-sheets
has answer: http://stackoverflow.com/a/27751238
has body: I am putting together a Google Apps script which interfaces with a Google spreadsheet. I am trying to compare two different cells, but they are comparing equal. Within my for loop, I make make the comparison if (cell[n][0] == failureCell) { failureFlag = 1; Logger.log(cell[n][0]); Logger.log(failureCell); } I have also tried using the toString() method on each object, but it does not change the return values or the logger values. The log returns [15-01-02 18:02:40:312 PST] Value1 [15-01-02 18:02:40:313 PST] FailValue [15-01-02 18:02:40:524 PST] Value2 [15-01-02 18:02:40:525 PST] FailValue [15-01-02 18:02:41:235 PST] Value3 [15-01-02 18:02:41:244 PST] FailValue Here is a screencap of the area of interest in my spreadsheet:
accepted answer: http://stackoverflow.com/a/27751238
tagged with: javascript
tagged with: google-apps-script
upvote count: 1
answer count: 1
has title: Why do these cells in a Google Spreadsheet compare equal?
favorite count: 0
has comment: http://stackoverflow.com/comment/43913478
tagged with: google-api
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43913518

http://stackoverflow.com/a/27786714
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27786686
score: 5
type: Answer
answers question: http://stackoverflow.com/q/27786686
has body: There is no way to extract the image source from the Image object. The AJAX solution included in your question is the only way to obtain the source. If you want to only load the image once, then perhaps you could fetch it first using AJAX, and then use the fetched XML to render the image (e.g. adding to the document as inline SVG, or setting the source to a data: or Blob URL).
has comment: http://stackoverflow.com/comment/43988511
upvote count: 5
has comment: http://stackoverflow.com/comment/43983822

http://stackoverflow.com/q/27644296
tagged with: django
tagged with: python
upvote count: 6
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/13897472
tagged with: cookies
has body: I am implementing one advertising system in which when one user puts down script code into their website A. what I want to do at that time is set up a cookie into website A while it display response or resource of website B(Advertising System), so in present day when user comes again , I can log it's entry. I have read down this question and came to know that it is possible to set cookie into other website A when that website A is display content from another website B In script I am executing one rest API and returning one response like below.. source_image = "http://example.com/media/format.png" response = Response({'success':source_image}) response.set_cookie( 'cookie_name', 'cookie_value' ) return response Now I am able to see cookie set in browser of the response of this url. But when I reload it ,cookie does not get display. Also why it is not getting display in the cookies section of the site in which I have put down script code. Am I doing right thing to set up a cookie? And I have tried to set cookie's expiry date for 1 day. But still it is getting destroyed..Please help..
has answer: http://stackoverflow.com/a/27650661
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27650661
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27644736
has answer: http://stackoverflow.com/a/27644736
downvote count: 0
favorite count: 0
has title: Python : Setting cookie into another website
score: 6

http://stackoverflow.com/q/27673837
tagged with: javascript
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27673844
has body: I keep getting [object, Object] from array for $.each when i try and alert it. Below is the code I am using, I have tried several different ways but this seems to be the way that works the best. Could someone please help me out var min_chats = []; $(function () { $(".append_chat").click(function () { var chatid = $(this).attr('alt'); var data = $(this).attr('data'); min_chats.push({ "chatid": chatid, "data": data }); }); $("#max_close").live("click", function () { var chatid = $(this).attr('alt'); var data = $(this).attr('data'); $.each(min_chats, function (key, val) { alert(key + val); }); }); });
accepted answer: http://stackoverflow.com/a/27673844
has title: Keep getting [object, Object] from array for $.each
downvote count: 2
type: Question
type: AnsweredQuestion
score: -2

http://stackoverflow.com/comment/43728402
has text: I have edited the above comments. I would like to prevent the XSS for the form action URL . My doubt is that, can I use the `ESAPI.encoder().encodeForURL()` for the form action URL because when I saw the Rule #5 from [Cross_Site_Scripting Prevention Cheat sheet](https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet), it has mentioned that this rule has to be applied for HTML URL Parameter Values.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27655638

http://stackoverflow.com/comment/55965748
type: QuestionComment
score: 4
comment on: http://stackoverflow.com/q/27661306
has text: What do you expect `param*=>{ }` to do?
type: Comment

list
type: Tag
tags question: http://stackoverflow.com/q/27795597
tag name: list
tags question: http://stackoverflow.com/q/27778785
tags question: http://stackoverflow.com/q/27750600

http://stackoverflow.com/comment/43762946
comment on: http://stackoverflow.com/a/27671685
has text: awesome, one issue: it gives me result as `{"address": [ {"address": "Halifax, NS, Canada"},{"address": "Toronto, ON, Canada"},{"address": "Winnipeg, MB, Canada"}]}` which is perfect as what it should produce according to your code
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27721801
has answer: http://stackoverflow.com/a/27721913
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43855392
favorite count: 0
has comment: http://stackoverflow.com/comment/43855426
has comment: http://stackoverflow.com/comment/43855362
possible better answer: http://stackoverflow.com/a/27721909
type: Question
answer count: 2
has title: Clone div with all nested elements along with events in pure javascript
has answer: http://stackoverflow.com/a/27721909
linked to: http://stackoverflow.com/q/16939335
upvote count: 1
accepted answer: http://stackoverflow.com/a/27721913
tagged with: css
has comment: http://stackoverflow.com/comment/43855416
tagged with: javascript
has body: I am trying to clone a div which has input fields. But the eventListeners are not being fired. Even though I am doing a deep clone in the following way - var rows = document.querySelectorAll('.row'); var dupNode = rows[0].cloneNode(true); sheet.appendChild(dupNode); Here is the Demo Each input has a click event and the cloned inputs are not registering with the click event. What am I missing ?

http://stackoverflow.com/a/35015622
has comment: http://stackoverflow.com/comment/100714328
upvote count: 38
has comment: http://stackoverflow.com/comment/69108636
has comment: http://stackoverflow.com/comment/100753087
answers question: http://stackoverflow.com/q/27732209
type: Answer
has comment: http://stackoverflow.com/comment/59763386
score: 34
has comment: http://stackoverflow.com/comment/61523840
has comment: http://stackoverflow.com/comment/67148736
has body: The general end of line comment, // eslint-disable-line, does not need anything after it: no need to look up a code to specify what you wish ES Lint to ignore. If you need to have any syntax ignored for any reason other than a quick debugging, you have problems: why not update your delint config? I enjoy // eslint-disable-line to allow me to insert console for a quick inspection of a service, without my development environment holding me back because of the breach of protocol. (I generally ban console, and use a logging class - which sometimes builds upon console.)
has comment: http://stackoverflow.com/comment/57840542
downvote count: 4

http://stackoverflow.com/q/27736565
score: -1
type: Question
answer count: 2
tagged with: javascript
favorite count: 0
has title: Displaying the results of a function using the onClick event
has answer: http://stackoverflow.com/a/27736692
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has answer: http://stackoverflow.com/a/27736595
accepted answer: http://stackoverflow.com/a/27736595
upvote count: 0
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27736692
has body: I want to solve this using pure JavaScript (No Jquery) I have written a function that solves the first question on Project Euler. I would like to make a button that retrieves whichever value is placed in the input field, runs the function, and then displays the result in a separate div after being clicked. function problem1() { var sum = 0; for (var i = 0; i < sum; i++){ if((i % 3 === 0) || (i % 5 === 0)){ sum += i; }; } Problem 1: Multiples of 3 and 5 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. Solve Here is a jsfiddle to show what I'm working with: http://jsfiddle.net/wh9uj2j6/1/

http://stackoverflow.com/comment/44019238
has text: Thank's for your answers. I try with st-sort="{{undefined}}" and I got st-sort in return. I try also with ng-attr-st_sort and the result is the same : in result I've got the empty attribute st-sort. The directive st-sort is not mine (it is provided by the Smart Table plugin)
comment on: http://stackoverflow.com/q/27793758
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27699641
type: Question
tagged with: javascript
has body: I want to run a script snippet on the SAP BO "Query Builder", it's a simple tool to retrieve data using SQL. (I can't upload the image due to the reputation, the product's interface can be found here: http://scn.sap.com/docs/DOC-42952) Since I have a bunch of queries to run, I want to use snippet to run them automatically. Using the following code: //select the textarea to insert retrieved queries document.querySelector("textarea").textContent = "SELECT * FROM CI_INFOOBJECTS"; //click the submit button document.getElementsByTagName('input')[0].click(); //code to export the query result //after click(), the page reloaded and it won't executed the following code. document.addEventListener("DOMContentLoaded", function() { //back to the previous page, run the previous code again window.history.back(1); }, false); Does anyone have good ideas how to implement it? Thanks for your help.
has title: Run JavaScript Script snippet automatically
downvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/34151215
score: 1
upvote count: 1
tagged with: business-objects
tagged with: google-chrome
tagged with: code-snippets

http://stackoverflow.com/comment/43957182
type: QuestionComment
comment on: http://stackoverflow.com/q/27772785
score: 0
has text: Oh yes, your code would need to be in a directive, that's where all jQuery plugins should be called. then you would use `element.Jcrop` in directive and would have scope access
type: Comment

http://stackoverflow.com/comment/43945751
comment on: http://stackoverflow.com/q/27767466
has text: the browser is sending POST request. i am using javascript, is there anyway to do it!
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43919353
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27754249
score: 0
has text: @BogdanKuštan - True. I was just about to comment that on the main post.

http://stackoverflow.com/q/27799961
answer count: 2
tagged with: javascript
tagged with: icons
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Toggling multiple jQuery icons
accepted answer: http://stackoverflow.com/a/27800074
possible better answer: http://stackoverflow.com/a/27800024
has answer: http://stackoverflow.com/a/27800024
type: Question
has answer: http://stackoverflow.com/a/27800074
type: AnsweredQuestion
has body: I'm having a few problems with my icon toggling in jQuery. The html for each toggled section is: Section 1.1 Hidden text. And the javaScript: jQuery(document).ready(function () { $(".collapse").click(function () { $(this).next().toggle(); $("span").toggleClass("ui-icon-triangle-1-s"); }).next().hide(); }); JSfiddle also here. When I click any of the collapsible sections, all of the icons change at once, though not all of them expand/collapse. I also can't get my icon to be on the same line as the text, though that's a smaller problem.

http://stackoverflow.com/q/27782659
has title: Absolute div can't get on top of canvas element
tagged with: css
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27783273
accepted answer: http://stackoverflow.com/a/27783618
type: Question
tagged with: leaflet
has answer: http://stackoverflow.com/a/27783618
tagged with: javascript
has body: I am using Leaflet, and am using a modified version of the FullCanvas plugin to draw lines on top of the map. http://jsfiddle.net/ruroor5v/ $(document).ready(function() { var map = L.map('map').setView([0, 0], 13).setZoom(2); L.tileLayer('http://c.tile.openstreetmap.se/hydda/full/{z}/{x}/{y}.png').addTo(map); var markerLocations = [{ "slat": 38.54, "slon": -100.19, "tlat": 52.37, "tlon": 4.89 }, { "slat": 40.69, "slon": -74.04, "tlat": -33.93, "tlon": 18.42 }, { "slat": 35.96, "slon": 138.70, "tlat": -22.59, "tlon": 138.60 }, { "slat": 13.92, "slon": 103.04, "tlat": 13.92, "tlon": 104.04 }, { "slat": 36.31, "slon": -117.07, "tlat": 43.83, "tlon": 142.38 }]; var layer = new L.SupplyChain(); layer.setData(markerLocations); layer.addLayerTo(map); L.marker([38.54, -100.19], { icon: L.divIcon({ // Specify a class name we can refer to in CSS. className: 'count-icon', // Define what HTML goes in each marker. html: ' I want on top! ', // Set a markers width and height. iconSize: [40, 40] }) }).addTo(map); }); if (typeof(L) !== 'undefined') { L.SupplyChain = L.Class.extend({ options: this.options || {}, initialize: function() { this._myCanvas = document.createElement('canvas'); // this._myCanvas.style.position = 'absolute'; this._myCanvas.style.top = 0; this._myCanvas.style.left = 0; this._myContext = this._myCanvas.getContext('2d'); this.options.filterPointsInBounds = false; // als je deze op true zet, verdwijnen supply chains uit beeld als het startpunt buiten beeld valt (handig voor tragere computers). }, setData: function(data) { var me = this; var bounds = new L.LatLngBounds([-90, -180], [90, 180]); this._myQuad = new QuadTree(this.boundsToQuery(bounds), false, 50, 10); data.forEach(function(d) { me._myQuad.insert({ x: d.slat, y: d.slon, data: d }); if (d.ty && d.tx) { me._myQuad.insert({ x: d.tlat, y: d.tlon, data: d }); } }); }, onAdd: function(map) { this._myMap = map; if (!map._panes.staticPane) { map._panes.staticPane = map._createPane('leaflet-tile-pane', map._con…
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27783273

dreamweaver
type: Tag
tag name: dreamweaver
tags question: http://stackoverflow.com/q/27715202
tags question: http://stackoverflow.com/q/27737561

http://stackoverflow.com/q/27711227
has answer: http://stackoverflow.com/a/27711274
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/27711278
answer count: 2
accepted answer: http://stackoverflow.com/a/27711278
has body: Can anyone explain why function x() { console.log("Hello!"); } var a = x; a(); x(); produces Hello! Hello! but this var a = function x() { console.log("Hello!"); } a(); x(); throws an error when you try to call function x? Is the second x function not considered a hoisted function? I tried this in both nodejs and a browser.
tagged with: function
has title: Simultaneously Declaring Variables and Functions in JavaScript
has comment: http://stackoverflow.com/comment/43834532
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: scope
possible better answer: http://stackoverflow.com/a/27711274
has comment: http://stackoverflow.com/comment/43834552
tagged with: node.js
score: 2
type: AnsweredQuestion

http://stackoverflow.com/q/27770476
has title: knockout: How to program interdependence between elements of observable array
has answer: http://stackoverflow.com/a/27771435
upvote count: 2
downvote count: 1
type: AnsweredQuestion
tagged with: knockout.js
accepted answer: http://stackoverflow.com/a/27771435
type: Question
answer count: 1
tagged with: javascript
score: 1
favorite count: 0
has body: I have scenario where I have to display a list of questions to the user. I came across observable array and foreach binding in knockout. I could easily display a list of questions with them. However, my requirement is the questions are interdependent. say for eg. if the first question has a response of "a", then question 2 must be displayed, if question 2 has a response of "b" then question 4,5 should be displayed. How can I do this with knockout js? I am thinking about using computed field for each question and defining a visible condition based on them. But I am not able to think of a complete solution. Any suggestions would be extremely helpful. Thanks in advance

http://stackoverflow.com/a/27707666
accepted answer of: http://stackoverflow.com/q/27707392
has body: For a better user experience, I'd check the box immediately as the user clicks it, and let the request be sent to the server anonymously. Otherwise the user woul'd have to wait the round-trip time for visual feedback, which is generally not so great. You can however easily implement a sort of queue:ing method that executes request "serially", like this. (warning untested) var queue = []; var processing = false; function queueRequest(data, cb){ // Queue data to be send to the backend // Also cb will be called after it's done queue.push({ data: data, cb: cb }); processQueue(); } function processQueue(immediate) { // If we have an empty queue, we are done! if (queue.length === 0) { processing = false; return; } if (!processing || immediate) { var item = queue.shift(); // Take first item processing = true; // Send the ajax request $.ajax({ url: "backend.com/checks", data: item.data, type: 'post', success: function(res) { if (typeof item.cb === "function") cb(res); // Go on with the queue processQueue(true); // We call ourself, so it's "immediate" } }); } } Then you queue data to be sent like this: queueRequest({checkbox:5}, function(res){ // Check the checkbox here, or do w/e you want // ... }); In a cool world I'd use promises instead of a callback, but this is a better example for the untrained JS-eye.
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/27707392

http://stackoverflow.com/comment/43865104
type: QuestionComment
has text: @Indigo the `break` statement works for loops constructed using keywords like `for` and `while`. The `each` function executes its supplied argument function for each element of a collection, and therefore a `break` inside that function would not impact the iterator in the `each` function itself.
comment on: http://stackoverflow.com/q/27726447
score: 0
type: Comment

http://stackoverflow.com/q/27770222
answer count: 0
has title: Can't make jQuery rating plugin (Raty) work
has comment: http://stackoverflow.com/comment/43951442
type: Question
has comment: http://stackoverflow.com/comment/43953156
has comment: http://stackoverflow.com/comment/43951481
tagged with: javascript
has body: I'm trying to use Raty - jQuery rating plugin on my website, but I just can't make it work. Plugin is working but only on default settings: $.fn.raty.defaults = { cancel : false, cancelHint : 'Cancel this rating!', cancelOff : 'cancel-off.png', cancelOn : 'cancel-on.png', cancelPlace : 'left', click : undefined, half : false, halfShow : true, hints : ['Beznadziejny', 'Słaby', 'Średni', 'Dobry', 'Bardzo dobry'], iconRange : undefined, mouseout : undefined, mouseover : undefined, noRatedMsg : 'Not rated yet!', number : 5, numberMax : 20, path : '', precision : false, readOnly : false, round : { down: .25, full: .6, up: .76 }, score : undefined, scoreName : 'score', single : false, size : 16, space : true, starHalf : 'star-half.png', starOff : 'star-off.png', starOn : 'star-on.png', target : undefined, targetFormat : '{score}', targetKeep : false, targetText : '', targetType : 'hint', width : undefined }; when I'm trying to make my own setting directly to choose DIV it just doesn't work and use the default settings. My div &lt;div id=\"score\" class=\"score\"&gt; My #score $('#score').raty({ .. CODE FROM PREVIOUS PLUS score: 3, click: function(score, evt) { alert('ID: ' + this.id + "\nscore: " + score + "\nevent: " + evt); }); }); so I want to make in div with ID score: 3 but it doesn't work and I just get default setting. Of course all JS files are connected in HTML.
tagged with: jquery
score: 0
tagged with: raty
has comment: http://stackoverflow.com/comment/43951375
has comment: http://stackoverflow.com/comment/43951753
type: UnansweredQuestion

http://stackoverflow.com/comment/50377958
type: Comment
type: QuestionComment
has text: We used CSOM C# as Chirag64 suggested, though we wanted to avoid it. This solution can't be used in SPOnline without running deprecated sandbox code on the site. Thanks for your suggestions.
comment on: http://stackoverflow.com/q/27728927
score: 0

http://stackoverflow.com/q/27650062
score: 0
has comment: http://stackoverflow.com/comment/43717399
favorite count: 0
has comment: http://stackoverflow.com/comment/43717589
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43717512
upvote count: 1
has title: Jquery copy other sites content into my site
downvote count: 1
has comment: http://stackoverflow.com/comment/43717423
has comment: http://stackoverflow.com/comment/43717359
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43717695
has body: I have a site that should list the search result. User should enter bicycle name press search. After pressing search according to entered name I need to take search result and print it in my Search Result field. This is the search address. Example search type: http://api.citybik.es/idecycle.json. Anyone help how to make it ? http://jsfiddle.net/68w5xroL/ <TITLE>City Bike Search Engine Search Engine Share Bike Search Search Share Results SHARE Search results: Favorites: Fill me up! Invalid email! eg. pero@doma.mk Email:
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43717668
has comment: http://stackoverflow.com/comment/43717448

http://stackoverflow.com/a/27759930
score: 0
has body: Why must you use $.inArray, you joined the pieces into a string, all you need for the alert to work is to replace : if ($.inArray('i', piecesArray) !==-1) with: if (piecesArray == "idaho") http://jsfiddle.net/q3x1gg9b/2/
type: Answer
answers question: http://stackoverflow.com/q/27759809

http://stackoverflow.com/comment/43972857
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27781325
type: Comment
has text: It's on default code, I didn't add. Your code has also these 2 dots. http://i.imgur.com/6qYl6rj.png

http://stackoverflow.com/comment/43935791
has text: @fibi Excellent. Be sure to mark the answer as the correct one so we know that it worked. As for "remov[ing] this object," to what object are you referring?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27672860
type: AnswerComment

http://stackoverflow.com/q/27803444
has comment: http://stackoverflow.com/comment/44017527
has answer: http://stackoverflow.com/a/27812131
type: Question
tagged with: google-apps-script
tagged with: google-sheets
tagged with: javascript
has body: Basically, Im getting a spreadsheet from my drive and trying to read a range. Logging its name works perfectly, Logging any information like sheet-names etc works fine, But when i try to do getRange("A1") or getDataRange() on a sheet, it returns unidentified. Im 100% sure the given range(es) have data in them, its like the script cant find it, or has no acces to it. Please help. Thanks. (If someone wants code to look at, just ask.)
has comment: http://stackoverflow.com/comment/44018852
has comment: http://stackoverflow.com/comment/44017467
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44016609
has comment: http://stackoverflow.com/comment/44018300
score: 0
has comment: http://stackoverflow.com/comment/44017412
has title: Google Script Spreadsheet range returns unidentified

http://stackoverflow.com/a/27714551
accepted answer of: http://stackoverflow.com/q/27714469
has comment: http://stackoverflow.com/comment/43841394
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/117485326
answers question: http://stackoverflow.com/q/27714469
upvote count: 20
has body: All you need to do is convert the string produced by the &lt;input&gt; into a Date using the Date constructor new Date("2014-06-12") function checkDate() { var selectedText = document.getElementById('datepicker').value; var selectedDate = new Date(selectedText); var now = new Date(); if (selectedDate &lt; now) { alert("Date must be in the future"); } } &lt;input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="date" data-date-format="yyyy-mm-dd" &gt;
has comment: http://stackoverflow.com/comment/43841428
has comment: http://stackoverflow.com/comment/43841335
has comment: http://stackoverflow.com/comment/43841451
score: 20

http://stackoverflow.com/comment/43745683
comment on: http://stackoverflow.com/a/27665188
score: 0
has text: i tried using ur method but it gives me the following error unfortunately: Parse error: syntax error, unexpected '?' in /home/a5219961/public_html/blog.php on line 112
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27771254
has title: Unstretchable Splash Screen
type: Question
has body: I'm trying to make a splash screen that can't be stretched. Using a 9 patch image doesn't really since there's no region that can be stretched. However, area around the centered logo can be cut off. Is there any way to achieve this effect with Cordova? I'm only interested in compiling it into an Android app.
has answer: http://stackoverflow.com/a/27773612
tagged with: javascript
score: 0
answer count: 1
tagged with: splash-screen
tagged with: cordova
type: UnansweredQuestion
tagged with: android

http://stackoverflow.com/comment/43972648
comment on: http://stackoverflow.com/q/27781344
score: 0
has text: From what i see on the document, this is not compatible for "plug & play" with laravel. Try searching similar package for laravel, in packalyst.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27649110
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27647092
score: 1
has body: I just tested and modified it a little bit to store the value (not the id), but it looks good: http://jsfiddle.net/ts92oafp/1/ var store = []; var ob = document.getElementById('getall_writers'); var nr = ob.length; for(var i=0; i &lt; nr; i++) { var option = ob.options[i]; if(option.selected) { store.push(option.value); } } console.log(store); Isn't this what you want?
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27647092
type: Answer

http://stackoverflow.com/comment/43820533
type: QuestionComment
has text: How did you even find out that calling `self;` fixes it. :)
comment on: http://stackoverflow.com/q/27704254
score: 0
type: Comment

http://stackoverflow.com/comment/43898542
type: Comment
has text: checkbox in an `` ?
score: 1
comment on: http://stackoverflow.com/a/27743876
type: AnswerComment

http://stackoverflow.com/q/27670590
favorite count: 0
tagged with: meanjs
answer count: 0
tagged with: angularjs
tagged with: twitter-bootstrap
type: UnansweredQuestion
upvote count: 1
has title: Uncaught TypeError: Cannot read property 'expr' of undefined
has body: I'm building a project with the meanjs stack. I want to use an angular lib that I found to make my selectors to look like the ones that bootstrap provides us. https://github.com/joaoneto/angular-bootstrap-select (This is the library) I added it in my bower.json and it's installed correctly inside my public/lib folder. After that I included it together with the bootstrap-select.js in my configuration. /rootFolder/config/env/all.js: 'use strict'; module.exports = { app: { title: 'MyProject', description: 'my project description', keywords: 'MongoDB, Express, AngularJS, Node.js' }, port: process.env.PORT || 3000, templateEngine: 'swig', sessionSecret: 'MEAN', sessionCollection: 'sessions', assets: { lib: { css: [ 'public/lib/bootstrap/dist/css/bootstrap.css', 'public/lib/bootstrap/dist/css/bootstrap-theme.css', ], js: [ 'public/lib/angular/angular.js', 'public/lib/angular-resource/angular-resource.js', 'public/lib/angular-cookies/angular-cookies.js', 'public/lib/angular-animate/angular-animate.js', 'public/lib/angular-touch/angular-touch.js', 'public/lib/angular-sanitize/angular-sanitize.js', 'public/lib/angular-ui-router/release/angular-ui-router.js', 'public/lib/angular-ui-utils/ui-utils.js', 'public/lib/angular-bootstrap/ui-bootstrap-tpls.js', 'public/lib/bootstrap-select/bootstrap-select.js', 'public/lib/angular-bootstrap-select/build/angular-bootstrap-select.js' ] }, css: [ 'public/modules/**/css/*.css', 'public/dist/css/*.css' ], js: [ 'public/config.js', 'public/application.js', 'public/modules/*/*.js', 'public/modules/*/*[!tests]*/*.js' ], tests: [ 'public/lib/angular-mocks/angular-mocks.js', 'public/modules/*/tests/*.js' ] } }; I'm getting the following error: Uncaught TypeError: Cannot read property 'expr' of undefined I entered inside the lib and I'm getting the error here: $.expr[':'].icontains = function(obj, index, meta) { return $(obj).text().toUpperCase().indexOf(meta[3].toUpperCase()) &gt;= 0; }; Any help will be so appreciated thank you!
score: 1
has comment: http://stackoverflow.com/comment/52872670
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/53019495

http://stackoverflow.com/comment/43923073
comment on: http://stackoverflow.com/a/27756159
type: AnswerComment
score: 0
type: Comment
has text: Thanks, although it is not the shortest or most elegant solution it works.

http://stackoverflow.com/q/27673544
answer count: 1
has comment: http://stackoverflow.com/comment/43774678
tagged with: sockets
has comment: http://stackoverflow.com/comment/43762193
has comment: http://stackoverflow.com/comment/43762246
has body: I have a basic client-server setup with Node.js: Server var port = 8000; var http = require('http'); var express = require('express'); var app = express(); var server = http.createServer(app).listen(port); var io = require('socket.io').listen(server); app.use(express.static(__dirname + '/site')); app.get('/', function(req, res) { res.sendFile(__dirname + '/site/index.html'); }); server.listen(port, function() { console.log("Listening on port " + port + "..."); }); io.on('connection', function(socket) { console.log("A user connected"); }); Client var socket = io.connect("http://72.53.66.228:8000"); socket.on('connect', function() { console.log("Connected."); }); However, I keep getting this error in my browser's console, and I'm not sure why: GET http://72.53.66.228:8000/socket.io/?EIO=3&amp;transport=polling&amp;t=1419738402131-5 net::ERR_CONNECTION_REFUSED I should also note that I'm running an Apache webserver and I'm using the ProxyPass directive to let Node.js serve off a subdirectory
has title: ERR_CONNECTION_REFUSED with socket.io on Node.js server
tagged with: node.js
accepted answer: http://stackoverflow.com/a/27682798
type: AnsweredQuestion
tagged with: socket.io
type: Question
has comment: http://stackoverflow.com/comment/43762293
has comment: http://stackoverflow.com/comment/43762038
has comment: http://stackoverflow.com/comment/43762052
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27682798

destructuring
tags question: http://stackoverflow.com/q/27704307
tag name: destructuring
type: Tag

http://stackoverflow.com/q/27684788
answer count: 2
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/27684838
has title: How to open new page into my website using Javascript?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43783643
possible better answer: http://stackoverflow.com/a/27684838
has answer: http://stackoverflow.com/a/27684953
downvote count: 3
tagged with: mysql
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43783678
accepted answer: http://stackoverflow.com/a/27684953
score: -2
tagged with: jsp
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43786668
has body: I'll try my best to explain what i'm looking for. Have a look, into this I've a lot's of news into my website. and i'm showing all that news using select * from table_name using MySql database. You know, showing all much news into one page looks so buggy. Now I've planned that i would show only titles(means using h1 tag) into my one web page but if clients click on that title. It must suppose to redirect with full news of web page of that title. Is it possible? I guess so.. Because sciencealert.com do the same thing. Can you please help me? Surely, Help would be appreciated!! EDITED: Some peoples are suggesting me to use anchor tag. But I put my news into database. Then how is it possible to redirect on particular Webpage? Any tricks?

http://stackoverflow.com/q/27737156
has answer: http://stackoverflow.com/a/27737189
has body: jsfiddle playlist first Alum Songs Playlist perfectly works but unfortunately the same code is not working for another playlist Id jsfiddle playlist second Medical Animated Playlist does not work var playListURL = 'http://gdata.youtube.com/feeds/api/playlists/B2A4E1367126848D?v=2&alt=json&callback=?'; var videoURL = 'http://www.youtube.com/watch?v='; $.getJSON(playListURL, function(data) { var list_data = ""; $.each(data.feed.entry, function(i, item) { var feedTitle = item.title.$t; var feedURL = item.link[1].href; var fragments = feedURL.split("/"); var videoID = fragments[fragments.length - 2]; var vid = item.media$group.yt$videoid.$t; var url = videoURL + videoID; var vidtitle = item.title.$t; var vidviews = item.yt$statistics.viewCount; var content = item.media$group.media$description.$t; var thumb = "http://img.youtube.com/vi/" + videoID + "/default.jpg"; list_data += ' ' + vidtitle + ' Views:- ' + vidviews + ' Case Study ' + content + ' '; }); $(list_data).appendTo(".cont"); });
accepted answer: http://stackoverflow.com/a/27737189
tagged with: http://stackoverflow.com/tag/json
has title: Why does my YouTube code not work with all playlists?
score: 0
upvote count: 1
answer count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/27760308
tagged with: ajax
type: Question
has comment: http://stackoverflow.com/comment/43931685
has comment: http://stackoverflow.com/comment/43932090
has answer: http://stackoverflow.com/a/27760864
tagged with: cordova
score: 0
tagged with: php
answer count: 1
has body: I'm currently building a mobile app using Cordova and I'm having trouble getting a basic test login function working with my code. I have no clue why this isn't working, and I'm unfamiliar with the convoluted way I have to use php so I'm not even sure how to get proper error reporting from that part of the code. If anyone could help me out, I'd be really grateful. Code below (I've blanked out some details with asterisks. HTML Hello World username: Password: username: Password: Re-type Password : logreg.js function logIn() { alert("1"); } function regisTer() { var un = $("#unr").val(); var pw = $("#pwr").val(); var pw2 = $("#pw2r").val(); if (pw!='' && pw2!='' && un!='') { if (pw == pw2) { alert("run post"); $.post("http://cs12ars.icsnewmedia.net/Media/register.php", { name:un, pass:pw }, function() { alert( "success" ); }) .done(function() { alert( "second success" ); }) .fail(function() { alert( "error" ); }) .always(function() { alert( "finished" ); }); } else { alert("both passwords must match"); } } else { alert("Please fill in all fields."); } } register.php (on the server, same server as the database) <?php //clean input function clean_string($db_server = null, $string){ $string = trim($string); $string = utf8_decode($string); $string = str_replace("#", "&#35", $string); $string = str_replace("%", "&#37", $string); if (mysqli_real_escape_string($db_server, $string)) { $string = mysqli_real_escape_string($db_server, $string); } if (get_magic_quotes_gpc()) { $string = stripslashes($string); } return htmlentities($string); } //encrypt data function salt ($string) { $salt1 = 'gds54d'; $salt2 = '54h6'; $salted = md5 ("$salt1$string$salt2"); return $salted; } ?> <?php $db_hostname = 'localhost'; $db_database = '****'; $db_username = '****'; $db_password = '****'; $db_status = 'not initialised'; $str_result = ''; $str_options = ''; $db_server = mysqli_connect($db_hostname, $db_username, $db_password); $db_status = "connected"; //connect to the database mysqli_select_…
has title: Having trouble using AJAX to POST to a database
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/q/27789050
has comment: http://stackoverflow.com/comment/43988187
has answer: http://stackoverflow.com/a/27789119
tagged with: javascript
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/43988362
accepted answer: http://stackoverflow.com/a/27789241
possible better answer: http://stackoverflow.com/a/27789119
has answer: http://stackoverflow.com/a/27789241
type: AnsweredQuestion
has body: I am trying to learn from this stopwatch example. I would like to be able to start the stopwatch by clicking on another html element, that is not defined on this page. How can I use the 'start' function elsewhere ( e.g. page reload etc. ) ? var Stopwatch = function(elem, options) { var timer = createTimer(), startButton = createButton("start", start), offset, clock, interval; // append elements elem.appendChild(startButton); reset(); // private functions function createTimer() { return document.createElement("span"); } function createButton(action, handler) { var a = document.createElement("a"); a.href = "#" + action; a.innerHTML = action; a.addEventListener("click", function(event) { handler(); event.preventDefault(); }); return a; } function start() { if (!interval) { offset = Date.now(); interval = setInterval(update, options.delay); } } // public API this.start = start; }; var d = document.getElementById("d-timer"); dTimer = new Stopwatch(d, {delay: 1000}); dTimer.start(); Q1: How will I be able to call the start function elsewhere ? Global ?
has title: Javascript; how can I make a function globally accessible?
tagged with: global-variables
type: Question
has answer: http://stackoverflow.com/a/27810484

caching
tags question: http://stackoverflow.com/q/27777961
type: Tag
tags question: http://stackoverflow.com/q/27732561
tags question: http://stackoverflow.com/q/27647435
tags question: http://stackoverflow.com/q/27662807
tags question: http://stackoverflow.com/q/27651268
tags question: http://stackoverflow.com/q/27776847
tags question: http://stackoverflow.com/q/27722226
tag name: caching
tags question: http://stackoverflow.com/q/27774919
tags question: http://stackoverflow.com/q/27781936

http://stackoverflow.com/comment/43912435
type: Comment
has text: You are missing the `else` condition, put it there and you will see what's happening.
comment on: http://stackoverflow.com/q/27750465
score: 0
type: QuestionComment

http://stackoverflow.com/q/27780687
type: Question
has comment: http://stackoverflow.com/comment/43972230
tagged with: javascript
has answer: http://stackoverflow.com/a/27816254
score: 2
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43971265
tagged with: d3.js
tagged with: c3.js
accepted answer: http://stackoverflow.com/a/27816254
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43998206
upvote count: 3
has body: Some weird stuff is happening to me with this library. I am trying to execute this samples that came with the package, but they do not work. My browser (Firefox and Chrome) seem not to find c3.css and c3.js. They were shortcuts, so I replaced them with the original source but nothing changed. Then I try to implement the most basic chart following the getting started guide (two bunch of code you just have to copy) but nothing happen (there is no chart). In this case no error is thrown. c3.js Version tested: 0.4.8 and 0.4.7 The d3.js version comes from: http://d3js.org/d3.v3.min.js
has title: C3.js samples just don't work
downvote count: 1

http://stackoverflow.com/comment/43834872
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27711424
has text: FYI `$_POST['page']` is a string

http://stackoverflow.com/comment/43769969
comment on: http://stackoverflow.com/q/27677796
score: 0
type: QuestionComment
type: Comment
has text: I think you meant "cacheEl" when you wrote "catcheEl" above... I'd consider renaming it for clarity.

http://stackoverflow.com/comment/46070199
comment on: http://stackoverflow.com/q/27722647
has text: You must have many, many rows. How many?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27749359
answers question: http://stackoverflow.com/q/27749113
type: Answer
score: 1
upvote count: 1
downvote count: 0
type: AcceptedAnswer
has body: The Content-Type header you see is the default header to be sent. When you set data to a string, jQuery assumes you have taken care of the encoding yourself, for any conversion to take place (e.g. the form URL encoding) you have to send an object. See the jQuery.ajax() documentation: contentType (default: 'application/x-www-form-urlencoded; charset=UTF-8') and data Type: PlainObject or String or Array Data to be sent to the server. It is converted to a query string, if not already a string. Emphasis mine. If jQuery converted strings, you'd never be able to send valid content types that should not be URL-encoded, like a JSON or XML post body, nor could you post data that was already URL-encoded by other means. To manually encode data yourself, use the encodeURIComponent() function: $.ajax({ url : "http://localhost:10000", type: "POST", data : encodeURIComponent(mydata), success: function(data, textStatus, jqXHR) {}, error: function (jqXHR, textStatus, errorThrown) {} }) });
accepted answer of: http://stackoverflow.com/q/27749113

http://stackoverflow.com/q/27676288
type: Question
has comment: http://stackoverflow.com/comment/43767665
has comment: http://stackoverflow.com/comment/43767130
score: 0
has comment: http://stackoverflow.com/comment/43767286
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43767198
has body: so I have this html markup create list I made it so whenever I click it I create a new list using packery jQuery plugin app.directive('packery', ['$compile', function($compile) { return { scope:false, restrict: "EA", link: function(scope,elm, attr) { $.bridget('packery', Packery); //convert Packery object into jquery plugin var $container = $(elm).packery(); //install packery plugin var item = { create: function() { var elem = document.createElement("div"); var panelHeight = document.createAttribute("panel-height"); panelHeight.value = ""; elem.setAttributeNode(panelHeight); elem.className = "item"; var treeGrid = document.createElement("grid-test"); treeGrid.id = "grids"; treeGrid.className = "little-font"; elem.appendChild(treeGrid); return $compile(elem)(scope); } scope.create = function() { var $items = $(item.create()); $container.append($items).packery('appended', $items); $container.packery(); $items.each(draggable); console.log(document.getElementById("grids")); //here it return with the object } } } } ]}); obviously I create a custom directive which is "grid-test" isn't it ? but the weird thing is when I'm using document.getElementById is always returning null whereas what I want is returning the "grids" element as I mentioned above on treeGrid variable app.directive('gridTest', [ function() { return { scope:false, restrict: "EA", link: function(scope,elm, attr) { var container = document.getElementById("grids"); var treegrid = new links.TreeGrid(container, []); //I need the container to install this new object but it always returns a null :( } } }]); I really stuck, could you guys help me ? ================================================================================== it seems that I couldn't save my plunkr so I guess I will copy paste the codes in here index.html {{title}} script.js var app = angular.module('myApp', []); app.controller('test', function($scope) { $scope.title = "Creating custom directive"; }); app.directive('createButton', function($co…
has comment: http://stackoverflow.com/comment/43767809
has comment: http://stackoverflow.com/comment/43767165
tagged with: angularjs
has title: document.getElementById returns null after create new packery using angularjs
has answer: http://stackoverflow.com/a/27677814
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43767349
has comment: http://stackoverflow.com/comment/43767404
has comment: http://stackoverflow.com/comment/43767421

http://stackoverflow.com/comment/43998856
comment on: http://stackoverflow.com/a/27794838
score: 0
type: AnswerComment
has text: http://stackoverflow.com/questions/24272211/align-nested-table-headers-using-jquery and refer this http://developer.actuate.com/community/forum/index.php?/topic/34934-hide-row-depends-on-nested-table-results/
type: Comment

http://stackoverflow.com/a/27687874
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27687797
has body: The issue is that the call to .siblings('div') will apply to EVERY div since every element in your supplied HTML is on the same level. If you don't want to change this structure, use .next() For example: &lt;script type="text/javascript"&gt; jQuery(document).ready(function($) { $('body').on('click', '.test', function () { $(this).fadeIn('medium').next("div").hide(); }); }); &lt;/script&gt;
upvote count: 1

http://stackoverflow.com/q/27784463
tagged with: node.js
has title: What is the best way to replace values/template "keys" in html in with node?
type: Question
has answer: http://stackoverflow.com/a/27784787
tagged with: javascript
tagged with: express
score: 0
answer count: 1
tagged with: templates
has comment: http://stackoverflow.com/comment/43978944
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: i want to replace values in my html with node express. for ex, the html: &lt;html&gt; &lt;p&gt; hello {guestName} &lt;/p&gt; &lt;/html&gt; I wanna replace the {guestName} inside my express app. i have a function that getting the right values , now how can do it? until now i cant find a nice way to do it. thank u!

http://stackoverflow.com/comment/45950220
type: QuestionComment
comment on: http://stackoverflow.com/q/27719984
has text: I tried to play with your code, but like @ChinKang, i'm not sure what are you trying to achieve. Do you want only one window opened at a time? Actual code isn't allowing duplicates for each users.
score: 0
type: Comment

http://stackoverflow.com/comment/43919062
type: QuestionComment
has text: Hi.. here is the demo: http://demos.9lessons.info/notifications_css/index.html# What i want is just when you click on link1 notification will popup.. if you click on link2 notification will popup again. if you click on the document notification will close
comment on: http://stackoverflow.com/q/27753932
score: 0
type: Comment

http://stackoverflow.com/comment/43751568
has text: @A.Wolff fine what changes should i do here
type: QuestionComment
comment on: http://stackoverflow.com/q/27668304
score: 0
type: Comment

http://stackoverflow.com/comment/44001059
comment on: http://stackoverflow.com/q/27796173
has text: http://stackoverflow.com/questions/18437594/angularjs-call-other-scope-which-in-iframe
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27683713
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43781971
type: Answer
has body: The construct you have shown in the question is called, function chaining. The function filter1, filter2, ... filterN would just modify the same canvas object and return the same object at the end of the function. You can very well include if conditions, like this var canvasObject = canvas.draw(texture); if (condition1) { canvasObject = canvasObject.filter1(); } if (condition2) { canvasObject = canvasObject.filter2(); } ... A simple example for the same, would look something like this function Canvas() { actualCanvas = ""; return { filter1: function() { actualCanvas += "filter1 "; return this; // return the same object }, filter2: function() { actualCanvas += "filter2 "; return this; // return the same object }, filter3: function() { actualCanvas += "filter3 "; return this; // return the same object }, getActualCanvas: function() { return actualCanvas; } } } And invoke the functions, like this var canvasObject = new Canvas(); if (1 === 1) { canvasObject = canvasObject.filter1(); } if (1 !== 1) { canvasObject = canvasObject.filter2(); } if (2 === 2) { canvasObject = canvasObject.filter3(); } console.log(canvasObject.getActualCanvas()); // filter1 filter3 console.log(new Canvas().filter1().filter2().filter3().getActualCanvas()); // filter1 filter2 filter3
accepted answer of: http://stackoverflow.com/q/27683703
answers question: http://stackoverflow.com/q/27683703
score: 4
upvote count: 4

http://stackoverflow.com/comment/43938061
type: QuestionComment
comment on: http://stackoverflow.com/q/27762993
score: 0
type: Comment
has text: When i typing data it retrive all possible data but after i select one and put it to text box and click search button it not load the selected item giving me data: false

http://stackoverflow.com/q/27729351
answer count: 5
has answer: http://stackoverflow.com/a/27813636
has answer: http://stackoverflow.com/a/27872207
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27743363
has body: I have developed a simple application using AngularJS hosted here. I am consuming an API I developed myself in Laravel hosted here. When I try to log into the application using Firefox, it works fine. My API accepts the pre-flight OPTIONS request and responds with a 200 OK. Finally the POST request generates a token and the user is logged in. On the other hand, when Chrome sends the pre-flight OPTIONS request, it receives an 403 back and it gives me this error in the console: XMLHttpRequest cannot load http://angulairapi.rohanchhabra.in/auth. Invalid HTTP status code 403 I have tried sending the OPTIONS request on /auth via Postman REST client also, and it gives back a 200 OK as expected. Why is Chrome behaving like this? What am I missing?
has comment: http://stackoverflow.com/comment/43917421
tagged with: google-chrome
type: Question
score: 5
tagged with: laravel-4
accepted answer: http://stackoverflow.com/a/27872207
upvote count: 5
possible better answer: http://stackoverflow.com/a/27861237
has answer: http://stackoverflow.com/a/27753322
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27861237
has title: Preflight OPTIONS request by AngularJS not working with Chrome?
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/43719568
has text: Okay, thank you. I thought you were only supposed to use the declaration once, not in a for loop like that. Thank you!
type: Comment
comment on: http://stackoverflow.com/a/27651217
type: AnswerComment
score: 0

http://stackoverflow.com/a/27692483
type: Answer
has body: One of the easiest javascript template engines to get started with is Underscore. Here is a protected answer from SO explaining how to do it: How to use underscore.js as a template engine?
score: 0
answers question: http://stackoverflow.com/q/27692303

http://stackoverflow.com/comment/43932328
comment on: http://stackoverflow.com/q/27760633
type: Comment
type: QuestionComment
score: 0
has text: I'm using an eLearning software program, I can only see it after I upload to the web because java does not work in preview.

http://stackoverflow.com/a/27788331
has body: Javascript has eval that allows you to create new code at runtime. A possible solution is to using recursion only once to create a string that looks like: code = "[obj.prop1.prop1A, obj.prop1.prop1B.prop1BA]" then you can create a data conversion function with f = eval("function(obj){return " + code + "]}") and use it with f(x) to get your array. This is also the most efficient solution if you have to extract the data many times. For example: function mkFilter(schema) { var parts = []; function xtract(s, prefix) { if (typeof s === "string") { parts.push(prefix + s); } else if (s &amp;&amp; s.constructor === Array) { s.forEach(function(x){ xtract(x, prefix); }); } else { for (var f in s) { xtract(s[f], prefix + f + "."); } } } xtract(schema, "obj."); var code = "(function(obj){ return [" + parts.join(", ") + "]; })"; return eval(code); } passing schemaFilter as argument mkFilter will return a function that given an object returns the array; with your input: console.log(mkFilter(filterSchema)(obj)); displays ['A', 'BA']. Of course this approach makes sense if you need to reuse the same filter many times with different objects. If the object may have missing parts and you don't want the filter to fail but just undefined values in the array the code generator needs to be changed slightly: var code = "(function(obj){ return ["; parts.forEach(function(p){ var chain = p.split("."); var expr = ""; for (var i=0; i&lt;chain.length-1; i++) { expr += chain.slice(0, i+1).join(".") + " &amp;&amp; "; } code += expr + p + ","; }); code += "]; })"; This will create in your example a filter evaluating (function(obj){ return [obj &amp;&amp; obj.prop1 &amp;&amp; obj.prop1.prop1A, obj &amp;&amp; obj.prop1 &amp;&amp; obj.prop1.prop1B &amp;&amp; obj.prop1.prop1B.prop1BA,]; })
has comment: http://stackoverflow.com/comment/43986717
downvote count: 1
has comment: http://stackoverflow.com/comment/43986785
has comment: http://stackoverflow.com/comment/43986777
score: 0
answers question: http://stackoverflow.com/q/27787453
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/43986677

http://stackoverflow.com/q/27800668
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44009967
favorite count: 0
has title: Asynchronus calls in angularjs
has body: I am new to Javascript and Angularjs. I wanted to know , how to call a function asynchronously without waiting for it to return from it. Please let me know and if there is some example then it would be very helpful. Regards, nG
has answer: http://stackoverflow.com/a/27800793
tagged with: asynchronous
score: -1
tagged with: angularjs
type: UnansweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/27800765
has answer: http://stackoverflow.com/a/27801009
type: Question
answer count: 3

http://stackoverflow.com/q/27760706
has comment: http://stackoverflow.com/comment/43932541
has comment: http://stackoverflow.com/comment/43932501
score: 0
has comment: http://stackoverflow.com/comment/43932564
tagged with: button
has body: In my page i have three php variables. Each variable has his own button in the page Some infor ?php echo $hotelName0;?> DETAILS Some infor ?php echo $hotelName1;?> DETAILS Some infor ?php echo $hotelName2;?> DETAILS Ho can i create a cookie from the selected article and post its correspodent variable ($hotelNamex) Can this be done with php cookies ? Thanks for looking into it.
tagged with: variables
tagged with: php
answer count: 0
tagged with: cookies
type: UnansweredQuestion
type: Question
has title: Create and post cookie from a HTML button
tagged with: javascript

http://stackoverflow.com/comment/44013946
has text: I have update the question with jsfiddle to show what im trying to achive
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27789732
score: 0

http://stackoverflow.com/comment/43989137
comment on: http://stackoverflow.com/q/27789558
score: 0
type: Comment
type: QuestionComment
has text: We can't help you if you don't explain what the problem is.

http://stackoverflow.com/q/27674593
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27674703
has comment: http://stackoverflow.com/comment/43764256
has answer: http://stackoverflow.com/a/27675354
type: Question
answer count: 2
has body: I'm new to PHP and its development. I used html checkboxes. I want to save all the checked values there. In order to do that I'm retrieving id of the selected checkboxes. But my alert not retrieve the value I expected. I would be very grateful if anyone could point out my stupidity. Thanks! I would be very grateful if anyone could point out my stupidity. Thanks! &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="&lt;?php echo base_url(); ?&gt;js/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function OnChangeCheckbox (checkbox) { if (checkbox.checked) { var inputElements = document.getElementsBy('tagbox'); alert ('checkbox'); } else { alert ("The check box is not checked."); } } &lt;/script&gt; &lt;/head&gt; &lt;?php foreach ($relevanttags as $tags) { echo "&lt;br&gt;"; echo '&lt;input class="tagbox" type="checkbox" onclick="OnChangeCheckbox (this)" value="' . $tags . '" name="tags" &gt;' . $tags; echo "&lt;/br&gt;"; } ?&gt; &lt;/html&gt;
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27675354
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27674703
has comment: http://stackoverflow.com/comment/43764165
has title: HTML post selected value in checkbox

http://stackoverflow.com/comment/65004318
type: AnswerComment
has text: I've got the exact same problem with a locally loaded file, except this is just a basic function call supposed to show an alert. Any ideas what is causing it?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27709334

http://stackoverflow.com/q/27731313
has body: I am trying to write a simple quiz. here is a fiddle I want to create an array of questions, pass it into a loop and print the final answer through a variable which will compute 20 marks for every right answer. function Myfunction() { var y = ["q0", "q1", "q2", "q3", "q4"]; for (i = 0; i <= y.length; i++) { var x = document.getElementById(y[i]).value("correct"); var score = x * 20; alert("Your score is" & "score"); break; } } Welcome to your Web Quiz Quiz about corporate crap What's the difference between a boss and a manager? Boss is a boss Manager is a manager Both are blah What's the right thing to do? Do what the boss says Do what the bosses boss says Dont give a fuck do what you want to do Listen to your heart is that good advice? Listen to it, do not execute Shove it up your a#$$ Shove it up some one elses a$#$ Who is a client? Someone whose astrological charts are right Who gets payed to screw around Someone who is arrogant about being stupid and proud about it
has comment: http://stackoverflow.com/comment/52278102
downvote count: 2
answer count: 1
tagged with: javascript
type: UnansweredQuestion
upvote count: 0
tagged with: arrays
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/27731356
has title: Hello All - Java Script Quiz
score: -2

http://stackoverflow.com/q/27647925
type: Question
tagged with: javascript
has body: I have the below code --> var last_will = new Paho.MQTT.Message("last message"); last_will.destinationName = "Bridge123"; client = new Paho.MQTT.Client("broker.mqttdashboard.com", Number("8000"), "AX123"); client.onConnectionLost = onConnectionLost; client.onMessageArrived = onMessageArrived; client.connect({onSuccess:onConnect} , {willMessage:last_will}); When i disconnect the client i expect a last will message being sent to the topic i have created .. Am using Paho 's mqtt version -3.1 .. Websockets are getting created fine but i do not see the last will message ... Can anyone guide here ? Adding the bigger picture : I have a Python script p gathering current on / off status of a IOT device in the local environment and publishing to a topic "IOT1" over mqtt . I do not want the python script always running to get status from the IOT device as it overloads the device .. To solve this i am in need of finding active clients for "IOT1" topic so that i run or pause the thread sending requests to the IOT device in the local environment .. Is there a way other than the last will message to know this ?
tagged with: iot
score: 0
answer count: 2
tagged with: communication
tagged with: paho
type: UnansweredQuestion
tagged with: mqtt
has answer: http://stackoverflow.com/a/46179358
has answer: http://stackoverflow.com/a/27650870
has title: MQTT Js Last Will Message not getting published

jsonp
tags question: http://stackoverflow.com/q/27722019
type: Tag
tags question: http://stackoverflow.com/q/27706878
tags question: http://stackoverflow.com/q/27758478
tags question: http://stackoverflow.com/q/27748911
tag name: jsonp
tags question: http://stackoverflow.com/q/27774717

http://stackoverflow.com/q/27684354
accepted answer: http://stackoverflow.com/a/27685396
has comment: http://stackoverflow.com/comment/43784038
tagged with: javascript
has title: HTML 5 Audio controls on-site not working as it should
score: 0
has comment: http://stackoverflow.com/comment/43783780
answer count: 1
has comment: http://stackoverflow.com/comment/43784647
tagged with: jquery
has answer: http://stackoverflow.com/a/27685396
has body: I am hoping someone is able to help with a problem I am having. The below code manages the audio player on a website I am developing. The idea is that the user can click a mute button to toggle sound on the website and if the user clicks on a specific link to leave the site, the sound should be muted if not already. So the first part of the script below sets a global variable for the audio player (audio html5 tag) (audioPlayer) and the second part sets a global variable for the mute button the user can click. &lt;script type="text/javascript"&gt; var muteAudio = document.getElementById('audioPlayer'), ctrl = document.getElementById('audioControl'); Then if someone clicks the mute button, I update the inner html of the mute button to either say mute or play, depending on what status the button is on ctrl.onclick = function () { // Update the Button var pause = ctrl.innerHTML === 'Mute'; ctrl.innerHTML = pause ? 'Play' : 'Mute'; And then I update the html 5 audio embed method // Update the Audio var method = pause ? 'pause' : 'play'; muteAudio[method](); // Prevent Default Action return false; }; The second part of the script sets a 3rd global variable for a external link (SHOP) that takes users to the e-commerce store. If the sound is on, it should get muted when the user leaves. If the sound is not on, this if statement should not execute ctrl3 = document.getElementById('muter'); if (ctrl.innerHTML.indexOf('Mute') != -1) { console.log('not-muted'); ctrl3.onclick = function () { $("#audioControl").click(); return false; }; } else {console.log('did nothing');} &lt;/script&gt; Problem is that the if statement does not appear to work. If the audio is muted, it should not execute the click function on the mute button to mute the sound when a user exits to the online store. What is happening is that the if statement always seems to be true because regardless of whether the mute button is in play state (i.e. the mute button says mute/inner html), it will toggle the sound t…
tagged with: audio
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/101438562
type: Comment
comment on: http://stackoverflow.com/a/48073751
type: AnswerComment
has text: But, when I use this answer, my App stuck at beforesend function. Do you know why?
score: 0

http://stackoverflow.com/comment/43713978
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27648074
has text: i have a search form with drop-down select the user choose a first select list and the second select get updated after that the form is submitted and we have the search result with the same criteria that the user choose first to tune his search and i want the data populated dynamically in first form
type: Comment

http://stackoverflow.com/q/27683051
downvote count: 0
tagged with: drop-down-menu
score: 1
favorite count: 0
has title: Absolute positioned dropdown menu in scrolling div
has answer: http://stackoverflow.com/a/27683458
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43780720
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27683458
tagged with: javascript
has body: I have a scrollable div of max height around 500px. Inside, are multiple child divs (sections) that have a menu on each of them. The menu are typical dropdowns, something like: .menu ul li{ position:relative; float:none; display:none; } The problem I am facing is that when menu opens, it pushes everything down. If I make it position absolute, it messes up for sections that come later down (after scrolling down). Should I compute offsets by javascript and position them programatically, or can this be resolved via CSS? One way would be to have the "sections" position absolute. Then I can leverage position: relative for the menus to be at the right place in each section. But that is something I can't do due to other reasons. JSFiddle http://jsfiddle.net/iamjab/m66sgs5z/ Any help will be appreciated.
has comment: http://stackoverflow.com/comment/43781267
answer count: 1

http://stackoverflow.com/a/27733012
score: 1
type: AcceptedAnswer
upvote count: 1
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/27732842
accepted answer of: http://stackoverflow.com/q/27732842
has body: You can try adding an inner wrapper with this CSS: display: inline-block; max-width: 200px; /* Maximum scrollable amount */ overflow: hidden; .outer-wrapper { border: solid 2px black; height: 100px; width: 100px; overflow: auto; } .inner-wrapper { display: inline-block; max-width: 200px; overflow: hidden; } LongLongLongLongLongLongLongLongLongLongLongLong Short

http://stackoverflow.com/a/27788059
type: Answer
downvote count: 2
has comment: http://stackoverflow.com/comment/43986002
answers question: http://stackoverflow.com/q/27787967
score: -2
upvote count: 0
has body: Try: var theUrl = $(this).attr('href'); var index = theUrl.lastIndexOf("/") + 1; var filename = theUrl.substr(index); console.log( 'link file name is '+filename );

http://stackoverflow.com/comment/44004763
type: Comment
type: QuestionComment
score: 0
has text: @ColinRamsay good catch, fixed in the question.
comment on: http://stackoverflow.com/q/27797529

http://stackoverflow.com/a/27736989
type: Answer
has body: Aside from the missing quote in the other answer, you have a few quotes that are not standard or double quotes. Here are the ones that a JS parser found: lineReader.eachLine(‘Location.txt... - The single quote before Location is not a single quote var b= line.split(“,” - These are not really double quotes - perhaps convert to single quotes or use actual double quotes Additionally, after your closing brace to the function, you have some extra closing braces and parenthesis. ); - The parenthesis and semicolon } - The last bracket Hope this helps
has comment: http://stackoverflow.com/comment/43885570
score: 0
answers question: http://stackoverflow.com/q/27736898

http://stackoverflow.com/a/27642846
answers question: http://stackoverflow.com/q/27642835
has body: req is short for request which would be the HTTP request data from the client.
upvote count: 3
downvote count: 1
type: Answer
score: 2

http://stackoverflow.com/comment/47338566
type: Comment
comment on: http://stackoverflow.com/a/27848326
has text: ...Sigh. It would be nice to see any answers relating to Angular not pointing to BootStrap. It's a little hard to take it as a serious alternative and replacement to jQuery when everyone's answer when it comes to creating new UI components is "You should use Bootstrap".
score: 0
type: AnswerComment

http://stackoverflow.com/q/27760640
has answer: http://stackoverflow.com/a/27760741
has body: To check my understanding, do we have that the following for loop never escapes only if row.length &lt; n (otherwise, the loop can escape)? function someFunction (matrix,n) { for (var i = 0; i &lt; n; i += 1) { var row = matrix[i]; for (var i = 0; i &lt; row.length; i += 1) { if (row[i] &lt; 0) { alert("Something's wrong"); } } } }
has comment: http://stackoverflow.com/comment/43932346
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43932354
downvote count: 2
has comment: http://stackoverflow.com/comment/43932445
score: -2
tagged with: javascript
has title: When does this for loop escape?
type: Question
has comment: http://stackoverflow.com/comment/43932781
answer count: 2
upvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27760768

http://stackoverflow.com/q/27692517
answer count: 1
tagged with: javascript
has body: When you click a link the linked page is opened in the current tab. If you click a link while holding a Ctrl button pressed the linked page is opened in a new background tab. I want to implement an extension that would capture Alt+Clicks or Shift+Clicks so when a user clicks a link while holding an Alt button pressed a function of mine gets the link target URL (and nothing else but what I have programmed happens). How can this be achieved? An SDK way is very much preferred.
has title: How to handle a modified link click event in a Firefox extension?
favorite count: 0
tagged with: firefox-addon
tagged with: firefox-addon-sdk
downvote count: 0
type: UnansweredQuestion
type: Question
score: 2
tagged with: mozilla
upvote count: 2
has answer: http://stackoverflow.com/a/27695619
tagged with: firefox

http://stackoverflow.com/a/27793620
score: 1
answers question: http://stackoverflow.com/q/27788562
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27788562
upvote count: 1
type: Answer
has body: Hi, bool check = false; protected void RadGrid1_PreRender(object sender, EventArgs e) { if (check) { RadGrid1.AllowPaging = false; RadGrid1.Rebind(); Response.Write(RadGrid1.MasterTableView.Items.Count); RadGrid1.AllowPaging = true; RadGrid1.Rebind(); } } protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) { if (e.CommandName == RadGrid.FilterCommandName) { check = true; } else { check = false; } } Thanks, Saritha.
downvote count: 0

http://stackoverflow.com/comment/43784567
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27685174
type: AnswerComment
has text: and I can't add the other action before the alert or after the user clicks "ok"?

http://stackoverflow.com/comment/43973129
has text: @Quentin: there is no need of `JSON.stringify()`
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27781583
type: AnswerComment

http://stackoverflow.com/q/27678922
type: Question
tagged with: built-in
has comment: http://stackoverflow.com/comment/43773073
tagged with: javascript
tagged with: inheritance
duplicate of: http://stackoverflow.com/q/8802845
score: 0
has title: Extending (inheriting) from built-in class `Error`
has comment: http://stackoverflow.com/comment/43772862
has comment: http://stackoverflow.com/comment/43772598
has body: I try to write my own HTTPError object in JS. My code looks as follows "use strict"; HTTPError.prototype = Object.create( Error.prototype ); HTTPError.prototype.constructor = HTTPError; function HTTPError( msg, httpStatus, httpStatusText, fileName, lineNumber ) { var _httpStatus = httpStatus; var _httpStatusText = httpStatusText; // Public and privileged methods this.httpStatus = function() { return _httpStatus; } this.httpStatusText = function() { return _httpStatusText; } // C'tor starts here Error.call( this, msg, fileName, lineNumber ); this.name = "HTTPError"; } HTTPError.prototype.toString = function() { var name = this.name; name = (typeof name !== "string") ? 'HTTPError' : name; var msg = this.message; console.log( "This is msg: " + msg ); msg = (typeof msg !== "string") ? '' : msg; var status = '(Status: ' + this.httpStatus() + ' - ' + this.httpStatusText() + ')'; if (name === '') { return msg + ' ' + status; } if (msg === '') { return name + ' ' + status; } return name + ': ' + msg + ' ' + status; } The method toString was inspired by MDN Error.toString reference. The signature of the Error-constructor is taken from MDN Error reference. The problem is that the toString() method never prints the error message. The line of code console.log( "This is msg: " + msg ) solely exists for debugging purposes. This line reveals that msg is undefined, hence it is set to ''. But why is it undefined? For some reason the message property does not seem to be exist but I called the parent Error constructor. What I am doing wrong?
has comment: http://stackoverflow.com/comment/43773053
has comment: http://stackoverflow.com/comment/43773096
answer count: 0
has comment: http://stackoverflow.com/comment/43772540
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/8802845
has comment: http://stackoverflow.com/comment/43772964
has comment: http://stackoverflow.com/comment/43781069
has comment: http://stackoverflow.com/comment/43772812

http://stackoverflow.com/comment/43871795
comment on: http://stackoverflow.com/q/27729779
score: 0
has text: `/^([^\d]*?)(\d+|\.\d+|\d+\.\d+)([^\d]*?)$/` -> `["hello there can sometimes be decimals like 1.5 in here", "hello there can sometimes be decimals like ", "1.5", " in here"]`
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43897677
comment on: http://stackoverflow.com/q/27743034
has text: No, it's not wrong. My mistake - I thought at first look you would like to retrieve the data from the XML again when clicking a button. I just gave an answer, maybe that's what you're looking for.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27723126
answers question: http://stackoverflow.com/q/27723040
score: 2
downvote count: 0
upvote count: 2
has body: Have you tried anything to accomplish this yet? This should be fairly simple by implementing a custom extender in Knockout which subscribes to value changes and checks for others to be empty and fills them in. Ex. extender - ko.extenders.setOthersOnChange = function(target, others) { target.subscribe(function(newValue) { ko.utils.arrayForEach(others, function (other) { if (!ko.unwrap(other)) { other(newValue); } }); }); return target; }; And in your VM - this.person2 = ko.observable().extend({ setOthersOnChange: [] }); this.person1 = ko.observable().extend({ setOthersOnChange: [this.person2] }); The benefit here is you can have n number of other dependent observables without increasing how many subscriptions you have to manually create. I would also suggest ensuring you dispose of them properly. Updated fiddle for reference http://jsfiddle.net/r29xtLaq/3/
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27723040

http://stackoverflow.com/a/27748326
type: Answer
answers question: http://stackoverflow.com/q/27748161
score: 2
accepted answer of: http://stackoverflow.com/q/27748161
downvote count: 0
has body: createState() is overwriting the prototypes for your StateLearnConstructor and your StateExamConstructor after you have assigned functions to them. You shouldn't be conditionally extending them. Just extend them: extend(StateLearnConstructor, StateConstuctor); extend(StateExamConstructor, StateConstuctor); StateConstuctor.prototype.getTitles = function () { console.log('base "virtual" function'); }; StateLearnConstructor.prototype.getTitles = function () { console.log('learn'); }; StateExamConstructor.prototype.getTitles = function () { console.log('exam'); }; function createState(rollType) { if (rollType == 'learn') { return new StateLearnConstructor(); } else if (rollType == 'exam') { return new StateExamConstructor(); } } Once you do that, your "virtual functions" should work as expected. demo Note: Your implementation for extend() is more complicated than it needs to be. The modern way to inherit a prototype is to use Object.create(): function extend(Child, Parent) { Child.prototype = Object.create(Parent.prototype); Child.prototype.constructor = Child; Child.superclass = Parent.prototype; }
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/44004009
score: 2
has text: @user205537: Read your own question again. It says, word-for-word, "I need to add a loop into this javascript code but can't figure out how".
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27795474

http://stackoverflow.com/a/27712000
downvote count: 0
has body: findOne returns only one record, you need use find, like this Liq.find({ typeOfLiq : 'aqua'}) ....
type: AcceptedAnswer
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/27711901
upvote count: 1
answers question: http://stackoverflow.com/q/27711901

http://stackoverflow.com/q/27792381
score: 0
has comment: http://stackoverflow.com/comment/43994337
answer count: 3
has comment: http://stackoverflow.com/comment/43994341
has title: Is there any reason not to dynamically load a website content
has body: Now that (V8)Chrome and (SpiderMonkey)Firefox's JS Dom traversals are relatively fast : Is there any reason not to dynamically load in website content via javascript? I was thinking of requesting large files (images and such) with Javascript while displaying a loading bar. Is there any reason not to dynamically load the large JS/JPG files? I don't see it very often and wanted to make such it was not a big mistake.
has comment: http://stackoverflow.com/comment/43994348
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27792481
has comment: http://stackoverflow.com/comment/43994455
has comment: http://stackoverflow.com/comment/43994312
has comment: http://stackoverflow.com/comment/43994386
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27792479
has answer: http://stackoverflow.com/a/27792431
has comment: http://stackoverflow.com/comment/43994351
tagged with: ajax
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43994292
has comment: http://stackoverflow.com/comment/43994388

http://stackoverflow.com/comment/43757417
has text: Thanks! Your questioning did led me to find a better solution overall by using indexOf. See new codepen here for anyone else with similar issue: http://codepen.io/chriscruz/pen/pvEKpB
score: 0
comment on: http://stackoverflow.com/q/27671023
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27714425
score: 0
possible better answer: http://stackoverflow.com/a/27714485
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43840977
accepted answer: http://stackoverflow.com/a/27714457
type: AnsweredQuestion
has body: So in javascript I am trying to make a section of my website to be 100% - "nav" you can think of it like 2 visible objects only, the first really big, and the second is small on the bottom. CSS declared like: #mainHeader{ height: 100vh; } #nav{ height 90px; } and I have created this in javascript / jquery this executes upon &lt;body onload = "function()"&gt; &lt;/body&gt; var mainHeaderHeight = $("#mainHeader").outerHeight(true) - $("nav").outerHeight(true); $("#mainHeader").css("height",mainHeaderHeight + "px"); What it looks like:
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27714457
tagged with: javascript
has answer: http://stackoverflow.com/a/27714485
tagged with: jquery
has title: Height in Javascript doesn't render as expected

http://stackoverflow.com/a/29839114
answers question: http://stackoverflow.com/q/27742070
downvote count: 0
type: Answer
upvote count: 1
has body: The Reason You are not opening the page through a server, like Apache, so when the browser tries to obtain the resource it thinks it is from a separate domain, which is not allowed. Though some browsers do allow it. The Solution Run inetmgr and host your page locally and browse as http://localhost:portnumber/PageName.html or through a web server like Apache, nginx, node etc. Alternatively use a different browser No error was shown when directly opening the page using Firefox and Safari. It comes only for Chrome and IE(xx). If you are using code editors like Brackets, Sublime or Notepad++, those apps handle this error automatically.
score: 1

http://stackoverflow.com/a/27718308
answers question: http://stackoverflow.com/q/27715005
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43906292
type: Answer
has body: I had an issue like this before. What fixed it for me was just running git clean -dfx I don't really see anything wrong with your code that should throw that error. It may just be git being strange.
upvote count: 1

http://stackoverflow.com/comment/43997160
has text: This doesn't seem to work. I use "radiant" instead of RadiantUI and I get 'module 'radiant' is not available...' Also, the syntax of TriggerEvent seems wrong (= instead of :)
type: Comment
comment on: http://stackoverflow.com/a/27792928
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43999097
type: Comment
comment on: http://stackoverflow.com/a/27794969
has text: nope. still the same result. only getting focus on the input field. the key i pressed is lost, i need it to appear on the field
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43796147
comment on: http://stackoverflow.com/q/27691313
score: 0
has text: I could say more really but I'll just constrain this to "what is the question we are supposed to answer?" because I don't see a clear question here IMHO.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/103250996
has text: Unfortunately, this approach will not address the `focus` pseudo selector, but will instead update the background of the element when the `focus` event has been triggered. The only solution that will work here is @karthik's solution below, since it will allow selecting the `focus` pseudo selector.
type: AnswerComment
comment on: http://stackoverflow.com/a/27751432
type: Comment
score: 2

http://stackoverflow.com/q/27678881
has comment: http://stackoverflow.com/comment/43773189
tagged with: javascript
has answer: http://stackoverflow.com/a/27679472
has title: How to handle click events on div
has comment: http://stackoverflow.com/comment/43772306
answer count: 3
has comment: http://stackoverflow.com/comment/43772362
has body: I have a data set of items coming from a SQL database. Those items are displayed in multiple divs like: <?php $url = 'DataBase'; $json_response = file_get_contents ( $url ); $json_arr = json_decode ( $json_response, true ); for($i = count ( $json_arr )-1; $i > 0; $i--) { $json_obj = $json_arr [$i]; echo ' '; echo $json_obj ['id'] ; echo $json_obj ['title']; echo $json_obj ['article']; echo ' Read more '; echo ' ' } ?> My problem is that I cannot handle click events for EACH div, so I cannot identify which item has been clicked. I’ve been searching for a solution for quite a while, but haven’t found anything. So my question is – how can I identify the clicked item? EDIT I have no idea how I can dynamically assign an ID to a button
downvote count: 0
has comment: http://stackoverflow.com/comment/43773883
tagged with: jquery
has comment: http://stackoverflow.com/comment/43772305
favorite count: 0
has comment: http://stackoverflow.com/comment/43773249
has answer: http://stackoverflow.com/a/27679543
has answer: http://stackoverflow.com/a/27678921
has comment: http://stackoverflow.com/comment/43772365
has comment: http://stackoverflow.com/comment/43772394
tagged with: http://stackoverflow.com/tag/html
upvote count: 3
has comment: http://stackoverflow.com/comment/43772354
accepted answer: http://stackoverflow.com/a/27679543
type: Question
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/27679472

http://stackoverflow.com/a/27657425
has body: Please try this: just change type="button" to type="submit". Untitled Document
has comment: http://stackoverflow.com/comment/43730628
upvote count: 4
answers question: http://stackoverflow.com/q/27657277
has comment: http://stackoverflow.com/comment/43730764
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43813306
score: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/43830134
has comment: http://stackoverflow.com/comment/43730712
accepted answer of: http://stackoverflow.com/q/27657277
type: Answer

http://stackoverflow.com/comment/43968192
type: Comment
has text: Updated my code. In main window initially text will be "ON" by clicking it changed to "OFF" and when I open popup it is again showing as "ON"
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27777921

http://stackoverflow.com/comment/43875602
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27732073
has text: Well there's no "configuration of JavaScript" server-side, other than to have the files in the right place. If the files aren't being loaded, then of course they won't work, but if you're sure they *are* being loaded then there's nothing that any normal server needs to do.

http://stackoverflow.com/a/27733937
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27733829
has body: Assuming your form has the ID my-form-id, you would first call: $("#my-form-id").validate(); This validates the form. And then you can do: if($("#my-form-id").valid()){ //enable save button //if user accept terms(by using check the check box) } else { return false; } See full doc here: http://jqueryvalidation.org/valid
accepted answer of: http://stackoverflow.com/q/27733829
type: Answer
has comment: http://stackoverflow.com/comment/43948390

android
tags question: http://stackoverflow.com/q/27766710
tags question: http://stackoverflow.com/q/27729582
tags question: http://stackoverflow.com/q/27761392
tags question: http://stackoverflow.com/q/27709527
tags question: http://stackoverflow.com/q/27759085
tags question: http://stackoverflow.com/q/27735002
tags question: http://stackoverflow.com/q/27661873
tags question: http://stackoverflow.com/q/27646927
tags question: http://stackoverflow.com/q/27733931
tags question: http://stackoverflow.com/q/27794565
tags question: http://stackoverflow.com/q/27641312
tags question: http://stackoverflow.com/q/27709995
tags question: http://stackoverflow.com/q/27803596
tags question: http://stackoverflow.com/q/27794488
tags question: http://stackoverflow.com/q/27730224
tags question: http://stackoverflow.com/q/27770942
tags question: http://stackoverflow.com/q/27771254
tags question: http://stackoverflow.com/q/27753001
tags question: http://stackoverflow.com/q/27691736
tags question: http://stackoverflow.com/q/27684960
tags question: http://stackoverflow.com/q/27714085
tags question: http://stackoverflow.com/q/27654005
tags question: http://stackoverflow.com/q/27686998
tags question: http://stackoverflow.com/q/27754926
tags question: http://stackoverflow.com/q/27786536
tags question: http://stackoverflow.com/q/27707472
tags question: http://stackoverflow.com/q/27777471
tags question: http://stackoverflow.com/q/27686986
tags question: http://stackoverflow.com/q/27694375
tags question: http://stackoverflow.com/q/27802330
tags question: http://stackoverflow.com/q/27761467
tags question: http://stackoverflow.com/q/27791966
tags question: http://stackoverflow.com/q/27705599
tags question: http://stackoverflow.com/q/27642035
tags question: http://stackoverflow.com/q/27742109
tags question: http://stackoverflow.com/q/27755336
tags question: http://stackoverflow.com/q/27782621
tags question: http://stackoverflow.com/q/27750601
tags question: http://stackoverflow.com/q/27760349
tags question: http://stackoverflow.com/q/27680006
tags question: http://stackoverflow.com/q/27786165
tags question: http://stackoverflow.com/q/27692201
tags question: http://stackoverflow.com/q/27722549
tags question: http://stackoverflow.com/q/27666463
tags question: http://stackoverflow.com/q/27777920
tags question: http://stackoverflow.com/q/27798086
tags question: http://stackoverflow.com/q/27710434
tags question: http://stackoverflow.com/q/27708576
tags question: http://stackoverflow.com/q/27727699
tags question: http://stackoverflow.com/q/27647247
tags question: http://stackoverflow.com/q/27734569
tags question: http://stackoverflow.com/q/27668552
tag name: android
tags question: http://stackoverflow.com/q/27779363
tags question: http://stackoverflow.com/q/27799434
type: Tag
tags question: http://stackoverflow.com/q/27689904
tags question: http://stackoverflow.com/q/27747899
tags question: http://stackoverflow.com/q/27743571

http://stackoverflow.com/comment/44167985
type: AnswerComment
score: 0
type: Comment
has text: My error was in the path of the route just that but thank you anyway
comment on: http://stackoverflow.com/a/27807838

http://stackoverflow.com/comment/45167124
type: QuestionComment
comment on: http://stackoverflow.com/q/27793737
has text: Be ware of `FileReader` browser support. Here you can find another example/experiment: https://gist.github.com/ispedals/5613344
score: 0
type: Comment

http://stackoverflow.com/comment/43886529
comment on: http://stackoverflow.com/q/27737561
score: 0
type: QuestionComment
has text: You sure you aren't looking at a minified version of the code?
type: Comment

http://stackoverflow.com/a/27712558
upvote count: 2
has body: Nesting isn't necessarily bad, however an issue here is that if the code above is called more than once over any elements with the class editable-pais that existed the last time the code was called you will end up with more than one click handler. This will generate multiple requests to your inner request's URL. If you don't need data from the first call to complete this call, or the data can be obtained by other means, you may want to consider un-nesting them. jQuery offers the ability to do delegated callbacks if you need to capture events from elements that may not exist yet: $("selector for parent element").on("click", ".editable-pais", function (event) { ... });
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27712487
type: Answer
answers question: http://stackoverflow.com/q/27712487
has comment: http://stackoverflow.com/comment/43864498
has comment: http://stackoverflow.com/comment/43841590
score: 2
downvote count: 0

http://stackoverflow.com/q/27799915
has answer: http://stackoverflow.com/a/27799981
has answer: http://stackoverflow.com/a/27799957
accepted answer: http://stackoverflow.com/a/27799957
tagged with: ajax
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
possible better answer: http://stackoverflow.com/a/27800066
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27800066
type: Question
score: 0
has body: I want to disable onclick event after successful ajax request Report this is my div which i want to disable div after clicked function reported_text(user_id,lead_id){ new Ajax.Request("/agent/report/lead-refund", { method:"POST", parameters:"user_id=" + user_id + "&lead_id=" + lead_id , onSuccess: function(transport){ alert("Thank you for Response"); jQuery('#report_button').attr("disabled", "disabled"); }, onFailure: function(transport){ $('tag_error_status').innerHTML = ''; alert("Unsuccessful request processing. This will be rectified soon."); } }); } is there any way to do this. and this div is used for many users, i have to do it in such a way so that it only disable for particular user.
has title: How can i disable onclick event after successful ajax request?
has comment: http://stackoverflow.com/comment/44008331
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/11186666
has comment: http://stackoverflow.com/comment/44008447

http://stackoverflow.com/comment/43987906
type: AnswerComment
comment on: http://stackoverflow.com/a/27772795
score: 0
type: Comment
has text: All what I can do is, to return false on oncut,oncopy and onpaste. This will not allow copy cut paste blindly, although my client is fine with this, I feel its a stupid way to resolve problem, because, I feel they should be allowed to copy/cut/paste positive values no matter the business logics. My simple solution is, check the value copied/cut and see if it contains negative, don't allow. Ideally it shouldn't allow only when scenarios in keypress dont allow, but its ok if we can achieve to the extent that if we dont allow copyu/cut/paste no matter business scenarios

http://stackoverflow.com/comment/56375282
has text: Nightwatch is fine for UnitTesting
type: Comment
comment on: http://stackoverflow.com/a/27714308
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44667206
type: AnswerComment
has text: have created a jsfiddle.. but it doesn't seem to work http://jsfiddle.net/co53d9jf/
type: Comment
comment on: http://stackoverflow.com/a/27880173
score: 0

http://stackoverflow.com/q/27772393
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27776018
has title: CKEDITOR.editor.on not working with replaceAll
upvote count: 1
type: Question
score: 1
tagged with: ckeditor
accepted answer: http://stackoverflow.com/a/27776018
downvote count: 0
answer count: 1
has body: I'm trying to capture an event from a plugin: $(document).ready(function( ) { CKEDITOR.replaceAll( 'js-ckeditor' ); CKEDITOR.editor.on('simpleuploads.startUpload', function (ev) { console.log(ev.data) }); }); ...but when I run it, I see the error TypeError: CKEDITOR.editor.on is not a function. What am I doing wrong here? According to the documentation editor should have a method "on" (which I can see when I inspect the object). By the way, both the textarea and plugin function well so replaceAll seems to work fine.
tagged with: javascript

http://stackoverflow.com/q/27660905
downvote count: 2
upvote count: 1
answer count: 1
favorite count: 0
has body: Username Password <?php $l=0; $nl=1; $connection = mysqli_connect("127.0.0.1", "root", "", "agentie"); if(isset($_POST['nume']) && isset($_POST['password'])) { echo $_POST["nume"]; echo $_POST["password"]; $nl=0; $query1 = mysqli_query($connection, "SELECT user, password FROM user u WHERE u.user='$_POST[nume]'") or die("Error in the consult.." . mysqli_error($connection)); while ($row = mysqli_fetch_assoc($query1)) { if (($row["user"] == $_POST["nume"]) && ($row["password"] == $_POST["password"])) { echo "Bine ati venit" . $row["user"]; $l=1; ?> Alegeti actiunea: Afiseaza Introdu Sterge Modifica <?php } } if($l==0) { ?> Jermaine Modelling <?php } } if(($l==0) && ($nl==1)) { ?> Jermaine Modelling <?php } ?> I would want, depending on the selected option, to do something with PHP and HTML; so I have changed the id of the select on onChange event with Javascript, but I do not know how to pass the changed id to PHP; how do I do that (I know that there is another similar question asked, but I don't know that to do with that function)? Or, is there another way to make something with PHP when an option is selected, without form (because I have a form already)?
has comment: http://stackoverflow.com/comment/43737773
has comment: http://stackoverflow.com/comment/43737568
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43737658
has comment: http://stackoverflow.com/comment/43737903
tagged with: php
has title: How to pass the id from select to PHP?
has comment: http://stackoverflow.com/comment/43737701
tagged with: select
type: Question
has answer: http://stackoverflow.com/a/27661118
tagged with: javascript
score: -1

http://stackoverflow.com/q/27724868
has answer: http://stackoverflow.com/a/30489940
has title: Kendo UI Grid get id of current element javascript
accepted answer: http://stackoverflow.com/a/30489940
type: AnsweredQuestion
has body: i m using Kendo UI apsnet and i have a Gird with autocomptele as template in 3rd column and i want send data using javascript function "onAutoCompleteX", in this function i want to get id of active autocomplete to send text as parametere to action "GetArticle" but my probleme is how get this id, tried many methods always i get "undefined" or error @using KendoUIMvcApplication2.Areas.Gescom.Models.Achat &lt;style&gt; .k-widget .templateCell { overflow: visible; } &lt;/style&gt; &lt;script&gt; function initMenus(e) { $(".templateCell").each(function () { eval($(this).children("script").last().html()); }); } function onAutoCompleteSelectX(e) { var dataItem = this.dataItem(e.item.index()); var url = '@Url.Action("GetArticle", "Fiche")'; $.ajax({ url: url, data: { code: dataItem.Code }, //parameters go here in object literal form type: 'GET', datatype: 'json', success: function (data) { if (data == null) document.getElementById('labelx').innerHTML = "null"; else document.getElementById('labelx').innerHTML = data.Code; }, error: function () { document.getElementById('labelx').innerHTML = "error"; } }); } function onAutoCompleteX() { var currentId = $(this).attr('id'); //var currentId = $(this).id; //document.getElementById('labelx').innerHTML = $(this).className; //$obj.attr('id'); return { text: document.getElementById(currentId).value //text: $("#id_of_another_autocomplete").val() works fine when i set static id manually }; } &lt;/script&gt; &lt;div class="lines-tab-doc"&gt; @(Html.Kendo().Grid&lt;LineAppelOffre&gt;() .Name("grid-lines-doc") // Declare grid column .Columns(columns =&gt; { // Cretae all the columns base on Model columns.Bound(l =&gt; l.Document); columns.Bound(l =&gt; l.LigneOriginale); columns.Template(l =&gt; { }).Title(@Resources.Resource.Article) .HtmlAttributes(new { @class = "templateCell" }) .ClientTemplate( Html.Kendo().AutoComplete() .Name("Article") .HtmlAttributes(new { id = "#=LigneOriginale#", style = "width:100%;" }) .DataTextField("Code") …
type: Question
tagged with: kendo-grid
answer count: 2
tagged with: autocomplete
tagged with: javascript
tagged with: kendo-ui
score: 0
has answer: http://stackoverflow.com/a/27730212
tagged with: kendo-asp.net-mvc
possible better answer: http://stackoverflow.com/a/27730212

http://stackoverflow.com/comment/43971882
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27780805
has text: I can see the same result at your updated answer too. everything is working fine. But, when get back from "congratulation" screen, back button is not working for clicked once from "Content-3" screen. I has to click twice to make it working
type: Comment

http://stackoverflow.com/q/27676923
score: 1
tagged with: webgl
has comment: http://stackoverflow.com/comment/43824490
type: Question
tagged with: cors
tagged with: soundcloud
tagged with: javascript
has title: Accessing Soundcloud waveform/artwork for WebGL (three.js) app - CORS issue
has answer: http://stackoverflow.com/a/28789426
upvote count: 1
answer count: 1
favorite count: 0
has body: I'm working on a WebGL app which uses data from the soundcloud API. I'm trying to use ThreeJS to load the track artwork and waveform PNGs into textures to put onto sprites. But I'm getting the error in chrome: Image from origin [soundcloudapi] has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. So I've been reading up on CORS and it seems from the Soundcloud documentation that CORS is supported in some way for the JSON data (Soundcloud CORS) but I'm not sure if or how this extends to requesting the pngs associated with tracks. I've also read a little about Three.js and CORS and so I've included the line: THREE.ImageUtils.crossOrigin = ''; I put this like before I call 'loadTexture()' anywhere but I'm still getting the same error. I was thinking one workaround would be to request the PNG in javascript and then make an AJAX request to a php file while just grabs the image and temporarily stores it on my server but that's not really efficient if a lot of people end up using my app (and probably isn't legal or something from Soundcloud's point of view). So I want to avoid this as much as possible. Has anyone tried this before? Does anyone have any ideas? Thanks for your time.
type: UnansweredQuestion
tagged with: three.js
downvote count: 0

http://stackoverflow.com/q/27663180
type: Question
score: 0
answer count: 1
has body: Using the client side Instagram authentication, I'm able to obtain an access token allowing me to view user media: https://instagram.com/oauth/authorize/?client_id=#####&amp;redirect_uri=http..&amp;response_type=token' However, when I'm redirected, the user needs to re-input their username. Is there a way to avoid this? Example live here.
tagged with: authentication
has title: Return info from instagram authentication
tagged with: javascript
type: UnansweredQuestion
tagged with: instagram
has answer: http://stackoverflow.com/a/27706536

http://stackoverflow.com/comment/43938052
has text: I changed if(isset($_POST["dangnhap"])) to (isset($_POST["submit"])) but still the problem exists.
type: Comment
comment on: http://stackoverflow.com/a/27763533
score: 0
type: AnswerComment

http://stackoverflow.com/a/27705690
type: Answer
has comment: http://stackoverflow.com/comment/43823263
has body: Put it into a pre tag, and it will keep the whitespace during display. Your code changed a bit: var myjson = JSON.stringify(json, null, 2); console.log(myjson); var x = window.open(); x.document.open(); x.document.write('&lt;html&gt;&lt;body&gt;&lt;pre&gt;' + myjson + '&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;'); x.document.close();
accepted answer of: http://stackoverflow.com/q/27705640
score: 15
upvote count: 15
answers question: http://stackoverflow.com/q/27705640
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27753511
has answer: http://stackoverflow.com/a/27753521
has comment: http://stackoverflow.com/comment/43918042
has answer: http://stackoverflow.com/a/27753539
upvote count: 49
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43917873
tagged with: if-statement
downvote count: 9
linked to: http://stackoverflow.com/q/5225096
has answer: http://stackoverflow.com/a/27753567
accepted answer: http://stackoverflow.com/a/27753521
possible better answer: http://stackoverflow.com/a/27753619
has answer: http://stackoverflow.com/a/27753619
has comment: http://stackoverflow.com/comment/43917924
tagged with: javascript
has comment: http://stackoverflow.com/comment/43917980
favorite count: 0
score: 40
has comment: http://stackoverflow.com/comment/132875452
has title: Javascript not greater than 0
answer count: 4
has body: How to check if the value is not greater than 0 in javascript? I tried if(!a&gt;0){} But it's not working.
has comment: http://stackoverflow.com/comment/43917882

http://stackoverflow.com/comment/43741175
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27662406
has text: @user1379351 You're question asks how to change an attribute within an animation chain. If you view the answer I linked to, it shows you how to execute something within your chain. You don't need to deal with a promise to do it based on your example.
type: Comment

http://stackoverflow.com/q/27684980
tagged with: jquery
has answer: http://stackoverflow.com/a/27685091
possible better answer: http://stackoverflow.com/a/27685039
score: 0
has comment: http://stackoverflow.com/comment/43784601
has title: without document.ready function does not work
has comment: http://stackoverflow.com/comment/43784024
has answer: http://stackoverflow.com/a/27685098
has comment: http://stackoverflow.com/comment/43783974
accepted answer: http://stackoverflow.com/a/27685098
answer count: 4
has answer: http://stackoverflow.com/a/27685039
type: AnsweredQuestion
has body: is document.ready really necessary. This question has been asked countless time. This code snippet is with document.ready and works perfectly Enter this paragraph. However, if i were to replace the script tag contents with this. $("#p1").mouseenter(function(){ alert("You entered p1!"); }); It no longer works. However, if the argument was that the document is not ready upon mouse enter. I have waited for a few mins before trying and it still does not work. Is there something i am missing out
has comment: http://stackoverflow.com/comment/43783996
has answer: http://stackoverflow.com/a/27685361
type: Question
has comment: http://stackoverflow.com/comment/43784051
has comment: http://stackoverflow.com/comment/43783973
tagged with: javascript

http://stackoverflow.com/a/31621272
answers question: http://stackoverflow.com/q/27791953
has body: If you use JQuery, a common javasSript framework, you can make an ajax request as follows var requestData = function() { $.ajax({ url: "http://api.wolframalpha.com/v2/query?input=pi&amp;appid=XXXX", }).done(function(data) { //data should contain the response from wolframalpha });
score: 0
type: Answer

http://stackoverflow.com/a/27652634
type: Answer
accepted answer of: http://stackoverflow.com/q/27652609
has body: You need to call your scripts after jQuery: Or $( document ).ready(function() { $('#first-element').on('click', function(){ $('html, body').animate({ scrollTop: $('#third').offset().top }, 500); }); }); jQuery needs to be loaded before it can be used.
answers question: http://stackoverflow.com/q/27652609
upvote count: 4
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/43722216
type: AcceptedAnswer

http://stackoverflow.com/a/27668041
has comment: http://stackoverflow.com/comment/43761372
score: 3
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/27668029
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27668029
has body: This is because .load() is asynchronous, which means that when the .load() has fired the script you have continues to execute thus alerting 0. But when you click the load is most likely finished and then you'll get the correct length. To fix this, use the callback that you can provide to load() which will be executed when the call has finished. $('&lt;div&gt;&lt;/div&gt;').load('1.html', function(data) { alert($("li").length); });
downvote count: 0

http://stackoverflow.com/a/27661839
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27661774
answers question: http://stackoverflow.com/q/27661774
score: 4
has body: Rather than create $scope.persons in a MainController, it would probably be better to use a service to store the persons object: app.service("People", function () { this.persons = [ {name: 'Daisy', description: 'Developer'}, {name: 'Zelda', description: 'Developer'}, {name: 'Luide', description: 'Developer'}, {name: 'Mario', description: 'Developer'} ]; }); Then you can inject this into your controllers (your code above): .state('add', { url: '/add', templateUrl: 'edit.html', controller: function($scope, $state, People) { $scope.person = {name: "", description: ""}; $scope.click = function () { //use persons object of people service. People.persons.push($scope.person); $state.go('list'); }; } }); }); You can share these persons across different controllers, services, and directives through Dependency Injection. For instance, your list controller (MyCtrl) would look as follows: app.controller('MyCtrl', function ($scope, People) { $scope.persons = People.persons; });
type: AcceptedAnswer
type: Answer
upvote count: 4

http://stackoverflow.com/comment/43882294
type: QuestionComment
has text: I'm willing to be most of your use cases are possible in GTM. Your question won't get the answers you're looking for without specific use cases/code.
score: 0
comment on: http://stackoverflow.com/q/27717458
type: Comment

http://stackoverflow.com/comment/43912883
has text: Did it work? That is the way to get your isolate scope out. http://stackoverflow.com/questions/17371836/how-to-unit-test-isolated-scope-directive-in-angularjs
type: Comment
comment on: http://stackoverflow.com/a/27698647
score: 0
type: AnswerComment

http://stackoverflow.com/a/27658745
downvote count: 0
answers question: http://stackoverflow.com/q/27657936
type: Answer
score: 1
upvote count: 1
has body: For theme: wp_enqueue_script( 'custom-script', get_stylesheet_directory_uri() . '/js/custom_script.js', array( 'jquery' ) ); For plugin: wp_enqueue_script( 'newscript', plugins_url( '/js/newscript.js' , __FILE__ ), array( 'scriptaculous' ) );

http://stackoverflow.com/a/27753327
accepted answer of: http://stackoverflow.com/q/27753246
upvote count: 122
has body: string.match finds the first match and returns it with the actual match, the index at which the text was found and the actual input, when the global flag is not used. string.match just returns all the matches, when the global flag is used. var myString = "[22].[44].[33]."; console.log(myString.match(/\d+/)); // [ '22', index: 1, input: '[22].[44].[33].' ] console.log(myString.match(/\d+/g)); // [ '22', '44', '33' ] The main difference between string.match and regex.exec is, the regex object will be updated of the current match with regex.exec call. For example, var myString = "[22].[44].[33].", myRegexp = /\d+/g, result; while (result = myRegexp.exec(myString)) { console.log(result, myRegexp.lastIndex); } will return [ '22', index: 1, input: '[22].[44].[33].' ] 3 [ '44', index: 6, input: '[22].[44].[33].' ] 8 [ '33', index: 11, input: '[22].[44].[33].' ] 13 As you can see, the lastIndex property is updated whenever a match is found. So, keep two things in mind when you use exec, or you will run into an infinite loop. If you don't use g option, then you will always get the first match, if there is one, otherwise null. So, the following will run into an infinite loop. var myString = "[22].[44].[33].", myRegexp = /\d+/, result; while (result = myRegexp.exec(myString)) { console.log(result, myRegexp.lastIndex); } Don't forget to use the same regular expression object with subsequent calls. Because, the regex object is updated every time, and if you pass new object, again the program will run into an infinite loop. var myString = "[22].[44].[33].", result; while (result = /\d+/g.exec(myString)) { console.log(result); }
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27753246
score: 122
type: Answer

http://stackoverflow.com/comment/43785399
score: 0
type: QuestionComment
type: Comment
has text: What do you mean by «JSON does not have value»?
comment on: http://stackoverflow.com/q/27685744

http://stackoverflow.com/comment/43760233
type: QuestionComment
has text: @elclanrs, Does boolean(x) return a boolean from a string, like parseBoolean() would do, but different?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27672735

http://stackoverflow.com/comment/127722109
has text: @OhadR Amazon S3 is a flat storage system that does not actually use folders. See this reply for more infos: https://stackoverflow.com/a/51218935/9802294
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/65862128
score: 1

http://stackoverflow.com/a/27673338
downvote count: 0
has comment: http://stackoverflow.com/comment/43804484
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/43819275
has body: If you are on Angular 1.3, Angular filters have been optimized for performance. They are now stateless and do not execute (or re-evaluate) till the original data source changes. This was not the case with older version of Angular filters. Learn about these stateless filters here http://blog.thoughtram.io/angularjs/2014/11/19/exploring-angular-1.3-stateful-filters.html For older version it would be better if you can do filtering in the controller or service, and always bind the filtered results to the view. This is about keeping an array such as $scope.filteredItem=[];, and updating it whenever the filter condition changes. You can still use angular filters in code, using the $filter service.
has comment: http://stackoverflow.com/comment/43811138
answers question: http://stackoverflow.com/q/27672784

http://stackoverflow.com/comment/43756618
score: 0
type: Comment
type: QuestionComment
has text: How do you use statics in Angular / Typescript? I had a quick google and couldn't find anything. I want to save the value as a property of the service but if I do that how do I then display it on the html page. I only want my html to depend on the controller.
comment on: http://stackoverflow.com/q/27670824

http://stackoverflow.com/comment/47261064
comment on: http://stackoverflow.com/q/27748096
score: 0
type: Comment
type: QuestionComment
has text: Just curious to know, how easy it was to replace showModalDialog with JS pop-up code? How did you handle the synchronous nature of showModalDialog?

http://stackoverflow.com/comment/43836890
comment on: http://stackoverflow.com/q/27712178
score: 0
type: Comment
has text: @epascarello - It actually took a few seconds before I got it, but that's hilarous, and I have actually seen similar things, job offers etc. hidden in the source.
type: QuestionComment

http://stackoverflow.com/comment/43714737
has text: What I mean is you should not use `Promise.resolve().then` at all. This trick achieves nothing. Regarding nextTick vs setImmediate there is a lot of info
type: AnswerComment
comment on: http://stackoverflow.com/a/27648394
score: 0
type: Comment

http://stackoverflow.com/comment/43887097
type: QuestionComment
has text: Can I focus on previous tab @Leo
comment on: http://stackoverflow.com/q/27737756
score: 0
type: Comment

http://stackoverflow.com/a/27763533
score: 0
has comment: http://stackoverflow.com/comment/43937977
type: Answer
has comment: http://stackoverflow.com/comment/43938052
answers question: http://stackoverflow.com/q/27763428
has body: in login_validate.php if(isset($_POST["dangnhap"])){ but in login.js dangnhap is not set. in $.ajax({ data can be an object, you dont have to make it a string
has comment: http://stackoverflow.com/comment/43937991
has comment: http://stackoverflow.com/comment/43938072
has comment: http://stackoverflow.com/comment/43938342

http://stackoverflow.com/comment/43861555
type: AnswerComment
type: Comment
has text: This seems like the right answer. Let me give it a test and i'll be back
score: 0
comment on: http://stackoverflow.com/a/27724712

http://stackoverflow.com/a/27765048
downvote count: 1
has body: The value of n isn't being interpreted as its in a string. Your selector should look something like: $("#parent:nth-child(" + n + ")")
upvote count: 1
answers question: http://stackoverflow.com/q/27765023
score: 0
type: Answer

http://stackoverflow.com/q/27736759
linked to: http://stackoverflow.com/q/11311410
has comment: http://stackoverflow.com/comment/43885117
downvote count: 0
score: 1
favorite count: 0
type: UnansweredQuestion
has title: Trying to figure out how to handle event overlapping in a week view calendar?
answer count: 0
upvote count: 1
tagged with: calendar
type: Question
has body: I'm trying to figure out how to handle calendar event overlapping the way Google calendar does it. I have an array of events with start and end dates. Currently I sort the entire array to be in order from earliest to latest then find out how many times an event is overlapped and how many times it is overlapping another. I'm not sure where to go from here, I feel like I could use those values to calculate proper css width % and left %. Am I even on the right track?? I'm doing this as a school project. Thank you in advance! EDIT: I took a look at the similar question that Markus Jarderot has answered before and found the answer I was looking for. Thank you so much! function getOverlappingEvents(eventArray) { var result = []; eventArray.sort(function(a, b) { return a.eventStart - b.eventStart; }); for (var i = 0; i &lt; eventArray.length; i++) { var overapped = 0; var overlaps = 0; var isdate = new Date(eventArray[i].eventStart); var iedate = new Date(eventArray[i].eventEnd); for (var x = 0; x &lt; eventArray.length; x++) { var xsdate = new Date(eventArray[x].eventStart); var xedate = new Date(eventArray[x].eventEnd); if(isdate &lt;= xsdate &amp;&amp; iedate &gt; xsdate){ overapped++; }else if(isdate &gt;= xsdate &amp;&amp; isdate &lt; xedate){ overlaps++; } } result.push([eventArray[i].calEventID, overapped, overlaps]); } return result; } function toDom(events, ids){ var domEvents = []; for (var i = 0; i &lt; events.length; i++) { var id = events[i].calEventID; var width = 0; var left = 0; var sDate = new Date(events[i].eventStart); var eDate = new Date(events[i].eventEnd); var time = sDate.format("htt") + " - " + eDate.format("htt"); var duration = (eDate.getHours() * 60 + eDate.getMinutes()) - (sDate.getHours() * 60 + sDate.getMinutes()); var height = Math.round((duration * 0.75)); var topOffSet = (sDate.getHours() - 6) * 45 + Math.round(sDate.getMinutes() * 0.75); var status = events[i].calStatus; var desc = events[i].description; var json = {id: id, sDate: sDate, …
tagged with: javascript

http://stackoverflow.com/comment/122279374
has text: what version of jquery is this?
score: 8
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27787793

http://stackoverflow.com/a/27705060
has comment: http://stackoverflow.com/comment/43822138
score: 4
has comment: http://stackoverflow.com/comment/43822636
has body: Because you are not getting the right value and you are not getting the right element. Here is a hacky solution. var oVDiv=document.getElementById("oDiv1").children[0].value; A better pattern would be to create a real form, and serialize the form values on submit. JSfiddle example
has comment: http://stackoverflow.com/comment/43822186
upvote count: 4
answers question: http://stackoverflow.com/q/27704965
has comment: http://stackoverflow.com/comment/43822316
downvote count: 0
has comment: http://stackoverflow.com/comment/43822363
type: Answer
has comment: http://stackoverflow.com/comment/43822548

http://stackoverflow.com/q/27641978
has comment: http://stackoverflow.com/comment/43702818
has answer: http://stackoverflow.com/a/27642246
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43703290
has body: I am developing a social media website of the scale of LinkedIn, and I am struggling with few things related to JS. As project is going on, the requirement of JavaScript/jQuery is increasing. I am guessing by the end of the project, jQuery required on each page will be of average file size 1.5MB which is a bad idea. Functions like image upload, comments, like, updates is almost on every page. My Question here is How to optimize jQuery? Any tricks or concept that I can use on this project which will lower file size as well as do these functions (there are much more than just above ones)? Here I have already implemented: 1. Compress/Minify jQuery by PHP plugin 2. Use jQuery.getScript() to load file only when it required 3. Divide one large JS file into few separate files to finish loading faster 4. HTML optimization (Google Pagespeed)
has answer: http://stackoverflow.com/a/27642036
has title: Javascript/jQuery optimization for large projects (social media)
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43702941
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43703009
has comment: http://stackoverflow.com/comment/43703127
has comment: http://stackoverflow.com/comment/43703001
has comment: http://stackoverflow.com/comment/43703082
tagged with: jquery
has comment: http://stackoverflow.com/comment/43702902

http://stackoverflow.com/comment/43855354
type: QuestionComment
comment on: http://stackoverflow.com/q/27721735
type: Comment
score: 0
has text: Look, it's been **compressed**. You know, a bit like a zip file? When the code is *uncompressed*, then it becomes JavaScript that the browser understands.

http://stackoverflow.com/comment/44549234
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27741720
type: Comment
has text: was checking for exact pixels....got the solution through resemble.js

http://stackoverflow.com/a/27802510
answers question: http://stackoverflow.com/q/27802453
has comment: http://stackoverflow.com/comment/44013926
score: 0
type: Answer
has body: would it be possible to us &lt;th&gt; tags to wrap your labels? Then you could use $('table').find('td').eq(0).children().eq(0).focus() Although its a bit long winded, but would work if the child was a input, select or anything else (textarea etc)

http://stackoverflow.com/comment/43915869
type: Comment
score: 0
has text: You can remove the outputs that I put in. They are only there to demonstrate when the timezone effect gets added and show that it is being removed by using UTC time.
type: AnswerComment
comment on: http://stackoverflow.com/a/27752363

http://stackoverflow.com/q/27689863
tagged with: wow.js
downvote count: 0
answer count: 1
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/27702291
type: UnansweredQuestion
has title: Wow.js offset equal to element height
has body: According to the wow.js documentation I can set the bottom offset at which the animation will trigger: wow = new WOW( { boxClass: 'wow', // default animateClass: 'animated', // default offset: 0, // &lt; --------------- This one mobile: true, // default live: true // default } ) wow.init(); I have a .foo container &lt;div class="foo wow fadeIn"&gt;&lt;/div&gt; I want to animate when its bottom hits the bottom of the viewport i.e. it is fully on my screen. So I guess the offset should be equal to the .foo element height. Is there any way to specify this in the wow.js settings above?
type: Question
tagged with: jquery-animate
tagged with: javascript
score: 2

http://stackoverflow.com/comment/43846381
comment on: http://stackoverflow.com/q/27716986
has text: @epascarello Thanks for the link.But I can't understand that what is to be put in **httpRequest.onreadystatechange = function(){}** ,as in my application ,there is button on which when I click table will be updated.But I want it to update automatically.How to fix that?How to use setTimeout for that??
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43973896
score: 0
type: Comment
has text: Thanks! Great answer! Quick question: why is there a "v" as the first argument in the addListener? I would have thought that should be "polygon".
comment on: http://stackoverflow.com/a/27751661
type: AnswerComment

http://stackoverflow.com/comment/43906458
has text: It does not remove item with zero index.
type: Comment
comment on: http://stackoverflow.com/a/27747381
score: 0
type: AnswerComment

http://stackoverflow.com/q/27694127
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43801565
answer count: 1
tagged with: angularjs
has answer: http://stackoverflow.com/a/27694228
has body: Imagine a prison with prisoners in separate cells, and I want to be able to be able to access a specific cell by calling the API '/getparameters' that will return the cell number, and then pass that variable in as the id for my factory. This is what I have come up with. No error are returned, but no data is being returned either. Where am I going wrong? var app = angular.module('myApp', ['ngResource']); //app.factory('Params', function) app.factory ('CellID', function($resource){ return $resource('/my/api/cell/:id'); }); app.controller('CellCtrl', function($scope, $http, CellID){ //use $http to getparameters, specifically, the cell number $http.get('/getparameters') .success( function(data) { var cellnumber = data.cellnum; CellID.get({id:cellnumber}), function(data){ $scope.info = data; } } ) });
accepted answer: http://stackoverflow.com/a/27694228
tagged with: factory
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43801650
has title: Controller not returning data from factory
type: Question

http://stackoverflow.com/comment/44019677
score: 0
has text: Simply appending a json object after a getScript function looks strange and results in "Invalid token" js error. I think what the original code is doing may be something described here: http://stackoverflow.com/questions/11494659/how-can-i-read-json-content-inside-a-script-tag . Anyway, I realized that for new sheets the embed code is an iframe (which I have no problem inserting into HTML). The sheet that I tried to publish was from 2012. I transfered the sheet to new and the problem is gone.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27800088

http://stackoverflow.com/q/27671139
has comment: http://stackoverflow.com/comment/43757131
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43757033
has comment: http://stackoverflow.com/comment/43757022
has comment: http://stackoverflow.com/comment/43757076
score: 0
upvote count: 1
has title: Using jQuery to fetch information from iframe from different domain
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43757175
has comment: http://stackoverflow.com/comment/43757112
favorite count: 0
has body: I'm doing a site that fetches the stock property from a site and show it on my site. But i'm having issue in displaying the it. Here's the code : I'm getting the following errors : AD BLOCK NOT DETECTED pop.js:1 rt():in true false tabunder 2 pop.js:1 rt():adv.bind http://serve.popads.net/servePopunder.php?cid=242978 pop.js:1 Uncaught SecurityError: Blocked a frame with origin "http://stockpart.net" from accessing a frame with origin "http://www.example.com". Protocols, domains, and ports must match. Anyway is there anyway i can fetch information with the other site class/id using jQuery within an iframe?
has comment: http://stackoverflow.com/comment/43757154
linked to: http://stackoverflow.com/q/364952
has answer: http://stackoverflow.com/a/27671479
accepted answer: http://stackoverflow.com/a/27671479
type: AnsweredQuestion
tagged with: iframe
type: Question

http://stackoverflow.com/comment/43772967
type: Comment
type: QuestionComment
has text: Even better: make a minimal example. Take out parts of your code until the problem doesn’t appear anymore, then post what you had just before that. (You might even solve the problem in the process!)
comment on: http://stackoverflow.com/q/27679134
score: 2

http://stackoverflow.com/comment/43863362
comment on: http://stackoverflow.com/a/27725579
type: AnswerComment
score: 0
type: Comment
has text: This is not a flexible solution since you are specifically stating to look at the 2nd li - if he adds another li above it - this breaks - that's bad.

http://stackoverflow.com/q/27785892
linked to: http://stackoverflow.com/q/2830296
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43981811
has answer: http://stackoverflow.com/a/27786043
has comment: http://stackoverflow.com/comment/43981876
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/43981908
accepted answer: http://stackoverflow.com/a/27786043
has body: Here's the basic setup: We're adding some HTML inside textareas using JavaScript/jQuery. Test 1 does not have a Baseline The above works as expected: all text areas show the HTML code. But if we use jQuery's .html function to add the content, then Test 2 does not display correctly. It appears to add the content as actual elements, rather than text. $(document).ready(function(){ $('#test1').html(test1HTML); $('#test2').html(test2HTML); // Causes some kind of problem }); If we replace .html with .text, then both tests again work as expected. What's going on with Test 2 using .html? Why does adding a tag change the way .html adds the content? Why do all other methods work correctly? (FWIW - browser is Chrome 39.0.2171.95 m)
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27785950
has title: jQuery's .html function doesn't write content to textarea correctly if there is a style tag
tagged with: javascript
has answer: http://stackoverflow.com/a/27785950
tagged with: jquery
has comment: http://stackoverflow.com/comment/43981795

http://stackoverflow.com/a/34574572
answers question: http://stackoverflow.com/q/27795104
type: Answer
has body: To add to previous solutions: also make sure to include jquery in your html because it's required by bootstrap's js.
score: 0

http://stackoverflow.com/a/27826928
accepted answer of: http://stackoverflow.com/q/27723406
answers question: http://stackoverflow.com/q/27723406
score: 0
type: AcceptedAnswer
has body: It needs to be done server side for the browser not to throw an insecure connection warning. The file with the responsible code is /library/core/functions.render.php, which you can see here. $PhotoURL is the variable that needs to be changed. Using the following makes sure all images are loaded over the https: protocol: str_replace('http://', 'https://', $PhotoURL). I usually don't mind global scope on smaller software but in something as big as Vanilla it's like finding a needle in a haystack. I couldn't find any other fixes for Vanilla in particular so I hope this helps people.
type: Answer

http://stackoverflow.com/comment/43784359
comment on: http://stackoverflow.com/q/27685112
score: 0
has text: can you show me exaple?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29517095
score: 0
answers question: http://stackoverflow.com/q/27799880
type: Answer
has body: possibly it will suit better grid.onSelectedRowsChanged.subscribe(function(e, args){ $scope.$emit('selectedRowsChanged', *someData*); }); $scope.$on('selectedRowsChanged', function(*someData*){ _do your stuff here_ })

http://stackoverflow.com/a/27828748
score: 0
answers question: http://stackoverflow.com/q/27763655
type: Answer
has body: I solved it by creating an actual linkedin account, put that auth info in the .env and just called fill_in method to fill out email and password field during its callback. And stuck with running a js driver throughout the entire context block. EDIT: This is of course not the best answer so I am still accepting other answers.

http://stackoverflow.com/comment/43936043
score: 0
type: Comment
has text: To do this on click of a different button, create a new function `show_content_bananas1` and move the code inside `if` part on to the function. Also, if need be, make sure you hide any other divs (bananas) that are already visible (like using `s.style.height = "0px"`).
type: AnswerComment
comment on: http://stackoverflow.com/a/27762291

http://stackoverflow.com/q/27704917
has comment: http://stackoverflow.com/comment/43821801
tagged with: debian
favorite count: 0
has answer: http://stackoverflow.com/a/27705022
has title: Apply css only for linux chrome but not for windows chrome
tagged with: css
accepted answer: http://stackoverflow.com/a/27705022
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43821866
upvote count: 3
downvote count: 1
possible better answer: http://stackoverflow.com/a/27705026
type: Question
has answer: http://stackoverflow.com/a/27705026
has body: Is the any way to apply css only for the linux chrome. Currently i am using the following code @media screen and (-webkit-min-device-pixel-ratio:0) { //css code } but the problem here is it is applying for both linux and windows chrome. Thanks
has comment: http://stackoverflow.com/comment/43821846
tagged with: javascript
tagged with: linux
answer count: 2
score: 2
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/27718710
answers question: http://stackoverflow.com/q/27718688
has body: You need to pass correct parameters. As you have defined un and pass as parameter to web service method, you need to use them. Use var str = "{'un':'" + username + "', 'pass': '" + password + "'}"; Also you can use JSON.stringify() var str = JSON.stringify({ un: username, pass: password });
has comment: http://stackoverflow.com/comment/43849376
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43849426
type: Answer
upvote count: 1

http://stackoverflow.com/comment/44002904
has text: Add the a sample code(html, js and the information), otherwise no one will help you...
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27796710

http://stackoverflow.com/q/27796045
type: Question
accepted answer: http://stackoverflow.com/a/27796523
has body: I have a three.js page that renders a set of particles (runnable demo and code at: https://dl.dropboxusercontent.com/u/31495717/cubemaker/index.html). Here is a snapshot of the default view, where we are basically looking into a unit cube centered at (0, 0, 0): I have transparent bounding boxes centered at each particle inside this unit cube. If I modify the opacity, we can then see the boxes surrounding each particle: var bounding_box = new THREE.Mesh( bounding_box_geometry, new THREE.MeshLambertMaterial({ opacity: 0.5, transparent: true, alphaTest: 0.5 }) ); I use the THREE.Raycaster() to trace a vector from the camera to the world coordinate of the current mouse position: var mouse_vector = new THREE.Vector3(mouse.x, mouse.y, 1).unproject(camera); raycaster.set(camera.position, mouse_vector.sub(camera.position).normalize()); var bounding_box_intersections = raycaster.intersectObjects(bounding_boxes); If there are any bounding_box_intersections, I retrieve the screen coordinates of the intersected bounding box and store it in screen_object_center: var width = window.innerWidth, height = window.innerHeight; var widthHalf = width / 2, heightHalf = height / 2; var screen_object_center = new THREE.Vector3(); var projector = new THREE.Projector(); projector.projectVector(screen_object_center.setFromMatrixPosition(INTERSECTED.matrixWorld), camera); screen_object_center.x = (screen_object_center.x * widthHalf) + widthHalf; screen_object_center.y = -(screen_object_center.y * heightHalf) + heightHalf; Once I have screen_object_center — the screen coordinates of the center of the intersected object or bounding box — I can place an offset-ed text label wherever the mouse hovers. As an example, here is a snapshot of how the text label shows up with mouse pointer hovered over the centermost particle's bounding box: I use the id_label bounding box to adjust the vertical offset of the label: id_label.style.top = (screen_object_center.y - 0.85 * (id_label_rect.height / 2)) + 'px'…
score: 3
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27796523
tagged with: three.js
tagged with: http://stackoverflow.com/tag/html
has title: Calculating screen coordinates of horizontal edge of bounding box in three.js
type: AnsweredQuestion
upvote count: 3

http://stackoverflow.com/comment/43813874
comment on: http://stackoverflow.com/a/27700073
score: 0
type: Comment
has text: what are you loggin to console and which line is giving error
type: AnswerComment

http://stackoverflow.com/comment/43733624
comment on: http://stackoverflow.com/q/27653757
has text: The resulting values for r, g, and b are not correct. When I plug the same hsl values into the color picker in Photoshop, the resulting rgb values are much different than what this function is returning.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43897548
type: QuestionComment
type: Comment
has text: Are you sure your working code is actually working? Because it seems that `userArray.length` is `> 0` **always**.
comment on: http://stackoverflow.com/q/27742495
score: 0

http://stackoverflow.com/q/27654895
has answer: http://stackoverflow.com/a/27655312
tagged with: knockout.js
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27657856
score: 0
answer count: 2
tagged with: knockout-2.0
tagged with: jquery
has title: How to get a total value by computing the property of different objects in knockout?
accepted answer: http://stackoverflow.com/a/27655312
has answer: http://stackoverflow.com/a/27657856
type: AnsweredQuestion
has body: I am trying to get the total amount of the meals ordered by all the passengers. I am new to knockout.js and I do't know how this viewModel is working. can you please clear me where is the class and how to reference the properties of that class. Your seat reservations Passenger name Meal Surcharge Reserve another seat Calculate total

http://stackoverflow.com/q/27782749
tagged with: safari
type: AnsweredQuestion
score: 2
has title: href links not working with onclick events in Safari
tagged with: onclick
accepted answer: http://stackoverflow.com/a/27785226
has comment: http://stackoverflow.com/comment/43976413
type: Question
has comment: http://stackoverflow.com/comment/43975644
has comment: http://stackoverflow.com/comment/43975772
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/7347786
has comment: http://stackoverflow.com/comment/43976359
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/27785226
has body: CLICK ME In Chrome, FF and IE, clicking the link will open Google in the current window and open somepage.html in a new tab/window But in Safari it will just open Google in the current window and nothing else. How can I make Safari replicate the other browsers?
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/43975714

http://stackoverflow.com/q/27649281
linked to: http://stackoverflow.com/q/12106952
accepted answer: http://stackoverflow.com/a/27652069
type: Question
has answer: http://stackoverflow.com/a/53078237
possible better answer: http://stackoverflow.com/a/27656974
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: extjs
tagged with: extjs4
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
has body: I need to create some custom buttons - like a red button with white text, green button with white text, etc. I followed the accepted answer of the same question "How to change background of hovered and pressed extjs-button dynamically" but did not work for me. It just changes the ui without any interactions. When I click the customized button, it toggles despite the handler function is executed. ExtJS button has 2 configuration for styling according to documentation: overCls and pressedCls. Despite I set them both pressedCls configuration did not work for me. Which css properties should I override/define in order to create my own buttons? Sencha Fiddle Link: https://fiddle.sencha.com/#fiddle/fim
has answer: http://stackoverflow.com/a/58188552
upvote count: 3
has answer: http://stackoverflow.com/a/27656974
has title: ExtJS - How to customize buttons?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27652069
score: 3

http://stackoverflow.com/q/27671614
has comment: http://stackoverflow.com/comment/43758346
has title: how to call javascript function from gridview button click event codebehind
type: Question
tagged with: c#
tagged with: javascript
has body: Actually I am trying to scroll the page after post back happened by delete button. I tried to call JavaScript function from button click event and the button is in gridview. But javascript function is not calling. And I want to call the JavaScript function from code-behind only not through OnClientClick event. Please help me protected void btnDelete_Click(object sender, EventArgs e) { string pos = hdnfield.Value; GridViewRow currentRow = (GridViewRow)((Button)sender).Parent.Parent; Button btnDelete= (Button)currentRow.FindControl("btnDelete"); long ImageId = Convert.ToInt64(gridImages.DataKeys[currentRow.RowIndex]["IMAGE_ID"].ToString()); bool bRetValue = DeleteImage(ImageId); ScriptManager.RegisterStartupScript(this, this.GetType(), "alertmessage", "javascript:scrollTo('" + pos + "')", true); } function scrollTo(val) { $('html').scrollTop(val); } &lt;asp:GridView ID="gridImages" runat="server" AutoGenerateColumns="False" Height="234px" Width="368px" ShowHeader="false" BorderStyle="None" style="border-collapse:separate; border-spacing:20px;" GridLines="None" DataKeyNames ="IMAGE_ID"&gt; &lt;Columns&gt; &lt;asp:TemplateField HeaderText="Image"&gt; &lt;ItemTemplate&gt; &lt;asp:Image ID="Image1" runat="server" ImageUrl='&lt;%#"ShowImages.ashx?ImgID="+ Eval("IMAGE_ID") %&gt;' Height="78px" Width="118px" style="border:3px solid #CCCCFF"/&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField HeaderText="Delete"&gt; &lt;ItemTemplate&gt; &lt;asp:Button ID="btnDelete" runat="server" Text="Delete" OnClick="btnDelete_Click"/&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt;
has answer: http://stackoverflow.com/a/27673538
tagged with: aspxgridview
score: 0
answer count: 1
tagged with: asp.net
tagged with: gridview
type: UnansweredQuestion

http://stackoverflow.com/a/27738416
has body: your comparative operators are incorrect, it should be temp == "Option 1" not temp = "Option 1" FIDDLE Also you should remove .change(); at the end of your function if you don't want your code executing on page load.
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27738372

http://stackoverflow.com/q/27771692
tagged with: css
answer count: 0
upvote count: 2
score: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43954697
has title: Duration of animation decreases as window is shrunk
tagged with: responsive-design
tagged with: javascript
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has body: Why is it that even though I have this animation's duration set to 2 seconds, shrinking the window results in there being a greater delay at first, and a faster animation? See Bootply. JS: function animateit() { $('.wrapper .water').animate({ 'height': '350px', 'top': 0 }, 2000, function () { $('.wrapper .water').animate({ 'height': 0, 'top': '350px' }, 2000, animateit); }); } animateit(); CSS: .wrapper { position: relative; height:auto; width: 100%; max-width: 350px; overflow:hidden; } .img-responsive { display: block; width: 100% \9; max-width: 100%; height: auto; } .glass { position:absolute; left:0px; top:0px; z-index:5; } .hide-image { display: block; opacity: 0; width: 100%; } .water { position:absolute; left:0px; right: 0; top:350px; background-color:#67d9ff; height:0px; display:block; } HTML: &lt;div class="wrapper"&gt; &lt;img class="hide-image" src="http://www.videsignz.com/testing/images/water-front2.png"&gt; &lt;img class="glass img-responsive" src="http://www.videsignz.com/testing/images/water-front2.png"&gt; &lt;div class="water"&gt;&lt;/div&gt; &lt;/div&gt; I noticed that for the second part of the animation's JS, changing 'top': '350px' to 'top': '100%' caused the it's duration to be relatively consistent regardless of window size, but applying that code to the filling of the glass doesn't yield the same result - and it also alters the animation in normal view nonetheless.
tagged with: animation

http://stackoverflow.com/comment/77789418
has text: Excellent solution! There is no description needed, all you have to do is set a class for your charts eg: "ga-charts".
comment on: http://stackoverflow.com/a/31223490
type: AnswerComment
score: 3
type: Comment

http://stackoverflow.com/comment/43992305
type: Comment
has text: Nope there isn't. I believe I have solved the problem, just testing it atm. The way I think I have fixed it is I have set the `map` variable back to an empty variable in my `stop` click event.
score: 0
comment on: http://stackoverflow.com/q/27790935
type: QuestionComment

http://stackoverflow.com/q/27693895
possible better answer: http://stackoverflow.com/a/27694028
upvote count: 1
accepted answer: http://stackoverflow.com/a/27693934
linked to: http://stackoverflow.com/q/1844688
favorite count: 0
has comment: http://stackoverflow.com/comment/43800978
has comment: http://stackoverflow.com/comment/43801231
has body: I am new to JavaScript hence all mess up with me this time.my doubt is I want to create a JavaScript function which can get the names of all the files in a folder. Please share your knowledge to get me the basic understanding for this.
has comment: http://stackoverflow.com/comment/43800983
score: -3
has answer: http://stackoverflow.com/a/27693934
has comment: http://stackoverflow.com/comment/43801316
downvote count: 4
has comment: http://stackoverflow.com/comment/43801233
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27694028
has title: How to read the name of the files in a folder using javascript
has comment: http://stackoverflow.com/comment/43801220
type: Question
has comment: http://stackoverflow.com/comment/43801235
has comment: http://stackoverflow.com/comment/43801125
answer count: 2
linked to: http://stackoverflow.com/q/371875
has comment: http://stackoverflow.com/comment/43801297
tagged with: javascript

http://stackoverflow.com/a/27750702
accepted answer of: http://stackoverflow.com/q/27750642
answers question: http://stackoverflow.com/q/27750642
upvote count: 2
has body: The jQuery get request is an asynchronous request. The callback function will not be called until after the render call. This means that the object will get added to the scene, but never drawn. You will need to call the render function inside the get handler. $.get("{% /graph %}",function(data,status){ scene.add(sphere2); renderer.render(scene, camera); }); Alternately, if you create a rendering loop for things like animation, this is unnecessary.
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43912561
type: Answer

http://stackoverflow.com/comment/43897869
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27743465
has text: do you ever write $rate back to $myData after the increment? also storeing information in cookies is very untypically and unsafe as it can be manipulated on the client side easily

jstl
tags question: http://stackoverflow.com/q/27793037
type: Tag
tags question: http://stackoverflow.com/q/27678442
tag name: jstl
tags question: http://stackoverflow.com/q/27755195

http://stackoverflow.com/comment/43815813
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27700778
type: Comment
has text: @Teemu You could also use the `.replace()` function to automate this.

http://stackoverflow.com/a/38140952
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27706595
has body: The script looks like it may have been signed by Microsofts SignTool, or something similar. I can think of two uses for this. One, as mentioned above, is to use it with the windows scripting host or some other non-browser engine that checks the signature before signing. The second is to verify the authenticity of the javascript files by checking the signatures at install time and/or periodically on the server side. This will enable administrators to verify that the scripts are not tampered with and that they, even after updates, come from a trusted supplier. I guess this could come in handy for intrusion detection systems as well.
upvote count: 1
type: Answer

http://stackoverflow.com/q/27769992
tagged with: knockout.js
tagged with: javascript
answer count: 4
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27770842
favorite count: 0
has comment: http://stackoverflow.com/comment/43950967
type: Question
has answer: http://stackoverflow.com/a/27770594
possible better answer: http://stackoverflow.com/a/27770200
has answer: http://stackoverflow.com/a/27770235
has body: I'm new to knockout.js so... I've got an object: function My_editor() { this.brushSize = 10; this.activeColor = '#ff0000'; }; var editor = new My_editor(); It is some sort or drawing tool. Here's the Knockout View-Model: function AppViewModel(ed) { this.brushSize = ko.observable(ed.brushSize); this.activeColor = ko.observable(ed.activeColor); } ko.applyBindings(new AppViewModel(editor)); I've written some html interface and it works OK. The problem is that if I change the brushSize value via Knockout it doesn't change the corresponding attribute of the editor object. I'm using Google Chrome developer tools to inspect my object's state. Piece of html: Brush Size: Active Color: Also, if I change brushSize in console, it doesn't update in the interface & knockout. I'm using: editor.brushSize = 15;
has comment: http://stackoverflow.com/comment/43950847
has answer: http://stackoverflow.com/a/27770200
has comment: http://stackoverflow.com/comment/43950993
has title: How to update object attributes values in knockout.js
has comment: http://stackoverflow.com/comment/43950882
accepted answer: http://stackoverflow.com/a/27770842
upvote count: 1

http://stackoverflow.com/a/27695640
accepted answer of: http://stackoverflow.com/q/27695246
has body: function calculate(){ var table=document.getElementById('shopTable'); var count = table.getElementsByTagName('tr').length; if (count &gt; 0) { var total = 0; for(var i = 1; i &lt; count; i++) { total += table.rows[i].cells[1].innerHTML * table.rows[i].cells[2].children[0].value; } } alert(total); }
answers question: http://stackoverflow.com/q/27695246
has comment: http://stackoverflow.com/comment/43806569
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/27691812
downvote count: 0
type: UnansweredQuestion
score: 1
type: Question
has title: Parent router activate function runs every time its child route is navigated to?
tagged with: javascript
answer count: 2
upvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27992607
tagged with: durandal
has answer: http://stackoverflow.com/a/27704796
has body: This could perhaps be a question of code structure rather than a question about the framework. Basically I am wondering if the activate function on the parent router should be called every time one of its child routes are navigated to? My goal: Have a module which returns a child router, this is the parent router. This parent router is in charge of creating an object if the user is adding something new, or retrieving data from the server if the user selects something which already exist. The child routes modules simply get the object created or retrieved via the parent router module, and provide form inputs to manipulate that object (via ko data-binding). The issue I am having is the parent router's activate function is getting called each time the child routes are navigated to, which is where the creation/retrieval logic is and causes the object to be retrieved once again, causing any data manipulation to be overwritten. Below is some code to hopefully better illustrate: // ParentRouter define([...], function(...) { var selectedObj = ko.observable(null), configRouter = router.createChildRouter() .makeRelative({ moduleId: 'viewmodels', fromParent: true, dynamicHash: ':id' }).map([ { route: ['Settings 1', ''], moduleId: 'SettingsOne', nav: true }, { route: 'Settings 2', moduleId: 'SettingsTwo', nav: true }, { route: 'Settings 3', moduleId: 'SettingsThree', nav: true } ]).buildNavigationModel(); function getSelectedObj() { return selectedObj; } return { router: configRouter, obj: selectedObj, // privileged property which is accessed by other modules via the getSelectedObj method, this prop gets set in the activate function depending on the param getSelectedObj: getSelectedObj, // method which returns the current selected obj activate: function (objId) { if (objId == 'New') { // create a new object with default props } else { // retrieve the data for the selected obj from API via the 'objId' param } } } }); // SettingsOne module - child route module define(['viewmodels…

http://stackoverflow.com/a/27755589
downvote count: 1
score: -1
has comment: http://stackoverflow.com/comment/43958152
upvote count: 0
has comment: http://stackoverflow.com/comment/43922994
type: Answer
has body: Try defining the variable g as global:- var g; Parse.initialize("HIL42pG8FRAx9AXasyyJAg5nXI6x2IifWh30AX5I","KUKOb5pz4GEbcbGAa8GVQrBQL7ER7DsV6m0PZLOL"); var queryGroups = new Parse.Query("Group"); var arr = []; queryGroups.find({ success: function(objects) { for (var i = 0; i &lt; objects.length; i++) { g = new Object(); g["whatsAppGroupName"] = objects[i].get("whatsAppGroupName"); g["whatsAppGroupDescription"] = objects[i].get("whatsAppGroupDescription"); g["entryCriteria"] = objects[i].get("entryCriteria"); g["parent"] = objects[i].get("parent"); arr.push(g); } for (var i = 0; i &lt; arr.length; i++) { console.log("whatsAppGroupName = " + arr[i].whatsAppGroupName); } }, error: function(error) { console.log("An error occured :("); } }); Check the value of g after completing the find call.
answers question: http://stackoverflow.com/q/27752769
has comment: http://stackoverflow.com/comment/43960759

http://stackoverflow.com/a/27794149
type: AcceptedAnswer
type: Answer
score: 1
answers question: http://stackoverflow.com/q/27794074
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27794074
has body: In your code, the scan method is actually inside the cashRegister object.
downvote count: 0

http://stackoverflow.com/comment/43736810
type: Comment
comment on: http://stackoverflow.com/a/27654837
score: 1
has text: Shouldn't that be `songView.render().el`? You want to add the view's `el` to the page, not the view object itself.
type: AnswerComment

http://stackoverflow.com/comment/43751729
type: AnswerComment
has text: this is the code that worked for me ' $(function(){ $('.exp_header').click(function(){ $(this).closest('.exp_container').toggleClass('exp_collapsed'); }); });'
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27647705

http://stackoverflow.com/a/27675503
has body: Without any further information, the most likely problem from what I can tell is that your form contains an &lt;input&gt; or a &lt;button&gt; with either an id or name attribute set to "submit". This will cause theForm.submit to return that element instead of the submit function as you would expect it to. My suggestion is a little hacky, but should hopefully fix the problem. Instead of theForm.submit(); try document.createElement('form').submit.call(theForm); If this works, then what I assumed to be the problem was it. EDIT: As suggested, a more permanent solution is to change the id or name to something else in order to prevent accidental interference.
accepted answer of: http://stackoverflow.com/q/27675385
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43765707
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27675385

http://stackoverflow.com/a/27698185
type: Answer
answers question: http://stackoverflow.com/q/27698122
upvote count: 1
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43809583
has body: $(".menu").toggle(function() { $("#topbar").animate({ height: 165 }, 200); }, function() { $("#topbar").animate({ height: 60 }, 200); });

http://stackoverflow.com/q/27803425
favorite count: 0
linked to: http://stackoverflow.com/q/750486
type: AnsweredQuestion
has title: Why is count correctly incremented
possible better answer: http://stackoverflow.com/a/27803551
type: Question
accepted answer: http://stackoverflow.com/a/27803464
tagged with: javascript
score: 4
upvote count: 4
has answer: http://stackoverflow.com/a/27803464
answer count: 2
downvote count: 0
has body: Consider this simple example: var count = 0; for (var i = 0; i &lt; 4; i++ ) { setTimeout(function() { console.log(i, count++); }, i * 200); } which outputs the following 4 0 4 1 4 2 4 3 I would guess that i always resolves to 4 because the setTimeout callback closes over the variable I but I can't figure out why the same doesn't hold true for count? var count = 0; for (var i = 0; i &lt; 4; i++ ) { setTimeout(function() { console.log(i, count++); }, i * 2000 ); }
has answer: http://stackoverflow.com/a/27803551

http://stackoverflow.com/comment/44001760
type: QuestionComment
comment on: http://stackoverflow.com/q/27796487
has text: The validation code that you added at last should be added as a separate function outside ajax call and you can call it inside success of ajax
score: 0
type: Comment

http://stackoverflow.com/q/27693146
tagged with: dialog
score: 1
tagged with: forms
upvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has body: I downloaded a jquery plug in for select boxes here: http://harvesthq.github.io/chosen/ Everything works fine on my page except, on one of my pages, the select boxes are placed in a jquery dialog window, which opens upon button click. The problem Im having is, that upon clicking the button, the dialog opens correctly, but it immediately places focus on the first select field, which I dont want. If I place it on the page it works fine, doesnt open upon loading. I found a similar issue and a possible solution here: http://jsfiddle.net/6Xa78/3/ $( "#dialog" ).dialog({ autoOpen: false, show: { effect: "puff",duration: 500 }, hide: { effect: "puff", duration: 500 }, height: 1000, width: 1000, position:['middle',30], open: function(){ $('.my_select_box', this).chosen(); } }); $( "#opener" ).click(function() { $( "#dialog" ).dialog( "open" ); }); but even though I use the exact same code, it still does it. I also tried to delete the first select box and it then automatically opened the second one - in other words, it always opens the first select box. I also tried replacing the class by id, but that had no effect, no effect also had trying the focusout command or blur command. It always opens upon opening the dialog... My page is here: http://meteopage.com/climate/climate_map.php Try clicking on the button "Filtr", which opens the dialog and you will see the first select box immediately pops up.
downvote count: 0
answer count: 1
favorite count: 0
has title: Automatic opening of select box
accepted answer: http://stackoverflow.com/a/27693205
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27693205
linked to: http://stackoverflow.com/q/1202079

http://stackoverflow.com/comment/44024636
has text: and since you're in Angular, you could use `$timeout` instead of `setTimeout`, not that it makes much difference but it's more Angular ;)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27800004

http://stackoverflow.com/q/27763205
favorite count: 0
has body: I have the following code: var showonlyswitch = document.querySelectorAll('#showonlyswitch &gt; optgroup &gt; option'); for (var y = 0; y&lt;showonlyswitch.length; y++) { showonlyswitch[y].addEventListener('click', showonlyproducts); } working in firefox, but not in chrome and not in iOS safari. As far as I know (and "caniuse" tells me), querySelectorAll and addEventListener should both be supported by both browsers. (iOS safari v.8.1 and chrome v.39.0.2171.95 (64-bit)) The function I am calling with this is quite simple: function showonlyproducts() { var searchvalue = document.getElementById('showonlyswitch').value; if (searchvalue == 1) { window.location.href = 'pricing?close=1'; } } First I thought window.location.href would cause some problems, but I tried to console.log some gibberish and it worked in firefox but not in chrome. I also tried to change var showonlyswitch = document.querySelectorAll('#showonlyswitch &gt; optgroup &gt; option'); to var showonlyswitch = document.querySelectorAll('#showonlyswitch &gt; option'); but that (obviously) doesn't work in any browser. The select is separated in some optgroups and the function should trigger on click on an option, as the change event isn't sufficient for the situation because it is possible that a solution is chosen without the change event being triggered (no change). As I said, the code is working perfectly fine in firefox, so there shouldn't be any typos or something (usually ...), there are no errors in chrome's console. Are there any known issues which come to your mind with anything here?
tagged with: google-chrome
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
tagged with: ios
tagged with: javascript
has answer: http://stackoverflow.com/a/27763262
accepted answer: http://stackoverflow.com/a/27763262
has title: Issue with chrome and iPad with querySelectorAll
upvote count: 1
answer count: 1

http://stackoverflow.com/a/27690627
type: Answer
answers question: http://stackoverflow.com/q/27690528
has body: var str = "%B~7566952"; document.write(str.replace(/[^a-zA-Z0-9]/g, ""));
has comment: http://stackoverflow.com/comment/43794435
score: 0

http://stackoverflow.com/q/27663858
linked to: http://stackoverflow.com/q/7999295
tagged with: rest
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27664049
has comment: http://stackoverflow.com/comment/43743532
score: 2
has comment: http://stackoverflow.com/comment/43743536
downvote count: 0
tagged with: http://stackoverflow.com/tag/json
type: Question
has title: How to make sure that only my javascript client web app is making requests to REST API?
tagged with: javascript
has body: I'm building a web application. It's basically a blog. There is a javascript client web application and there is a server that implements REST API. When user visits my blog, I use javascript function loadPosts() which uses Ajax to send GET request to myblog.com/api/posts endpoint on the server. Server returns JSON array containing blog posts and javascript on the client side parses the JSON and appends HTML to display blog posts. The problem I'm having is that I do not feel that my REST API is secure. Keep in mind that I do not want website visitors to have to login in order to see blog posts. However it seems that anyone could type myblog.com/api/posts into their browser and get JSON response from my server containing all the blog posts. This means that someone else can create duplicate blog and use the data I have on my server just by calling my REST API! Therefore my question is how to make sure that only my javascript client is able to make calls to my server and get data from my REST API? Note that I do not want my blog visitors to authorize in order to be able to view blog posts. Thanks in advance!
upvote count: 2
tagged with: security
tagged with: client-server
has comment: http://stackoverflow.com/comment/43743567
answer count: 1
favorite count: 0

http://stackoverflow.com/a/27709177
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27695837
upvote count: 1
type: Answer
has body: Try using: {async: false} // Ajax-JQuery: Perform an asynchronous HTTP (Ajax) request this.collection.fetch({async: false}, { success: function(c) { _.each(c.models, function(col) { var nationalDesc = col.toJSON().description; var nationalID = col.toJSON().id; var studentNationality = new cStudent([], { id: nationalID }); studentNationality.fetch({ success: function(c) { //console.log(nationalDesc + ": " + c.length); total = total + c.length; console.log(total); } }); }); } }); Links that may help you: Backbone.Sync Let me know if it works.﻿

http://stackoverflow.com/a/27743387
answers question: http://stackoverflow.com/q/27743246
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27743246
type: Answer
score: 1
has body: You can store the value in the browser localStorage like this: $(document).ready(function(){ var theLanguage = $('html').attr('lang'); $(".homeBtn a").click(function(){ var newHref = "home_" + theLanguage + ".html"; $(".homeBtn a").attr("href", newHref) localStorage.setItem('lang', theLanguage); }); }); This value will persist in the application and will be accesible for you even if you refresh the page or change the page. Then if you need to retrieve the item just do: console.log(localStorage.getItem('lang'));
upvote count: 1

http://stackoverflow.com/comment/43836696
type: AnswerComment
has text: @benjamin - Thanks for the detailed explanation and examples. That cleared up a few things for me. I was able to use your examples to do what I needed. However, this brought up one more question... In your chain example, does p2.then actually execute the promise each time it is called? In other words, if I call p2.then every time I need to do something with array subDirNames, is another iteration of the directory being executed?
type: Comment
comment on: http://stackoverflow.com/a/27663304
score: 0

http://stackoverflow.com/a/27642802
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43704481
type: Answer
accepted answer of: http://stackoverflow.com/q/27642745
answers question: http://stackoverflow.com/q/27642745
has body: When a button is clicked loop through all buttons, set their backgroundColor to #222 and set the backgroundColor of the one that was clicked to something else. Also, in the markup when you call the function change(), pass a parameter this,i.e, change(this). Updated Fiddle // el is the button that was clicked function change(el) { var all = document.getElementsByTagName('button'); // loop through all buttons for (i = 0; i < all.length; i++) { // if the current button is the one that was clicked change its color to 'plum', else '#222' all[i].style.backgroundColor = all[i] == el ? 'plum' : '#222' } } body { background-color: #fff; font-size: 62.5%; } #background-buttons { text-align: right; } #background-buttons button { background-color: #222; font-family: Roboto Condensed; color: #fff; padding: 10px; outline: none; border: none; width: 50px; height: 50px; border-radius: 50px; } #background-buttons button:hover { background-color: #555 !important; } 1 2 3 4 5 6 7 8 9 10

http://stackoverflow.com/comment/43878754
score: 0
type: AnswerComment
has text: Please don't take that tone.
type: Comment
comment on: http://stackoverflow.com/a/27733574

http://stackoverflow.com/comment/43962288
comment on: http://stackoverflow.com/a/27775397
type: Comment
has text: Please correct your contoller definition like above.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43805564
type: Comment
type: QuestionComment
has text: Are you looking to stick with pure Javascript? There's loads of Javascript libraries out there that are used solely for data visualization; for instance, Data Driven Documents, Highcharts, etc.
score: 0
comment on: http://stackoverflow.com/q/27696066

http://stackoverflow.com/a/33473496
type: Answer
downvote count: 0
score: 13
answers question: http://stackoverflow.com/q/27791644
upvote count: 13
has body: I don't have 50 reputation to comment so I'm replying to: If you use a library like jQuery or Angular to help you make the call, is >there a way to see the source code that called the helper functions? – >Atav32 Mar 14 at 1:01 If you want to find "real" method call then add breakpoint in line suggested by "Initiator" column and hit "Step out of current function (Shift+F11)" till you reach code you want to. Cheers!

http://stackoverflow.com/q/27698388
favorite count: 0
has answer: http://stackoverflow.com/a/46865625
accepted answer: http://stackoverflow.com/a/27714024
has title: Format currency type with Javascript
possible better answer: http://stackoverflow.com/a/46865625
has comment: http://stackoverflow.com/comment/43809951
downvote count: 1
has comment: http://stackoverflow.com/comment/43810893
type: AnsweredQuestion
tagged with: c#
linked to: http://stackoverflow.com/q/149055
score: -1
has body: In c# you can do this String.format(5000, "$###,###,##0.00;-$###,###,##0.00;$0.00") Which will output: $5,000 Or you can do this String.format(-5000, "$###,###,##0.00;-$###,###,##0.00;$0.00") Which will output: -$5,000 How do I do the same in Javascript?? UPDATE: I would also need to format a currency like this String.format(-5000, "###.###.##0.00€;-###,###,##0.00€;0.00€") Which would output: 5.000,00 €
has comment: http://stackoverflow.com/comment/43809896
type: Question
has answer: http://stackoverflow.com/a/27714024
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/43810875
tagged with: javascript

http://stackoverflow.com/a/27657903
score: 0
has comment: http://stackoverflow.com/comment/43732087
has comment: http://stackoverflow.com/comment/43784814
has comment: http://stackoverflow.com/comment/43731639
type: Answer
answers question: http://stackoverflow.com/q/27657784
has comment: http://stackoverflow.com/comment/43784680
has comment: http://stackoverflow.com/comment/43784756
has body: var jsonhelp= [ { "@type": "d", "@rid": "#-2:1", "@version": 0, "lower_num": 2 } ]; var extractedNumber = jsonhelp[0].lower_num; Now you can compare it with whatever you want; I hope it helps like this you can extract any of the properties in JSON. But in javascript there are two types of comparison 1) == simply compares values ,don't consider type ex. '5' == 5 true , both are 5 5 == 5 true. 2)=== considers type too ex. '5' === 5 is false, different type i.e String === integer 5 === 5 is true ,same type
has comment: http://stackoverflow.com/comment/43784687
has comment: http://stackoverflow.com/comment/43784745

http://stackoverflow.com/comment/43821292
type: Comment
has text: I would like to draw your attention to this question as well http://stackoverflow.com/questions/27653703/socket-io-node-js-mouse-tracking-as-soon-as-it-stops
type: AnswerComment
comment on: http://stackoverflow.com/a/27685219
score: 0

http://stackoverflow.com/comment/43957093
comment on: http://stackoverflow.com/q/27773020
score: 0
has text: Note that this may be duplicate of http://stackoverflow.com/questions/14804794/how-to-pass-data-back-to-parent-window (or some other question) depending on what you use.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43830519
score: 0
type: AnswerComment
has text: You're creating multiple , one for each invoice, it isn't?. The problem occurs when you appen on an id of html that would be unique
type: Comment
comment on: http://stackoverflow.com/a/27706673

http://stackoverflow.com/q/27711059
favorite count: 0
possible better answer: http://stackoverflow.com/a/27711359
has comment: http://stackoverflow.com/comment/43834392
has answer: http://stackoverflow.com/a/27711359
accepted answer: http://stackoverflow.com/a/27711090
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
upvote count: 2
has title: Firing jQuery code before page loads, is it possible?
downvote count: 1
type: Question
score: 1
has body: I have the following jQuery which currently runs when the oducment is ready but what it is doing is resizing the height of an element but looks ugly as it changes the height once page is loaded so my question is: is it possible to load the code and set the height before its displayed? $(document).ready(function () { // set hero height to max viewport var heroHeight = $(window).height(); var smsHeight = $('#send-text').height(); $('#oasis-hero').css('min-height', heroHeight - smsHeight - 140 + 'px'); // hide video $('#hero-video').hide(); // click function to auto play video $('.hero-text .primaryCta').on('click touchend', function (e) { $("#hero-video")[0].src += "&amp;autoplay=1"; $('#hero-video').show(); $('#hero-video-bg').hide(); $('.hero-text').hide(); $(this).unbind("click"); }); });
has answer: http://stackoverflow.com/a/27711090
has comment: http://stackoverflow.com/comment/43834122
has comment: http://stackoverflow.com/comment/43834155
answer count: 2
has comment: http://stackoverflow.com/comment/43834095
has comment: http://stackoverflow.com/comment/43834243
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/43794025
comment on: http://stackoverflow.com/q/27690342
type: QuestionComment
has text: ^ additional Hint: `document.sessionStorage` only has semantics in the page context. Another hint: `casper.evaluate` and `page.evaluate` are the same.
score: 0
type: Comment

http://stackoverflow.com/q/27769929
downvote count: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/43965748
accepted answer: http://stackoverflow.com/a/27770087
answer count: 2
possible better answer: http://stackoverflow.com/a/27770746
tagged with: jquery
has answer: http://stackoverflow.com/a/27770746
favorite count: 0
has comment: http://stackoverflow.com/comment/43951148
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has body: I want to create a website that has slides on the home page. For example when you open a website you will see that users can slide through different images using those tiny dots below the images or sometimes they are timed and the slides move on their own. I want to know what web language I need to use to create this effect? Are there any tutorials that explains how to achieve this effect? I have only learnt HTML5 and still learning css3. Thanks.
has answer: http://stackoverflow.com/a/27770087
score: -4
has comment: http://stackoverflow.com/comment/43950775
upvote count: 1
type: Question
has title: What web language to use to create slidshows on website

http://stackoverflow.com/comment/43969470
has text: We can best help you if you include your relevant code directly into the question. Please read [How to Ask](http://stackoverflow.com/questions/how-to-ask) to learn how to improve your question. Then [edit](http://stackoverflow.com/posts/27779654/edit) your post.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27779654
type: Comment

http://stackoverflow.com/q/27707566
has title: Getting Checkbox in JavaScript or JQuery Value While OnClick
type: Question
has answer: http://stackoverflow.com/a/27708639
has answer: http://stackoverflow.com/a/27708723
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27708639
answer count: 2
possible better answer: http://stackoverflow.com/a/27708723
downvote count: 0
tagged with: jquery
tagged with: asp.net
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
has body: I had a Checkbox I need to get the value of checkbox of while checked. either in JavaScript or jquery. I have placed my ASPX Code below. that Should Work in IE, While I am trying it is Showing response as "on" rather than value. ASPX code: &lt;asp:TemplateField&gt; &lt;HeaderTemplate&gt; &lt;asp:CheckBox ID="CHK_STY_ALL" runat="server" onclick="javascript:Selectallcheckbox(this);" /&gt; &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;asp:CheckBox ID="CHK_STY" runat="server" onclick="javascript:SelectallColorsForStyle(this,value);" CssClass="checkboxselection" Text='&lt;%#Eval("STY_NBR")%&gt;' /&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; JavaScript and JQuery : &lt;script language="javascript" type="text/javascript"&gt; function Selectallcheckbox(val) { if (!$(this).is(':checked')) { $('input:checkbox').prop('checked', val.checked); } else { $("#chkroot").removeAttr('checked'); } } &lt;/script&gt; &lt;script type="text/javascript"&gt; function SelectallColorsForStyle(e,val) { var IDValue = $(e).attr('id'); var StyleNumber = document.getElementById(IDValue).value; alert(StyleNumber); } &lt;/script&gt; Showing value as "ON" rather than the original value displaying aside of checkbox.
type: AnsweredQuestion
score: 3
upvote count: 3

http://stackoverflow.com/comment/43912951
type: AnswerComment
type: Comment
has text: Thanks a lot for the help. This did the trick. As I said, I am new to jQuery so I thought .parent() would get the closest parent that was a .
comment on: http://stackoverflow.com/a/27750880
score: 0

http://stackoverflow.com/q/27747080
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27751086
has title: Get the value of the dynamic anchor tag and pass it to the next page
type: AnsweredQuestion
downvote count: 0
tagged with: cookies
score: 1
has comment: http://stackoverflow.com/comment/44098828
type: Question
tagged with: session
tagged with: javascript
has body: I am developing a web application using Tornado framework. Currently I am working on a front end view. This page actually displays a list of ids and a small note about that id. (Its a table with two columns) id -------- Note 100 ----- Note on 100 101 ----- Note on 101 ![Table with link on id and note on id][1] The ids are displayed dynamically. When I click on the id (its a link- anchor tag), it should take me to another page which has all the details about that id. Approach - I thought of creating a cookie which will store the value of the id clicked, and get the cookie in tornado handler and retrieve all information about that id and send it to the next view. The code so far is - HTML Config ID Note {% for d in data %} {{ d[0] }} {{ d[1]}} {% end %} So on clicking the link it would store the value of the id, and then the link points to a handler where I can get the cookie and retrieve more information about that id. JavaScript function configidCreateCookieFunction(){ var cid = document.getElementById("configid").innerHTML; sessionStorage ['configid'] = cid } Tornado code - class SelectedConfigHandler(BaseHandler): def get(self): configid= None configid = self.get_cookie("configid") print configid But this is not working. When I print the id -its getting displayed as None. So basically I am not able to pull the value of the id which is a link, and the id is basically coming from the database Please help me out. Is my approach correct? Thanks in Advance
tagged with: tornado
accepted answer: http://stackoverflow.com/a/27751086

http://stackoverflow.com/a/73772768
downvote count: 1
upvote count: 0
score: -1
type: Answer
has comment: http://stackoverflow.com/comment/130351646
has body: let input = document.querySelector(".input-text"); let label = document.querySelector('.fields-label'); input.addEventListener('focus', function(e){ label.classList.add('is-active'); }) input.addEventListener('blur', function(e){ if(input.value === "") { label.classList.remove('is-active'); } }) label.is-active{ color:red; } Last Name
answers question: http://stackoverflow.com/q/27751409

http://stackoverflow.com/q/27745605
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27745745
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/27745951
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/43902200
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/53672160
score: 1
accepted answer: http://stackoverflow.com/a/27745745
downvote count: 1
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27745754
has title: How to display multiple lines in angularjs with limit on line length
has answer: http://stackoverflow.com/a/27745754
has body: I want to output some lines in only two mutliple lines using angular js (with a bit of CSS?) and each line should have a limit/length, and also if the output becomes more than 2 lines, the last word should be preceded by "..." and still make two lines. For example, "aaaa, bbbbbbbb, cccc, dddd, eeee, ffff, gggg, hhhh, iiii" Output should be: aaaa, bbbbbbbb cccc, ... iiii Any suggestions appreciated.

http://stackoverflow.com/comment/43982999
type: Comment
comment on: http://stackoverflow.com/a/27786284
has text: @user222 - answer updated with jQuery example with slide effects
score: 0
type: AnswerComment

http://stackoverflow.com/q/27731255
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
type: Question
has body: Am looking for a jquery script to 'animate/scroll' within a page, when clicked on an arrow which 'hash' tag: Below is the arrow code am placing above a background-image in html &lt;div style="margin-top:380px;"&gt; &lt;a href="#transparency"&gt; &lt;div class="arrow-down-light-blue"&gt;&lt;/div&gt; &lt;/a&gt; &lt;/div&gt; Javascript in html page $(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') &amp;&amp; location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); }); Could any please help me with providing a jquery script for this one?
tagged with: javascript
has title: Page scroll on click of an arrow which has hash tag
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43873919
has answer: http://stackoverflow.com/a/27731299
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27731394
accepted answer: http://stackoverflow.com/a/27731299
has answer: http://stackoverflow.com/a/27731394

http://stackoverflow.com/comment/43866031
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27726999
has text: @ham-sandwich the main folder has all the templates, the theme stylesheet, and assets folder. The assets folder has the js folder, bootstrap, and an img folder

http://stackoverflow.com/a/27669800
score: 1
has comment: http://stackoverflow.com/comment/43775104
has body: Wouldn't it be easier to do it this way? (Using the id as the value of the select options) &lt;form role="form" method="post" id="switch-customer-form" class="switch-customer-form"&gt; {% csrf_token %} &lt;div class="form-group col-xs-12 floating-label-form-group controls"&gt; &lt;select class="form-control customers-dropdown" id="customers-dropdown" name="form_customers"&gt; {% for c in customers %} &lt;option{% if customer == c %} selected="true"{% endif %} value="{{c.id}}"&gt;{{ c }} - {{ c.id }}&lt;/option&gt; {% endfor %} &lt;/select&gt; &lt;/div&gt; &lt;div class="form-group col-xs-12 floating-label-form-group controls"&gt; &lt;input type="submit" value="View Calendar" class="btn btn-primary btn-sm"&gt; &lt;/div&gt; &lt;/form&gt; $("#customers-dropdown").change(function() { var action1 = "/ac/calendar/"; var action2 = "/2014/12/"; var customer = this.value; var final_action = action1 + customer + action2; alert(final_action); $("#switch-customer-form").attr("action", final_action); }); UPDATE This is without adding a value to the tag. Upon doing so I encounter the same issue where it does not update the form action and simply posts to the current page. You're being redirected to the same page because the change event hasn't been triggered and there's no action in the form. If the change event would be triggered, the action would change and it would work. You need to add an action to the form or add javascript to change the action to the option marked as selected when the DOM is ready. For instance, on DOM ready: var changeAction = function(id) { var action1 = "/ac/calendar/"; var action2 = "/2014/12/"; var final_action = action1 + id + action2; $("#switch-customer-form").attr("action", final_action); }; changeAction($("#customers-dropdown").val());// On document ready, change action to selected item. $("#customers-dropdown").change(function () {// On change event, change action as well changeAction(this.value); }); fiddle
type: Answer
has comment: http://stackoverflow.com/comment/43755026
has comment: http://stackoverflow.com/comment/43776515
upvote count: 1
answers question: http://stackoverflow.com/q/27669701
has comment: http://stackoverflow.com/comment/43755622
downvote count: 0

http://stackoverflow.com/q/27747603
has comment: http://stackoverflow.com/comment/44406636
has comment: http://stackoverflow.com/comment/44406547
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43906332
has comment: http://stackoverflow.com/comment/43906444
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27749423
has body: Little Things <?php echo link_tag('resources/css/style.css'); ?> <script type="text/javascript" src="<?php echo base_url('resources/js/script.js');?>" > <img id="logo" src="<?php echo base_url('resources/images/logo.jpg'); ?>" alt="litLogo"/> <a href="<?php echo base_url('index.php/LittleController/index');?>">Home Shopping Cart Wish List Contact <?php if($this->session->userdata('email')) { echo "Welcome ".$user."!"; } else { echo "Welcome Guest!"; } ?> <?php if($this->session->userdata('email')) { echo ' Logout '; } else { echo ' Login '; } ?> <a href="<?php echo base_url('index.php/LittleController/signup');?>">Sign Up <?php $imgDir="../../resources/images/thumbs/"; echo " "; echo " "; echo " "; echo " Name Product Line Product Scale Product Description Price Image "; echo " "; $i=0; foreach($Products as $key => $value) { $i++; if($i%2==0) { echo " "; //echo ' '.$value["ID"].' '; echo " ".$value["productName"]." "; echo " ".$value["productLine"]." "; echo " ".$value["productScale"]." "; echo " ".$value["productDescription"]." "; echo " ".$value["buyPrice"]." "; //echo ' '.$value["QtySold"].' '; echo " "; //echo ' '.$value["ABV"].' '; echo " "; } else { echo " "; //echo ' '.$value["ID"].' '; echo " ".$value["productName"]." "; echo " ".$value["productLine"]." "; echo " ".$value["productScale"]." "; echo " ".$value["productDescription"]." "; echo " ".$value["buyPrice"]." "; //echo ' '.$value["QtySold"].' '; echo " "; //echo ' '.$value["ABV"].' '; echo " "; } } echo " "; echo " "; ?> So this is my code. I am trying to filter the table as I am typing into the text box. Any help appreciated. I've tried following the tutorials but they do not seem to work at all... any ideas? I find it difficult to understand and apply to my own website, the code I have for filtering is taken from the internet is well.
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/27749423
tagged with: jquery
has comment: http://stackoverflow.com/comment/43906314
tagged with: http://stackoverflow.com/tag/html
has title: Real time filtering of a table
tagged with: php
tagged with: css

http://stackoverflow.com/comment/114591436
type: Comment
comment on: http://stackoverflow.com/a/27760489
score: 1
has text: We often have parameter in our code, which can be anything. Checking if it's a Promise makes lots of sense in these cases.
type: AnswerComment

http://stackoverflow.com/q/27718393
favorite count: 0
has comment: http://stackoverflow.com/comment/43848851
tagged with: css
has comment: http://stackoverflow.com/comment/43848908
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43848956
upvote count: 2
has body: I want to change pseudo elements on a container based on its scroll position. I made a jsfiddle to demonstrate the bug I stumbled upon: http://jsfiddle.net/krzncu1k/1/ The :after-element shows the current scroll status ("upper half" or "lower half"). Its content changes by toggling the classes .upper-half and .lower-half based on scroll position: .upper-half:after {content:'upper half'; top:0;} .lower-half:after {content:'lower half'; bottom:0;} The corresponding JS: $wrap.toggleClass('upper-half', isUpper).toggleClass('lower-half', !isUpper); The bug happens when using Firefox and scrolling via dragging the scrollbar (not via mousewheel!). If you drag it and cross the middle (where the class changes from .upper-half to .lower-half) you suddenly can't drag any further. Any ideas on why this behavior occurs and how to fix it?
has answer: http://stackoverflow.com/a/27718864
has title: Firefox Scrolling Bug When Changing :after Contents
type: Question
tagged with: javascript
tagged with: firefox
accepted answer: http://stackoverflow.com/a/27718864
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/43821172
type: Comment
comment on: http://stackoverflow.com/a/27704548
has text: i want to reload only once ??
type: AnswerComment
score: 0

http://stackoverflow.com/q/27795879
tagged with: extjs
score: 0
tagged with: extjs5
answer count: 1
tagged with: listener
has title: ExtJs 5 - catch keydown event of Ext.ux.IFrame
has answer: http://stackoverflow.com/a/27801981
type: UnansweredQuestion
tagged with: iframe
type: Question
has body: In my ExtJs 5 application I use an Ext.ux.IFrame-component to displays a news html document from the intranet. When I press backspace or alt + left/right, the history navigation of the browser is triggered and the application loads new. To prevent these behaviour outside of the iframe, I attached a keydown listener to the document Ext.onReady(function () { var documentObj = Ext.getDoc(); documentObj.on('keydown', globalKeyDown); }); In the callback I stop these events globalKeyDown: function (event, targetDomEle) { var eventKey = event.getKey(); switch (eventKey) { case event.BACKSPACE: if ((!/^input$/i.test(targetDomEle.tagName) &amp;&amp; !/^textarea$/i.test(targetDomEle.tagName)) || targetDomEle.disabled || targetDomEle.readOnly) { event.stopEvent(); } break; case event.LEFT: case event.RIGHT: if (event.altKey) { event.stopEvent(); } break; } } But when I try to do the same for the iframe the method to listen for it of the ExtJs framework is not working as expected. Ext.application({ name: 'Test', requires: ['Ext.ux.IFrame'], launch : function() { var info = new Ext.Component({ renderTo: document.body, html: 'above the iframe', width: 350, padding: '0 0 20 0', margin: '0 0 1 0', style: { border: 'solid 1px blue' }, }); var iframe = Ext.create('Ext.ux.IFrame',{ style: { border: 'solid 1px red' }, width: 350, height: 350, renderTo: document.body }); var iframeDoc = iframe.getDoc(); var iframeDocEl = Ext.get(iframeDoc); iframeDocEl.on('keydown', function(){ console.log('iframeDoc.on callback'); // &lt;-- never executed }); iframeDoc.onkeyup = function(){ console.log('onkeyup callback') // &lt;-- works just fine }; } }); Why is iframeDocEl.on('keydown', ... not working for this case? The iframeDoc.onkeyup method is just a workaround, because in the callback I want to use the framework event object to be cross browser compatible (IE8+). Thank you for every suggestions. The fiddle can be found at Sencha Fiddle.
tagged with: javascript

http://stackoverflow.com/comment/43960492
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27774124
has text: @dr_dev, thanks for pointing that out. I forgot to reassign the str variable to the new string. But yes, it does work :P
score: 0

http://stackoverflow.com/q/27793738
type: UnansweredQuestion
has title: Scroll text on hover for each list element
tagged with: scroll
type: Question
tagged with: javascript
score: 0
has body: I have found a fiddle that shows how to scroll a text on hover. Here only first div element is scrolling on hover. but i want scroll text for each list li element on hover like in fiddle (i want change div to li ). please check. Fiddle On hover other li the scrolling text should stop to pre state. Please Help.
has answer: http://stackoverflow.com/a/27793865
answer count: 1
tagged with: jquery

http://stackoverflow.com/a/70425293
answers question: http://stackoverflow.com/q/27716119
has body: Try this:
score: 0
type: Answer

http://stackoverflow.com/comment/43775297
comment on: http://stackoverflow.com/a/27680334
score: 0
type: Comment
has text: Wow, ok thank you so much it works now. The video I was following is outdated I guess. Thank you so much.
type: AnswerComment

http://stackoverflow.com/comment/43807682
score: 0
type: AnswerComment
has text: Ok, then you should add a timer to make it go away after a few seconds. I'm changing the code, hold on.
type: Comment
comment on: http://stackoverflow.com/a/27697193

http://stackoverflow.com/comment/43747123
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27665949
type: Comment
has text: @GauravShah That comment should be part of your answer. Use the edit function next time to add relevant information to your own answers.

http://stackoverflow.com/q/27762943
tagged with: safari
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43936929
tagged with: google-chrome
type: Question
tagged with: javascript
has title: Using for in with Safari and Javascript (last key value is set to map)
has answer: http://stackoverflow.com/a/27762990
accepted answer: http://stackoverflow.com/a/27762990
score: 0
has body: I have an array with a length of 3. Like this: var numbers = [4, 5, 6]; and I want to use for .. in to loop through an array (Mozilla says: Note: for..in should not be used to iterate over an Array where index order is important.). But this issue isn't about index order, it's about the last key value showing up as map in Safari. So I created a test function below: var test = function(array) { var arr = array.slice(0); for(var key in arr){ console.log(key); } } Safari returns 0, 1, 2, map. Chrome returns 0, 1, 2. Safari Chrome So why does Safari iterate a 4th time with a key of map and chrome doesn't? Can anyone explain what is going on here?
answer count: 1

http://stackoverflow.com/comment/43794243
comment on: http://stackoverflow.com/a/27687733
score: 0
type: Comment
has text: @danielnixon no it doesn't just add `tabindex=1` like this `Here`
type: AnswerComment

http://stackoverflow.com/q/27738155
type: AnsweredQuestion
tagged with: internet-explorer
linked to: http://stackoverflow.com/q/4411551
score: 7
possible better answer: http://stackoverflow.com/a/27738262
has title: "Unable to get property 'getData' of undefined or null reference" in IE but not Chrome
answer count: 2
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43929278
favorite count: 0
has answer: http://stackoverflow.com/a/27769940
linked to: http://stackoverflow.com/q/6035071
linked to: http://stackoverflow.com/q/27572607
has body: Thanks to the help of another member I have successfully implemented a JS method that has the ability to paste excel data and split it into an HTML textbox table form (see thread). The issue that I am now faced with is that this is only functional in Chrome, while IE10 and IE11 both flag the following error: "Unable to get property 'getData' of undefined or null reference." This error is thrown in the 2nd line of the function (below): function (event) { var input_id = $(this).attr("id"); var value = event.originalEvent.clipboardData.getData('text/plain'); //ERROR in IE /* ... */ event.preventDefault(); // prevent the original paste } Wondering if anyone can see the issue at hand with why Chrome is satisfied while IE is not.
accepted answer: http://stackoverflow.com/a/27769940
upvote count: 7
tagged with: google-chrome
tagged with: excel
type: Question
has answer: http://stackoverflow.com/a/27738262

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/27675327
tags question: http://stackoverflow.com/q/27799828
type: Tag

http://stackoverflow.com/a/27680501
answers question: http://stackoverflow.com/q/27680472
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27680472
has comment: http://stackoverflow.com/comment/43776115
has body: You can create a function like this: function next(obj) { var keys = Object.keys(obj); if(keys &amp;&amp; keys.length &gt; 0) return obj[keys[0]]; } To use it: next(json.draw.item).hidden I test it with Angular.js it is Ok.(see also jsFiddle) See the snippet below. function next(obj) { var keys = Object.keys(obj); if(keys &amp;&amp; keys.length &gt; 0) return obj[keys[0]]; } var draw1 = { "item": { "aircraft": { "hidden": false} }}; var draw2 = { "item": { "mounted": { "hidden": false} }}; document.write(next(draw1.item).hidden, '&lt;br&gt;'); document.write(next(draw2.item).hidden, '&lt;br&gt;');
upvote count: 3
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/100489662
comment on: http://stackoverflow.com/a/27736383
score: 0
type: Comment
has text: This totally avoids an obvious question of what if a person wants synchronous
type: AnswerComment

http://stackoverflow.com/comment/43702902
has text: Have you tried automatic js minification on server side?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27641978
score: 1

http://stackoverflow.com/comment/43740857
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27661744
has text: Thanks. I already asked there and didn't really get any responses. This is what I got from a guy who did the same thing: "Easiest would be to put the markup for the modal in a custom show.php file - take a look at some of the exhibit themes I've built for examples of how to structure that file: https://github.com/davidmcclur... And then add a script.js file to your exhibit theme, and put the code to initialize the modal there." Unfortunately, I don't know what to put where. Which code would I put in script.js, for example?

http://stackoverflow.com/a/27773038
answers question: http://stackoverflow.com/q/27740686
upvote count: 1
downvote count: 0
type: Answer
has body: Just concatenate the array to itself, then use slice: function sliceWrap(arr, start, num) { return arr.concat(arr).slice(start, start+num); } Another approach, which wraps around: function sliceWrap2(arr, start, num) { var result = [], i, end = start+num, len = arr.length; for (i=start; i&lt;end; i++) { result.push(arr[i % len]); } return result; }
score: 1

http://stackoverflow.com/q/27759718
tagged with: asp.net-ajax
accepted answer: http://stackoverflow.com/a/27759785
tagged with: asp.net
has comment: http://stackoverflow.com/comment/43931741
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/27759785
type: Question
answer count: 1
tagged with: javascript
has body: I am trying to fill a part of my web page by using AJAX instead of C# since the webpage should not be refreshed for this action. All I need to do is to run a SELECT query and get the current client from SQL DB and fill the related form without refreshing the page. I managed to get the related client and to change the related textbox, however, the page is still refreshing and all the textboxes becomes null again! My code is on the below: &lt;asp:Panel ID="pnlClientSummaryDetails" runat="server" Width="360px" Visible="True"&gt; &lt;asp:TextBox runat="server" ID="txtDateOpened"&gt;&lt;/asp:TextBox&gt; &lt;!--other text boxes --&gt; &lt;/asp:Panel&gt; &lt;asp:Button ID="bnSelectClient" runat="server" CssClass="auto-style7" Text="Select Client" ToolTip="Click the view client button to view selected clients information" Width="282px" OnClientClick="BindClientSummaryForm()" /&gt; function BindClientSummaryForm() { $.ajax({ type: "POST", url: "Clients.aspx/GetClientSummaryData", contentType: "application/json;charset=utf-8", data: {}, dataType: "json", success: function(data) { document.getElementById('&lt;%= txtDateOpened.ClientID %&gt;').value = data.d.DateFileOpened; // other textboxes will be filled like that. }, error: function (result) { alert("Error occured while filling ClientSummary part."); } }); } [WebMethod] public static MyClient GetClientSummaryData() //GetData function { //FillClientSummaryGridView(); int intClientID = 0; Int32.TryParse(clientID, out intClientID); MyClient client = new MyClient(); string sQuery = "SELECT ClientID,FirstName,DateFileOpened FROM dbo.Client where ClientID = " + intClientID; String sConnectionString = ConfigurationManager.ConnectionStrings["myDatabase"].ConnectionString; SqlConnection con = new SqlConnection(sConnectionString); con.Open(); SqlCommand cmd = new SqlCommand(sQuery, con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dtGetData = new DataTable(); da.Fill(dtGetData); foreach(DataRow dtRow in dtGetData.Rows) { c…
tagged with: ajax
has title: Assign textbox values with ajax - page still refreshing and assigned values are gone
score: 0

http://stackoverflow.com/q/27706367
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27706868
tagged with: html-table
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43825291
tagged with: jsp
has comment: http://stackoverflow.com/comment/43824584
has comment: http://stackoverflow.com/comment/43824755
has title: Giving -Elements an ID with JSP
accepted answer: http://stackoverflow.com/a/27706868
has comment: http://stackoverflow.com/comment/43824635
has body: I'am new to Javascript/Jquery and JSP. I have a created with JSP ( 2 for-loops ), and with Javascript I can click on every Cell.This opens a new Window (Window is opened by Bootstrap Script) with an Text Input and an DELETE and SAVE-BUTTON. <%for(int i = 0; i <bsp.length;i++) { %> <%if(i==0){ %> <%} %> <%out.println(bsp[i]); %> <%} %> <%for(int ut = 0; u < test.length ;u++) { %> <%out.println(test[u]); %> <%for(int rest =0; rest<bsp.length;rest++) { %> <%} %> <%} %> $(document).ready(function() { $("#save").click(function() { $(".td_test").append($("#input").val()); }); }); The Problem is, that every -Element has the same Class, and if I change one Cell, it changes the whole Table.If i use ID-Selektor, it only works with the very first Cell in Table. Anyone has some ideas how I can solve that individually?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43824579
has answer: http://stackoverflow.com/a/27706647
has comment: http://stackoverflow.com/comment/43825324
type: Question
possible better answer: http://stackoverflow.com/a/27706647

http://stackoverflow.com/comment/43967674
type: Comment
score: 1
has text: Thank you so much. Much appreciated for the effort.
type: AnswerComment
comment on: http://stackoverflow.com/a/27778721

http://stackoverflow.com/a/27654615
downvote count: 0
has body: Whenever you trying to call an ajax call inside the controller, it will not fire the angular digest and hence the controller variables wont get updated. The ideal way to go about it to have this in a factory and then call the factory method from the controller. Code example: appModule.factory('Search', function($rootScope, $http, $q) { return { var deferred = $q.defer(); $http.get('https://gist.githubusercontent.com/vigneshvdm/862ec5a97bbbe2021b79/raw/d7155b9c7fd533597c912fc386682e5baee1487a/associate.json').success(function(response) { deferred.resolve({ data: response)}; }); return deferred.promise; } }); This code is using $q service inorder to make it more cleaner.Now just inject this factory (Search) into your controller and use it as is.
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43725673
answers question: http://stackoverflow.com/q/27654525

ionic-framework
tags question: http://stackoverflow.com/q/27756446
tags question: http://stackoverflow.com/q/27711182
tags question: http://stackoverflow.com/q/27748177
tags question: http://stackoverflow.com/q/27674640
tags question: http://stackoverflow.com/q/27727498
type: Tag
tags question: http://stackoverflow.com/q/27720901
tags question: http://stackoverflow.com/q/27770402
tags question: http://stackoverflow.com/q/27745296
tags question: http://stackoverflow.com/q/27645855
tags question: http://stackoverflow.com/q/27708542
tags question: http://stackoverflow.com/q/27793051
tags question: http://stackoverflow.com/q/27768988
tags question: http://stackoverflow.com/q/27703740
tags question: http://stackoverflow.com/q/27781956
tags question: http://stackoverflow.com/q/27690834
tags question: http://stackoverflow.com/q/27738997
tags question: http://stackoverflow.com/q/27651272
tags question: http://stackoverflow.com/q/27661296
tags question: http://stackoverflow.com/q/27641081
tags question: http://stackoverflow.com/q/27666622
tags question: http://stackoverflow.com/q/27692790
tag name: ionic-framework

http://stackoverflow.com/q/27726999
tagged with: wordpress
has comment: http://stackoverflow.com/comment/43865892
has comment: http://stackoverflow.com/comment/43873960
type: Question
has answer: http://stackoverflow.com/a/27727087
has comment: http://stackoverflow.com/comment/43866079
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43866023
has body: I am trying to add javascript files with wp_enqueue_script. The scripts do not seem to load at all in the page. What I have is:: function uberpasscode_scripts() { wp_enqueue_script( 'bootstrap', get_template_directory_uri() . "/assets/js/bootstrap.min", array('jquery')); wp_enqueue_script( 'jquery', get_template_directory_uri() . "/assets/js/jquery-1.11.1.min" ); } add_action( 'wp_enqueue_scripts', 'uberpasscode_scripts' );
answer count: 1
has title: WP - difficulty with enqueueing scripts
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43866041
has comment: http://stackoverflow.com/comment/43866031
has comment: http://stackoverflow.com/comment/43866509

http://stackoverflow.com/q/27660117
tagged with: date
has body: I am using Momentjs and Momentjs Timezone to handle dates / timezones. I'm attempting to have a date that is input from a user in a specific time zone and convert it to the local time in their own time zone. It doesn't look like Moment's Timezone library supports the new Date().getTimezoneOffset() format for setting the time zone. function calculateLocalTime(e) { var currentTz = new Date().getTimezoneOffset(), fromDate = moment.tz(this.value, 'GMT'), toDate = fromDate.tz(currentTz); $('to-time').val(toDate.format(dateFormat)); } I've also attempted to extract the three-letter time zone from the normal Date object as well, but that doesn't seem to be supported either. function calculateLocalTime(e) { var currentTz = new Date().toString().split(' ').pop().replace(/\(/gi, '').replace(/\)/gi, ''), fromDate = moment.tz(this.value, 'GMT'), toDate = fromDate.tz(currentTz); $('to-time').val(toDate.format(dateFormat)); } Any idea on how I should be doing this using Moment?
has answer: http://stackoverflow.com/a/27664041
answer count: 1
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/27664041
tagged with: momentjs
has title: Get Parseable Timezone
tagged with: timezone
type: Question
type: AnsweredQuestion

http://stackoverflow.com/q/27750679
has comment: http://stackoverflow.com/comment/43920891
answer count: 1
favorite count: 0
tagged with: casperjs
has comment: http://stackoverflow.com/comment/43922930
upvote count: 2
has answer: http://stackoverflow.com/a/27755205
accepted answer: http://stackoverflow.com/a/27755205
has body: I would like check the title of several website. So, when I want do that with the "test object", I randomly get different results. I mean, when I run the shell command "casperjs test ..." : Sometimes, my shell displays all the test (its Ok!) Sometimes (screenshot #1), all tests is not done Sometimes (screenshot #2), I get a fail "check title" test, the previous open(url) didn't load the new url (?!) The screenshot of my shell: My code: casper.options.loadImages = false; var lines = [ "http://www.jeuxvideo.com;JEUXVIDEO.COM - La Référence des Jeux Vidéo sur PC et Consoles !", "http://www.google.fr;Google", "http://casperjs.org/;CasperJS, a navigation scripting and testing utility for PhantomJS and SlimerJS", "http://en.wikipedia.org/wiki/Main_Page;Wikipedia, the free encyclopedia", "http://stackoverflow.com/;Stack Overflow", "http://9gag.com/;9GAG - Why So Serious?", "http://eu.blizzard.com/fr-fr/;Blizzard Entertainment", "http://openclassrooms.com/;OpenClassrooms, Le Site du Zéro - Les cours les plus ouverts du Web", "http://lesjoiesducode.fr/;Les joies du code ", "http://www.developpez.com/;Developpez.com, le club des développeurs et IT Pro", ]; function main(){ this.each(lines, function(self, line){ var tab = line.split(";"); casper.test.begin("test : "+tab[0], 1, function suite(test){ casper.start().then(function(){ this.then(function(){ this.open(tab[0]); }); this.then(function (){ this.echo(this.currentHTTPStatus); test.assertTitle(tab[1]); }); }).run(function(){ test.done(); }); }); }); } casper.start().then(main).run(); My versions : casperjs version : 1.1.0-beta3 phantomjs version : 1.9.7 Why sometimes, all tests aren't done and why sometimes le new url isn't loaded ? (whereas the open(url) is in a .then)
has comment: http://stackoverflow.com/comment/43921062
has comment: http://stackoverflow.com/comment/43920632
score: 2
has title: Loop of test suites in a CasperJS test file results in random failures in the shell
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43920985
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/43934839
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27760633
has text: What program is this that you are using? maybe you should put it in the tags so you can get help from people more familiar with debugging in that environment.

http://stackoverflow.com/comment/43759297
type: Comment
score: 0
type: AnswerComment
has text: Sorry I thought it wasn't you the one answering your own question. My fault
comment on: http://stackoverflow.com/a/27671479

http://stackoverflow.com/comment/43958305
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27773646
has text: Its entire JSON response http.post("server/viewRecords.php") .success(function(response){ console.log(response); scope.crew = response; });

canvas
tags question: http://stackoverflow.com/q/27664298
tags question: http://stackoverflow.com/q/27707055
tags question: http://stackoverflow.com/q/27673568
tags question: http://stackoverflow.com/q/27685156
tags question: http://stackoverflow.com/q/27745289
tags question: http://stackoverflow.com/q/27656375
tags question: http://stackoverflow.com/q/27689886
tags question: http://stackoverflow.com/q/27774699
tags question: http://stackoverflow.com/q/27650885
tags question: http://stackoverflow.com/q/27715857
tags question: http://stackoverflow.com/q/27688349
tags question: http://stackoverflow.com/q/27677771
tags question: http://stackoverflow.com/q/27640982
tags question: http://stackoverflow.com/q/27734777
tags question: http://stackoverflow.com/q/27688633
tags question: http://stackoverflow.com/q/27723190
tags question: http://stackoverflow.com/q/27762230
tags question: http://stackoverflow.com/q/27726631
tags question: http://stackoverflow.com/q/27739385
tags question: http://stackoverflow.com/q/27696406
tags question: http://stackoverflow.com/q/27755735
tags question: http://stackoverflow.com/q/27759753
tags question: http://stackoverflow.com/q/27652694
tags question: http://stackoverflow.com/q/27666936
tags question: http://stackoverflow.com/q/27736288
tags question: http://stackoverflow.com/q/27726118
tags question: http://stackoverflow.com/q/27789512
tags question: http://stackoverflow.com/q/27803449
tags question: http://stackoverflow.com/q/27751412
tags question: http://stackoverflow.com/q/27742369
tags question: http://stackoverflow.com/q/27653675
tags question: http://stackoverflow.com/q/27707528
tags question: http://stackoverflow.com/q/27720559
tags question: http://stackoverflow.com/q/27766647
tag name: canvas
tags question: http://stackoverflow.com/q/27676455
tags question: http://stackoverflow.com/q/27753081
tags question: http://stackoverflow.com/q/27644374
tags question: http://stackoverflow.com/q/27666781
tags question: http://stackoverflow.com/q/27688134
type: Tag
tags question: http://stackoverflow.com/q/27796920
tags question: http://stackoverflow.com/q/27767914
tags question: http://stackoverflow.com/q/27742492
tags question: http://stackoverflow.com/q/27783478
tags question: http://stackoverflow.com/q/27650944
tags question: http://stackoverflow.com/q/27674258
tags question: http://stackoverflow.com/q/27784114
tags question: http://stackoverflow.com/q/27681147
tags question: http://stackoverflow.com/q/27664103
tags question: http://stackoverflow.com/q/27747333
tags question: http://stackoverflow.com/q/27669841
tags question: http://stackoverflow.com/q/27761854
tags question: http://stackoverflow.com/q/27705977
tags question: http://stackoverflow.com/q/27693300
tags question: http://stackoverflow.com/q/27681085
tags question: http://stackoverflow.com/q/27723830
tags question: http://stackoverflow.com/q/27779220
tags question: http://stackoverflow.com/q/27732995
tags question: http://stackoverflow.com/q/27762837
tags question: http://stackoverflow.com/q/27801205
tags question: http://stackoverflow.com/q/27662327
tags question: http://stackoverflow.com/q/27716469
tags question: http://stackoverflow.com/q/27650148

http://stackoverflow.com/a/27675170
type: Answer
answers question: http://stackoverflow.com/q/27674400
has comment: http://stackoverflow.com/comment/43766100
has body: I would have have one main controller and then have one sub controller for each tab. The main controller would control which tab is visible using a $scope variable which keeps track of the current tab: 1 2 3 app.controller('MainCtrl', function($scope) { $scope.tab = 1; $scope.changeTab = function (tab) { $scope.tab = tab; }; }); tab1.html Tab1 Name: tab1.js: angular .module('plunker') .controller('Tab1Ctrl', function($scope) { }); Demo: http://plnkr.co/edit/iB6vhgIjT4fjYuBqVVS6?p=preview As you can see in the demo if you enter some text in the textbox, switch tabs and then switch back the text remains.
score: 0
has comment: http://stackoverflow.com/comment/43766646
has comment: http://stackoverflow.com/comment/43766197
has comment: http://stackoverflow.com/comment/43766854

http://stackoverflow.com/comment/44297589
score: 0
type: AnswerComment
type: Comment
has text: `_thenify` should be created on every instance of function. In other case, you are manipulating queue shared between all function instances.
comment on: http://stackoverflow.com/a/27881749

python
tags question: http://stackoverflow.com/q/27676151
tags question: http://stackoverflow.com/q/27730080
tags question: http://stackoverflow.com/q/27651094
tags question: http://stackoverflow.com/q/27690305
tags question: http://stackoverflow.com/q/27768686
tags question: http://stackoverflow.com/q/27748633
tags question: http://stackoverflow.com/q/27669224
tags question: http://stackoverflow.com/q/27673194
tags question: http://stackoverflow.com/q/27764841
tags question: http://stackoverflow.com/q/27713745
tag name: python
tags question: http://stackoverflow.com/q/27656283
tags question: http://stackoverflow.com/q/27744823
tags question: http://stackoverflow.com/q/27713111
tags question: http://stackoverflow.com/q/27644296
tags question: http://stackoverflow.com/q/27684020
tags question: http://stackoverflow.com/q/27736805
tags question: http://stackoverflow.com/q/27687641
tags question: http://stackoverflow.com/q/27673948
tags question: http://stackoverflow.com/q/27643942
tags question: http://stackoverflow.com/q/27754053
tags question: http://stackoverflow.com/q/27664466
tags question: http://stackoverflow.com/q/27724814
type: Tag
tags question: http://stackoverflow.com/q/27732113
tags question: http://stackoverflow.com/q/27790374
tags question: http://stackoverflow.com/q/27754760
tags question: http://stackoverflow.com/q/27682751
tags question: http://stackoverflow.com/q/27792463
tags question: http://stackoverflow.com/q/27720175
tags question: http://stackoverflow.com/q/27734776
tags question: http://stackoverflow.com/q/27671932
tags question: http://stackoverflow.com/q/27725062
tags question: http://stackoverflow.com/q/27801291
tags question: http://stackoverflow.com/q/27681731
tags question: http://stackoverflow.com/q/27749113
tags question: http://stackoverflow.com/q/27759625
tags question: http://stackoverflow.com/q/27652536
tags question: http://stackoverflow.com/q/27774451

http://stackoverflow.com/q/27673323
score: 8
favorite count: 0
has answer: http://stackoverflow.com/a/27673475
has answer: http://stackoverflow.com/a/27673556
type: AnsweredQuestion
has title: JavaScript properties with setter methods aren't real properties?
downvote count: 1
accepted answer: http://stackoverflow.com/a/27673556
type: Question
upvote count: 9
tagged with: javascript
tagged with: inheritance
possible better answer: http://stackoverflow.com/a/27673474
has answer: http://stackoverflow.com/a/27673474
has comment: http://stackoverflow.com/comment/43761752
answer count: 3
has body: function Name(first, last) { this.first = first; this.last = last; this.fullName = first + " " + last } Name.prototype = { get fullName() { return this.first + " " + this.last; }, set fullName(name) { var names = name.split(" "); this.first = names[0]; this.last = names[1]; } }; var person = new Name("Foo", "Bar"); // person.fullName = "Foo Bar" person.hasOwnProperty("fullName") // false Is there a way to return the properties?

http://stackoverflow.com/q/27704549
answer count: 3
has comment: http://stackoverflow.com/comment/43822215
has answer: http://stackoverflow.com/a/27704593
type: UnansweredQuestion
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43821659
has title: javascript variable is undefined after Initialized
tagged with: javascript
has answer: http://stackoverflow.com/a/27704956
type: Question
has comment: http://stackoverflow.com/comment/43821745
has comment: http://stackoverflow.com/comment/43821411
tagged with: undefined
has body: I have below code, it's too simple var Height = &lt;%= Height %&gt;, _height; console.log(Height); // in my test, I got 800 if(Height &gt; 800){ _height = 450; } else { _height = 330; } console.log(_height); // it will log 'undefined' What is the wrong part?
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/27705567

http://stackoverflow.com/q/27670312
tagged with: javascript
has comment: http://stackoverflow.com/comment/43755472
tagged with: radix
has comment: http://stackoverflow.com/comment/43755438
has comment: http://stackoverflow.com/comment/43755507
score: 0
has title: parseInt() doesn't regard leading zeros, even with radix
tagged with: converters
has comment: http://stackoverflow.com/comment/43755395
has comment: http://stackoverflow.com/comment/43755492
has comment: http://stackoverflow.com/comment/43755499
has answer: http://stackoverflow.com/a/27670418
linked to: http://stackoverflow.com/q/10073699
has comment: http://stackoverflow.com/comment/43755568
tagged with: binary
has comment: http://stackoverflow.com/comment/43755407
has comment: http://stackoverflow.com/comment/43755525
has body: When I want to convert a binary string to a base 10 decimal (Like this: parseInt('0001010', 2)), Javascript returns a decimal number, but a version in which the leading zeros mentioned in the example above have been disregarded. Is there any way to fix this?
has comment: http://stackoverflow.com/comment/43755419
possible better answer: http://stackoverflow.com/a/27670340
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27670340
has comment: http://stackoverflow.com/comment/43755382
has comment: http://stackoverflow.com/comment/43755406
accepted answer: http://stackoverflow.com/a/27670418
has comment: http://stackoverflow.com/comment/43755586
has comment: http://stackoverflow.com/comment/43755459
type: Question
answer count: 2

http://stackoverflow.com/comment/43947831
type: QuestionComment
has text: Mark my answer as correct if it helped you anyways
type: Comment
comment on: http://stackoverflow.com/q/27766405
score: 0

http://stackoverflow.com/q/27802244
score: 3
upvote count: 3
has answer: http://stackoverflow.com/a/27805104
type: Question
downvote count: 0
tagged with: javascript
has title: custom targets / running arbitrary code
answer count: 1
tagged with: gulp
favorite count: 0
has comment: http://stackoverflow.com/comment/44013575
type: UnansweredQuestion
tagged with: makefile
has body: In make it's possible to define custom targets that have no relevance to the actual code that they act upon, in the sense that they are language agnostic. release_sortof: @echo packaging release... tar czf release.tar.gz file1 file2 file3 ls /dev/null ls /dev/stderr ls /dev/stdout I know the example above is horrible, but the point I'm trying to illustrate is that the code in the release_sortof target doesn't depend on the fact that my project uses code written in C, for example; nor does it depend on me using Make built-ins such as foreach. Is there a way to work with javascript/&lt;INSERT-NAME&gt;script files without using the ever insufficient plugins available for gulp? As in, could I lint my coffeescript with coffeelint by directly calling the coffeelint module: var gulp = require('gulp') , coffeelint = require('coffeelint') ; gulp.task('lint', function() { /* run coffeelint on source files */ }); Or can this only be done using plugins? Another example would be to run arbitrary code like so: var spawn = require('child_process').spawn; gulp.task('blue', function() { var child = spawn('ls'); /* do stuff with spawned child process */ });

http://stackoverflow.com/a/27741265
type: Answer
has body: Now i'm not too sure on the outputted HTML but i'm going to take a wild guess, that this is how the HTML is being output: Text within header What you need if the code is to work as expected Text within header Option 1 - Change HTML Change your HTML code so that a span is contained within a div and the function to add the text is within the span Something like this Option 2 - Change jQuery Change your jQuery function to something like this: $('.site-description').each(function() { var $el = $(this), text = $el.text(), len = text.length, newCont = ''; for (var i = 0; i < len; i++) { var bgColor = '#' + (Math.random() * 0xffffff).toString(16).substr(-6); newCont += '' + text.charAt(i) + ''; } $el.html(newCont); }); Or generally just fix the first part of the query so that it finds the correct class or element.
score: 0
has comment: http://stackoverflow.com/comment/43927984
answers question: http://stackoverflow.com/q/27739642

http://stackoverflow.com/comment/43771841
score: 0
type: AnswerComment
type: Comment
has text: Welcome to SO. A little explanation would be nice.
comment on: http://stackoverflow.com/a/27678602

http://stackoverflow.com/a/47086609
has body: The OP mentions a requirement for the data to be forcibly transient i.e. (if possible) unable to be saved locally on the client - at least that is how I read it. If this type of data privacy is a firm requirement for an application, there are multiple considerations when dealing with a browser environment, I am unsure whether the images in question are to be displayed as images to the user, or where in relation to the client the source data of the images is coming from. If the data is coming into the browser over the network, you might do well (or better than the alternative, at least) to use a socket or other raw data connection rather than HTTP requests, and consider something like a "sentinel" value in the stream of bytes, to indicate boundaries of image data. Once you have the bytes coming in, you could, I believe, (or soon will be able to) pass the data via a generator function into a typedArray via the iterator protocol, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array // From an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint8 = new Uint8Array(iterable); // Uint8Array[1, 2, 3] And then perhaps integrate those arrays as private members of some class you use to manage their lifecycle? see: https://www.nczonline.net/blog/2014/01/21/private-instance-members-with-weakmaps-in-javascript/ var Person = (function() { var privateData = {}, privateId = 0; function Person(name) { Object.defineProperty(this, "_id", { value: privateId++ }); privateData[this._id] = { name: name }; } Person.prototype.getName = function() { return privateData[this._id].name; }; return Person; }()); I think you should be able to manage the size / wait problem to some extent with the generator method of creating the byte arrays as well, perhaps check for sane lengths, time passed on this iterator, etc. A general set of ideas more than an answer, and none of which are my own authorship, but this seems to be appropriate to the que…
answers question: http://stackoverflow.com/q/27798248
type: Answer
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/a/27644162
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27644141
type: Answer
upvote count: 7
has body: Use another object as a counter, like this var counter = {}; for (var i = 0; i &lt; db.length; i += 1) { counter[db[i].Position] = (counter[db[i].Position] || 0) + 1; } for (var key in counter) { if (counter[key] &gt; 1) { console.log("we have ", key, " duplicated ", counter[key], " times"); } }
score: 7
accepted answer of: http://stackoverflow.com/q/27644141

http://stackoverflow.com/q/27731935
tagged with: node.js
type: Question
answer count: 1
tagged with: javascript
has title: grunt watch is not working and gets hanged
tagged with: gruntjs
score: 0
has body: I am new to using grunt. I am not been able to use grunt watch. Following is my grunt file: module.exports = function(grunt) { module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uglify: { my_target: { files: { 'public/admin/js/developer.min.js': ['public/admin/js/developer.js'] } } }, cssmin: { target: { files: { 'public/admin/css/developer2.min.css': ['public/admin/css/developer.css'] } } }, csslint: { strict: { options: { import: 2 }, src: ['public/admin/css/developer.css'] }, lax: { options: { import: false }, src: ['public/admin/css/developer.css'] } }, htmlhint: { html1: { options: { 'tag-pair': true }, src: ['app/views/admin/property/*.php'] } }, jshint: { all: ['Gruntfile.js', 'public/admin/js/developer.js'], options: { reporter: require('jshint-stylish') } }, jslint: { // configure the task // lint your project's client code client: { src: [ 'public/admin/js/developer.js' ], directives: { browser: true, predef: [ 'jQuery' ] }, options: { junit: 'out/client-junit.xml' } } }, qunit: { qunit: { all: { options: { urls: [ 'http://localhost:8000/tests/TestCase.php', 'http://localhost:8000/tests/ExampleTest.php' ] } } } }, jsvalidate: { options:{ globals: {}, esprimaOptions: {}, verbose: false }, targetName:{ files:{ src:['public/admin/js/*.js'] } } }, watch: { files: 'public/admin/js/*.js', task: ['uglify'], options: { nospawn: false }, }, }); // Load the plugin that provides the "uglify" task. grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-contrib-csslint'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-jslint'); grunt.loadNpmTasks('grunt-jsvalidate'); grunt.loadNpmTasks('grunt-htmlhint'); grunt.loadNpmTasks('grunt-contrib-qunit'); grunt.loadNpmTasks('grunt-contrib-watch'); // Default task(s). grunt.registerTask('default', ['uglify'],['cssmin'],['csslint'],['jshint'],['jslint'],['htmlhint'],['jsvalidate'…
has answer: http://stackoverflow.com/a/27732331
type: UnansweredQuestion
tagged with: grunt-contrib-watch

http://stackoverflow.com/comment/93662835
comment on: http://stackoverflow.com/a/34678386
type: AnswerComment
score: 0
type: Comment
has text: I use a combination of `prettier` and `eslint` to format my code. This does not allow for inline comments. Many `/* eslint-disable-next-line ... */` statements are hard to read and to spot in the code.

http://stackoverflow.com/comment/43739115
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27661635
has text: Next Up... [Promises](http://blog.millermedeiros.com/callbacks-promises-signals-and-events/)
score: 0

http://stackoverflow.com/a/27743739
has body: Associate a controller with the module to access $scope value in the scope method. Sample code is given below: Html ... userId: {{addresss}} ... Js var module = angular.module("AuthApp", []); module.controller("MyCntrl", function($scope){ $scope.userIdChanged = function () { // now access $scope.userId here }; }); Try this, will help you.
has comment: http://stackoverflow.com/comment/43899180
type: Answer
has comment: http://stackoverflow.com/comment/43900984
answers question: http://stackoverflow.com/q/27743456
accepted answer of: http://stackoverflow.com/q/27743456
score: 0
type: AcceptedAnswer

express
tags question: http://stackoverflow.com/q/27744531
tags question: http://stackoverflow.com/q/27765269
tags question: http://stackoverflow.com/q/27758566
tags question: http://stackoverflow.com/q/27763228
tags question: http://stackoverflow.com/q/27759880
tags question: http://stackoverflow.com/q/27702664
tags question: http://stackoverflow.com/q/27678491
tags question: http://stackoverflow.com/q/27715631
tags question: http://stackoverflow.com/q/27708434
tags question: http://stackoverflow.com/q/27676936
tags question: http://stackoverflow.com/q/27741480
tags question: http://stackoverflow.com/q/27732155
tags question: http://stackoverflow.com/q/27732623
tags question: http://stackoverflow.com/q/27789611
tags question: http://stackoverflow.com/q/27785896
tags question: http://stackoverflow.com/q/27799496
tags question: http://stackoverflow.com/q/27793564
tags question: http://stackoverflow.com/q/27644885
tags question: http://stackoverflow.com/q/27641018
tags question: http://stackoverflow.com/q/27649157
tags question: http://stackoverflow.com/q/27666744
tags question: http://stackoverflow.com/q/27648177
tags question: http://stackoverflow.com/q/27680933
tags question: http://stackoverflow.com/q/27769697
tags question: http://stackoverflow.com/q/27658316
tags question: http://stackoverflow.com/q/27754896
tags question: http://stackoverflow.com/q/27694315
tags question: http://stackoverflow.com/q/27658997
tags question: http://stackoverflow.com/q/27745357
tags question: http://stackoverflow.com/q/27702795
tags question: http://stackoverflow.com/q/27784463
tags question: http://stackoverflow.com/q/27708469
tags question: http://stackoverflow.com/q/27754871
tags question: http://stackoverflow.com/q/27679512
tags question: http://stackoverflow.com/q/27766858
tags question: http://stackoverflow.com/q/27642015
tags question: http://stackoverflow.com/q/27768439
tags question: http://stackoverflow.com/q/27719918
tags question: http://stackoverflow.com/q/27784668
tags question: http://stackoverflow.com/q/27791129
tags question: http://stackoverflow.com/q/27773050
tags question: http://stackoverflow.com/q/27712004
tags question: http://stackoverflow.com/q/27746571
tag name: express
tags question: http://stackoverflow.com/q/27792961
tags question: http://stackoverflow.com/q/27682207
tags question: http://stackoverflow.com/q/27764575
tags question: http://stackoverflow.com/q/27720266
type: Tag
tags question: http://stackoverflow.com/q/27787204
tags question: http://stackoverflow.com/q/27730840
tags question: http://stackoverflow.com/q/27712442
tags question: http://stackoverflow.com/q/27759190
tags question: http://stackoverflow.com/q/27743240
tags question: http://stackoverflow.com/q/27765177
tags question: http://stackoverflow.com/q/27758209
tags question: http://stackoverflow.com/q/27763638
tags question: http://stackoverflow.com/q/27750932
tags question: http://stackoverflow.com/q/27759539
tags question: http://stackoverflow.com/q/27700464

http://stackoverflow.com/comment/43758245
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27671406
has text: @Teemu - sorry, but which way? `vertical-align` aligns in text line height only, while `display: table-cell;` leads to incorrect height calculations (http://stackoverflow.com/questions/25119868/why-my-heights-fixer-code-work-wrong-when-browser-window-restored-after-being-ma) of elements placed in such container.
score: 0

http://stackoverflow.com/comment/43762596
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27673591
has text: Are you really using `<input-type="hidden"`? Shouldn't it be `<input type="hidden"`?

http://stackoverflow.com/q/27712860
tagged with: google-chrome
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27721145
upvote count: 3
accepted answer: http://stackoverflow.com/a/27721145
tagged with: google-chrome-extension
has title: What is causing an "Error connecting to native app" when connecting to a native host application with connectNative() in a Chrome extension?
answer count: 1
favorite count: 0
has body: I am implementing communication between a web page and a Mac application using Chrome's Native Messaging feature. All seems to go well until I make the javascript call to chrome.runtime.connectNative("my_native_host_app_name"), which produces the following error in the console: Error in event handler for runtime.onMessageExternal: Error connecting to native app: com.allinlearning.nmhforbrowserextension Stack trace: Error: Error connecting to native app: com.allinlearning.nmhforbrowserextension at Object.&lt;anonymous&gt; (extensions::runtime:189:11) at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14) at Object.handleRequest (extensions::binding:55:27) at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14) at Object.&lt;anonymous&gt; (extensions::binding:318:32) at chrome-extension://gldheanjpgopipommeingjlnoiamdfol/background.js:19:27 at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14) at EventImpl.dispatchToListener (extensions::event_bindings:395:22) at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14) at Event.$Array.forEach.publicClass.(anonymous function) [as dispatchToListener] (extensions::utils:65:26) extensions::event_bindings:383 EventImpl.dispatch_extensions::event_bindings:383 EventImpl.dispatchextensions::event_bindings:401 $Array.forEach.publicClass.(anonymous function)extensions::utils:65 messageListenerextensions::messaging:190 EventImpl.dispatchToListenerextensions::event_bindings:395 $Array.forEach.publicClass.(anonymous function)extensions::utils:65 EventImpl.dispatch_extensions::event_bindings:378 EventImpl.dispatchextensions::event_bindings:401 $Array.forEach.publicClass.(anonymous function)extensions::utils:65 dispatchOnMessageextensions::messaging:304 The actual call that seems to cause this error (line 19 in the ref to background.js in the stack trace) is: port = chrome.runtime.connectNative("com.nmhforbrowserextension"); To give more context, it is invoked from a…
tagged with: chrome-native-messaging
type: AnsweredQuestion
score: 3
downvote count: 0

http://stackoverflow.com/a/27689656
has comment: http://stackoverflow.com/comment/43792564
has body: In my opinion your code is not well formatted, you should show the your full code with your HTML too, also I don't know why you are making an array of question id, if they can be sent to server without looping them with dimensional array of elements. And use IN operator in mysql as you are using json_decode() which returns array or object, so try your query like, $result=mysqli_query($mysqli, "SELECT COUNT(*) FROM answer WHERE question_id IN (".$questionid.") AND optionid IN (".$option.")"); For example, you have questionid as array of html elements then just pass it in ajax like, $('#form').on('submit',function(e){ e.preventDefault(); var data=$(this).serialize(); $.ajax({...});/// using post method return false; }); And in php-mysql query use it like, $sqlQuery = "SELECT COUNT(*) FROM answer WHERE question_id IN (".implode(',',$_POST['questionid'].") ";
answers question: http://stackoverflow.com/q/27689501
has comment: http://stackoverflow.com/comment/43793174
score: 0
has comment: http://stackoverflow.com/comment/43793248
type: Answer
has comment: http://stackoverflow.com/comment/43793220

http://stackoverflow.com/a/27783270
has body: This is happening because when you try to get the position of the element has the new value. One possible solution is to use a local variable: var gap = 6, size = 60; var Circle = function(t, l, color) { var elem = document.createElement('div'); t = t, l = l; elem.setAttribute("class", "circle"); elem.style.backgroundColor = color; elem.style.top = gap + t * (size + 2 * gap) + "px"; elem.style.left = gap + l * (size + 2 * gap) + "px"; document.body.appendChild(elem); this.getPosition = function() { return [t, l]; } this.setPosition = function(arr) { t = arr[0]; l = arr[1]; elem.style.top = gap + t * (size + 2 * gap) + "px"; elem.style.left = gap + l * (size + 2 * gap) + "px"; } } var circle1 = new Circle(0, 0, "blue"); var circle2 = new Circle(0, 1, "red"); // we need the circles to swap positions setTimeout(function() { //use local variables to keep circles position var circle1Pos = circle1.getPosition(); var circle2Pos = circle2.getPosition() circle1.setPosition(circle2Pos); circle2.setPosition(circle1Pos); }, 200); .circle { width: 60px; height: 60px; border-radius: 50px; background-color: red; position: absolute; -webkit-transition-property: top, left; -webkit-transition-duration: 0.3s; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
answers question: http://stackoverflow.com/q/27783169
downvote count: 0
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/a/27717235
accepted answer of: http://stackoverflow.com/q/27717021
answers question: http://stackoverflow.com/q/27717021
score: 0
type: AcceptedAnswer
type: Answer
has body: So based the loop off 5 and the number of items. Not sure the syntax but with JS it would be for ($i=$j=0; $i&lt;=5 &amp;&amp; $i&lt;$x.length ; $i++) {

http://stackoverflow.com/comment/43979911
has text: how can i put jsonData = { values : [ .... in the json file? i cutted from there and pasted in json and the graph doesn't loads !
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27770883

http://stackoverflow.com/q/27665032
tagged with: typescript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43745503
score: 1
has comment: http://stackoverflow.com/comment/43745446
has answer: http://stackoverflow.com/a/27666219
tagged with: knockout.js
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43805092
has body: I’m working with knockout for more than 1 year now, but there is still a problem I cannot resolve. This is more “syntax sugar” problem, than actual problem. The code simples are in TypeScript, but it should be ok, even if you’ve never hear of it. Let me explain. Let’s say we we have an observable array ( MyArray) , where each element has “Value” observable. We want to create a computed observable to get a sum of all. The evident approach is : public SommeOne = ko.pureComputed((): number =&gt; { var res = 0; for (var i = 0; i &lt; this.MyArray().length; i++) { res += this.MyArray()[i].Value(); } return res; }); But in this case, the call to this.MyArray() is evaluated twice on each iteration. And “Value” once. Which is OK for small arrays (less than 1000 elements), but become a problem for bigger arrays. So, so far my solution is : public SommeOne = ko.pureComputed((): number =&gt; { var res = 0; var array = this.MyArray(); for (var i = 0; i &lt; array.length; i++) { res += array[i].Value(); } return res; }); At this point we evaluate Array function only once (Still 1 evaluation for Value, but it’s ok, we need this) and it works fine. So the final question: How can I implement second solution without creating an intermediary “array” ? It is fine for one array, but if you need to do subtraction between two arrays, or something more complex, this is getting out of hand fast.
has comment: http://stackoverflow.com/comment/43746716
favorite count: 0
accepted answer: http://stackoverflow.com/a/27666219
has title: Knockout observables and performances
upvote count: 1

http://stackoverflow.com/comment/43898096
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27743296
type: Comment
has text: @RichardLundWinther One more thing to keep in mind: even if you have jQuery at that time, it won't work as well. Because it's still ahead of your HTML, so when it runs, `#home` is not parsed in DOM at all, the element is not existing yet.

http://stackoverflow.com/a/27712041
has body: You're incorrectly concatenating your JavaScript string with PHP content. Change var col6html = " ---- Select Player --- " . <?php while ($trpRow=mysql_fetch_array($trpResult)) {extract($trpRow); echo ' $lastName, $firstName ' ;}?> . " "; To <?php $options = ""; while ($trpRow=mysql_fetch_array($trpResult)) { extract($trpRow); $options .= " $lastName, $firstName " ; } ?> var col6html = " "+ " ---- Select Player --- " + <?php echo json_encode($options) ?> + " ";
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43838293
type: Answer
has comment: http://stackoverflow.com/comment/43837728
answers question: http://stackoverflow.com/q/27711933
score: 0
accepted answer of: http://stackoverflow.com/q/27711933

http://stackoverflow.com/a/27644797
has body: var myname=document.getElementById("myname").value; var password=document.getElementById("password").value; var male=document.getElementById("male").checked; var female=document.getElementById("female").checked; var flag = true; // text box validation if(myname==""){ alert("please enter name"); flag = false; } else if(password==""){ alert("please enter password"); flag =false; } else if(male==false &amp;&amp; female==false){ alert("please choose gender"); flag = false; } // returning value if(flag){ return true; }else { return false; } JS Fiddle
score: 0
accepted answer of: http://stackoverflow.com/q/27644754
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27644754
type: Answer

http://stackoverflow.com/a/27770087
upvote count: 1
type: AcceptedAnswer
score: 0
downvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/27769929
answers question: http://stackoverflow.com/q/27769929
has comment: http://stackoverflow.com/comment/43951238
has body: You'll most likely need JavaScript to get what you are looking for. I usually like to recommend the jQuery Cycle2 Plugin for these cases, as it's easy to use and very straightforward: http://jquery.malsup.com/cycle2/

http://stackoverflow.com/comment/44503629
comment on: http://stackoverflow.com/q/27705460
score: 0
has text: Hi there. Can you please suggest on this. I feel its not duplicate. So please look into the issue. Any help would be appreciated. Thanks, Arun
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27781605
has comment: http://stackoverflow.com/comment/44489307
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27743312
score: 2
has body: This task does't require recursion, but if you just want some recursion example, here you go: var pageStream = function(page, limit) { if (page &gt; limit) { return Bacon.never(); } else { return Bacon.once(page).concat(pageStream(page + 1, limit)); } } But again I wouldn't recommend this solution as for example for pageStream(1, 5) it generates: Bacon.once(1).concat( Bacon.once(2).concat( Bacon.once(3).concat( Bacon.once(4).concat( Bacon.once(5).concat( Bacon.never()))))); Which will perform badly on large numbers. Instead I would do something like this: var pageStream = function(page, limit) { var arr = []; while (page &lt;= limit) { arr.push(page); page++; } return Bacon.fromArray(arr); } Also if I listen to stream.onEnd, the stream doesn't work at all. This is classic Bacon pitfall with synchronous streams like .fromArray or .once: https://github.com/baconjs/bacon.js/wiki/FAQ#why-isnt-my-subscriber-called To avoid this you can use .sequentially() instead of .fromArray(), and .later() instead of .once(): var pageStream = function(page, limit) { var arr = []; while (page &lt;= limit) { arr.push(page); page++; } return Bacon.sequentially(0, arr); } var pageStream = function(page, limit) { if (page &gt; limit) { return Bacon.never(); } else { return Bacon.later(0, page).concat(pageStream(page + 1, limit)); } }
upvote count: 2
has comment: http://stackoverflow.com/comment/44447343
answers question: http://stackoverflow.com/q/27743312

http://stackoverflow.com/comment/43939398
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27764331
has text: The tilde is a bitwise NOT operator. Here it's used as shorthand for `[6,0].indexOf(day))>-1`. The operator converts the expression to 0 (`falsy`) or a negative value (`truthy`). See also: http://www.javascriptturnsmeon.com/the-tilde-operator-in-javascript/

http://stackoverflow.com/a/27715363
score: 1
has body: you do not need the form most of the other events you are tying to. I just clicked through to the component you are using and they have a clear example on usage. I edited your code so that it minimally works. You should be able to tweak the functionality from here and see what the usage pattern needs to be like. See below Select FOIL Owner Handler: Ronald Thomas Elizabeth FOIL Request Information First name: Last name: Email: Phone: Title: Origin Date: 5 Day Reminder Date: 20 Day Reminder Date: Description: Location: Single Event
accepted answer of: http://stackoverflow.com/q/27714186
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27714186
type: Answer
has comment: http://stackoverflow.com/comment/43859092
downvote count: 0

http://stackoverflow.com/q/27801029
has answer: http://stackoverflow.com/a/27815152
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27815152
has title: Persistence storage JSON in a file using OS.File
upvote count: 2
tagged with: firefox-addon
answer count: 1
downvote count: 0
favorite count: 0
tagged with: firefox-addon-sdk
type: AnsweredQuestion
score: 2
has body: How to do a Persistence storage in firefox addon sdk of JSON in a file using OS.File in OS independent way? Like if I save the file in D:\file in windows, it wont work in linux or even on windows without drive :D. How do I go about doing this?
type: Question
tagged with: firefox

http://stackoverflow.com/a/27762203
has comment: http://stackoverflow.com/comment/44184241
has comment: http://stackoverflow.com/comment/43968388
has body: Please note that; input: don't have which property and triggered after keypress. Namely you can bind unbind input event inside keypress event. Also input event don't triggered on Enter. Namely e.which==13 not requred to validate. keypress event not triggered when backspace, if you don't need check value when backspace, there is no problem. keydown and keyup events triggered for each key you can use them with eachother You can try something like this. .directive('cstInput', function() { return { restrict: 'A', require: '^ngModel', link: function (scope, element, attrs, ngModel) { element.on('keypress', function(event) { if (event.which === 13) { return; } // check key how you want //attach input event element.on('input', function(evt) { scope.$apply(function(){ scope.ngModel = element.val(); scope.$eval(attrs.cstInput, {'answer': scope.ngModel}); }); //deatach event again element.off('input') }); }); //Alternatively using keydown with same way element.on('keydown', function(event) { if (event.which === 13) { return; } // check key how you want //attach input event element.on('input', function(evt) { scope.$apply(function(){ scope.ngModel = element.val(); scope.$eval(attrs.cstInput, {'answer': scope.ngModel}); }); //deatach event again element.off('input') }); }); } }; })
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/44138939
score: 3
has comment: http://stackoverflow.com/comment/43965540
has comment: http://stackoverflow.com/comment/43969491
accepted answer of: http://stackoverflow.com/q/27760375
answers question: http://stackoverflow.com/q/27760375
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/42194995
score: 1
downvote count: 0
type: Answer
has body: TLDR; You cannot. I'm sorry. More tests: It's on application (browser) level. When you drag to Safari any kind of files in any webapp with dropdown ability, even iCloud, you will have same result as you show. On Chrome you will have diferent results. Counter will show you last result. Ex. when you drag files directly from dictionary, you will got counter of two, but when you drag on safari and then move cursor on chrome you will got zero. You must change Safari code to fix that ;)
upvote count: 1
answers question: http://stackoverflow.com/q/27797760

http://stackoverflow.com/comment/43773871
type: AnswerComment
has text: thanks but why is the barebone jsfiddle shows up fine?
type: Comment
comment on: http://stackoverflow.com/a/27679643
score: 0

http://stackoverflow.com/q/27783269
tagged with: internet-explorer-8
has body: Angular 1.3 introduced a new debugInfoEnabled() method that can provide a boost in performance if called with false in the application config function: myApp.config(['$compileProvider', function ($compileProvider) { $compileProvider.debugInfoEnabled(false); }]); Also, Angular 1.3 dropped IE8 support. And this is a problem for me, my application have to run on IE8. Hence, I cannot upgrade to angular 1.3 and have to live with 1.2. Is there a way to achieve the same functionality with angular 1.2? In particular, at least a part of what debugInfoEnabled() does: prevent creation of ng-scope/ng-isolated-scope CSS classes while creating new scopes do not attach binding data and ng-class CSS class to elements with ngBind, ngBindHtml or {{...}} interpolations As one possible option, I can fork the angularjs repository and backport the feature back to 1.2. Then, use the fork maintaining updates from the upstream. Would appreciate any pointers.
upvote count: 11
has answer: http://stackoverflow.com/a/27952008
has comment: http://stackoverflow.com/comment/44298688
type: Question
tagged with: debugging
answer count: 2
has comment: http://stackoverflow.com/comment/44298582
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28003778
accepted answer: http://stackoverflow.com/a/28003778
has title: debugInfoEnabled for Angular 1.2
has comment: http://stackoverflow.com/comment/44487831
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44298297
downvote count: 0
tagged with: backport
has comment: http://stackoverflow.com/comment/44487806
possible better answer: http://stackoverflow.com/a/27952008
score: 11
type: AnsweredQuestion

http://stackoverflow.com/comment/43833329
has text: @prospector Also, it appears to pass validation client-side. Once it gets to the server, it fails. The page loads again, but without the values changed via JS (textboxes are empty). The page has `EnableViewState='true'`.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27710094

http://stackoverflow.com/comment/43725498
has text: Because this answer is working better than what OP introduced _only_ on files having trailing `xls*` as not extension.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27654473

http://stackoverflow.com/a/27657969
has body: The documentation suggests you should use $('.textareaclass').cleditor(). Note the parentheses.
type: Answer
has comment: http://stackoverflow.com/comment/43732020
answers question: http://stackoverflow.com/q/27657904
score: 0

http://stackoverflow.com/a/27740010
has comment: http://stackoverflow.com/comment/43929583
downvote count: 1
score: 1
upvote count: 2
answers question: http://stackoverflow.com/q/27739811
has body: I've found a code here: http://terminal.jcubic.pl/examples.php#json_rpc_demo Demo is here: http://terminal.jcubic.pl/rpc-demo.html
type: Answer

http://stackoverflow.com/a/27702980
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27702947
score: 1
downvote count: 0
has body: You can use toFixed. The toFixed() method converts a number into a string, keeping a specified number of decimals. var num = 3333.333333333 var n = num.toFixed(2);

http://stackoverflow.com/comment/44004849
type: AnswerComment
comment on: http://stackoverflow.com/a/27786436
score: 0
type: Comment
has text: service should not be called directly from UI..it should use controller scope.

http://stackoverflow.com/comment/43741959
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27662406
has text: I don't see where you are even trying to use the returned promise.
score: 0

http://stackoverflow.com/comment/43850337
type: Comment
type: QuestionComment
has text: May be, it was a mistake :)
score: 0
comment on: http://stackoverflow.com/q/27719358

http://stackoverflow.com/comment/43811023
has text: If it's moving too fast, increase 2500 to something like 5000 (5 seconds).
type: Comment
comment on: http://stackoverflow.com/q/27699021
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43846023
type: Comment
type: QuestionComment
has text: In [this question](http://stackoverflow.com/questions/14689252/how-can-superagent-and-nock-work-together) it returns an Object.
score: 0
comment on: http://stackoverflow.com/q/27716667

http://stackoverflow.com/comment/43770262
type: Comment
comment on: http://stackoverflow.com/a/27648799
has text: If you use iron-router then you should make publish in waitOn function(in old API) or this.subscribe('name').wait() in new API. Or instead of data.themes.fetch() use WPThemes.find() - its reactive so at first you'll see blank page but after publication is done your page will fill up with needed data
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43953875
score: 0
type: Comment
type: QuestionComment
has text: Still probably viable. A CSS-only example of the current JSBin behavior: http://jsbin.com/tayepakuqo/1/edit?html,css,js,output
comment on: http://stackoverflow.com/q/27726725

http://stackoverflow.com/comment/43941591
has text: then use the same function for the callback and check the data inside it
comment on: http://stackoverflow.com/a/27758553
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27752911
score: 1
answers question: http://stackoverflow.com/q/27745685
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27745685
downvote count: 0
type: Answer
has body: Before form submission save one side items values in an hidden input element. (comma separated values of listbox items.) The value of hidden element is sent to server by submitting the form. In controller you can do the next things.
upvote count: 1

http://stackoverflow.com/comment/43773955
type: QuestionComment
comment on: http://stackoverflow.com/q/27679534
has text: Of course; the bitwise representation of floating-point values in JavaScript includes two values for zero, one with the sign bit set and one without. The question however is about performing comparisons in JavaScript.
score: 0
type: Comment

http://stackoverflow.com/comment/43953552
has text: @adeneo no, that doesn'T work.. it calls /.jason_encode($url)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27771190

http://stackoverflow.com/comment/43963384
comment on: http://stackoverflow.com/a/27776269
has text: I edited my question to better represent what I'm asking, thank you meskobalazs
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43828873
comment on: http://stackoverflow.com/a/27708533
score: 0
type: Comment
has text: OP's code is on **1000** which offset **100** with "+=220px", so given it time it's offset from the div
type: AnswerComment

http://stackoverflow.com/comment/44006245
type: QuestionComment
has text: @Deadpool if you already have userAuth and you know which staffer is allowed to view which staffers images, then you just need to tie these systems together instead of trying to create something on the clientside
comment on: http://stackoverflow.com/q/27798248
score: 0
type: Comment

http://stackoverflow.com/q/27718034
has title: Message is not showing in Chrome and IE while it is working in Firefox
has comment: http://stackoverflow.com/comment/43849903
type: Question
score: -1
tagged with: google-chrome
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43848942
tagged with: asp.net-mvc
upvote count: 0
has answer: http://stackoverflow.com/a/27718096
has comment: http://stackoverflow.com/comment/43848122
tagged with: firefox
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has body: This Div message is getting changed and being showing in Firefox, but it is not showing in chrome. This is the HTML: &lt;div style="position: relative; color: Green" id="divMessage"&gt; &lt;input type="button" value="value" class="abc" id="btnClick" name="Submit" /&gt; Javascript: var strMessageEmpty = ""; var strMessageSavingInProgress = "Saving Data. Please wait..."; var strMessageDone = "Module Calculation has been done...!"; $("#btnClick").click(function() { $("#divMessage").val(strMessageEmpty); $("#divMessage").html(strMessageSavingInProgress); // SAVE DATA $.ajax({ type: 'post', // contentType: 'application/json', async: false, cache: false, url: '/Controller/Action', // dataType: 'json', data: { Period: $('#ddlPeriod').val() }, success: function(data) { $("#divMessage").html(strMessageSavingInProgress); key = data; }, error: function(err) {} $("#divMessage").val(strMessageEmpty); });
favorite count: 0

http://stackoverflow.com/q/27783057
possible better answer: http://stackoverflow.com/a/27783149
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27783172
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27783172
has body: I have a pretty weird issue going on with my site right now. I have a "send this product to a friend" popup window that comes up on my product pages. This window is a popup, but has it's on seperate html page that is called and put into the pop up, as seen here: Here is the link that the user would click to trigger the popup: &lt;li&gt;&lt;a class="email-friend" rel="nofollow"&gt;&lt;/a&gt;&lt;/li&gt; And here is the jquery to get the popup to show: &lt;script&gt; jQuery(document).ready(function(){ jQuery('.email-friend-popup').jqm(); jQuery('a.email-friend').click(function(){ jQuery.ajax("/catalog/send.html?productId=&lt;?= $product-&gt;entity_id; ?&gt;", { data: {}, success: function(data, status, xhr){ setTimeout(function(){ jQuery('.email-friend-popup').html(data); }, 1000); //jQuery('#jqmHide').click(function(){ jQuery('#jqmWindow').jqmHide(); }); } }); jQuery('.email-friend-popup').html('&lt;img src="/media/island/loading.gif" /&gt;').jqmShow(); return false; }); }); &lt;/script&gt; When Google crawls my page, it creates a link like this: /catalog/send.html?product=3791. And with a couple hundred products on our site, it's causing quite an SEO issue. As you can see, I've added rel="nofollow" to the a tag but that doesn't seem to be resolving the issue since the pages still exist. Does anyone know about this issue or have a solution that may resolve it? You can see the popup working here: http://www.islandcompany.com/catalog/mens-resort-wear/classic-shirts/bimini-striped-linen-shirt.html And here is the page that is being created as a result of this bug: http://www.islandcompany.com/catalog/send.html?product=7871
type: Question
has answer: http://stackoverflow.com/a/27783149
answer count: 2
tagged with: javascript
has title: Prevent Google from creating pages from links on my site
tagged with: jquery

http://stackoverflow.com/q/27763590
has comment: http://stackoverflow.com/comment/72379146
downvote count: 0
answer count: 1
tagged with: javascript
duplicate of: http://stackoverflow.com/q/10115372
favorite count: 0
has body: I recently come across "strict mode" in JavaScript. I know that strict mode is very important to get programmer coding JavaScript in proper way. My question is, does removing "strict mode" when putting the script up online will bring better "stability"? Is it the good practice to do so? Also, does "strict mode" help to improve performance of your web app?
type: UnansweredQuestion
type: Question
linked to: http://stackoverflow.com/q/10115372
upvote count: 5
has answer: http://stackoverflow.com/a/27763615
has title: Javascript's "strict mode" in production
has comment: http://stackoverflow.com/comment/43938955
score: 5

http://stackoverflow.com/a/27737269
type: Answer
has body: you can do that: 4.6 Inches and function linker () { correct(); var url = window.location.href.lastIndexOf('aref=')+5; url = window.location.href.substr(url); url = decodeURIComponent(url); window.open(url, '_self'); }
answers question: http://stackoverflow.com/q/27737197
score: 0

http://stackoverflow.com/comment/43816072
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27701677
has text: Yeah, but its not exactly an array but a [`NodeList`](https://developer.mozilla.org/en-US/docs/Web/API/NodeList). It acts like an array but has some differences (see the link).
type: AnswerComment

http://stackoverflow.com/comment/43763820
comment on: http://stackoverflow.com/q/27674425
has text: @lucasem nope it should not be
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27793216
score: 0
has comment: http://stackoverflow.com/comment/43996012
has body: Do not use regex for this: use hostname: The URLUtils.hostname property is a DOMString containing the domain of the URL. var x = new URL("http://www.blog.domain.com/page/category=?").hostname; console.log(x); as pointed by vishwanath, URL faces compatibilty issues with IE&lt;10 so for those cases, regex will be needed. use this : var str = "http://www.blog.domain.com/page/category=?"; var res = str.match(/[^.]*.(com|net|org|info|coop|int|co\.uk|org\.uk|ac\.uk|uk)/g); console.log(res); =&gt; domain.com the list in the regex can be expanded further depending upon your need. a list of TLDs can be found here
has comment: http://stackoverflow.com/comment/43996240
has comment: http://stackoverflow.com/comment/43996208
type: Answer
answers question: http://stackoverflow.com/q/27793115
has comment: http://stackoverflow.com/comment/43995792

http://stackoverflow.com/comment/43950373
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27769706
has text: And I can't imagine why you'd expect separate ` ` elements to appear when all you're doing is converting the JavaScript object into JSON and adding them to the single ` `. Your output is exactly in line with the code you wrote. JSON serialization isn't some magic that creates whatever structure you're thinking of. It creates JSON.
score: 3

http://stackoverflow.com/a/27775474
type: Answer
has comment: http://stackoverflow.com/comment/43994804
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27775323
has body: Try grunt uglify. https://github.com/gruntjs/grunt-contrib-uglify Here's a good tutorial as well https://egghead.io/lessons/grunt-minifying-your-output-with-grunt-uglify
downvote count: 0

http://stackoverflow.com/q/27673394
tagged with: tabs
upvote count: 1
has answer: http://stackoverflow.com/a/27673483
type: AnsweredQuestion
has title: Multiple Tabs Issue
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/27673483
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have the following fiddle: http://jsfiddle.net/7bt4f8zk/ Basically, I'm trying to have multiple tabs working, and for the most part, they are. However, for some reason, when clicking on a new tab on the second one (for example), it replicates the content in the first, even though it should only work on the second. My jQuery looks like: $(document).ready(function() { $(".tabs-menu a").click(function(event) { event.preventDefault(); $(this).parent().addClass("current"); $(this).parent().siblings().removeClass("current"); var tab = $(this).data("tab"); $(".tab-content").not(tab).css("display", "none"); $(tab).fadeIn(); }); });
tagged with: http://stackoverflow.com/tag/html
favorite count: 0

http://stackoverflow.com/a/27703141
has comment: http://stackoverflow.com/comment/43818696
has body: No, it's not possible, but your case can be written like: var x = new function(){ this.a = 1; this.b = { c: 2, d: this.a } };
score: 0
has comment: http://stackoverflow.com/comment/43818588
type: Answer
answers question: http://stackoverflow.com/q/27703029

http://stackoverflow.com/a/27660613
score: 1
has body: "or here" is your answer, just refactor your code to prevent running your DOM for sizes when it's not needed: jsFiddle demo $(document).ready(function() { var $div = $('#test'), x, y; function getSizes(){ x = $(document).width() - $div.width(); y = $(document).height() - $div.height(); } function loop_pos(){ $div.css({ // or use `.animate` instead of `.css` left: ~~(Math.random() * x), top: ~~(Math.random() * y) }); } getSizes(); // Get them immediately $("window").on("resize", getSizes); // Update values on Win. resize setInterval(loop_pos, 1000); });
upvote count: 1
answers question: http://stackoverflow.com/q/27660478
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43891127
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27739811
has text: @Abbey: please be advised that it is a _horrible_, outright ***dangerous*** idea to grant shell access via this method. Basically you lever out any security measures of which the vast majority aimed at remote logins and tend to have a `localhost` exception. This allows brute force attacks to be commenced, which wouldn't even be logged in most default OS configurations. To grant access, you should always use ssh, and only if absolutely necessary and only in a system hardened by a security specialist.

http://stackoverflow.com/q/27694465
has comment: http://stackoverflow.com/comment/43802264
answer count: 1
downvote count: 0
tagged with: web
favorite count: 0
has title: Google Plus Sign-In button rendered but not working
upvote count: 2
tagged with: google-api
type: UnansweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/43802396
type: Question
has body: I'm trying to get comfortable with the Google APIs. To study the sign-in process, I built a simple web page to get the sign-in button working according to https://developers.google.com/+/web/signin/add-button and the button is rendered properly. However, it is not active - it doesn't react to clicks, there's also no error in the browser console. I do not run the page from a web server, I'm opening it directly from disk. I.e. the URL is something like file:///c:/projects/GooglePlusClientJS/google_plus_js.html. The page code: GooglePlus Test What am I doing wrong? Is it caused by opening it directly from disk? If so, why? Thanks. EDIT 1: When running off of a web server, the page seems to work fine, the logon dialog is being displayed. Can anyone shed a light on why this happens?
has answer: http://stackoverflow.com/a/33443434
tagged with: javascript

http://stackoverflow.com/comment/43768837
type: AnswerComment
has text: Hi. Thanks for answering my question. 1.However, I still dont get the image.arguments.length and image.arguments. 2. What is the very first function call? (preloadImages?) 3. After you create that image Array. What is exactly in the array? Image? or Link? If image, how to use it?
comment on: http://stackoverflow.com/a/27677228
score: 0
type: Comment

http://stackoverflow.com/q/27777123
has comment: http://stackoverflow.com/comment/43964779
score: 3
answer count: 0
upvote count: 3
has title: Position Bootstrap typeahead menu
type: Question
tagged with: javascript
tagged with: jquery
tagged with: bootstrap-typeahead
tagged with: typeahead.js
has comment: http://stackoverflow.com/comment/43964841
has comment: http://stackoverflow.com/comment/43964759
downvote count: 0
favorite count: 0
has body: I have a modal window, which is opened from the main window. Now this modal dialog has a textbox (kind of auto-suggest) and the user gets list of suggestions as he types. I am using the Bootstrap typeahead for the same. So I use typeTimeout = setTimeout(function(){ var _input = me.$element, _offset = _input.offset(); _menu.css({ position: "fixed", height: "auto", overflow: "visible", left: _offset.left, top: _offset.top + _input.outerHeight(), "z-index": 999999 }); }, 5); Now my question is if the modal is called without scrolling on the main window, the list of suggestions appear in the correct position (i.e. just below the textbox) However, lets say I scroll vertically down and then call the modal dialog, in that case, my suggestions does not appear in the correct position vertically (they move down). How do I fix this issue? I have tried changing position from fixed to absolute, but this does not help, since my parent for the suggestions is relative div.
tagged with: twitter-bootstrap
type: UnansweredQuestion

http://stackoverflow.com/a/27795611
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27793743
score: 1
upvote count: 1
has body: it's doable in both js and css. and as for the falling book / physics, try physi.js

google-visualization
tags question: http://stackoverflow.com/q/27730697
tags question: http://stackoverflow.com/q/27795054
type: Tag
tags question: http://stackoverflow.com/q/27715261
tag name: google-visualization
tags question: http://stackoverflow.com/q/27775448
tags question: http://stackoverflow.com/q/27771631
tags question: http://stackoverflow.com/q/27802921
tags question: http://stackoverflow.com/q/27760953
tags question: http://stackoverflow.com/q/27800088

http://stackoverflow.com/q/27708889
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27709078
type: Question
has comment: http://stackoverflow.com/comment/43830220
has comment: http://stackoverflow.com/comment/43829821
score: 0
accepted answer: http://stackoverflow.com/a/27709078
answer count: 1
tagged with: javascript
has title: JS Date comparison CET with GMT
has body: I don't understand... I have the following code: console.log(stats.mtime); // Tue Dec 30 2014 17:03:48 GMT+0100 (CET) console.log(s3Info.LastModified); // Tue, 30 Dec 2014 15:46:37 GMT console.log(stats.mtime == s3Info.LastModified); // false console.log(stats.mtime &gt; s3Info.LastModified); // false console.log(stats.mtime &lt; s3Info.LastModified); // false How can I compare those dates? I tried to convert to timestamps but it won't work. I get a TypeError: Object Tue, 30 Dec 2014 15:46:37 GMT has no method 'getTime' error. Using nodejs but (hopefully) the answer would be similar clientside. Thanks
tagged with: node.js

http://stackoverflow.com/comment/43796847
type: AnswerComment
comment on: http://stackoverflow.com/a/27691080
score: 0
type: Comment
has text: Are you using document ready? Take a look at this Q&A about cookies http://stackoverflow.com/questions/1458724/how-to-set-unset-cookie-with-jquery

http://stackoverflow.com/comment/43824825
type: Comment
comment on: http://stackoverflow.com/a/27706447
score: 0
type: AnswerComment
has text: Thank you for your suggestion. I have assigned the two ID seperatetly, my problem is in assigning the submit event that would call the upload function as well as store the two text input fields as well.

polymer
tags question: http://stackoverflow.com/q/27749460
tags question: http://stackoverflow.com/q/27648328
tags question: http://stackoverflow.com/q/27669224
tags question: http://stackoverflow.com/q/27748931
tags question: http://stackoverflow.com/q/27669347
tag name: polymer
tags question: http://stackoverflow.com/q/27641485
tags question: http://stackoverflow.com/q/27642788
tags question: http://stackoverflow.com/q/27728499
tags question: http://stackoverflow.com/q/27644154
tags question: http://stackoverflow.com/q/27668037
tags question: http://stackoverflow.com/q/27780723
tags question: http://stackoverflow.com/q/27682028
tags question: http://stackoverflow.com/q/27736314
tags question: http://stackoverflow.com/q/27715090
tags question: http://stackoverflow.com/q/27758908
tags question: http://stackoverflow.com/q/27671567
tags question: http://stackoverflow.com/q/27766349
tags question: http://stackoverflow.com/q/27702274
tags question: http://stackoverflow.com/q/27698448
tags question: http://stackoverflow.com/q/27725062
tags question: http://stackoverflow.com/q/27664437
tags question: http://stackoverflow.com/q/27693189
tags question: http://stackoverflow.com/q/27769385
tags question: http://stackoverflow.com/q/27751373
tags question: http://stackoverflow.com/q/27741436
tags question: http://stackoverflow.com/q/27679394
type: Tag
tags question: http://stackoverflow.com/q/27747975

http://stackoverflow.com/comment/43766877
score: 2
comment on: http://stackoverflow.com/q/27676151
has text: HTTP wasn't built for that. When a client requests a resource, it expects at most one resource back. If you want to send multiple resources, trigger multiple requests.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27716081
type: Question
accepted answer: http://stackoverflow.com/a/27716925
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43845782
tagged with: javascript
tagged with: jquery
has title: Display a different div based on the combination of two different options
tagged with: http://stackoverflow.com/tag/html
has body: OK, so I am trying to display a different iFrame (in a div) based on the selection of two different options. The first option is BOYS or GIRLS, and the second option is GRADE LEVEL. With 1st-12th, that would be 24 total divs. Upon load, I'd want the BOYS option and 12th Grade option chosen and the corresponding div displaying that particular iframe. The following code is merely my attempt to display how I want the sidebar of choices to look. Functionally, I'm not sure if much of it applies. Thank you for any help you're willing and able to provide. I've been searching a few hours a day over the past few days with no luck. BOYS GIRLS 12th Grade 11th Grade 10th Grade 9th Grade 8th Grade 7th Grade 6th Grade 5th Grade 4th Grade 3rd Grade 2nd Grade 1st Grade 7 Year Olds 6 Year Olds 5 Year Olds 4 Year Olds
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27716925
tagged with: iframe
has comment: http://stackoverflow.com/comment/43844397

http://stackoverflow.com/q/27803340
upvote count: 1
has comment: http://stackoverflow.com/comment/44015649
has comment: http://stackoverflow.com/comment/44016320
has answer: http://stackoverflow.com/a/27803446
has body: I'm fairly new to the AngularJS framework, but basically what I am trying to do is inject a CSRF token into my app, but I want to change the url based on a config. Here is what I have so far: var VERISION_API = 'v1'; var config_data = { 'CFG': { 'EP': 'https://mydomain.com/api/' + VERISION_API + '/web/' } }; var configMod = angular.module("cfg",[]); angular.forEach(config_data,function(key,value) { configMod.constant(value,key); }); var myApp = angular.module("app", ["cfg", "ngResource", "ngRoute"]); (function () { var $injector = angular.injector(['ng']); $injector.invoke(['cfg', '$http', '$rootScope', function (cfg, $http, $rootScope) { $rootScope.$apply(function (CFG) { $http.get(CFG.EP + "accounts/csrf").then(function (response) { myApp.constant("CSRF_TOKEN", response.csrf_token); angular.bootstrap(document, ['app']); }); }); }]); })(); I keep getting the following error: Uncaught Error: [$injector:unpr] Unknown provider: cfgProvider &lt;- cfg I know it has something to do with the way that I am running the $injector.invoke, but I have tried everything. Hopefully someone could help me out and tell me what I am doing wrong?
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/44016141
tagged with: javascript
score: 1
has title: AngularJS configuration module not being found
favorite count: 0
accepted answer: http://stackoverflow.com/a/27803446
tagged with: angularjs
type: Question
possible better answer: http://stackoverflow.com/a/27803423
has answer: http://stackoverflow.com/a/27803423
has comment: http://stackoverflow.com/comment/44016233
answer count: 2

http://stackoverflow.com/comment/43726297
type: QuestionComment
comment on: http://stackoverflow.com/q/27653441
score: 0
has text: ? What exactly re you trying to accomplish? You are obviously not doing it the best way with Drupal. Tell us what exactly what you want, then we maybe can help you,
type: Comment

http://stackoverflow.com/comment/44003925
has text: @RobG I don't think that's correct if supplied inline - only as written in JS code. AFAIK, anything supplied inline gets wrapped in an anonymous function wrapper, so the effect would be as if writing `function() { centerNumber; }`
type: Comment
comment on: http://stackoverflow.com/a/27797621
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43906332
score: 0
has text: Your question is very broad, please expand on what you're asking.
type: QuestionComment
comment on: http://stackoverflow.com/q/27747603
type: Comment

http://stackoverflow.com/q/27700306
tagged with: javascript
has comment: http://stackoverflow.com/comment/43813892
has comment: http://stackoverflow.com/comment/43814105
has comment: http://stackoverflow.com/comment/43813735
has comment: http://stackoverflow.com/comment/43814416
has comment: http://stackoverflow.com/comment/43813803
answer count: 1
has comment: http://stackoverflow.com/comment/43813751
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43814248
type: UnansweredQuestion
tagged with: session-timeout
has comment: http://stackoverflow.com/comment/43817489
has body: I am using a js file which gives me a popup before the user session is about to end. I am using this file in 2 ways 1) In web forms application - It is working just fine. Following is the code for it. I am following this link &lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head id="Head1" runat="server"&gt; &lt;title&gt;Session Time Out Warning Message&lt;/title&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;script src="Script/timeout-dialog.js" type="text/javascript"&gt;&lt;/script&gt; &lt;link href="css/timeout-dialog.css" rel="stylesheet" type="text/css" /&gt; &lt;script type="text/javascript" language="javascript"&gt; function Timer(time) { setTimeout(TimeOut, time); } function TimeOut() { alert(window.location.pathname); $.timeoutDialog({ timeout: 0.15, countdown: 60, keep_alive_url: window.location.pathname, logout_redirect_url: '/AutoSessionTimeOut/SessionTime.aspx', restart_on_yes: true }); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:Label ID="lblMsg" runat="server" Text=""&gt;&lt;/asp:Label&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; cs code : if (!IsPostBack) { int _displayTimeInMiliSec = (Session.Timeout - 1) * 60000; if (Session["ID"] == null) { Session["ID"] = "New Session"; lblMsg.Text = Convert.ToString(Session["ID"]); } else lblMsg.Text = "Old Session"; ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "message", "&lt;script type=\"text/javascript\" language=\"javascript\"&gt;Timer('" + _displayTimeInMiliSec + "');&lt;/script&gt;", false); } 2) I am using it…
has comment: http://stackoverflow.com/comment/43813764
has comment: http://stackoverflow.com/comment/43814288
linked to: http://stackoverflow.com/q/17733509
has comment: http://stackoverflow.com/comment/43813781
has title: Not able to call js file function
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43813772
has answer: http://stackoverflow.com/a/27700390
has comment: http://stackoverflow.com/comment/43814392
tagged with: asp.net-mvc
downvote count: 0

http://stackoverflow.com/comment/43949721
score: 0
has text: wow, could have sworn I had tried that but I guess not. Thanks! :)
comment on: http://stackoverflow.com/a/27769436
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27773322
has answer: http://stackoverflow.com/a/27776983
score: 0
has title: AngularJS - ng-grid - Date Column issue
has answer: http://stackoverflow.com/a/27773903
answer count: 3
has answer: http://stackoverflow.com/a/27774455
has body: UPDATED DEMO I am using Angular ui-grid http://ui-grid.info/. There is one column Date of Birth which needs DatePicker when in edit mode. When i click on the column it shows me Date Picker but the selected date value doesn't get selected in Date picker. Also also Date Picker doesn't get removed after edition is complete. columnDefs: [ { field: 'name' }, { field: 'dob', cellFilter: 'date', enableCellEdit: true, editableCellTemplate: '&lt;input type="date" /&gt;' } Thanks
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
tagged with: ng-grid
linked to: http://stackoverflow.com/q/20983948
has comment: http://stackoverflow.com/comment/43957751
tagged with: datepicker
has comment: http://stackoverflow.com/comment/43958492
tagged with: angularjs
type: Question

http://stackoverflow.com/comment/43853794
type: AnswerComment
has text: I see. Now I am just curious what kind of other situations would cause this kind of a behaviour :) Thanks for the comprehensive answer though.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27721001

http://stackoverflow.com/comment/43853379
has text: Why don't you make a 20*20px image and use that one, instead of this? Like [this one](http://jsfiddle.net/k92hc4Lv/2/).
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27720750

http://stackoverflow.com/a/27690357
has comment: http://stackoverflow.com/comment/70582427
answers question: http://stackoverflow.com/q/27656887
has comment: http://stackoverflow.com/comment/88687653
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/108415485
has comment: http://stackoverflow.com/comment/88657406
upvote count: 9
has body: To work with Ranges we need to keep in mind that we are working with Nodes, not only the text that is rendered. The structure you want to manipulate is: <-- Element Node "some text" <-- TextNode But it also could be: <-- Element Node "some text" <-- TextNode "more text" <-- TextNode "" <-- TextNode To solve your problem is simplier to handle only one TextNode, I propose to use the normalize() function to join all of them into a single one. Then you only need to set the Range to the word's bounds before deleteContents(). Once deleted, you can insert a new TextNode with the substitution using insertNode(). var wordStart = range.toString().lastIndexOf(lastWord); var wordEnd = wordStart + lastWord.length; /* containerEl.firstChild refers to the div's TextNode */ range.setStart(containerEl.firstChild, wordStart); range.setEnd(containerEl.firstChild, wordEnd); range.deleteContents(); range.insertNode(document.createTextNode(resultValue)); For this to work, you need that the text is in a single TextNode. But after ìnsertNode the div will contain multiple text nodes. To fix this simply call normalize() to join all TextNode elements. containerEl.normalize(); Edit: As Basj points out, the original solution fails for multiline. That's because when hitting ENTER the structure changes from: <-- Element Node "some text" <-- TextNode to something like: <-- Element Node "some text" "more text" I've updated this answer, but it's also worth to read Basj's answer at this question: Replace word before cursor, when multiple lines in contenteditable JSFiddle demo or runnable code snippet: document.getElementById('divTest').onkeyup = function (e) { if (e.keyCode == 32) { getWordPrecedingCaret(this); } }; function getWordPrecedingCaret(containerEl) { var preceding = "", sel, range, precedingRange; if (window.getSelection) { sel = window.getSelection(); if (sel.rangeCount > 0) { range = sel.getRangeAt(0).cloneRange(); range.collapse(true); range.setStart(containerEl, 0); preceding = range.t…
type: Answer
score: 9
accepted answer of: http://stackoverflow.com/q/27656887

http://stackoverflow.com/q/27643242
linked to: http://stackoverflow.com/q/4616202
has answer: http://stackoverflow.com/a/27643274
has answer: http://stackoverflow.com/a/27643529
linked to: http://stackoverflow.com/q/2787245
duplicate of: http://stackoverflow.com/q/4616202
type: Question
has comment: http://stackoverflow.com/comment/43705429
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/43705180
accepted answer: http://stackoverflow.com/a/27643274
score: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43705164
has comment: http://stackoverflow.com/comment/43705070
upvote count: 1
downvote count: 1
has body: Is there a way of accomplishing {foo: parseFloat("5.5"), bar: foo + 5} without having to define the value of foo before evaluating the object literal? EDIT: Sorry that I didn't make that more clear, but I wanted to define foo in-place and then reference it's value from within bars value definition.
has title: javascript object literal with in-place value definition
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27643529

http://stackoverflow.com/a/28589346
answers question: http://stackoverflow.com/q/27757498
accepted answer of: http://stackoverflow.com/q/27757498
type: AcceptedAnswer
has body: To close this question finally I'd like to share my solution with you. Maybe it is helpful for someone else in the future: The PrimeFaces component p:calendar provides a setDate function in the client side API. So the final solution that I am using now reads like this &lt;p:calendar widgetVar="calendar_widget_name" /&gt; &lt;p:commandButton type="button" onclick="PF('calendar_widget_name').setDate(new Date(#{bean[date].time}));" /&gt;
type: Answer
score: 0

http://stackoverflow.com/a/27715541
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27710563
answers question: http://stackoverflow.com/q/27710563
type: Answer
has body: When you use push state, pages are served from the back end, which means that you have to define a corresponding route in your back end that corresponds to a front end route. If the back end doesn't find the requested route, then it will deliver a 404 message, because it won't know what to serve. In your case, the episodes view gets triggered at the front end level, but the browser doesn't have a DOM to render the view when the page gets refreshed because nothing was served. By default, the route http://backbone:8888/ will serve the index file because this is how the webserver is configured. I'm not sure what back end technology you are using, but for serving a file from http://backbone:8888/episodes, just make sure that your back end has a router set up that serves the requested route and it should work.
score: 1

http://stackoverflow.com/comment/43745386
type: AnswerComment
type: Comment
has text: These are good corrections, but they did not solve my issue. Still getting exact same error.
comment on: http://stackoverflow.com/a/27664266
score: 0

http://stackoverflow.com/q/27768782
has body: im having a strange problem. i just did a fresh installation of Opencart on my server and for some reason none of the jquery functions work.. sliders, popups and even the add to cart button or even a simple alert box dont work (i created a button with the ID test) $( "#test" ).click(function() { alert( "clicked" ); }); Below is how the theme files are loaded checked all the files and they are place correctly. no missing files. All are freshly uploaded. i even changed to the default theme which hasnt been touched, but still same. when i even click on add to cart or any other button it doesnt work i tried accessing the site with and without www , still it doesnt work the main problem is it does not show any error though the console or firebug which makes it hard to debug. can someone tell me what might be causing this?
has answer: http://stackoverflow.com/a/27769024
tagged with: javascript
tagged with: jquery
tagged with: opencart
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43948847
has answer: http://stackoverflow.com/a/27769771
has comment: http://stackoverflow.com/comment/43948284
has title: none of the jquery functions work even the correct files are loaded
has comment: http://stackoverflow.com/comment/43948660
has comment: http://stackoverflow.com/comment/43948288
type: Question
has comment: http://stackoverflow.com/comment/43948272
answer count: 2
has comment: http://stackoverflow.com/comment/43948890

http://stackoverflow.com/q/27698764
linked to: http://stackoverflow.com/q/14220321
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has title: Access Ajax response using deferred response
duplicate of: http://stackoverflow.com/q/14220321
tagged with: php
score: 2
answer count: 0
has body: Code: function getEcoScore(geometry, dataType){ return $.ajax({ type:'POST', data: {geometry:geometry, attType:dataType}, dataType:'text', url: 'php/eco_query.php' }); } function test(){ var x = getEcoScore(geoJsongeom,"wetlands").done(); console.log(x.responseText); } I want to store the result of this request and run a few other requests on different tables, then process the results into an HTML format to form a pop up/dialog box. When I run this code with just console.log(x), I get and object with the responseText, however, then I try to access the responseText it comes up as undefined. I have tried processing the response in done(function(data){...code...}); but still all i get is an object for x. Is there a particular function for accessing the responseText? I have used a callback function to assign the response to a global variable &amp; that remains undefined. The main issue is why I cannot access the responseText variable of the response.
has comment: http://stackoverflow.com/comment/43810684
type: Question
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/43810759
downvote count: 0

http://stackoverflow.com/q/27715142
score: 0
has body: I have multiple elements that I want to define a function for (switch-case style)...something like this: $("#s1, #s2").hover({param: *specific selector name*}, switchFunc); function switchFunc(event) { switch (event) { case "#s1": do something; break; case "#s2": do something else; break; } } Can I do this somehow?
has answer: http://stackoverflow.com/a/27715274
tagged with: parameters
type: AnsweredQuestion
type: Question
has title: Can I define a function that takes a variable parameters based on which selector is active?
tagged with: jquery-selectors
tagged with: function
answer count: 1
accepted answer: http://stackoverflow.com/a/27715274
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/27650129
has comment: http://stackoverflow.com/comment/43717547
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27650041
has body: Arrays are by default, passed be reference in JavaScript. So if you're just doing something like var fourDice = sortedDice and then edit fourDice, sortedDice will also get edited Please also put the code where you're copying sortedDice to fourDice in the question.
answers question: http://stackoverflow.com/q/27650041

http://stackoverflow.com/q/27765349
tagged with: javascript
tagged with: jquery
has title: JQuery (Mobile) / JavaScript Select option cannot be selected
has comment: http://stackoverflow.com/comment/43946074
answer count: 1
accepted answer: http://stackoverflow.com/a/27768382
favorite count: 0
tagged with: html-select
has comment: http://stackoverflow.com/comment/43947398
type: AnsweredQuestion
score: 1
has body: I have created a search filter that detaches the options that does not match with what the user has entered. For example, the list contains: "hello", "good bye", "halo", and if I enter "h" then it'll only show "hello" and "halo". The problem I'm facing is that if there is one option I cannot select it, but if there are multiple options I can. Here is the (full code) JSFiddle: JSFIDDLE LINK To recreate the problem: Enter "another" in the input box, and try select the "do another" option in the select menu. I can select any option if there are more than one, so if I enter the word, "do", then I can select either options with that word inside. var probOptions = $("#problem&gt;option"); function searchFilter() { $("#searchInput").change(function() { var searchString = $(this).val().toLowerCase(); $("#problem").empty().append(probOptions); $("#problem&gt;option").each(function() { var text = $(this).text().toLowerCase(); if (text.indexOf(searchString) &lt;= -1) { $(this).detach(); // THE LINE BELOW FIXES THE PROBLEM (THE LINE BELOW IS NEWLY ADDED) $("#problem").selectmenu("refresh"); } }); }); } searchFilter();
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27768382
downvote count: 0
tagged with: jquery-mobile
has comment: http://stackoverflow.com/comment/43946967

http://stackoverflow.com/q/27752213
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27757022
tagged with: google-chrome
has title: Calling server-side script within a sidebar GAS
type: Question
tagged with: google-apps-script
answer count: 2
possible better answer: http://stackoverflow.com/a/27756550
has body: I am trying to call another sidebar within a different sidebar to create a sort of tabbed interface in google docs. I cannot figure out how to call the server-side function that displays the new sidebar within the html file of the present sidebar. Here is my html sidebar button layout...(doesn't work) Functions NavBar Settings and my gs file... function showSettings() { var html = HtmlService.createHtmlOutputFromFile('settings') .setSandboxMode(HtmlService.SandboxMode.IFRAME) .setTitle('DebateDocs') .setWidth(300); DocumentApp.getUi() // Or DocumentApp or FormApp. .showSidebar(html); } The documentation on google deals with calling the buttons via "input type="button"..." however that will screw with my styling. Additionally they always call the scripts within javascript "script" tags. Is there some way I can route the button to a javascript event within the html file that points to the server? Thanks for your help! Any is appreciated.
tagged with: javascript
has answer: http://stackoverflow.com/a/27756550
score: 0
has answer: http://stackoverflow.com/a/27757022

http://stackoverflow.com/comment/44047098
type: QuestionComment
has text: I called it as an object in my customized js file with CKEDITOR.document.getById('blablaID') and now working on it.
comment on: http://stackoverflow.com/q/27800375
score: 0
type: Comment

http://stackoverflow.com/comment/43821121
score: 2
has text: Could you elaborate more on your comment?
type: AnswerComment
comment on: http://stackoverflow.com/a/27704479
type: Comment

http://stackoverflow.com/a/27645025
score: 8
type: Answer
has body: Option 1: Use a NOWDOC, which is to HEREDOCs as ' single quotes are to " double quotes. $javascript = &lt;&lt;&lt;'EOT' ...\n... EOT; Option 2: Escape the special character: $javascript = &lt;&lt;&lt;EOT ...\\n... EOT;
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27644901
upvote count: 8
answers question: http://stackoverflow.com/q/27644901
type: AcceptedAnswer

http://stackoverflow.com/comment/43973662
type: QuestionComment
comment on: http://stackoverflow.com/q/27777920
has text: when you run `cordova ruǹ and then go to chrome://inspect you should see your device and the running webviews / website unless you made a release build...
score: 0
type: Comment

http://stackoverflow.com/q/27653101
upvote count: 1
has comment: http://stackoverflow.com/comment/43723193
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27653153
has answer: http://stackoverflow.com/a/27653334
has answer: http://stackoverflow.com/a/27653171
score: 0
tagged with: javascript
tagged with: jquery
has body: I have a span: Click me You can see there are two classes click1 and click2. Now below is the script: $(".click1").click(function () { alert('yes I am click1'); }); $(".click2").click(function () { if(confirm('Sure to Click1')) return false; }); What I expect is to click2 will only be called if click1 allows. Here is the code snippet: $(".click1").click(function() { alert('yes I am click1'); }); $(".click2").click(function() { if (confirm('Sure to Click1')) return false; }); Click me I tried with the swapping of jquery functions, and it was to call which one is first written, but that will not work in scenario, There are lots of function written, **now what i want to add a class to element, and want to fire a new permission dialogue, the previous written events will only work if new event allow them to work.. If the question is not clear, Question is when i say NO to confirmation on if(confirm('Sure to Click1')) then click1 should not work.
has answer: http://stackoverflow.com/a/27653129
favorite count: 0
answer count: 5
has title: second click on element if first click is valid
has comment: http://stackoverflow.com/comment/43723198
has answer: http://stackoverflow.com/a/27653775
type: UnansweredQuestion

http://stackoverflow.com/comment/43907305
comment on: http://stackoverflow.com/q/27748021
has text: Sooooo is there a reason for downvoting asking a question?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27729875
answers question: http://stackoverflow.com/q/27727495
type: Answer
upvote count: 1
has body: per discussion in comment thread above, I'm still not 100% sure why you're reloading the same video so I may be missing some context, but the following code will let you change the video source but preserve the current time. It does assume jQuery for the event handler (though you can easily use the regular javascript event handler on the same event to do the same thing) Reload
score: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27727495
type: AcceptedAnswer

http://stackoverflow.com/comment/43992917
has text: @Deryck Exactly, I'm trying to alter the #test element only when hovering over the last list element. The div with the id test is not inside the div containing the id menu.
score: 0
comment on: http://stackoverflow.com/q/27791529
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27689772
upvote count: 1
answers question: http://stackoverflow.com/q/27689340
type: AcceptedAnswer
downvote count: 0
has body: The event handlers is being added every time the button is being clicked. You will need to move your event handlers outside of the click event. var count=0 $('#myModal').on('shown.bs.modal', function (e) { count++; jQuery("#exec_count").append("&lt;span&gt;"+count+"&lt;/span&gt;&lt;/br&gt;"); }); $('#myModal').on('hide.bs.modal', function (e) { count=0; jQuery("#exec_count").append("&lt;/br&gt;"); }); $("#button").click(function(){ $('#myModal').modal('show'); });
type: Answer
accepted answer of: http://stackoverflow.com/q/27689340
score: 1

http://stackoverflow.com/q/27760921
has comment: http://stackoverflow.com/comment/43932941
has body: I want to merge objects wich has same id. I am getting javascript objects as a string from mysql with php: $sql="SELECT plaka,il,SUM(hasta_say) AS Hasta_Say FROM ADSM GROUP BY plaka,il ORDER BY Hasta_Say "; ///COLUMN CHARTS $result=$baglanti-&gt;query($sql); $ilEventChart=""; while ($query=$result-&gt;fetch(PDO::FETCH_ASSOC)) { $color=random_color(); $ilEventChart.=' columnChartData.TR'.$query['plaka'].' = [ { "il": "'.$query['il'].'", "hasta_sayisi":'.$query['Hasta_Say'].', "color": "'.$color.'" }]; '; } So I am printing to $ilEventChart php variable to javascript area. After this javascript Objects created Like this.But recursive 'plaka' causing recursive objects with different properties. Here Objects: columnChartData.TR78 = [ { "il": "KARABÜK", "hasta_sayisi":66148, "color": "b2147e" }]; columnChartData.TR78 = [ { "il": "ÇANAKKALE", "hasta_sayisi":66246, "color": "9a720a" }]; I want to merge this objects as a one object.Desired output like this: columnChartData.TR78 = [ { "il": "KARABÜK", "hasta_sayisi":66148, "color": "b2147e" }, { "il": "ÇANAKKALE", "hasta_sayisi":66246, "color": "9a720a" }]; How can we do this with javascript? Thanks
downvote count: 3
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/43933081
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43932980
has answer: http://stackoverflow.com/a/27764701
tagged with: php
has comment: http://stackoverflow.com/comment/43933031
has title: How can merge objects if objects id is same?
type: Question
has comment: http://stackoverflow.com/comment/43932994
has comment: http://stackoverflow.com/comment/43933178
score: -2
tagged with: javascript

http://stackoverflow.com/comment/43775303
type: QuestionComment
comment on: http://stackoverflow.com/q/27680046
has text: @Seti Alright, thanks. Unfortunately this didn't fix the Angular Issue.
score: 0
type: Comment

http://stackoverflow.com/q/27664615
type: Question
tagged with: debugging
has comment: http://stackoverflow.com/comment/43756585
downvote count: 0
tagged with: javascript
has title: Detect if Chrome debugger is running from fb-flo plugin handler
has comment: http://stackoverflow.com/comment/43750331
favorite count: 0
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: google-chrome
score: 2
has body: This is a rather strange situation, as it doesn't show up with typical Chrome dev workflow, and maybe it can really only be answered when we know about the inner workings of the fb-flo Chrome plugin (or of Chrome, of course). Basically what I'm experiencing is some breakage whenever I have Chrome in a debugger breakpoint paused state, and update my source code. This causes the fb-flo plugin to actually run, but when it hot-swaps the code (which I want to use most of the time), it places the entire tab into a bad state that persists after I refresh the page. Needless to say the workaround is to simply not leave the Chrome debugger paused and edit code, but I think you can understand how easy it is to do this because when I find a reason to fix the code during a debug session it is very hard to remember to do something potentially destructive like unpausing the debugger. Now i have some ideas about where to try to dig in the react plugin code to try to make sense of this, but I can't really afford to do that, either. Basically I have to find out whether Chrome is currently paused in the debugger, and if it is, I have to prevent the hot-swap from proceeding. Is there a way to do this?

http://stackoverflow.com/comment/43925893
comment on: http://stackoverflow.com/a/27757609
has text: @user1432315 You wrote "the functions don't seem to run", and that's what meskobalazs solved. If there's something else that's wrong, you need to describe it exactly.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43888288
comment on: http://stackoverflow.com/a/27721853
has text: yes it is showing 'error : true', but required directive is returning false,when no input is provided.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27705946
favorite count: 0
accepted answer: http://stackoverflow.com/a/27706465
has comment: http://stackoverflow.com/comment/43824093
type: AnsweredQuestion
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/43824067
downvote count: 3
has comment: http://stackoverflow.com/comment/43824324
upvote count: 1
has comment: http://stackoverflow.com/comment/43824046
type: Question
has answer: http://stackoverflow.com/a/27706811
has comment: http://stackoverflow.com/comment/43824359
score: -2
tagged with: arrays
has answer: http://stackoverflow.com/a/27706465
tagged with: javascript
has comment: http://stackoverflow.com/comment/43823824
has title: Combine arrays of objects by unique key
has comment: http://stackoverflow.com/comment/43824864
has comment: http://stackoverflow.com/comment/43824240
possible better answer: http://stackoverflow.com/a/27706409
answer count: 3
has answer: http://stackoverflow.com/a/27706409
has body: I have two arrays of objects. One of them have visitor count per day, other have document count per day. Like this: var visitors = [ { '2014.12.25': 141 }, { '2014.12.26': 630 }, { '2014.12.30': 71 } ]; var documents = [ { '2014.12.15': 31 }, { '2014.12.26': 60, }, { '2014.12.30': 95 } ]; Dates may be different in each array. How can I transform arrays to the following structure (meaning combine them by date key): [ { date: '2014.12.15', visits: 0, docs: 31 }, // here visits = 0 because there were no visitors at this date { date: '2014.12.25', visits: 441, docs: 0 }, // here docs = 0 because no docs were created at this date { date: '2014.12.26', visits: 630, docs: 60 }, { date: '2014.12.30', visits: 71, docs: 95 }, ] Tools permitted: JavaScript and Undescore.js. Thank you

http://stackoverflow.com/q/27758204
has comment: http://stackoverflow.com/comment/43929298
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43928488
answer count: 0
has body: I have problems understanding what is happening in my code and hope some of you might shed some light on it. So Im using jQuery slideUp and slideDown functions to reveal and hide my nav menu for small screens: function init_menu(){ $( "#menu-button" ).click(function () { if ( $( "#filter-box-nav" ).is( ":hidden" ) ) { $( "#filter-box-nav" ).slideDown( "fast" ); } else { $( "#filter-box-nav" ).slideUp("fast"); } }); } And the styling for the elements targeted are: #filter-box-nav { width: 99%; padding-left: 1%; padding-top: 5px; padding-bottom: 5px; overflow: hidden; background-color: #F4FA5C; display: none; } .filter-box { cursor: pointer; list-style-type: none; float: left; margin: .5%; width: 17.5%; border: 2px solid #000; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } I use the function: function style_nav_elements() { $(".filter-box").css("height", $(".filter-box:first").width()); } to resize the elements at the end of a javascript window.onload. But the pixel size of the elements are set to the set CSS percentage 17.5%. But when the menu is opened and the resize event handler is triggered and executes the function to change the elements hight it works perfectly. What is happening in my code and what am i doing wrong? Additionally, if there is any recommendations to how this is usually solved I appreciate pointers and advice. HTML:
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
score: 0
tagged with: jquery
has title: Set size of height with width on display:none element children

http://stackoverflow.com/comment/43705341
type: Comment
comment on: http://stackoverflow.com/q/27643352
type: QuestionComment
has text: `querySelectorAll` returns a **nodeList**, not a single element, and a nodeList has no parentNode ?
score: 0

http://stackoverflow.com/q/27728538
has comment: http://stackoverflow.com/comment/43869004
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43869067
has body: I have an html table where I have set row marge like below image. When select second row then my selection does not work properly. see below.. But I am going to set selection in second row i.e I expect like below.... How is it possible by css. I have used bootstrap css. //== Tables .table { min-width: 100%; margin-bottom: 0px; border-spacing: 0; background: #fff; margin:0px; table-layout: fixed; //fit to screen @include breakpoint(small) { table-layout: auto; &.table-blank { display: none; } } > thead > tr > th, > tbody > tr > td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } > tbody > tr > td { height: element-height(); margin: 0; padding-bottom: 0; padding-top: 0; vertical-align: middle; } // Bottom align for column headings > thead > tr > th { background: $table-header-color; } // Remove top border from thead by default > caption + thead, > colgroup + thead, > thead:first-child { > tr:first-child { > th { background: $table-header-color; color: $light-color; } } } //button group into table .table-link-group { margin-left: 0; margin-bottom: 0; list-style: none; width: 100%; white-space: nowrap; overflow: hidden; text-align: center; li { display: inline-block; float: none; } &:before { display: table; content: ""; } &:after { display: table; content: ""; clear: both; } a { padding: 0 5px; text-decoration: none; border: none; &:hover { background-color: #f5f5f5; } } } // Baseline styles // Zebra-striping // Default zebra-stripe styles (alternating gray and transparent backgrounds) .table-striped > tbody > tr:nth-child(odd) > td { background-color: #f5f5f5; } // Hover effect // Placed here since it has to come after the potential zebra striping .table-hover > tbody > tr:hover > td { background-color: #d7d7d7; //color:#eeeeee; } //selected row color .selected-row td { background-color: #d7d7d7 !important; color: #101010; cursor: pointer; } //no cell padding .no-cell-padding { padding: 0 } //outside border less lable .table { border-collapse: colla…
has comment: http://stackoverflow.com/comment/43868968
answer count: 0
favorite count: 0
has title: How to set selection or hover effect in marge table row
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43870440

http://stackoverflow.com/q/27802335
has answer: http://stackoverflow.com/a/27802363
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/44068879
tagged with: breeze
type: UnansweredQuestion
has title: findWhere on backbone collection only returns one result
has body: I have a backbone collection I am trying to add models to so I can show a list of available forms that you can add to the ui in a drop down. And this seemed to be working until they needed to be able to add more than one type. It seems though that my findWhere statement when I'm trying to add to the collection is only returning the fist one that has the Show property instead of all of them(There are maybe twenty). To add it I am doing something like this. this.temp = new Backbone.Collection(); var api = breeze api stuff this.temp.add(api.collections[(this.templateType)].findWhere({Show : true})) Is there a way to modify the findWhere so it grabs them all instead of just the first one. I was searching, but I can't seem to find anything like this. Any help would be appreciated!
type: Question
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/q/27726447
has title: Exit jQuery loop
accepted answer: http://stackoverflow.com/a/27726520
has comment: http://stackoverflow.com/comment/43865104
answer count: 2
linked to: http://stackoverflow.com/q/1784780
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/43865018
has comment: http://stackoverflow.com/comment/43865016
possible better answer: http://stackoverflow.com/a/27726536
has body: This jQuery code loops through rows in a table and highlights each row as it goes. I have a stop button that sets a variable to false. I know that I can break out of the .each loop by using return false;, but I want it to break out from within the queue. How can I do this if the var is false? $('.js-channel-notes tr').each(function(i) { $(this).delay((i++) * 160).queue(function() { $('.channel-row-highlight').removeClass('channel-row-highlight'); $(this).addClass('channel-row-highlight').clearQueue(); }); });
has comment: http://stackoverflow.com/comment/43865070
has answer: http://stackoverflow.com/a/27726536
has answer: http://stackoverflow.com/a/27726520
has comment: http://stackoverflow.com/comment/43865150
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43865068

http://stackoverflow.com/comment/43813893
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27700420
has text: @WayneEllery I want the jquery code to be executed on the print page

http://stackoverflow.com/comment/43910748
has text: Yes, password_hash is working fine, because if I post correct email and password I will be login and cookies will be set. But even in that case I'm firstly redirect to http://localhost/uinspireme/profile.php?u=%3Cbr%20/%3E%3Cb%3ENotice%3C/b%3E:%20%20Undefined%20index:%20activated%20in%20%3Cb%3EC:\xampp\htdocs\uinspireme\login.php%3C/b%3E%20on%20line%20%3Cb%3E46%3C/b%3E%3Cbr%20/%3E**USERNAME** but It should be like profile.php?u=USERNAME I think the problem could be in JS code.
type: Comment
comment on: http://stackoverflow.com/a/27749652
score: 0
type: AnswerComment

http://stackoverflow.com/q/27714880
answer count: 2
has body: When I load my page , I get an ERROR 403 message. It seems that the browser cannot access the CSS file, but in fact i don't have a CSS file. My style is between the head tag: GET https://s3-us-west-1.amazonaws.com/strong-lifts-5x5/stylesheet.css &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;title&gt; New Responsive design web page &lt;/title&gt; &lt;meta charset="utf-8" /&gt; &lt;link rel="stylesheet" href="stylesheet.css" type="text/css" /&gt; &lt;meta name="viewport" content= "width=device-width , initial-scale = 1.0"&gt; &lt;style&gt; body { background-image: url(https://s3-us-west-1.amazonaws.com/strong-lifts-5x5/light-grey+5x5.jpg); color:#000305; font-size:89.5%; /* Base font size is 14px*/ font-family: Arial, 'Lucida Sans Unicode'; line-height:1.5; text-align:left; width: 99%; margin: 0 auto; } &lt;/style&gt; &lt;/head&gt;
has answer: http://stackoverflow.com/a/27714902
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43841929
has answer: http://stackoverflow.com/a/27718808
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Problems loading the css file
tagged with: css
possible better answer: http://stackoverflow.com/a/27718808
has comment: http://stackoverflow.com/comment/43841858
accepted answer: http://stackoverflow.com/a/27714902
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43841878
type: Question
has comment: http://stackoverflow.com/comment/43848721

http://stackoverflow.com/q/27653850
has title: How to detect passive voice sentences with javascript
type: Question
tagged with: javascript
score: -1
answer count: 1
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27654186
accepted answer: http://stackoverflow.com/a/27654186
has body: A sentence in the passive voice is one where the doer of the action is put at the end, and the recipient of the action is at the beginning, the opposite of a sentence in the active voice. For example, John caught the ball. Is in the active voice, but The ball was caught by John. Is in the passive voice. This answer on English SE gives 4 necessary conditions for a clause to be passive, which are for a clause to have a transitive verb's past participle, no direct object, and an auxiliary/helping verb (in any form). For my purposes we can ignore the fourth condition, since it would be extremely hard to code this and most sentences fall into this category anyway. A few more things to note: Passive sentences very often (but not always) have the prepositional phrase ("by X"), where X is the subject that would be at the beginning of the active version of the sentence. Sentences can have several clauses separated by commas or semicolons or the like, and each clause can have its own voice. For example, When the bell was rung (by the schoolmaster), Jimmy exited the class. The first clause from "When" to the comma is passive, and the second one is active. Additionally, the sentence is just fine without the part in parenthesis, referring to my first point. Although this is not strictly true, we can consider every group of words with a verb and at least three words separated by some punctuation to be a clause. Consider that you have an array containing every clause in the text (so you don't need to worry about extracting the clauses). My question is, then, "How can we identify passive clauses using JavaScript?" I've thought about this for a while, with several failed attempts, but I couldn't get very far. If it helps, the reason I need at least an approximation of the percentage of passive clauses in a text is because I'm trying to analyze the characteristics of an author of a text using stylometry; passive sentence usage, among other things such as the frequency of certain phra…
tagged with: text
type: AnsweredQuestion
upvote count: 0

http://stackoverflow.com/q/27709320
has comment: http://stackoverflow.com/comment/43839361
has body: I have created a chart with Highcharts that plots two plotLines, one vertical and one horizontal. I have set their zIndex to 1001 and 1002 respectively to make sure that these lines can be seen above my column series. Unfortunately, my tooltips appear BENEATH the plotLines, despite setting a higher zIndex property for the tooltips. Is this expected behaviour, and is there a workaround? Thank you in advance. Picture PlotLine 1: plotLines: [{ value: 55, color: '#ff0000', width: 1, zIndex: 1001, label: { text: 'Demand', style: { fontSize: '11px' } } }] PlotLine 2: chart.yAxis[0].addPlotLine({ value: marge, zIndex: 1002, color: 'rgb(243,152,20)', dashStyle: 'solid', width: 1, label: { text: 'Market price: $' + marge + '/bbl' } }); Tooltips: tooltip: { useHTML: true, zIndex:2005, formatter: function () { if (this.y != 0) { return '&lt;b&gt;' + this.series.name + '&lt;/b&gt;&lt;br&gt;Breakeaven : $' + this.y + '/bbl'; } else { return false; } } },
upvote count: 3
accepted answer: http://stackoverflow.com/a/27722572
type: Question
tagged with: highcharts
tagged with: javascript
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/27722572
favorite count: 0
has title: Tooltip appears under plotLine highcharts
type: AnsweredQuestion
score: 3

http://stackoverflow.com/q/27659434
type: Question
has answer: http://stackoverflow.com/a/27659513
accepted answer: http://stackoverflow.com/a/27659513
upvote count: 1
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Is there a function to test if objects match other objects?
has body: I have an object like this but more complex: var obj = { a: foo, b: bar, sub:{ a: foz } } and then I have a conditionals based on the keys and values, for example: { a: ^f, sub:{ a: z$ } } Is there a method for checking the conditionals are true for all of the objects properties. I'm also fine with chome-only-features or something like underscore. I can also re-structure the structure of my conditionals.
has comment: http://stackoverflow.com/comment/43734624
linked to: http://stackoverflow.com/q/201183
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43734622
tagged with: underscore.js
score: 1
has comment: http://stackoverflow.com/comment/43734585

http://stackoverflow.com/a/27666858
answers question: http://stackoverflow.com/q/27666838
type: AcceptedAnswer
upvote count: 14
type: Answer
downvote count: 0
score: 14
has body: set the x position of the text to the rect x + width and set text-anchor="end"
accepted answer of: http://stackoverflow.com/q/27666838

http://stackoverflow.com/comment/43903388
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27746057
has text: Awesome! I'm about to give this a shot.

http://stackoverflow.com/comment/43741467
comment on: http://stackoverflow.com/a/27662808
type: AnswerComment
has text: Doesn't work. Same thing. Your cutdown version works, when edited to suit the script it does nothing different.
score: 0
type: Comment

http://stackoverflow.com/a/27751273
score: 0
has comment: http://stackoverflow.com/comment/43913765
type: Answer
has comment: http://stackoverflow.com/comment/43913780
has body: Your last line loads a JSONP website. JSONP works by having the server send back Javascript that calls a function. When you specify callback=determineCountry, that tells it to put a call to that function in the Javascript. So the script at the end contains a top-level call like: determineCountry({ some JSON object }); When you load the script, it runs the function immediately. Usually JSONP is used in AJAX calls, not directly in Actually, what it looks like you really need to do is perform a JSONP AJAX call when the user clicks on the anchor: Install
accepted answer of: http://stackoverflow.com/q/27751258
answers question: http://stackoverflow.com/q/27751258
has comment: http://stackoverflow.com/comment/43913840
type: AcceptedAnswer

http://stackoverflow.com/a/27674858
downvote count: 0
score: 1
has body: Turns out that $digest and $timeout.flush will not affect the binding. In order to make it work, I had to call isolateScope.$apply(). I would still like to have an explanation for this.
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27674361
has comment: http://stackoverflow.com/comment/48071672
has comment: http://stackoverflow.com/comment/43764594

http://stackoverflow.com/a/27651535
answers question: http://stackoverflow.com/q/27651389
score: 0
has body: Listen to multiple things then perform an action determined in the callback. $('.obj1, .obj2, .obj3').on('click', function (event) { var target = $(event.target); if (target.hasClass('.obj1')) { # do stuff } // ...
type: Answer

http://stackoverflow.com/comment/59712379
score: 6
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27760489
has text: Unless the question is really about someone actually implementing a promise library, the question is invalid. Only a promise library would need to do the check, after that you can always use its .resolve method like I showed.

http://stackoverflow.com/q/27790420
has body: I am working with Safari 6.1.1 and videojs. I am streaming an MP4 and am having an issue where the black screen is loaded when I click play with the loading spinner continuously spinning and the time going to 0:04 and then looping back to 0:00. When I show the native controls I am getting the QuickTime controls with a black bar that says Loading... The odd part is that if I right click on the video and open it in a new tab QuickTime opens the video no problem. No errors in the console. It works fine in Chrome and the VideoJS homepage works fine in Safari that I am using to test. Here is how I am setting up the video the {{}} is handlebars that files in the information upon page load. To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video And the JavaScript videojs.options.flash.swf = 'assets/js/videojs/video-js.swf'; videojs.players = {}; var videoPlayer = videojs('docViewerVideo'); videoPlayer.ready(function(){ }); Let me know if more information is needed or if you have any suggestions on things I can try. Thank you very much for looking.
tagged with: safari
tagged with: video
has title: VideoJS - Black screen with loading circle safari 6.1.1
type: Question
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44381163
has answer: http://stackoverflow.com/a/27905775
type: UnansweredQuestion
tagged with: quicktime

http://stackoverflow.com/q/27743246
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27743387
linked to: http://stackoverflow.com/q/16206322
type: AnsweredQuestion
score: 2
possible better answer: http://stackoverflow.com/a/27743394
downvote count: 0
has answer: http://stackoverflow.com/a/27743394
has title: Passing value of language variable
type: Question
has body: I have 10 separate home pages for different languages. Language can be selected from index.html page. Problem is that only home page is multilingual in website. All other pages are in English language. When i am navigating from other pages to home page how can i store value of language which i had selected on home page earlier? I am defining language by HTML "lang" attribute in tag of each home page. The code i am using as below: $(document).ready(function(){ var theLanguage = $('html').attr('lang'); $(".homeBtn a").click(function(){ alert(theLanguage) var newHref = "home_"+theLanguage+".html"; $(".homeBtn a").attr("href", newHref) }); }); I am getting undefined value of "theLanguage" variable in alert. I think variable is not passing from home page to other pages. Please help me to resolve this.
tagged with: javascript
has comment: http://stackoverflow.com/comment/43897452
upvote count: 2
has comment: http://stackoverflow.com/comment/43897395
answer count: 2
has comment: http://stackoverflow.com/comment/43897489
has comment: http://stackoverflow.com/comment/43897418
tagged with: variables
accepted answer: http://stackoverflow.com/a/27743387
favorite count: 0
has comment: http://stackoverflow.com/comment/43897525

http://stackoverflow.com/a/27685875
answers question: http://stackoverflow.com/q/27685820
score: 1
upvote count: 1
has body: Try this angular/ angular-ui-router/ It must be work fine.
has comment: http://stackoverflow.com/comment/43786057
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43785770
type: Answer
accepted answer of: http://stackoverflow.com/q/27685820
has comment: http://stackoverflow.com/comment/43823238

http://stackoverflow.com/comment/43728529
comment on: http://stackoverflow.com/a/27656247
score: 0
type: AnswerComment
type: Comment
has text: the start time is start from 1 hours and end time need 30 min gap after start time. i understand what you say.

http://stackoverflow.com/comment/43713739
score: 0
type: Comment
has text: okay, sorry for thinking that it was a Cross-Domain issue. How about accessing the url or the domain name using JavaScript: window.location.href or window.location.hostname More info: http://www.w3schools.com/js/js_window_location.asp
type: QuestionComment
comment on: http://stackoverflow.com/q/27647796

http://stackoverflow.com/comment/43719444
score: 0
type: Comment
type: QuestionComment
has text: http://jsfiddle.net/grLoLdyb/1/
comment on: http://stackoverflow.com/q/27651176

http://stackoverflow.com/q/27652100
type: Question
tagged with: javascript
score: -1
has title: How do I make an iFrame reload the page it is on when the iframe loads a specific page?
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27652141
type: UnansweredQuestion
upvote count: 0
has body: I am using a wyswyg based site "builder" in order to make a site as I am not very familiar with any sort of web code. The builder has locked their system pages from any sort of modification due to "security issues". What I want to do is load the login and register tables into a iFrame that is nested inside of an html module with a div tag. This actually works very well. The issue I have now is that the whole thing seems to hang once the needed action is completed. What I would like to be able to do is have the whole page (not just the iFrame) reload once the iframe has gone to a specific url. I understand that javascript may be able to allow me to do this, but I'm at a loss as to how to make it work. I have manually tested refreshing the page and that works fine. So, if I could just automate that in some way this would probably work as intended. Here is the code my partner and I have cobbled together to load the section of the page we want to be visible, what now?
tagged with: iframe
downvote count: 1

http://stackoverflow.com/q/27695502
has comment: http://stackoverflow.com/comment/43804807
has comment: http://stackoverflow.com/comment/43804653
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27695567
tagged with: ajax
has answer: http://stackoverflow.com/a/27695567
score: 0
has title: jquery hide/show divs troubleshooting
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/27695832
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27695832
has body: I have a series of links to hide/show six different divs. I want the page to load where all of the six divs are hidden. Upon clicking on one of the six links, the respective div should fade in. When clicking on any of the other links, the current should fade out, and the newly selected div should appear. Here is the start of the jQuery script that I placed just inside the opening body tag: &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $("#1").on('click', function() { $(this).fadeOut(); $("#Graphics, #Jury, #Witness, #Mock, #Continuing").fadeOut(); $("#Strategy").fadeIn(); }); &lt;/script&gt; Here are the links: &lt;a href="#Strategy" id="1"&gt;Strategy &amp;amp; Theme Development&lt;/a&gt; &lt;a href="#Graphics" id="2"&gt;Graphics&lt;/a&gt; &lt;a href="#Jury" id="3"&gt;Jury Selection&lt;/a&gt; &lt;a href="#Witness" id="4"&gt;Witness Preparation&lt;/a&gt; &lt;a href="#Mock" id="5"&gt;Mock Trials &amp;amp; Focus Groups&lt;/a&gt; &lt;a href="#Continuing" id="6"&gt;Continuing Legal Education&lt;/a&gt; These are the target divs: &lt;div id="Strategy"&gt;&lt;/div&gt; &lt;div id="Graphics"&gt;&lt;/div&gt; &lt;div id="Jury"&gt;&lt;/div&gt; &lt;div id="Witness"&gt;&lt;/div&gt; &lt;div id="Mock"&gt;&lt;/div&gt; &lt;div id="Continuing"&gt;&lt;/div&gt; I'm not sure if the links to the divs override the jQuery effect or not.
has answer: http://stackoverflow.com/a/27695776
answer count: 3

http://stackoverflow.com/comment/43827137
comment on: http://stackoverflow.com/q/27707209
has text: console.log("opening_" + i); - can you print this
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27751256
has body: The simplest solution, given that your <iframe...> is actually a string coming from a and that you're always trying to match the same http://embed.videokoo.com... URL, isn't to "strip" the string, but to match a substring with a regular expression: var str = ' ' var substring = str.match(/http:\/\/embed.videokoo.com\/\w+\?client_file_id=\d+/) document.write(substring);
score: 0
accepted answer of: http://stackoverflow.com/q/27751182
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/27751182

http://stackoverflow.com/q/27648541
has body: I've got this object player1 and i can't get the scene.add(Obj); line to work as it comes up with an error saying Obj does not exist: function Player(x, y, z) { this.Speed = 0; this.AngleAcc = 0; this.Angle = 0; this.X=x; this.Y=y; this.Z=z; this.MaxSpeed = 100; var PlayerMateririal = new THREE.MeshLambertMaterial({ color: 0x00ff80, overdraw: 0.5 }); this.Obj = new THREE.Mesh(new THREE.BoxGeometry(50, 90, 60), PlayerMateririal); scene.add(Obj); Obj.position.set(x, y, z); } thanks i'm using Three.js and want to set the Obj position in other locations hence why i'm setting it up as a property.
has comment: http://stackoverflow.com/comment/43714373
has title: object orientated javascript
type: AnsweredQuestion
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43714385
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27648568
accepted answer: http://stackoverflow.com/a/27648568
tagged with: three.js

http://stackoverflow.com/comment/43978862
comment on: http://stackoverflow.com/a/27784403
type: Comment
score: 1
has text: @Mörre - But there is no passing references in javascript, saying there is would be even more wrong, it's all pass by value.
type: AnswerComment

http://stackoverflow.com/comment/43833663
has text: Java and Javascript are not the same thing
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27710880

http://stackoverflow.com/a/27667174
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43749235
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/43749227
answers question: http://stackoverflow.com/q/27667155
has body: You can't create HTML elements in javascript by doing &lt;span&gt;&lt;/span&gt;. If you want to create HTML elements use the createElement function. var span = document.createElement('span'); span.className = 'skimlinks-unlinked'; Now you can fill this with whatever info you want and then append it to the body. span.innerHTML = scores[i]; document.body.appendChild(span); JSBin Demo

http://stackoverflow.com/comment/43964055
comment on: http://stackoverflow.com/q/27776743
type: QuestionComment
has text: How about number input field ` ` ?
score: 0
type: Comment

http://stackoverflow.com/q/27780086
has body: Is there a way to have a specific 6 digit number to transform into another 6 digit number? It's meant to be used into a User Interface where the user must know a secret number and it will result into another number. For instance, the number to obtain is 123456 and the number the user should input is 111111. So if the user inputs 111111, he will see 123456 which is the right number. If the user input 222222, he will see something else than 123456 which won't be the right number. The goal is to avoid telling the user weither he knows the right or wrong secret number to begin with. He could try every combination but won't know 111111 was the right one.
tagged with: cryptography
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27780619
type: Question
has comment: http://stackoverflow.com/comment/43970231
tagged with: javascript
has title: Transform a specific secret 6 digit number into another 6 digit number
score: 0
has answer: http://stackoverflow.com/a/27780170
answer count: 2

http://stackoverflow.com/q/27698476
accepted answer: http://stackoverflow.com/a/27698492
has body: I'll try to simplify this problem down: I am deploying an application using Heroku, and I would like to automatically install my bower dependencies. When testing on a localhost, I would just run a "bower install" command in the terminal, but I am not sure how to translate this over to a deployed application.
answer count: 1
downvote count: 0
favorite count: 0
tagged with: deployment
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
tagged with: heroku
linked to: http://stackoverflow.com/q/14736941
has title: How can I install my bower dependencies on a deployed Heroku app?
has answer: http://stackoverflow.com/a/27698492
tagged with: javascript
duplicate of: http://stackoverflow.com/q/14736941

http://stackoverflow.com/a/27770638
upvote count: 1
has comment: http://stackoverflow.com/comment/43953825
downvote count: 0
answers question: http://stackoverflow.com/q/27769465
has body: It is only secure if you use SSL/TLS, because otherwise an network-based attacker may use a man-in-the-middle attack to change the client side JavaScript code in a way that sends the password directly to the attacker including all notes. If you have that and can effectively prevent the attacker from adding more JavaScript (e.g. through XSS), you should be fine.
type: Answer
score: 1

http://stackoverflow.com/comment/44007138
has text: am not using the form for submitting, i am using it to generate some content.
type: QuestionComment
comment on: http://stackoverflow.com/q/27799298
type: Comment
score: 0

http://stackoverflow.com/comment/43848174
has text: u don't want to show any dates..??
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27718196
score: 0

http://stackoverflow.com/q/27742412
has comment: http://stackoverflow.com/comment/43895774
tagged with: javascript
tagged with: comments
answer count: 2
downvote count: 0
linked to: http://stackoverflow.com/q/12936215
favorite count: 0
has comment: http://stackoverflow.com/comment/43895828
has title: Disable visual studio autocomplete comment in javascript
type: UnansweredQuestion
has body: My problem is simple. Whenever I type "/*" in javascript or typescript file in VisualStudio, editor adds "*/" so I get: "/* */". I like to disable this autocomplete feature because its annoying. I want to just type "/*" and have only this. Where I can disable this autocomplete function? I was looking in resharper and visualstudio options and I couldnt find anything about it.
upvote count: 6
tagged with: visual-studio
has answer: http://stackoverflow.com/a/27742559
tagged with: visual-studio-2013
has answer: http://stackoverflow.com/a/41589984
has comment: http://stackoverflow.com/comment/43895927
score: 6
type: Question

http://stackoverflow.com/comment/43715506
has text: @MarcelGwerder right, thanks for pointing that out, I didn't even look past the `.live()`
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27649079

http://stackoverflow.com/comment/43766510
type: Comment
has text: ultimately what Im wanting is to store the time difference between when the links appear (i.e. the end of the video) and when one of the links get clicked. in other words, how long did it take them to click a link once it appeared
comment on: http://stackoverflow.com/a/27674940
type: AnswerComment
score: 0

gulp-inject
tag name: gulp-inject
tags question: http://stackoverflow.com/q/27794237
type: Tag

http://stackoverflow.com/q/27704061
type: Question
tagged with: testing
tagged with: istanbul
tagged with: javascript
has title: Jasmine test case for private variables
tagged with: jasmine-jquery
has body: I am using jasmine 2.0 for testing javascript functions. I have backbone code which is written below. events:{ "click #div1":"div1Clicked" } div1Clicked:function(){ onComplete = function(){ some functionality }; onComplete(); } I have written test case with jasmin which looks like following: describe('View : Test View', function() { beforeEach(function(){ testView = new View(); }); describe('div1Clicked',function(){ it('Should call div1Clicked',function(){ spyOn(testView,'div1Clicked').and.callThrough(); testView.div1Clicked(); expect(testView.div1Clicked).toHaveBeenCalled(); }); }); }); How to write test case for onComplete inside div1Clicked function?
tagged with: karma-jasmine
score: 0
has comment: http://stackoverflow.com/comment/43828917
has comment: http://stackoverflow.com/comment/49154560
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/27704126
has body: So, the problem was, that I had multiple div containers nested into each other and using a scrollbar plugin. It doesn't matter which - each will produce this problem. I've fixed the problem by changing one line in the scrollReveal.js - Line 78: viewport: window.document.documentElement, // &lt;HTML&gt; element by default. to viewport: window.document.getElementById('right'), // it's my custom container-div Now it works how supposed. If you encounter a similar problem with any scrollbarplugin or wow.js it should also fix your problem. Just change the corresponding viewport.
accepted answer of: http://stackoverflow.com/q/27681410
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27681410

http://stackoverflow.com/q/27718802
accepted answer: http://stackoverflow.com/a/27718843
has answer: http://stackoverflow.com/a/27718863
answer count: 4
type: AnsweredQuestion
has body: How can I select base on 'cd' char? I tried $('.cd*) but doesn't work.
upvote count: 1
has answer: http://stackoverflow.com/a/27718846
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27718843
linked to: http://stackoverflow.com/q/5376431
has title: Any selector using * failed in my case
has answer: http://stackoverflow.com/a/27718880
possible better answer: http://stackoverflow.com/a/27718846
has comment: http://stackoverflow.com/comment/43849219
has comment: http://stackoverflow.com/comment/43849239
score: 0
has comment: http://stackoverflow.com/comment/43849254
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/27684512
answer count: 1
accepted answer: http://stackoverflow.com/a/27686465
favorite count: 0
tagged with: google-sites
has answer: http://stackoverflow.com/a/27686465
has title: ReferenceError: google is not defined - Google Apps script error in Mozilla firefox
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has body: I'm creating a Google Site with Google Apps Script "Enum Sandbox Iframe mode". In Google Developer Docs, It says, to call a custom function, we need to use google.script.run Sample: Code.gs function doGet() { return HtmlService.createHtmlOutputFromFile('index') .setSandboxMode(HtmlService.SandboxMode.IFRAME); } function doSomething() { Logger.log('I was called!'); } index.html &lt;script&gt; google.script.run.doSomething(); &lt;/script&gt; When I run this using Google Chrome, Its working perfect. But it throws an error in Mozilla Firefox. ReferenceError: google is not defined. Does anyone know the reason behind it? Any help would be appreciated. Update: Filed a bug in Google Code : https://code.google.com/p/google-apps-script-issues/issues/detail?id=4652&amp;thanks=4652&amp;ts=1419836713&amp;
tagged with: javascript
tagged with: google-apps-script
upvote count: 1
tagged with: firefox

http://stackoverflow.com/comment/43949134
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27768906
has text: no. it's not exactly what I need.

http://stackoverflow.com/q/27704862
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43823681
tagged with: drag-and-drop
has title: Angular drag and drop - how to pass a parameter to the onStart callback function
score: 6
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/43823893
type: Question
has answer: http://stackoverflow.com/a/27706543
accepted answer: http://stackoverflow.com/a/27706543
upvote count: 6
tagged with: javascript
tagged with: jquery
has body: THE SITUATION: I have an app that make use of angular drag and drop. Everything is working fine except one thing. I need to pass one parameter in the onStart callback function, but i don't know how. I search around and try several possibilities but without success. The function itself is working, has been called and properly executed, the only problem i have is to pass a parameter to it. THE CODE: In this example there one of the attempt i have made. {{item.title}} THE QUESTION: How can i pass a parameter in the callback function of angular drag and drop? Thank you very much!
answer count: 1
tagged with: jquery-ui-draggable
favorite count: 0

http://stackoverflow.com/q/27770140
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43951569
has answer: http://stackoverflow.com/a/27770453
tagged with: jquery
has comment: http://stackoverflow.com/comment/43951510
has answer: http://stackoverflow.com/a/27778055
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43965289
type: Question
has comment: http://stackoverflow.com/comment/43951164
has title: Animate when user has scrolled to the bottom of the page
tagged with: javascript
has body: On my page, I have a div element containing copyright information. I would like to detect if the user has scrolled all the way to the bottom of the page. if so, have the div slide down. It would also be nice if there was a way that JQuery could tell if I am near the box without having to scroll over it to display the copy right as well. Thanks, DoubleDogg6
has comment: http://stackoverflow.com/comment/43952161

http://stackoverflow.com/comment/43900718
type: QuestionComment
has text: @alexs I seem to get a 404 for feed.html only some of the time. I'm not sure what could possibly be causing a race condition in this app
comment on: http://stackoverflow.com/q/27744539
score: 0
type: Comment

http://stackoverflow.com/q/27790063
has body: I have items that are stored as models through an add to cart button. The model has: Name Quantity Item_ID But it will not store duplicate items. If someone clicks on the add to cart button again I want the collection to merge the 2 models together by adding the quantities together but keeping the name/item_id the same. I'd imagine I need to override the collection add function, to do specifically this when it sees a duplicate. Or is there some kind of method or parameter I can use when adding to my collection to do this for me? var CartCollection = Backbone.Collection.extend({ model: Item, add: function(newItem) { var dupeHandle = this.any(function(item) { if (item.get('name') === newItem.get('name')){ item.set('quantity', (item.get('quantity') + newItem.get('quantity')); return true; } } if (dupeHandle) return; Backbone.Collection.add.call(this, item); } });
has comment: http://stackoverflow.com/comment/43990612
tagged with: javascript
has title: Merging duplicate models in my collection but adding the quantity
downvote count: 0
favorite count: 0
tagged with: backbone.js
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: backbone.js-collections

http://stackoverflow.com/comment/43854194
type: Comment
comment on: http://stackoverflow.com/a/27721001
has text: Very good link about the automatic insertions :) The second link might be broke though, the article of Axel Rauschmayer.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43837913
score: 0
type: AnswerComment
has text: @MatthewDavidJankowski, have a look at my edited answer?
comment on: http://stackoverflow.com/a/27711053
type: Comment

http://stackoverflow.com/q/27714872
has answer: http://stackoverflow.com/a/29526206
type: Question
linked to: http://stackoverflow.com/q/2450954
has answer: http://stackoverflow.com/a/27714944
has title: Is there a way to create a shuffle mode with html5 audio player
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43869349
answer count: 2
upvote count: 1
favorite count: 0
has body: I am trying to create a shuffle mode for multiple playlists with the native html5 audio player. I am not that great with javascript i am more of a web designer and not developer. I cannot find anything on creating a shuffle mode online so I figured I would ask the question here and see if someone can help. I have multiple playlists and would like to create a shuffle mode for each individual playlist and load it into the one audio player. Is this possible with javascript or jquery? Here is my code that I have for my audio playlists. Track1</button Track2</button Track3</button Track1</button Track2</button Track3</button
type: UnansweredQuestion
score: -3
tagged with: http://stackoverflow.com/tag/html
downvote count: 4

http://stackoverflow.com/q/27746217
has comment: http://stackoverflow.com/comment/43903999
has comment: http://stackoverflow.com/comment/43903622
has comment: http://stackoverflow.com/comment/43903717
has comment: http://stackoverflow.com/comment/43904429
has answer: http://stackoverflow.com/a/27746700
tagged with: javascript
tagged with: jquery
has title: How to hide a progress bar in javascript
accepted answer: http://stackoverflow.com/a/27746700
type: AnsweredQuestion
tagged with: validation
has comment: http://stackoverflow.com/comment/43903850
downvote count: 0
score: 1
tagged with: asp.net
favorite count: 0
has body: Guys I am working on a flight booking api integration project. Every thing is working fine when I click for search flights on button progress bar comes in a fine way.But Problem I am getting is that I am calling progress bar from javascript and when there are validation error on the page still progress bar shows up. So my question is how to hide progressbar when there are validation errors on page I am using asp.net server validations. My javascript is like this: &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function ShowProgress() { setTimeout(function () { var modal = $('&lt;div /&gt;'); modal.addClass("modal"); $('body').append(modal); var loading = $(".loading"); loading.show(); var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0); var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0); loading.css({ top: top, left: left }); }, 200); } function changes() { ShowProgress(); } &lt;/script&gt; I am calling it on button click like thsi: &lt;asp:Button ID="btnSearch" OnClientClick ="changes();" runat="server" ValidationGroup ="r" Text="Search" Height="40px" Width="134px" onclick="btnSearch_Click" /&gt; My progress bar div is like this: &lt;div class="loading" align="center"&gt; Loading. Please wait.&lt;br /&gt; &lt;img src="load.gif" style="height:50px; width :50px;" alt="" /&gt; &lt;/div&gt;
type: Question
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/47391181
type: Comment
has text: Having the same issue here, dunno how to solve it
type: QuestionComment
comment on: http://stackoverflow.com/q/27692201
score: 0

http://stackoverflow.com/a/27802561
answers question: http://stackoverflow.com/q/27802359
has comment: http://stackoverflow.com/comment/44119460
type: AcceptedAnswer
downvote count: 0
has body: Add a public boolean property to your Auth service which holds the authentication state of the user. once user is authenticated set it to true. Then before you call the callback check if based on that previous value setting it is needed to run the callback code or not. if (!Auth.isUserAuthenticated) { $scope.auth.$onAuth(authDataCallback); } I have to say, I could show you patterns of forcing a function to run only once either from lodash or elsewhere, but what is the real issue is that controllers unlike services etc. are not singletons and expressions run at least once during the digest cycle and the digest cycle is not a one time only process. Your problem is architectural as your controller holds logic that is more than just managing behavior. You need to ensure that all of the main business logic of your app is inside services and controllers only manage their own behavior by either calling methods on those services or reading a state from them. This is a sketch but I hope you get the general principle.
type: Answer
has comment: http://stackoverflow.com/comment/44038258
score: 2
has comment: http://stackoverflow.com/comment/44063378
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27802359
has comment: http://stackoverflow.com/comment/44029240

http://stackoverflow.com/a/27686597
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43826054
has comment: http://stackoverflow.com/comment/43790087
upvote count: 2
has comment: http://stackoverflow.com/comment/43793622
has comment: http://stackoverflow.com/comment/43787465
has body: While Pieter B isn't right about the closeAction he is right about his recommendation to use the beforeclose event! First let's have a look at the implementation of the cloaseAction property within the Ext.Window class, which look like this: this[this.closeAction](); and is used in several event callback methods. Important is this: Tab Events There is no actual tab class — each tab is simply a Component such as a Panel. However, when rendered in a TabPanel, each child Component can fire additional events that only exist for tabs and are not available from other Components. These events are: activate : Fires when this Component becomes the active tab. deactivate : Fires when the Component that was the active tab becomes deactivated. beforeclose : Fires when the user clicks on the close tool of a closeable tab. May be vetoed by returning false from a handler. close : Fires a closeable tab has been closed by the user. So in theory something like this work: new Ext.TabPanel({ title: 'Manage', renderTo: Ext.getBody(), closable: true, closeAction: 'hide', defaults: { listeners: { 'beforeclose': function(panel) { // We should have the tab scope here var closeAction = this.ownerCt.closeAction if (closeAction === 'hide') { panel.hide(); Ext.get(panel.tabEl).setVisible(false); return false; } return true; } } }, activeTab: 0, items:[ {xtype:'panel', title: 'Tab 1', id:'tab1', closable: true, html: 'Tab 1'}, {xtype:'panel', title: 'Tab 2', id:'tab2', closable: true, html: 'Tab 2'} ] }); Please notice that this is a already working snipped but you will still need to fix some parts here. For example the tab el are just hidden and will stay in place. For a final version you will either need to remove them or set their size to zero.
has comment: http://stackoverflow.com/comment/43820251
type: Answer
answers question: http://stackoverflow.com/q/27684916

http://stackoverflow.com/q/27696743
score: 1
accepted answer: http://stackoverflow.com/a/27696795
has comment: http://stackoverflow.com/comment/43806833
tagged with: ruby-on-rails
type: Question
has title: Using bootstrap-sass in Rails, Bootstrap / Javascript not working
has body: trying to learn rails (and I'm still really early on in my development) but I've hit a wall and I'm scratching my head. I'm trying to leverage bootstrap via bootstrap-sass, and it seems like when I use the default bootstrap navigation bar I can get the bar to render - but it's not interactive. It looks like javascript isn't working properly, but I'm not sure why. My gemfile: source 'https://rubygems.org' gem 'rails' gem 'bootstrap-sass' gem 'sprockets' gem 'sass-rails' gem 'uglifier' gem 'coffee-rails' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder' gem 'sdoc', '~> 0.4.0', group: :doc group :development do gem 'sqlite3' gem 'spring' end group :production do gem 'pg' gem 'rails_12factor' end application.css *= require_tree . *= require_self app/javascripts/application.js //= require jquery //= require jquery_ujs //= require turbolinks //= require_tree . custom.css.scss @import "bootstrap-sprockets"; @import "bootstrap"; config/application.rb module FamilyLunch class Application < Rails::Application config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif) end application.html.erb Family Lunch | <%= yield(:title) %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> <%= render 'layouts/header' %> <% flash.each do |key, value| %> <div class="alert alert-<%= key %>"><%= value %> <% end %> <%= yield %> <%= render 'layouts/footer' %> <%= debug(params) if Rails.env.development? %>
has comment: http://stackoverflow.com/comment/43806765
has answer: http://stackoverflow.com/a/27696795
tagged with: javascript
has answer: http://stackoverflow.com/a/48612082
answer count: 2
upvote count: 1
favorite count: 0
tagged with: ruby
tagged with: twitter-bootstrap
possible better answer: http://stackoverflow.com/a/48612082
tagged with: css
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/43863773
has text: I think the OP wants the graph of this to look really steep at the beginning, and then level out, instead of starting fairly level and ending very steep.
score: 1
comment on: http://stackoverflow.com/q/27725822
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27683596
has body: Here is what I was referring to when I said use sessions + PHP. You can do this all in PHP, though javascript would be optimal. I have not included a way to remove the session inputs, however using other form elements will suffice. Also, I have not done any echoing values on reload. This is only an option if you really do not want to use javascript: &lt;?php // Put at top of page session_start(); // Also somewhere at top of page // Check post empty and assign post to a session for continual use if(!empty($_POST)) { $_SESSION['form'] = $_POST; } ?&gt; &lt;form action="" method="post" class="smart-green"&gt; &lt;h1&gt;Contract Form &lt;span&gt;Please fill all the texts in the fields.&lt;/span&gt; &lt;/h1&gt; &lt;label&gt; &lt;span&gt;Client:&lt;/span&gt; &lt;input type="text" name="client" placeholder="Your Client Name" /&gt; &lt;/label&gt; &lt;label&gt; &lt;span&gt;Your Name (Salesman):&lt;/span&gt; &lt;input type="text" name="salesman" placeholder="Name" /&gt; &lt;/label&gt; &lt;label&gt; &lt;span&gt;Construction Name:&lt;/span&gt; &lt;input type="text" name="construction" placeholder="Construction Name" /&gt; &lt;/label&gt; &lt;label&gt; &lt;span&gt;City:&lt;/span&gt; &lt;input type="text" name="city" placeholder="City" /&gt; &lt;/label&gt; &lt;label&gt; &lt;span&gt;Items:&lt;/span&gt; &lt;input type="text" name="id_item" placeholder="Item" /&gt; &lt;/label&gt; &lt;label for="new"&gt;Add Fields&lt;/label&gt; &lt;select name="new" id="new"&gt; &lt;option value=""&gt;Select&lt;/option&gt; &lt;option value="1"&gt;Add 1&lt;/option&gt; &lt;option value="2"&gt;Add 2&lt;/option&gt; &lt;option value="3"&gt;Add 3&lt;/option&gt; &lt;option value="4"&gt;Add 4&lt;/option&gt; &lt;/select&gt; &lt;?php // This checks if new has been posted if(isset($_POST['new']) &amp;&amp; $_POST['new'] &gt;= 1) { // Check if there are inputs in the queue $count = (isset($_SESSION['form']['new_input']) &amp;&amp; !empty($_SESSION['form']['new_input']))? count($_SESSION['form']['new_input']):1; /…
has comment: http://stackoverflow.com/comment/43792960
type: Answer
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43791012
has comment: http://stackoverflow.com/comment/43781677
answers question: http://stackoverflow.com/q/27682516
score: 0

http://stackoverflow.com/comment/43809093
type: Comment
has text: Adding events directly - performance hit is when you are attaching the event. Delegated events - performance hit is when the event is triggered. What is better to use depends on the actual code.
comment on: http://stackoverflow.com/q/27697888
score: 1
type: QuestionComment

http://stackoverflow.com/comment/108295368
comment on: http://stackoverflow.com/a/47368825
has text: This throw an error: TypeError: Cannot read property 'emit' of undefined
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/27748612
score: 1
answers question: http://stackoverflow.com/q/27748567
upvote count: 1
has body: You need to find div elements within #cardSlotsJoueur: var elmt = document.getElementById("cardSlotsJoueur"); var divs = elmt.getElementsByTagName('div'); for (var i = 0; i &lt; divs.length; i++) { divs[i].style.backgroundImage = "url('images/backcard.png')"; }
type: Answer
downvote count: 0

http://stackoverflow.com/a/27727061
type: AcceptedAnswer
has body: You should add a callback to your postback function ShowProgress() { // I guess it shows your modal setTimeout(function () { var modal = $('&lt;div /&gt;'); modal.addClass("modal"); $('body').append(modal); var loading = $(".loading"); loading.show(); var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0); var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0); loading.css({ top: top, left: left }); }, 200); // Gets the request manager var requestManager = Sys.WebForms.PageRequestManager.getInstance(); // Callback function will be called after __doPostBack function EndRequestHandler(sender, args) { // This will be executed after __doPostBack // Here's you should put your code to close modal! // Remove the request handler requestManager.remove_endRequest(EndRequestHandler); } // Tells the request manager we are adding a callback requestManager.add_endRequest(EndRequestHandler); __doPostBack("&lt;%=btnSubmit.UniqueID %&gt;", ""); }
type: Answer
has comment: http://stackoverflow.com/comment/43866042
has comment: http://stackoverflow.com/comment/43867738
accepted answer of: http://stackoverflow.com/q/27726964
score: 0
answers question: http://stackoverflow.com/q/27726964

http://stackoverflow.com/a/27765074
score: 7
answers question: http://stackoverflow.com/q/27764930
upvote count: 7
accepted answer of: http://stackoverflow.com/q/27764930
has comment: http://stackoverflow.com/comment/44115426
type: AcceptedAnswer
downvote count: 0
has body: UPDATE: previous version of this answer would not be working with a angular strict mode, or minification. I would therefore suggest to add this ng-strict-di directive into index.html: &lt;html data-ng-app="App" ng-strict-di&gt; // see ng-strict-di &lt;head&gt; And that would reveal that the proper way is: module App { export class RootConfig { static inject = ['$rootScope', '$state', '$stateParams']; constructor( $rootScope: any, //ng.IRootScopeService, $state: ng.ui.IStateProvider, $stateParams: ng.ui.IStateParamsService) { $rootScope.$state = $state; $rootScope.$stateParams = $stateParams; } } } angular.module('App') // wrong - not working in minified world // .run(App.RootConfig); // correct .run(['$rootScope', '$state', '$stateParams', App.RootConfig]); Why this $rootScope: any, //ng.IRootScopeService, instead of this: $rootScope: ng.IRootScopeService,? To make life easier... and quickly assign not declared properties $state and $stateParams
has comment: http://stackoverflow.com/comment/46670265
type: Answer

http://stackoverflow.com/comment/43966419
type: Comment
has text: You should use android emulator (or a real device) and the chrome dev tools to remote-debug your app, I've tried some other solutions, like weinre but they were not working. Take a look at [this](https://developer.chrome.com/devtools/docs/remote-debugging), it explains how to set up android and chrome for remote debugging hybrid android app. You can also have a look on eclipse to check the output of logcat. ` ` might also be an issue.
comment on: http://stackoverflow.com/q/27777920
score: 0
type: QuestionComment

http://stackoverflow.com/q/27675321
has title: Angular js Nesting custom directives
has comment: http://stackoverflow.com/comment/43765337
has answer: http://stackoverflow.com/a/27676007
answer count: 2
has comment: http://stackoverflow.com/comment/43765405
has answer: http://stackoverflow.com/a/27677131
downvote count: 1
has comment: http://stackoverflow.com/comment/43766651
has comment: http://stackoverflow.com/comment/43765871
type: UnansweredQuestion
upvote count: 22
tagged with: nested
has comment: http://stackoverflow.com/comment/43765364
score: 21
tagged with: javascript
favorite count: 0
tagged with: angularjs
type: Question
has body: I want to use something like nesting with custom directives in angular js. Could anyone explain me with simple solution ? example code is below is not working for me : JS var app = angular.module('app',[]); app.directive('outer',function(){ return{ restrict:'E', template:' i am a outer ', compile : function(elem,attr){ return function(scope,elem,att,outercontrol){ outercontrol.addItem(1); } }, controller : function($scope){ this.addItem = function(val){ console.log(val); } } } }); app.directive('inner',function(){ return{ require : 'outer', template : ' i am a inner ', link:function(scope,elem,attr){ } } });

http://stackoverflow.com/a/27680597
downvote count: 0
has comment: http://stackoverflow.com/comment/43813741
upvote count: 2
has body: The problem is that you are not escaping things properly. Instead of manually replacing certain patterns, you should use encodeURIComponent for each of the parameters that you add. In other words, your code should look like this: var subject = ... // whatever you do to create this string var body = ... // whatever you do to create this string var encodedSubject = encodeURIComponent(subject); var encodedBody = encodeURIComponent(body); var emailLink = 'mailto:?subject=' + encodedSubject + '&amp;body=' + encodedBody; // ... use emailLink
type: Answer
has comment: http://stackoverflow.com/comment/43790949
score: 2
answers question: http://stackoverflow.com/q/27680543

http://stackoverflow.com/comment/51430825
comment on: http://stackoverflow.com/q/27742070
score: 1
has text: Just a quick pointer that if you do something stupid, such as in my case I accidentally appended the TLD to the port: "http://localhost:8070.com" then you will receive the same error. Check what URL you're attempting to resolve!
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27786463
has answer: http://stackoverflow.com/a/27786522
score: 0
has answer: http://stackoverflow.com/a/27786654
answer count: 2
has comment: http://stackoverflow.com/comment/43983076
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43982944
tagged with: node.js
has title: Modifying and passing global variables
has comment: http://stackoverflow.com/comment/43982941
has body: I'm having trouble modifying a global variable in a callback. I need to reload the data from a file every hour. It works fine if I use readFileSync but not if I use the normal readFile: var MY_GLOBAL = {}; fs.readFile("some_path", function (err, data) { if (err) throw err; MY_GLOBAL.some_name = data; }); setInterval(function() { fs.readFile("some_path", function (err, data) { if (err) throw err; MY_GLOBAL.some_name = data; } }, 60 * 60 * 60 * 1000); I have another module named router.js which contains all the routing for my application. I call it using: router(app, MY_GLOBAL). My issue is that although MY_GLOBAL gets set in the readFile callback, it doesn't update in the router. I need to access the updated data every hour.
type: Question
tagged with: javascript

http://stackoverflow.com/comment/43737761
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27660926
type: Comment
has text: The response should be an array now so you can't just access `id` like that.

http://stackoverflow.com/comment/43935015
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27761690
score: 0
has text: The regex should still work with that format; take a look at the example I linked.

http://stackoverflow.com/q/27672823
has comment: http://stackoverflow.com/comment/43760493
has comment: http://stackoverflow.com/comment/43760455
type: Question
has comment: http://stackoverflow.com/comment/43760537
has comment: http://stackoverflow.com/comment/43760471
tagged with: css
tagged with: progress
has comment: http://stackoverflow.com/comment/43760562
has comment: http://stackoverflow.com/comment/43760617
has comment: http://stackoverflow.com/comment/43760564
score: 0
has answer: http://stackoverflow.com/a/27672923
upvote count: 1
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43760432
has comment: http://stackoverflow.com/comment/43760461
has title: Javascript progress bar doesn't work
accepted answer: http://stackoverflow.com/a/27672923
type: AnsweredQuestion
has body: I'd really love to have that progress bar (click me to see bar code) on my site, but when I add it, it doesn't work. Original files: HTML: &lt;div class="progress-wrap progress" data-progress-percent="25"&gt; &lt;div class="progress-bar progress"&gt;&lt;/div&gt; &lt;/div&gt; CSS: .progress { width: 100%; height: 50px; } .progress-wrap { background: #f80; margin: 20px 0; overflow: hidden; position: relative; .progress-bar { background: #ddd; left: 0; position: absolute; top: 0; } } JS: // on page load... moveProgressBar(); // on browser resize... $(window).resize(function() { moveProgressBar(); }); // SIGNATURE PROGRESS function moveProgressBar() { console.log("moveProgressBar"); var getPercent = ($('.progress-wrap').data('progress-percent') / 100); var getProgressWrapWidth = $('.progress-wrap').width(); var progressTotal = getPercent * getProgressWrapWidth; var animationLength = 2500; // on page load, animate percentage bar to data percentage length // .stop() used to prevent animation queueing $('.progress-bar').stop().animate({ left: progressTotal }, animationLength); } I have put these lines into my html file just to link these files: &lt;script src="http://code.jquery.com/jquery-2.1.3.min.js"&gt;&lt;/script&gt; &lt;script src='bar.js'&gt;&lt;/script&gt; I don't know am I doing anything wrong or the code is broken? Please help! Mieciu
has comment: http://stackoverflow.com/comment/43760548
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/27791754
has comment: http://stackoverflow.com/comment/43993328
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43993193
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43993446
has body: I'm getting this error calling the Controller Method getListCategories() from the view. TypeError: Object.keys called on non-object at Function.keys (native) at extend (app/bower_components/angular/angular.js:412:25) at Function.angular.module.provider.$get.Resource.(anonymous function) (app/bower_components/angular-resource/angular-resource.js:575:15) at Scope.$scope.getListCategories (app/shoppinglists/shoppinglists.js:17:69) at $parseFunctionCall (app/bower_components/angular/angular.js:12332:18) at Object.expressionInputWatch (app/bower_components/angular/angular.js:12735:31) at Scope.$get.Scope.$digest (app/bower_components/angular/angular.js:14217:40) at Scope.$get.Scope.$apply (app/bower_components/angular/angular.js:14488:24) at done (app/bower_components/angular/angular.js:9646:47) at completeRequest (app/bower_components/angular/angular.js:9836:7) (22:31:11:425 | error) I'm not sure if this is the best way to do this, so any suggestion is more than welcome. Service shoppingListService.factory('ShoppingLists', function ($resource) { var factory = { getShoppingLists: $resource('http://localhost:8080/ShoppingListBackend/webresources/shoppinglists', {}, { all: {method: 'GET', isArray: true} }), getCategories : $resource('http://localhost:8080/ShoppingListBackend/webresources/shoppinglists/getcategories/:id', {id: '@id'}, { byId: {method: 'GET', isArray: true} }) }; return factory; }); Controller .controller('ShoppingListController', function ($scope, ShoppingLists) { $scope.shoppinglists = ShoppingLists.getShoppingLists.all(); $scope.getListCategories = function (id) { $scope.listCategories = ShoppingLists.getCategories.byId(id); }; }); View {{list.title}} {{getListCategories(list.id)}} Toilet Paper
answer count: 0
has comment: http://stackoverflow.com/comment/43993406
tagged with: http://stackoverflow.com/tag/json
has title: Error calling Controller Method from View - AngularJS
type: Question
has comment: http://stackoverflow.com/comment/43993374
tagged with: javascript
has comment: http://stackoverflow.com/comment/43993383
score: 0

http://stackoverflow.com/a/27714218
accepted answer of: http://stackoverflow.com/q/27705765
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27705765
has body: is there a way to suborganize the parts into some kind of partial views? Subcontrollers? These parts should really be directives. You would have the left view being a directive and the right view being a directive with the controller being the glue between the two directive instances. so an overview of the controller: myPageController tablesData : IData1Model[]; userSelectedTable : IData1Model;
score: 0
type: Answer

http://stackoverflow.com/comment/43959941
has text: You're right, but it does say _all HTML_. So I would assume the `!DOCTYPE` deceleration... That's just me though. :)
comment on: http://stackoverflow.com/a/27774574
type: AnswerComment
type: Comment
score: 2

http://stackoverflow.com/a/27742173
accepted answer of: http://stackoverflow.com/q/27740649
score: 2
answers question: http://stackoverflow.com/q/27740649
has body: Try this way. Find the group using a recursive method and collect leaf nodes using another recursive method. function getLeafNodes(leafNodes, obj){ if(obj.children){ obj.children.forEach(function(child){getLeafNodes(leafNodes,child)}); } else{ leafNodes.push(obj); } } function findIds(json,name){ if(json.children){ if(json.name==name) { var leafNodes = []; getLeafNodes(leafNodes,json); console.log(leafNodes.map(function(leafNode){ return leafNode.id; })); //Logs leaf node ids to the console } else { json.children.forEach(function(child){ findIds(child,name); }); } } } Execution of following code will print ["014", "288", "223", "244"] findIds(actualJSON,"group110");
upvote count: 3
type: AcceptedAnswer
downvote count: 1
type: Answer

http://stackoverflow.com/a/27708411
has comment: http://stackoverflow.com/comment/43829543
type: Answer
has body: You have a problem with quotation marks: document.writeln("First number is:" + + a + ); should be: document.writeln("First number is: " + a + ""); you can use \" to escape quotation inside a string, or use simple quotes: document.writeln('First number is: + ' + a + ''); See it in action: http://plnkr.co/edit/MWS1a0cKC3XM8sf5xLXk?p=preview
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/27708350
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27708350

http://stackoverflow.com/q/27668176
tagged with: ajax
score: 0
has title: Datatable AJAX, JSON & JQUERY - net::ERR_CONTENT_LENGTH_MISMATCH
tagged with: datatables
answer count: 1
has answer: http://stackoverflow.com/a/27668200
type: UnansweredQuestion
has body: I'm using the Datatables library to build an auto-refreshing table from a JSON feed. Which is working, however it throws this error every time data in the table changes: Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH The table does update correctly, it just throws a pop-up error every time it does. I'm completely new the Javascript/JQUERY so I'm clutching at straws trying to resolve it. Here's my custom code for the initial load and refresh: $(document).ready(function() { var table = $('#example').DataTable( { ajax: "http:xxx.com/datatables/examples/ajax/data/arrays.txt" } ); setInterval( function () { table.ajax.reload(); }, 1000 ); } ); Is there anyway I can stop the error popping-up? If it wasn't for the pop-up, the table does what it is supposed to do. Any help much appreciated, thanks.
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/43757877
has text: Now you gave even better solution with restoring scroll. Thank you.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27671464
score: 0

http://stackoverflow.com/comment/43750560
type: QuestionComment
comment on: http://stackoverflow.com/q/27667887
has text: Some bootstrap plugins can be delegated using `selector` option. Checking the DOC, it appears this one doesn't implement it so you should call this plugin on new specific elements once added to the DOM or find a workaround as in @Simo's answer, even this asnwer should be tested, not sure it will work as expected
score: 0
type: Comment

http://stackoverflow.com/a/32852181
upvote count: 8
type: Answer
has comment: http://stackoverflow.com/comment/71321875
has body: If you are using nested views just dont write any other Controller. By this way they will share same Controller Data. .state("main", { url: "/main", templateUrl: "templates/Ders", controller: "DersController as DersC" }).state("main.child1", { url: "/child1", templateUrl: "templates/Ders/child1" }).state("main.child2", { url: "/child2", templateUrl: "templates/Ders/child2" })
downvote count: 0
answers question: http://stackoverflow.com/q/27696612
score: 8

jasmine
tags question: http://stackoverflow.com/q/27697747
tags question: http://stackoverflow.com/q/27711427
tag name: jasmine
tags question: http://stackoverflow.com/q/27680933
tags question: http://stackoverflow.com/q/27777046
tags question: http://stackoverflow.com/q/27718743
tags question: http://stackoverflow.com/q/27741024
tags question: http://stackoverflow.com/q/27799728
tags question: http://stackoverflow.com/q/27736568
tags question: http://stackoverflow.com/q/27744197
type: Tag
tags question: http://stackoverflow.com/q/27683730
tags question: http://stackoverflow.com/q/27674361
tags question: http://stackoverflow.com/q/27749873
tags question: http://stackoverflow.com/q/27702569
tags question: http://stackoverflow.com/q/27748708

http://stackoverflow.com/a/27787556
answers question: http://stackoverflow.com/q/27787073
score: 0
type: Answer
has body: So I have included a cachebuster query following charlietfl's suggestion. It fixed the issue. This is what the updated code looks like: container.load(href + '.html?' + (new Date).getTime(), function(){ self.open(id); });

http://stackoverflow.com/q/27726314
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43864930
has answer: http://stackoverflow.com/a/27726495
type: Question
has comment: http://stackoverflow.com/comment/43864750
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Required Entry for only one button of two
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27726429
tagged with: php
accepted answer: http://stackoverflow.com/a/27726495
has comment: http://stackoverflow.com/comment/43864789
possible better answer: http://stackoverflow.com/a/27726429
has body: I have a form that has a text field that is a required entry for one(1) of my two(2) buttons. The first(1st) button applies a code, in the text field, to the products in the cart section of my store. The second(2nd) removes all codes from all products in the cart section. What's the best way of going about this? Thx. <form id="discount-coupon-form" action="<?php echo $this->getUrl('checkout/cart/couponPost') ?>" method="post"> <input class="input-text" id="coupon_code" name="coupon_code" value="<?php echo $this->escapeHtml($this->getCouponCode()) ?>" placeholder="Enter a Coupon or Promo Code" autocomplete="off"/> <button type="button" title="<?php echo $this->__('Apply Coupon') ?>" class="button" onclick="discountForm.submit(false)" value="<?php echo $this->__('Apply Coupon') ?>"><?php echo $this->__('Apply Coupon') ?> <button type="button" title="<?php echo $this->__('Cancel Coupon') ?>" class="button" onclick="discountForm.submit(true)" value="<?php echo $this->__('Cancel Coupon') ?>"><?php echo $this->__('Cancel Coupon') ?> The above form will be serialized and set to a controller via AJAX and an appropriate response will be returned. When the input box is null I want the input box to act as a required field and disallow submission via the first button. However, when it is null the second button should still allow for submission. When text is entered into the input box they both behave normally. Currently i'm attempting to do something like this: // var discountForm = new VarienForm('discount-coupon-form'); discountForm.submit = function (isRemove) { if (isRemove) { $('coupon_code').removeClassName('required-entry'); $('remove-coupone').value = "1"; } else { $('coupon_code').addClassName('required-entry'); $('remove-coupone').value = "0"; } if(something where I identify if it is required and the field is null){return null;} else{continue with ajax call;}
has comment: http://stackoverflow.com/comment/43864739
type: AnsweredQuestion

http://stackoverflow.com/comment/43807995
comment on: http://stackoverflow.com/a/27693656
score: 0
type: Comment
has text: Keep the animation going forever (an animation loop that does no work is not expensive). You could set/clear a flag (doAnimate) that indicates if the animation loop need to do work then in animateParallaxImages: `if(doAnimate) {...animate stuff...}`. About your memory leak...you'll just have to use the dev tools to track down the problem. Good luck with your project!
type: AnswerComment

http://stackoverflow.com/a/27763797
has body: Doing: var {x,y} = {x:3,y:5}; Is called a destructuring assignment and is a new feature in JavaScript, it requires a new JavaScript runtime. This feature is not supported in NodeJS yet and not even in v8 yet (the JS engine JavaScript runs on). You can either assign it in 3 lines manually or use a tool like Traceur or Babel to compile your ES6 (new specification of EcmaScript) to ES5 (what node runs) code.
accepted answer of: http://stackoverflow.com/q/27763781
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43938404
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/27763781
score: 6

http://stackoverflow.com/q/27658316
tagged with: express
has answer: http://stackoverflow.com/a/27658952
has title: How to capture database connection state or ping connection?
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27658952
has body: Using MySql driver for Node.js, here is my ping method: function ping(){ connection.connect(function(err) { if (err) { console.error('error connecting: ' + err.stack); return false; } console.log('connection authenticated: ' + (connection.state == "authenticated")); console.log('connected as id ' + connection.threadId); }); console.log("connection: " + connection.state); return (connection.state == "authenticated"); } Apparently, this node-mysql library does not have a native Ping method. I thought this would serve well in its stead. However, I am seeing the following issue in the console: debugger listening on port 53213 connection: disconnected Fri, 26 Dec 2014 14:12:38 GMT RazorJS Express server listening on port 3000 connection authenticated: true connected as id 17 It seems that the connection state is being logged and returning false before the connection is actually open. Maybe this is being executed async? How can I get this to function synchronously?
tagged with: mysql
type: Question
score: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/53144665
downvote count: 0
answers question: http://stackoverflow.com/q/27666936
has body: Loop through the rows and columns like so: for (let column = 0; column &lt; board.columns; column++) { for (let row = 0; row &lt; board.rows; row++) { } } and create the checkered pattern by drawing a rectangle if either of the following conditions is true: row is even and the column is odd row is odd and the column is even In code: if (row % 2 === 0 &amp;&amp; column % 2 === 1 || row % 2 === 1 &amp;&amp; column % 2 === 0) { canvas.context.rect( column * column_width, row * row_height, column_width, row_height ); } const canvas = { element: document.querySelector("canvas"), context: document.querySelector("canvas").getContext('2d') } const board = { rows: 15, columns: 17, colors: { light: '#a3cf53', dark: '#abd55a' } } canvas.context.beginPath(); canvas.context.fillStyle = board.colors.dark; canvas.context.rect(0, 0, canvas.element.width, canvas.element.height); canvas.context.fill(); canvas.context.beginPath(); canvas.context.fillStyle = board.colors.light; for (let column = 0; column &lt; board.columns; column++) { for (let row = 0; row &lt; board.rows; row++) { if (row % 2 === 0 &amp;&amp; column % 2 === 1 || row % 2 === 1 &amp;&amp; column % 2 === 0) { canvas.context.rect( column * canvas.element.width / board.columns, row * canvas.element.height / board.rows, canvas.element.width / board.columns, canvas.element.height / board.rows ); } } } canvas.context.fill(); body { margin: 0; } &lt;canvas width="595" height="525"&gt;&lt;/canvas&gt;
score: 4
type: Answer
upvote count: 4

http://stackoverflow.com/q/27782621
tagged with: cordova
has body: I am building an APP with Phonegap and I want a youtube video in my APP. I thought I could use the cordova plugin media for this but it doesn't work. Anyone knows what's wrong with my code or how to get a youtube video in my APP? Thanks KVL Leermomenten Welkom bij de expo ‘KVL-Leermomenten’. Afgelopen jaar zijn Oisterwijkers uitgenodigd in de huiskamer van het Leerlokaal KVL om mee te denken over de toekomst van dit gebouw. Hier is het idee ontstaan om een expositie over de geschiedenis van de Koninklijke Verenigde Lederfabriek (KVL) te organiseren. Het Leerlokaal KVL heeft dit idee vertaald in deze expo samen met ruim 240 leerlingen van 2College Durendeal uit Oisterwijk.De expo ‘KVL-Leermomenten’ maakt de geschiedenis op twee manieren zichtbaar. Zo is er enerzijds een tijdlijn van de leerfabriek te zien en anderzijds worden herinneringen aan de draaiende leerfabriek verteld, door mensen die er zelf mee te maken hebben gehad. Deze verhalen worden nu aan jullie doorgegeven en krijgen zo weer een nieuwe toekomst. Bekijk hieronder de video waarbij je een rondleiding krijgt in de expositie. Bekijk hier uw locatie. Maak je eigen expositie over erfgoed! hier komt filmpje 2 Javascript function loadScript() { // Wait for device to be ready loading everything onDeviceReady(); }; // When device is ready function onDeviceReady() { document.getElementById('nav1').addEventListener('mousedown', nav1Down, false); //mousedown = touchstart for app document.getElementById('nav1').addEventListener('mouseup', page1Show, false); //mouseup = touchend for app document.getElementById('nav2').addEventListener('mousedown', nav2Down, false); document.getElementById('nav2').addEventListener('mouseup', page2Show, false); document.getElementById('nav3').addEventListener('mousedown', nav3Down, false); document.getElementById('nav3').addEventListener('mouseup', page3Show, false); document.getElementById('volgende').addEventListener('mousedown', volgendeDown, false); document.getElementById('volgen…
type: UnansweredQuestion
tagged with: youtube
has title: How to get a youtube video in my APP ? ( build with Phonegap)
type: Question
tagged with: javascript
score: 0
tagged with: android
answer count: 1
has answer: http://stackoverflow.com/a/27783165

http://stackoverflow.com/q/27710949
type: UnansweredQuestion
tagged with: node.js
score: 2
answer count: 0
upvote count: 2
has title: Node.js MongoDB returning 0 documents while write lock is in place
type: Question
tagged with: mongodb
tagged with: javascript
has body: I have a simple node server running that queries mongoDB and returns documents to the client for processing. In the background, I have a java application that's capturing data from various sources and writing to the mongoDB instance as a batch process. The java app also updates records in the mongoDB instance as appropriate. The java app does this approximately once per minute, and usually includes about 500 inserts and maybe 1000 updates. Node.JS: var MongoClient = require('mongodb').MongoClient; var collection = ''; MongoClient.connect('pathToMongo', function(err, db){ collection = db.collection('mycollection'); }); ... app.get('/getData', function(req, res){ collection.find(queryString, {_id: 0, createdAt: 0}).sort({EVENTTIME:-1}).toArray(function(err,docs){ if (err){ console.log(err); res.send(500,err); } else { res.json(docs); } }); }); Java snippet (assuming I already have all my data to insert/update in result and a valid connection to mongoDB): public static void doWork(DBCollection coll){ while(result.next()){ BasicDBObject tempDoc = new BasicDBObject(); //Add values to tempDoc based on result iteration DBObject unchanged = coll.findOne(tempDoc); if (unchanged != null){ //update existing record DBObject modifiedObject = new BasicDBObject(); modifiedObject.put("$inc", new BasicDBObject().append("cyclesUnchanged", 1)); coll.update(unchanged, modifiedObject, false, false); } else { //insert record coll.insert(tempDoc); } } } Initialization of the java Mongo instance: MongoClient mongoClient; DB db; DBCollection coll = null; try{ mongoClient = new MongoClient('localhost", 27017); db = mongoClient.getDB("test"); coll = db.getCollection("mycollection"); } catch (Exception e){ System.out.println("Mongo Error."); System.exit(0); } final DBCollection newColl = coll; doWork(newColl); //call to method above My node server returns the exact number of documents I'm expecting most of the time (so it's not a query issue). However, occasionally, the query will run into a w…
has comment: http://stackoverflow.com/comment/43859713
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/44258044

http://stackoverflow.com/comment/43955169
type: Comment
has text: That fixed it! Thanks very much! :) Mixed up linkDistance with charge, a negative value with charge will make the nodes repel each other I think. Thanks again!
type: AnswerComment
comment on: http://stackoverflow.com/a/27771820
score: 0

http://stackoverflow.com/comment/43813742
type: AnswerComment
has text: I just don't understand, the same code works fine in web forms as in the link but does not work in mvc.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27700390

http://stackoverflow.com/comment/43885973
type: QuestionComment
comment on: http://stackoverflow.com/q/27737162
has text: Dear downvoter, why?, just why?
score: 0
type: Comment

http://stackoverflow.com/tag/svg
tags question: http://stackoverflow.com/q/27729234
tags question: http://stackoverflow.com/q/27799912
tags question: http://stackoverflow.com/q/27701347
tags question: http://stackoverflow.com/q/27753561
tags question: http://stackoverflow.com/q/27701607
tags question: http://stackoverflow.com/q/27704218
tags question: http://stackoverflow.com/q/27650510
tags question: http://stackoverflow.com/q/27751032
tags question: http://stackoverflow.com/q/27702100
tags question: http://stackoverflow.com/q/27751928
tags question: http://stackoverflow.com/q/27791056
tags question: http://stackoverflow.com/q/27801510
tags question: http://stackoverflow.com/q/27662502
tags question: http://stackoverflow.com/q/27686081
tags question: http://stackoverflow.com/q/27781735
tags question: http://stackoverflow.com/q/27665076
tags question: http://stackoverflow.com/q/27704974
tags question: http://stackoverflow.com/q/27713591
tag name: svg
tags question: http://stackoverflow.com/q/27789662
tags question: http://stackoverflow.com/q/27679975
tags question: http://stackoverflow.com/q/27650885
tags question: http://stackoverflow.com/q/27727144
tags question: http://stackoverflow.com/q/27703371
tags question: http://stackoverflow.com/q/27691620
tags question: http://stackoverflow.com/q/27678592
tags question: http://stackoverflow.com/q/27654913
tags question: http://stackoverflow.com/q/27801655
tags question: http://stackoverflow.com/q/27795351
tags question: http://stackoverflow.com/q/27688615
tags question: http://stackoverflow.com/q/27751434
tags question: http://stackoverflow.com/q/27749367
tags question: http://stackoverflow.com/q/27666838
tags question: http://stackoverflow.com/q/27768699
tags question: http://stackoverflow.com/q/27784529
tags question: http://stackoverflow.com/q/27738471
tags question: http://stackoverflow.com/q/27697757
tags question: http://stackoverflow.com/q/27786686
tags question: http://stackoverflow.com/q/27642270
tags question: http://stackoverflow.com/q/27670991
tags question: http://stackoverflow.com/q/27790128
tags question: http://stackoverflow.com/q/27653675
tags question: http://stackoverflow.com/q/27756267
tags question: http://stackoverflow.com/q/27761778
tags question: http://stackoverflow.com/q/27676455
tags question: http://stackoverflow.com/q/27710409
tags question: http://stackoverflow.com/q/27684956
tags question: http://stackoverflow.com/q/27775579
tags question: http://stackoverflow.com/q/27799755
tags question: http://stackoverflow.com/q/27665707
type: Tag

http://stackoverflow.com/a/27728007
upvote count: 2
downvote count: 0
type: Answer
has body: Refactor your times function like this: function times(n, obj, fx, arg) { for (var index = 0; index &lt; n; ++index) { obj[fx](arg); } } times(3, christophe, "greet", elodie); times(1, elodie, "getFullName" ); working fiddle: http://jsfiddle.net/acatkk53/
score: 2
answers question: http://stackoverflow.com/q/27727933

http://stackoverflow.com/comment/43811398
comment on: http://stackoverflow.com/q/27699059
score: 0
type: Comment
type: QuestionComment
has text: Where should the two buttons sit? Your Safari screenshot doesn't show either of them.

http://stackoverflow.com/comment/43772305
has text: what do you mean by `I cannot handle click events for EACH div, so I cannot identify which item has been clicked.` As in it doesnt work? or you cant figure out how to find out which div has been clicked?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27678881
score: 0

http://stackoverflow.com/comment/44063378
comment on: http://stackoverflow.com/a/27802561
score: 0
type: AnswerComment
has text: On another page/view (profile.html) there is a logout button with ng-click="auth.$unauth()" which then fires the $onAuth() callback detailed in the controller for that view. If I load that profile.html page (either through refresh or navigating back to it) more than once, the callback in that controller gets called/executed multiple times.
type: Comment

http://stackoverflow.com/comment/43762341
comment on: http://stackoverflow.com/a/27673560
score: 0
type: AnswerComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/67781/discussion-between-yuck-and-twinlakes).
type: Comment

http://stackoverflow.com/comment/43895413
type: QuestionComment
has text: No. The `body` is an implicit part of the `document` structure and cannot be removed.
score: 3
type: Comment
comment on: http://stackoverflow.com/q/27742293

http://stackoverflow.com/q/27647172
favorite count: 0
type: UnansweredQuestion
has title: how to search the value of data from db whatever i enter in the text field on html
has answer: http://stackoverflow.com/a/27647291
type: Question
has comment: http://stackoverflow.com/comment/43713351
has body: i used one text input with id.... &lt;input type="text" placeholder="" id="textsearch"&gt; i already created database.. this is my javascript code .... $("#search").click(function(){ var searchlist=$("#textsearch").val(); db.transaction(function (tx) { tx.executeSql('SELECT * FROM LOGS WHERE id LIKE '%searchlist%''); }); db.transaction(function (tx) { tx.executeSql('SELECT * FROM LOGS', [], function (tx, results) { var searchresult = results; msg = "&lt;p&gt;"+searchresult+"&lt;/p&gt;"; document.querySelector('#status').innerHTML = msg; },null); }); here status is div in html page please help me i want to get the data from the db....
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43712225
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 1

http://stackoverflow.com/q/27744285
type: AnsweredQuestion
tagged with: cookies
has answer: http://stackoverflow.com/a/27744339
type: Question
tagged with: encoding
answer count: 1
has title: In Js cookie html tags have gone
tagged with: javascript
tagged with: jquery
has body: I have a html text in js cookie. When i tried to get the text in cookie and set that text in a html div, it becomes encoded. I tried to decode the html but no use. This is my code: function addToCoupon(team1,team2,id,bet,rate){ var betTableContent=$('#bet_table').html(); var row="&lt;tr&gt;&lt;td&gt;"+team1+"-"+team2+"&lt;/td&gt;&lt;td&gt;"+bet+"&lt;/td&gt;&lt;td&gt;"+rate+"&lt;/td&gt;&lt;/tr&gt;"; betTableContent+=row; $.cookie("coupon",betTableContent); $('#bet_table').html(unescape($.cookie("coupon"))); } My text in #bet_table looks as not matter if I use unescape() function or not: %3Ctr%3E%3Ctd%3EHapoel%20Nazareth%20Elite-Maccabi%20Herzliya%3C%2Ftd%3E%3Ctd%3E1X2 So how can I display this html text as normal html?
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27744339

http://stackoverflow.com/a/27653483
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43725472
has comment: http://stackoverflow.com/comment/43724945
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/27652439
answers question: http://stackoverflow.com/q/27652439
has body: You can get the information about a particular book by making xhr request. I have created a function which return title and thumbanil of particular Book ID: function getBookDetails(id) { var xmlhttp = new XMLHttpRequest(); var url = "https://www.googleapis.com/books/v1/volumes/" + id; xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { var item = JSON.parse(xmlhttp.responseText); document.getElementById("content").innerHTML += "&lt;br&gt;" + item.volumeInfo.title + "&lt;br&gt;" + "&lt;img src=\""+item.volumeInfo.imageLinks.thumbnail+"\" &gt;"; } } xmlhttp.open("GET", url, true); xmlhttp.send(); } getBookDetails("buc0AAAAMAAJ"); Working Fiddle

http://stackoverflow.com/a/27785610
accepted answer of: http://stackoverflow.com/q/27785245
type: Answer
answers question: http://stackoverflow.com/q/27785245
has body: By using Regx. in string replace you can achieve this. See the below code var unicode_dictionary = { "\\00E9": "é", "\\00E0": "à" } var old_str = "rapport couvrant une p\00E9riode de 6 mois (f\00E9vrier \00E0 juillet)" function convert(){ for(var key in unicode_dictionary){ var regx=new RegExp(key,'g') old_str=old_str.replace(regx,unicode_dictionary[key]); } alert(old_str); } Convert
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/43876320
score: 1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27732433
has text: Because if you used an array the indexing would automatically start from zero and your problem would be solved.

http://stackoverflow.com/a/27672758
accepted answer of: http://stackoverflow.com/q/27669943
has body: To combine multi sliders in one page, please use different name. For example, the name of the first slider is 'slider1', please make the second named 'slider2'. So, please open thumbnail-07.source.html, replace all 'slider1' with 'slider2'.
answers question: http://stackoverflow.com/q/27669943
type: Answer
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/43924357
score: 0
type: Comment
type: QuestionComment
has text: Doesn't work. I will give a link up top to where all the code is and how its supposed to work. @abhitalks
comment on: http://stackoverflow.com/q/27756335

http://stackoverflow.com/q/27799780
has comment: http://stackoverflow.com/comment/44008184
tagged with: mongodb-query
has comment: http://stackoverflow.com/comment/44008361
has comment: http://stackoverflow.com/comment/44024981
has title: MongoDB query should return many information
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/27822808
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/44008967
has comment: http://stackoverflow.com/comment/44048047
has body: I'm still a beginner with MongoDB and I'm getting crazy to create a complex (for me) query with it. So, my model is: { email: String, name: String, orientation: String, location: { country: String, city: String }, contacts: { phone: String, email: String, website: String } } Now I created a query like this: User.aggregate([ { $group: { _id: { city: '$location.city', country: '$location.country', orientation: '$orientation' }, count: { $sum: 1 } } }, { $group: { _id: '$_id.country', count: { $sum: '$count' }, cities: { $push: { city: '$_id.city', count: '$count' } }, orientations: { $push: { orientation: '$_id.orientation', count: '$count' } } } } ], function(err, results) { if (err) return next(); console.log(JSON.stringify(results)); }); Unfortunately I receive good data but just in part. What I wish to have is a record with: total users (I don't have it) total users in each Country (I have it) total users in each City (I have it) total users for each orientation (I don't have it, I have total users for each orientation for each city) total users for each orientation in each city (I have it) Currently it return: [{ "_id": "France", "count": 1, "cities": [{ "city": "Maël-Carhaix", "count": 1 }], "orientations": [{ "orientation": "a", "count": 1 }] }, { "_id": "United Kingdom", "count": 4, "cities": [{ "city": "Bagshot", "count": 1 }, { "city": "London", "count": 3 }], "orientations": [{ "orientation": "a", "count": 1 }, { "orientation": "a", "count": 3 }] }] This is what I would like to have: "totalUsers": 5, "countries: [{ "_id": "France", "count": 1, "cities": [{ "city": "Maël-Carhaix", "count": 1 }], "orientations": [{ "orientation": "a", "count": 1 }] }, { "_id": "United Kingdom", "count": 4, "cities": [{ "city": "Bagshot", "count": 1 }, { "city": "London", "count": 3 }], "orientations": [{ "orientation": "a", "count": 4 }, { "orientation": "b" // if exist... "count: // n... }] }] I think to have changed this query hundreds of times but I'm at the 60% of the ope…
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44008817
has comment: http://stackoverflow.com/comment/44025328
has comment: http://stackoverflow.com/comment/44008243
has comment: http://stackoverflow.com/comment/44008666
answer count: 1

http://stackoverflow.com/comment/121509402
comment on: http://stackoverflow.com/a/63736713
score: 0
type: AnswerComment
has text: Your browser should consume the locale from OS settings, but to your point that can get complicated. Say for example the OS locale is set to `en-US`, but you also prefer `h23` time. I don't believe browsers have a way to detect this at the moment. I haven't researched it in a few years, so I would be curious if anything has changed. Using `hour12` works too, but I wouldn't recommend `dayPeriod` as only Safari seems to return that property.
type: Comment

titanium
type: Tag
tags question: http://stackoverflow.com/q/27759538
tag name: titanium
tags question: http://stackoverflow.com/q/27671920
tags question: http://stackoverflow.com/q/27801921

http://stackoverflow.com/comment/43811288
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27692201
type: Comment
has text: I added that plugin already !

http://stackoverflow.com/comment/43710683
type: AnswerComment
type: Comment
has text: No you moved it. If you look at the original source in your browser you will maybe still see it but look at your demo in a browser debugger and you will see it is moving.
comment on: http://stackoverflow.com/a/27646345
score: 0

http://stackoverflow.com/a/27700592
has comment: http://stackoverflow.com/comment/43814228
has body: you need to install PHP for Tomcat &amp; set its path to compile it.see the below link for php configuration settings. http://php-java-bridge.sourceforge.net/doc/tomcat6.php http://www.studytrails.com/blog/php-on-a-java-app-server-apache-tomcat-using-quercus/
answers question: http://stackoverflow.com/q/27700437
has comment: http://stackoverflow.com/comment/43813977
score: 3
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43814148
type: Answer
has comment: http://stackoverflow.com/comment/43814080
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27700437

http://stackoverflow.com/q/27679577
tagged with: responsive-design
has body: Hello i am trying to achieve this effect with css but im not sure is it possible, here is an image what im trying to do: it needs to have fluid width (70%, 30%), then later i will put float:none via mediaquerys so images will go one below the other, but it also needs to have fluid height, or the right column needs to be same height as the left so i tried with this css: .gallery{ width:100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .gallery-70{ width:70%; float:left; box-sizing: border-box; } .gallery-30{ width:30%; float:right; box-sizing: border-box; } .gallery img{ width:100%; } html: &lt;div class="gallery"&gt; &lt;div class="gallery-70"&gt; &lt;img src="images/img1.jpg"&gt; &lt;/div&gt; &lt;div class="gallery-30"&gt; &lt;img src="images/img1.jpg"&gt; &lt;/div&gt; &lt;div class="gallery-30"&gt; &lt;img src="images/img1.jpg"&gt; &lt;/div&gt; &lt;/div&gt; and i got this result then i tried to set height for big and small images like this .gallery .imgbig{ width:100%; height:100%; max-height:500px; } .gallery .imgsmall{ width:100%; height:100%; max-height:250px; } And it looks fine (cant put image beacuse reputation) but when i try to resize it and img width:100% do its thing it gets back to SECOND LINK (again reputation) . Is there any way to do this with css or jquery. TY in advance and sry for bad english
accepted answer: http://stackoverflow.com/a/27679749
has title: responsive image gallery with different heights - how to achieve this with css (or jquery)
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27679749
answer count: 1
tagged with: css
favorite count: 0
upvote count: 2
score: 2
type: AnsweredQuestion

http://stackoverflow.com/a/27725579
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43863362
accepted answer of: http://stackoverflow.com/q/27725500
answers question: http://stackoverflow.com/q/27725500
has body: $(document).ready(function() { // Targeting 2nd li element inside #packages var price=$("#packages li").eq(2).data("cost"); // create a span element with text 'price' var amount=$("&lt;span&gt;"+price+"&lt;/span&gt;"); // append as last child of the form $("#form").append(amount); });
type: AcceptedAnswer
type: Answer
score: 0

computed-properties
type: Tag
tag name: computed-properties
tags question: http://stackoverflow.com/q/27711649

http://stackoverflow.com/comment/43745340
has text: done you are right color problem is solved but still content of 1st div is not showing .May be this is beacause in my original webpage there are somay divs and in your code i am using div:nth-of-type(2){ display:block; } can you apply some other identity to this that makes it unique from other divs present in my original webpage
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27664701
type: Comment

http://stackoverflow.com/comment/43821264
score: 2
comment on: http://stackoverflow.com/q/27704634
type: Comment
type: QuestionComment
has text: remove the `var` from `s = 11`. But how you get 70 or 80 from that I have no idea

http://stackoverflow.com/comment/43745212
comment on: http://stackoverflow.com/a/27664701
type: Comment
score: 0
type: AnswerComment
has text: @Darkknight look at my fiddle and copy my HTML and CSS exactly how I have them

http://stackoverflow.com/a/32383538
has comment: http://stackoverflow.com/comment/52830340
downvote count: 0
has body: I know this is an old post and you may not even be using this anymore, but you just need to float your holding class left: .yourclass { float: left; }
has comment: http://stackoverflow.com/comment/52786323
answers question: http://stackoverflow.com/q/27681211
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/52685339
score: 2

http://stackoverflow.com/q/27738965
has answer: http://stackoverflow.com/a/27739009
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43888722
type: Question
has answer: http://stackoverflow.com/a/27738994
accepted answer: http://stackoverflow.com/a/27738987
linked to: http://stackoverflow.com/q/4524661
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44200870
has body: Hi I am trying to generate dynamically HTML tables using append(). The way I have written the code is if the user wants to enter the data in the localStorage it first checks if it is empty.If it is empty the code in if block gets executed.If not empty then the else block gets executed.All this code is in the getDetails() JavaScript function. I have given the dynamically generated table id as "myTable". &lt;table align="center" id="myTable"&gt; &lt;/table&gt; &lt;script&gt; function getdetails(){ if(localStorage.length == 0){ ...... } else{ do something ... } } &lt;script&gt; The issue is that I need to get the row number when I click the table row.For that I have created the following function. $(window).load(function() { $("#myTable tr").click(function(){ ..... }); }); The above code gets executed (window.load ) when the page refreshes or loads for th first time.But when I add another row in the HTML table( the code exceutes the else block since localStorage is not empty) and click any table row the code doesnt work. Could anyone please tell me on how to get the .click() to work every time.Thanks.
tagged with: jquery
has answer: http://stackoverflow.com/a/27739097
has answer: http://stackoverflow.com/a/27738987
possible better answer: http://stackoverflow.com/a/27739009
has title: calling .click() script inside another function
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43943915
comment on: http://stackoverflow.com/q/27766679
type: Comment
type: QuestionComment
has text: there is some problem in Your Jsp .can you explain what you are doing in JSP.
score: 0

http://stackoverflow.com/comment/43807476
type: Comment
comment on: http://stackoverflow.com/q/27697103
has text: what error you find??
score: 0
type: QuestionComment

http://stackoverflow.com/a/27746421
has comment: http://stackoverflow.com/comment/43905932
accepted answer of: http://stackoverflow.com/q/27745604
score: 0
answers question: http://stackoverflow.com/q/27745604
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43904589
has comment: http://stackoverflow.com/comment/43905107
type: Answer
has comment: http://stackoverflow.com/comment/43906835
has body: The code is correct, so the function may not be getting triggered. Add a Logger.log('test ran!'); statement, and VIEW the LOG to see if anything printed to the LOG. If nothing printed to the LOG, then the function never got triggered. If there is an error that is killing your code, it should show up in the VIEW, EXECUTION TRANSCRIPT log.

http://stackoverflow.com/comment/43850272
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27719358
has text: You would have to ask [Brendan Eich](http://en.wikipedia.org/wiki/Brendan_Eich) for his reasons ,-)

http://stackoverflow.com/a/27683252
has comment: http://stackoverflow.com/comment/43781368
downvote count: 0
has body: Because instead of an argument or variable it uses window.length property which happens to be 0.
upvote count: 6
answers question: http://stackoverflow.com/q/27683233
type: Answer
score: 6

http://stackoverflow.com/q/27680910
has title: Why does ViewModel.getStore("Key") return null?
answer count: 1
tagged with: javascript
tagged with: extjs
score: 0
tagged with: mvvm
tagged with: extjs5
has answer: http://stackoverflow.com/a/27695299
has body: The previous version was incorrect. My apologies. I'm trying to load a store from the server with some parameters. onSave: function (cmp) { var vm = cmp.up('stageform').getViewModel(); vm.set("extraParams", {applicationFormId: 1}); var store = vm.getStore("applicationForms"); console.log(store); } vm.getStore("applicationForms"); returns null when the event is fired the first time, after that it returns the actual instance of the store. Why do I get such a strange behavior? And is this the proper way of loading data from the server? ViewModel Code: Ext.define('CPCApplication.view.cases.ApplicationFormModel', { ..... stores: { applicationForms: { model: 'CPCApplication.model.ApplicationForm', autoLoad: true, proxy: { type: 'ajax', extraParams: '{extraParams}', autoload: true, url: ..., reader: { type: 'json' } }, } } });
type: UnansweredQuestion
type: Question

http://stackoverflow.com/q/27754101
upvote count: 8
type: Question
possible better answer: http://stackoverflow.com/a/43028804
has answer: http://stackoverflow.com/a/27757291
accepted answer: http://stackoverflow.com/a/27757291
tagged with: javascript
has body: I have created a Google Maps Multiple locations page, using Advanced Custom Fields Google Map field. I have managed to make the marker icon change when clicked on, but I want it to be changed back when clicking on other icons. here is an example of the code: for (i = 0; i &lt; locations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: iconBase + 'Stock%20Index%20Up.png' }); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(locations[i][0], locations[i][6]); infowindow.open(map, marker); marker.setIcon("https://cdn3.iconfinder.com/data/icons/musthave/24/Stock%20Index%20Down.png"); } })(marker, i)); Better look of the working code here: http://jsfiddle.net/gargiguy/s8vgxp3g
favorite count: 0
tagged with: google-maps-api-3
answer count: 3
tagged with: google-maps-markers
score: 8
has answer: http://stackoverflow.com/a/43028804
has title: Change Google Maps marker icon when clicking on other
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/51781393
tagged with: advanced-custom-fields
downvote count: 0

http://stackoverflow.com/comment/43779061
score: 0
has text: Good catch +!, turned out three other files shared this bug (and effectively broke with the upgrade) as well!
type: Comment
comment on: http://stackoverflow.com/a/27682104
type: AnswerComment

http://stackoverflow.com/comment/59763386
type: AnswerComment
type: Comment
has text: Do NOT do this. If you have 5 errors on the line, they will all be ignored. Always explicitly set the rule which is to be ignored or the kids will make a mess.
score: 31
comment on: http://stackoverflow.com/a/35015622

http://stackoverflow.com/q/27765399
type: Question
has comment: http://stackoverflow.com/comment/43941688
tagged with: javascript
has comment: http://stackoverflow.com/comment/43941841
score: 0
has body: I need, using ui-routes, to create multiple, compare-two-models pages with params like so: http://localhost:3030/compare/thinkpad-t430-and-thinkpad-x220 Here is my $stateProvider: .state('compareTwo', { url: '/compare/:models', templateUrl: '/views/compareTwo.html', controller: 'CompareTwoCtrl' }); Here is my html: Compare Well its changes url, logs the message from the new controller, but still stays on the same view and controller. But if you change url: '/compare/:models' to url: '/:models' everything works fine. Why is that?
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43941971
tagged with: angular-ui-router
has title: AngularJS-UI-Router path before :params issue

http://stackoverflow.com/q/27763737
possible better answer: http://stackoverflow.com/a/27763757
tagged with: javascript
has answer: http://stackoverflow.com/a/27763757
answer count: 2
has title: Multiple condition in .each jQuery
downvote count: 0
tagged with: jquery
has body: Here is my HTML Name: something I want to change sp-rightclass to sp-left class and sp-left to sp-right with toggle . here is my jquery : $(".sp-right").each(function(){ $(this).removeClass("sp-right").addClass("sp-left"); }); it's working only once and for 1 element ? Any idea ? Thanks
favorite count: 0
has answer: http://stackoverflow.com/a/27763805
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27763805

http://stackoverflow.com/q/27774772
possible better answer: http://stackoverflow.com/a/27774999
has title: Why is the first date not being added to an array
has answer: http://stackoverflow.com/a/27774999
answer count: 2
accepted answer: http://stackoverflow.com/a/27774853
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43960440
has body: Why is the first date not being added to this array? function createArrayOfDates(start, end) { var dateArray = []; while(start &lt; end) { dateArray.push(start); start = new Date(start.setDate( start.getDate() + 1 )); } return dateArray; } start = new Date(2015, 01, 01); end = new Date(2015, 01, 05); console.log(createArrayOfDates(start, end)); The Output I expect should include the first date (2015/01/01) but the array starts at the second. Any ideas?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27774853
upvote count: 1
type: Question

http://stackoverflow.com/q/27802658
has comment: http://stackoverflow.com/comment/44014793
has comment: http://stackoverflow.com/comment/44014674
has answer: http://stackoverflow.com/a/27803116
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44014558
has comment: http://stackoverflow.com/comment/44014391
has title: Javascript to force browser back button to go back 2 pages
has comment: http://stackoverflow.com/comment/44014218
type: UnansweredQuestion
downvote count: 2
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/44014890
score: -1
type: Question
tagged with: javascript
tagged with: jquery
has body: I have a link on a page that goes to a redirect php and then onto another page based on a user input from page one. Problem is that when the user is on page three and presses the back button if they wish to select a different option is going to the php redirect and returning to page 3 again. Any solution for this? my idea was to call a JS using the history.go(-2) which someone has told me about but i'm not technical enough to code this. Could someone provide the HTML JS call to go in my page head on page 3 and the contents of the JS file i would need to call if this will work? Thanks. &lt;?php $choice = $_GET['choice']; switch ($choice) { case "Arrange a personal demo": header("Location: http://exela.co.uk/infusionsoft/arrange-demo/"); break; case "Speak with a personal consultant": header("Location: http://exela.co.uk/infusionsoft/arrange-demo/"); break; case "View pricing options": header("Location: http://exela.co.uk/infusionsoft/pricing/"); break; case "View training options": header("Location: http://exela.co.uk/infusionsoft-training/"); break; } ?&gt;

http://stackoverflow.com/q/27747660
has comment: http://stackoverflow.com/comment/43906711
upvote count: 3
has answer: http://stackoverflow.com/a/27747851
accepted answer: http://stackoverflow.com/a/27747851
downvote count: 1
has comment: http://stackoverflow.com/comment/43906449
favorite count: 0
score: 2
has title: JQuery.one() event that fires immediately
type: AnsweredQuestion
has body: I'm making a jquery plugin in which you can set the event for something to happen. $.fn.makeSomething = function(options) { var defaults = { activationEvent: "mouseover" }; options = $.extend(defaults, options); this.each(function() { var elem = $(this); elem.one(options.activationEvent, function(){ // some code to be called at the event (in which I use elem) // but by default should be called immediately on load }); }); return this; } I would like the default to be that it just happens without any needed interaction. Is this possible? A little more info: I have several divs in which some extra content should be loaded. By default I want the content to be loaded when the page loads. However, on some pages I don't want all the content to be loaded with the page, but I want each piece to be loaded only when you hover your mouse over its div. Thanks!
has comment: http://stackoverflow.com/comment/43906752
has comment: http://stackoverflow.com/comment/43906408
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/43979945
comment on: http://stackoverflow.com/q/27656184
type: QuestionComment
has text: No, Its hand made. No Templates..
score: 0
type: Comment

http://stackoverflow.com/comment/43893281
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27741130
type: Comment
has text: Dear Akash. okay but how can i link this with my app.js file? kindly explain me in detail..

http://stackoverflow.com/q/27758833
favorite count: 0
upvote count: 2
has body: I have searched all over but have not figured out what I am doing wrong. I am trying to set up mocha for testing node.js javascript application files. I have node installed and have successfully ran basic things on it to confirm it is working. I installed mocha in my project file, and also have a Makefile and a file called "test" within my project file as well. Here is the error my terminal(osx 10) is spitting out when I run the command "make test". humbleMousesMBP:chapter02 humbleMouse$ make test /Users/humbleMouse/chapter02/test/exchange.test.js:22 ￼￼ ^ SyntaxError: Unexpected token ILLEGAL at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at /Users/humbleMouse/chapter02/node_modules/mocha/bin/_mocha:313:27 at Array.forEach (native) at load (/Users/humbleMouse/chapter02/node_modules/mocha/bin/_mocha:310:9) at Object.&lt;anonymous&gt; (/Users/humbleMouse/chapter02/node_modules/mocha /bin/_mocha:301:1) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3 make: *** [test] Error 8 This is the test I am trying to run: 'use strict'; var assert = require('assert') , should = require('should'); var exchangeData = {}; suite('exchange', function() { test('buy should add a BUY nockmarket order', function(done) { exchangeData = exchange.buy(40, 100, exchangeData); exchangeData.buys.volumes[40].should.eql(100); done(); }); test('sell should add a SELL nockmarket order', function(done) { exchangeData = exchange.sell(41, 200, exchangeData); exchangeData.sells.volumes['41'].should.eql(200); //this is line 22 done(); }); ￼￼ test('sell should produce trades', function(done) { exchangeData = exchang…
tagged with: node.js
type: AnsweredQuestion
score: 2
has title: Unexpected token ILLEGAL while running node.js mocha test
type: Question
downvote count: 0
tagged with: javascript
tagged with: mocha.js
answer count: 1
has answer: http://stackoverflow.com/a/27758882
accepted answer: http://stackoverflow.com/a/27758882

http://stackoverflow.com/a/27787527
score: 82
type: Answer
has comment: http://stackoverflow.com/comment/43985989
type: AcceptedAnswer
downvote count: 0
upvote count: 82
answers question: http://stackoverflow.com/q/27778105
has comment: http://stackoverflow.com/comment/43986549
has body: The three reasons were: Readability. A generator is quite different from a function, and the difference should be immediately visible (that is, without examining the whole implementation in search for a yield). Generality. It should be naturally possible to write generators that do not yield, and only return directly. Moreover, commenting out part of the body (e.g. for debugging) should not silently change whether something is a generator. Compatibility. Only strict mode reserved 'yield' as a keyword, but it was made a goal for ES6 that all new features are also available in sloppy mode (an unfortunate decision IMHO, but nevertheless). Moreover, even in strict mode there are many parsing subtleties around 'yield'; for example, consider default arguments: function* g(a = yield(2)) { 'use strict' } Without the *, the parser could only decide how to parse the yield after it has seen the body of the function. That is, you would need infinite look-ahead, or back-tracking, or other hacky techniques to deal with this. I should note that (1) and (2) are already reason enough. (Full disclosure: I am a member of the EcmaScript committee.)
accepted answer of: http://stackoverflow.com/q/27778105

http://stackoverflow.com/comment/44003593
has text: FYI, jQuery lets you specify multiple selectors in one string: `$("#player2, #player3, #player4").hide()` for instance.
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27794960

http://stackoverflow.com/comment/43884513
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27735075
has text: I'm hesitating between Typescript and Dart. Because the process to be able to call Javascript from Dart is quite long.

http://stackoverflow.com/a/27815256
has comment: http://stackoverflow.com/comment/44039281
score: 54
has comment: http://stackoverflow.com/comment/46328290
accepted answer of: http://stackoverflow.com/q/27791644
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27791644
downvote count: 0
has body: See the "Initiator" column in the network tab. It tells you which code initiated the AJAX call. You will also get a tooltip with a full stack trace.
type: Answer
upvote count: 54
has comment: http://stackoverflow.com/comment/58390906
has comment: http://stackoverflow.com/comment/65234169

http://stackoverflow.com/q/27714009
type: AnsweredQuestion
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/27716405
tagged with: browser
has comment: http://stackoverflow.com/comment/43840891
score: 2
has title: Opening Multiple New Pages in Browsers from the console
answer count: 1
has comment: http://stackoverflow.com/comment/43840968
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27716405
has comment: http://stackoverflow.com/comment/43840992
has body: I'm trying to use the browser console to get some data. I've managed to make an array of anchor elements. The DOM has a .click() method. When I run the following it only launches one new browser tab links.forEach(function(element) { element.click(); }); the tab launched corresponds to the last link in the links array, so it feels like it may be a closure issue. The variables are the correct format as I'm able to execute links[0].click() links[1].click() links[2].click() ... and download the files from my browser by incrementing the index by hand. But I have 68 of these links and would like to automate it. Any help? update: for(var i = 0; i &lt; links.length; i++) { links[i].click(); console.log(i); } only opens the last link as well. And prints out 68 numbers. update2: Here's some context on what motivated this question http://harrymoreno.com/2014/12/30/Scraping-links-with-your-browser.html
has comment: http://stackoverflow.com/comment/43841104
tagged with: console.log
has comment: http://stackoverflow.com/comment/43840754
favorite count: 0
has comment: http://stackoverflow.com/comment/43840683
downvote count: 1

http://stackoverflow.com/comment/65124652
has text: What do you mean by "mess up"?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27891444
type: AnswerComment

http://stackoverflow.com/a/27725537
score: 8
has body: You can loop over every .foo and create an Inview for each: $('.foo').each(function() { new Waypoint.Inview({ element: this, entered: function(direction) { $(this.element).addClass('active'); } }); });
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27686851
upvote count: 8
answers question: http://stackoverflow.com/q/27686851
type: AcceptedAnswer

http://stackoverflow.com/q/27734238
accepted answer: http://stackoverflow.com/a/27734323
answer count: 2
downvote count: 3
has body: Is it possible to once press a random value on from the 25 given and change the value of the button next to it? http://jsfiddle.net/ehcfqm22/ $(document).on('click', '#table input',function () { var value1 = ""; value1 = $(this).val(); }); I'm able to get the current button value but that's about it.
favorite count: 0
has title: Unable to change the button value next to another button - Javascript - JQuery
score: -3
possible better answer: http://stackoverflow.com/a/27734338
type: AnsweredQuestion
upvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/43880057
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27734338
has answer: http://stackoverflow.com/a/27734323

http://stackoverflow.com/comment/43981755
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27746151
has text: Shouldn't be that hard to change my code to split it every N characters, and then if N+1 its a space leave it alone, otherwise, subtract 1 and insert a hyphen.

http://stackoverflow.com/q/27762824
has comment: http://stackoverflow.com/comment/43936800
tagged with: javascript
type: UnansweredQuestion
has body: i have a problem with this code, in INSERT only insert the first item_price in every insert, in example i have three differents item_price, thanks for you help sorry for bad english html part in table: 1 2 3 javascript part: $(document).on("click","button#checkoutinventory, a[href$='checkoutinventory']",function() { var items = ""; var price = ""; $("tr[id^=shop] button.btn-danger").each(function() { items += $(this).parents("tr").attr("id").replace(/\D/g,'')+","; price += $(this).parents("tr").find('input[name="price"]').val().replace(/\D/g,'')+","; //this code send price in this format: 1,2,3,etc }); if (!items) return displayResponse("ERROR","an error ocurred try again."); var settings = {}; settings['action'] = "checkoutinventory"; settings['items'] = items; settings['price'] = price; $.get("includes/process.php", settings, function(data) { processResponse(data); }); return false; }); process.php part: if ($_GET['action'] == "checkoutinventory") { if (!@$character) exit("REFRESH"); if (!$VALIDATE->blank(@$_GET['items'])) exit(); $items = explode(",", rtrim($_GET['items'],",")); //Here obtain item_id in this format: id_1,id_2,id_3,etc $price = $_GET['price']; //Here obtain item_price in this format: price1,price2,price3,etc $isonline = $SERVER->select($query['characterIsonline'],array($COOKIE->get("character"))); if(!$isonline) { $itemData = $SERVER->select("SELECT * FROM `items` WHERE `object_id` IN (".implode(",",$items).");",array()); //Here obtain perfectly information for insert later in foreach } else { exit("RESPONSE^ERROR^Your character ".$character['char_name']." is online disconnect please and try again.."); } if($itemData) { foreach($itemData as $itemlist) { $selling = $SERVER->insert("INSERT INTO `shop_items` (`itemId`,`itemAmount`,`itemPrice`,`itemEnchant`,`vendedor`,`object_id`) VALUES (?,?,?,?,?,?);",array($itemlist['item_id'],$itemlist['count'],$_GET['price'],$itemlist['enchant_level'],$character['char_name'],$itemlist['object_id'])); } } if (coun…
has answer: http://stackoverflow.com/a/27763019
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
type: Question
has title: javascript send variable but insert array php not work propertly
tagged with: php
tagged with: mysql
upvote count: 1
answer count: 1

http://stackoverflow.com/q/27802851
has comment: http://stackoverflow.com/comment/44014584
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/27803827
tagged with: http://stackoverflow.com/tag/html
has body: I have a to-do list that I'm trying to write, and I'm struggling with getting the information out of my inputs and into a predefined template (written in the HTML). I have attached the code for help... To-Do List Create Task Submit Drag your task here to delete it. Tasks Subject Due Date Description In Progress Completed In Progress Completed
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27803289
has comment: http://stackoverflow.com/comment/44015317
has title: Writing from an input to a div
score: 0

http://stackoverflow.com/q/27701779
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43816183
tagged with: javascript
has title: Word for aliasing globals or properties as local variables for better compression
tagged with: variables
has body: For the last few weeks, I've had a maddening case of "tip-of-the-tongue" syndrome concerning a colloquial verb I read a while ago while digging through uncompressed JavaScript. At the top of the module's closure, the author had assigned commonly used values like true to a JavaScript variable named "TRUE", false to a variable named "FALSE", and similar transformations applied to other suspects. In a comment, the author had written something along the lines of "Here we'll ******* some commonly used variables for better minification". I vaguely remember it sounding something like, uhm... "kludge" or something like that...? Was ages ago. Either way, I see this practice all the time with scripts the size of Olympus Mons, I just wish I remembered the damn word... :( EDIT: Yeah, okay, it definitely wasn't "kludge", but I vaguely remember it having a similar phonetic structure. This is starting to keep me up at night...
has comment: http://stackoverflow.com/comment/43816385
tagged with: minify
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43816215
tagged with: build
has answer: http://stackoverflow.com/a/27974273
tagged with: compression
type: Question

http://stackoverflow.com/comment/43792399
comment on: http://stackoverflow.com/q/27683658
type: Comment
type: QuestionComment
has text: @RequestMapping(value = "/heartbeat", method=RequestMethod.GET) protected void doGet(HttpServletRequest request, HttpServletResponse response) { request.getSession(); }
score: 0

http
tags question: http://stackoverflow.com/q/27692546
tags question: http://stackoverflow.com/q/27645411
tags question: http://stackoverflow.com/q/27761362
tags question: http://stackoverflow.com/q/27715248
tag name: http
type: Tag
tags question: http://stackoverflow.com/q/27746142
tags question: http://stackoverflow.com/q/27676645
tags question: http://stackoverflow.com/q/27681555
tags question: http://stackoverflow.com/q/27662402
tags question: http://stackoverflow.com/q/27676151
tags question: http://stackoverflow.com/q/27644047
tags question: http://stackoverflow.com/q/27649157
tags question: http://stackoverflow.com/q/27711004
tags question: http://stackoverflow.com/q/27694711

http://stackoverflow.com/comment/43874351
type: Comment
score: 1
has text: Thanks, @AliNaddaf. I'm aware of the Cast button in the extension; I'm looking to show the enumerated receivers in a different place in my UI. Think of it as a management UI. Is that possible?
type: AnswerComment
comment on: http://stackoverflow.com/a/27728360

http://stackoverflow.com/a/27760258
has comment: http://stackoverflow.com/comment/43931609
score: 5
has comment: http://stackoverflow.com/comment/43931619
type: AcceptedAnswer
downvote count: 0
has body: "In fact, collisionBlocs() is a callback function from a phaser collision events : game.physics.arcade.collide(this.sprite, blocs, this.collisionBlocs); Maybe that's the problem" That will be the problem. In JS, the value of this within a function depends on how a function is called. You pass a reference to collisionBlocs to the .collide() method and when it calls it it won't be setting this correctly so then this.bounce will be undefined. You need to force the value of this to be correct. The easiest way to do that is with .bind(): game.physics.arcade.collide(this.sprite, blocs, this.collisionBlocs.bind(this)); The .bind() method is not supported in older browsers (IE &lt;=8), but there is a polyfill you can use if you need to support those browsers. MDN has more information on how this works in JavaScript.
type: Answer
answers question: http://stackoverflow.com/q/27760125
accepted answer of: http://stackoverflow.com/q/27760125
has comment: http://stackoverflow.com/comment/43931665
upvote count: 5

http://stackoverflow.com/comment/43703290
has text: Should actually find some good articles on subject of loading. I've seen a few lately discussing some advanced loading techniques. Here's one I had stored might be helpful http://www.html5rocks.com/en/tutorials/speed/script-loading/ Also look into `Above the fold loading` .. basically deferring what wouldn't be in viewport until after page load
comment on: http://stackoverflow.com/q/27641978
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/43839504
comment on: http://stackoverflow.com/q/27713548
type: Comment
type: QuestionComment
score: 0
has text: Since you are defining `toString` method as a prototype method, it becomes an instance property of the created object. It means that after creating a person with `var person = x.newPerson(1, "John");` you can use it like `person.toString()`. Also `this.Id` should be `this.id` in `toString` definition.

http://stackoverflow.com/comment/43766139
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27675746
type: Comment
has text: That'll be using GET, not POST.

http://stackoverflow.com/q/27790384
has comment: http://stackoverflow.com/comment/43990625
answer count: 1
has answer: http://stackoverflow.com/a/27790459
tagged with: javascript
has comment: http://stackoverflow.com/comment/43990650
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/43991413
accepted answer: http://stackoverflow.com/a/27790459
downvote count: 2
upvote count: 1
has body: How can I automatically click on an object using onload() with HTML. Here's the button I would like to be automatically clicked: &lt;input type="button" value="{$LANG.checkout} &amp;raquo;" class="checkout" onclick="addtocart();" /&gt; What I would like to happen is for the button to be clicked automatically; as soon as a certain div is loaded. I know it's possible to do with Javascript, but is there any way to do it without javascript? If javascript is the only way I am more than open to it!
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43990644
has title: Automatically click using onload?
score: -1
type: Question

java
tags question: http://stackoverflow.com/q/27772432
tags question: http://stackoverflow.com/q/27679803
tags question: http://stackoverflow.com/q/27756540
tags question: http://stackoverflow.com/q/27686998
tags question: http://stackoverflow.com/q/27731813
tags question: http://stackoverflow.com/q/27659328
tags question: http://stackoverflow.com/q/27666463
tags question: http://stackoverflow.com/q/27692842
tags question: http://stackoverflow.com/q/27766679
tags question: http://stackoverflow.com/q/27801025
tags question: http://stackoverflow.com/q/27692599
tags question: http://stackoverflow.com/q/27640350
tags question: http://stackoverflow.com/q/27731375
tags question: http://stackoverflow.com/q/27726805
tags question: http://stackoverflow.com/q/27683658
tags question: http://stackoverflow.com/q/27761392
tags question: http://stackoverflow.com/q/27658370
tags question: http://stackoverflow.com/q/27784663
tags question: http://stackoverflow.com/q/27675432
tags question: http://stackoverflow.com/q/27697369
tags question: http://stackoverflow.com/q/27795596
tags question: http://stackoverflow.com/q/27796707
tags question: http://stackoverflow.com/q/27732141
tags question: http://stackoverflow.com/q/27696957
tags question: http://stackoverflow.com/q/27642662
tags question: http://stackoverflow.com/q/27803159
tags question: http://stackoverflow.com/q/27699483
tags question: http://stackoverflow.com/q/27800051
tags question: http://stackoverflow.com/q/27746801
tag name: java
tags question: http://stackoverflow.com/q/27691313
tags question: http://stackoverflow.com/q/27736141
tags question: http://stackoverflow.com/q/27669122
tags question: http://stackoverflow.com/q/27729908
tags question: http://stackoverflow.com/q/27786016
tags question: http://stackoverflow.com/q/27661573
tags question: http://stackoverflow.com/q/27788356
tags question: http://stackoverflow.com/q/27706808
tags question: http://stackoverflow.com/q/27700823
tags question: http://stackoverflow.com/q/27764495
tags question: http://stackoverflow.com/q/27732654
type: Tag
tags question: http://stackoverflow.com/q/27652768
tags question: http://stackoverflow.com/q/27653218
tags question: http://stackoverflow.com/q/27657192
tags question: http://stackoverflow.com/q/27646694
tags question: http://stackoverflow.com/q/27777471
tags question: http://stackoverflow.com/q/27645876
tags question: http://stackoverflow.com/q/27710787
tags question: http://stackoverflow.com/q/27786003

http://stackoverflow.com/comment/43873928
type: Comment
comment on: http://stackoverflow.com/a/27731227
type: AnswerComment
has text: @wmock: Use of the word "inheritance" with prototypical inheritance is very well-established with something like a 35-year history, long predating JavaScript. Feel free to race against the wind if you like, but I'd keep it out of answers if you're trying to be most useful. :-) *(Not my dv)*
score: 0

http://stackoverflow.com/a/27691389
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43796000
type: Answer
score: 7
upvote count: 7
has body: Your code works fine but you simply put caret to the wrong place. Change the last line to: this.selectionStart = this.selectionEnd = start + spaces.length; DEMO: http://jsfiddle.net/qdqrs3cw/
answers question: http://stackoverflow.com/q/27691291
accepted answer of: http://stackoverflow.com/q/27691291

http://stackoverflow.com/q/27785087
has comment: http://stackoverflow.com/comment/43983176
type: Question
linked to: http://stackoverflow.com/q/1242974
tagged with: javascript
tagged with: http://stackoverflow.com/tag/c
score: 0
has body: I have got a c program,which reads integer values from stdin. I wrote a nodejs program to execute the c file, and the nodejs program will read a text file(containg numbers in multiple lines) and pipe this data to stdin of the child process. The problem is, if the no of inputs in the txt file is less than the expected number then the child process will be supplied with value 0. I want the child process to wait until the data is received. c program #include&lt;stdio.h&gt; int main(){ int a; printf("hekllowworls"); scanf("%d",&amp;a); printf("%d",a); scanf("%d",&amp;a); printf("%d",a); scanf("%d",&amp;a); printf("%d",a); } Node JS Program var fs = require('fs'), cp = require('child_process'); stream = fs.createReadStream('myfile.txt'); var obj = cp.spawn('/home/arju/Desktop/exec/a.out'); stream.pipe(obj.stdin); obj.stdout.on('data',function(data){ console.log(data.toString()); }); obj.on('error',function(err){ console.log(err); }); TextFile - Myfile.txt 10 20
answer count: 1
has title: Node.js Stream and child process - Strange Behavior
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27787025
tagged with: node.js
has comment: http://stackoverflow.com/comment/43982698

http://stackoverflow.com/comment/43895596
comment on: http://stackoverflow.com/a/27740648
score: 3
has text: Perhaps because it's the first working day of the year, after some party ;) It's not unusual that we try to find the problem where it isn't. An advice for next time: when you get an `undefined` error, try to discover what is `undefined`. If you get this error in a function call, type in the console the function name without parentheses, i.e. `$input.autocomplete` and you'll get `undefined` and discover that the function itself is missing for some reason
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27704506
answers question: http://stackoverflow.com/q/27704328
has body: You can use scope: true and the scope will prototypically inherit from the location it is inserted. However, if all you need is access to the parent scope, you can always use $parent, even in an isolated scope. It is not recommended, but it is possible.
has comment: http://stackoverflow.com/comment/43824212
type: Answer
score: 0

http://stackoverflow.com/q/27761067
has comment: http://stackoverflow.com/comment/43933470
has comment: http://stackoverflow.com/comment/43993020
upvote count: 1
tagged with: javascript
has body: I am currently using the the following plugin and I'm trying to figure out how I can tell it to just display normally my options by the value not the text. http://ivaynberg.github.io/select2/ Anyone know? Please Select Active Banned Inactive Suspended $("#status_id, #role_id").select2({ minimumResultsForSearch: -1, placeholderOption: 'first' });
tagged with: jquery
has comment: http://stackoverflow.com/comment/43934001
tagged with: jquery-select2
score: 0
has title: Ordering Select 2 Dropdown
downvote count: 1
favorite count: 0
answer count: 0
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/43999817
comment on: http://stackoverflow.com/q/27795437
has text: try wrapping your link in ` ` within this function.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27758008
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27755735
answers question: http://stackoverflow.com/q/27755735
has body: Your area points are actually point-pairs of a polygon. That polygon is the desired area of the source image. Here's how to extract the area mapped pixels from the source image: Calculate the bounding box of the area coordinates: minX,minY &amp; maxX,maxY Resize the destination canvas to the size of the bounding box: width=maxX-minX, height=maxY-minY Create a clipping path on the destination. The clipping path is the original area moved to the top-left of the destination canvas. // draw the clipping path ctx.beginPath(); ctx.moveTo(pointpairs[0]-minX,pointpairs[1]-minY); for(var i=2;i&lt;pointpairs.length;i+=2){ var x=pointpairs[i]; var y=pointpairs[i+1]; ctx.lineTo(x-minX,y-minY); } ctx.closePath(); ctx.clip(); Draw the image onto the destination canvas, but offset by minY &amp; minY ctx.drawImage(img,-minX,-minY); Here's example code and a Demo: var srcCanvas=document.getElementById("source"); var sctx=srcCanvas.getContext("2d"); var canvas=document.getElementById("canvas"); var ctx=canvas.getContext("2d"); var pointpairs=[ 428,361,432,374,475,399,470,472,420, 494,400,486,328,461,183,409,176,386, 178,356,182,345,270,309,192,288,072, 257,069,228,069,219,077,212,112,205, 133,207,185,201,213,203,277,215,291, 220,298,222,323,225,388,235,418,244, 412,269,393,312,387,332,388,349,407, 356,414,360]; var minX=1000000; var minY=minX; var maxX=-1000000; var maxY=maxX; for(var i=0;i&lt;pointpairs.length;i+=2){ var x=pointpairs[i]; var y=pointpairs[i+1]; if(x&lt;minX){minX=x;} if(y&lt;minY){minY=y;} if(x&gt;maxX){maxX=x;} if(y&gt;maxY){maxY=y;} } var img=new Image(); img.onload=start; img.src='https://dl.dropboxusercontent.com/u/139992952/multple/transportation.jpg'; function start(){ srcCanvas.width=img.width; srcCanvas.height=img.height; sctx.drawImage(img,0,0); // draw the source image // and also stroke the text area sctx.lineWidth=2; sctx.strokeStyle='blue'; sctx.beginPath(); sctx.moveTo(pointpairs[0],pointpairs[1]); for(var i=2;i&lt;pointpairs.length;i+=2){ var x=pointpa…
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43943051
has comment: http://stackoverflow.com/comment/43948120

http://stackoverflow.com/a/27822651
answers question: http://stackoverflow.com/q/27797006
score: 1
has body: You can use the dayRender callback which is the "hook for modifying a day cell." This example does the following on dayRender: 1) Checks that the start date from the input is valid. 2) Adds the # of days for the frequency. The result will be the initial day selected + the number of days for frequency (so if frequency is 2 then total # of days highlighted will be 3). If this isn't the expected behavior, then change the check in the if statement to < endDate.format("YYYYMMDD"). 3) When the calendar draws and each day is rendered, it checks to see if the day being rendered is within the start date + frequency. If so, add a class to highlight it. $(document).ready(function() { var loadCal = function() { $('#fullCal').fullCalendar({ header: { left: '', center: 'prev title next today', right: '' }, dayRender: function(date, cell) { var startDate = moment($("#startdate").val()); if (startDate.isValid()) { var endDate = moment(startDate).add($("#frequency").val(), 'days'); //just compare the YYYYMMDD so don't run into problems with hour/minute/second, etc. if we used valueOf() or similar if (moment(date).format("YYYYMMDD") >= startDate.format("YYYYMMDD") && moment(date).format("YYYYMMDD") <= endDate.format("YYYYMMDD")) { cell.addClass("pjpDay"); }; } } }); }; //reload calendar on input change $("input").on("change", function() { $('#fullCal').fullCalendar('destroy'); //must redraw the calendar, so destroy it and then reload. loadCal(); }); loadCal(); //initial load of calendar }); .pjpDay { background-color: #6666cc !important; } PJP start date: PJP cycle frequency:
downvote count: 0
has comment: http://stackoverflow.com/comment/44057836
type: Answer
has comment: http://stackoverflow.com/comment/44057909
upvote count: 1

http://stackoverflow.com/comment/43723022
type: Comment
type: QuestionComment
has text: Apologies. "videos" in the above post are meant to read "example" in keeping with the code in my original post.
comment on: http://stackoverflow.com/q/27652855
score: 0

http://stackoverflow.com/a/27684941
has comment: http://stackoverflow.com/comment/43783951
has body: Use Function.prototype.bind, like this example: function(data) { return _.compose( ObjectOne.methodName.bind(ObjectOne), ObjectTwo.methodName.bind(ObjectTwo) )(data); } The bind call will return a new function object, with the argument you pass as the context object.
accepted answer of: http://stackoverflow.com/q/27684907
answers question: http://stackoverflow.com/q/27684907
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/a/27820583
downvote count: 0
answers question: http://stackoverflow.com/q/27801258
type: Answer
upvote count: 1
score: 1
has body: You should use click() instead of mouseEvent(), unless you have a special reason. IIRC, mouseEvent() requires the button being clicked to be in the current viewport, whereas click() just wants it anywhere in the page. The second problem with your code is here: input[class="right boutonActionTableau nouveau"] Either use: input.right.boutonActionTableau.nouveau as in Artjom's answer or, if you really want the attribute syntax, then this way: input[class*="right"][class*="boutonActionTableau"][class*="nouveau"] BTW, you might find my story in this post useful. In that case, the link (that I thought was not getting clicked) was actually fine and was getting clicked; the Ajax call involved was returning an error message which is why the screenshot never updated. But I did get to explore lots of ways to do a click!
has comment: http://stackoverflow.com/comment/44047111
has comment: http://stackoverflow.com/comment/44055139

http://stackoverflow.com/comment/43918778
type: AnswerComment
type: Comment
has text: this just returns "TypeError: parserOutput.data.map is not a function" should I be loading another external library and which one? I have jquery and papaParse for now
comment on: http://stackoverflow.com/a/27745912
score: 0

http://stackoverflow.com/comment/115366838
type: Comment
comment on: http://stackoverflow.com/a/55473259
has text: This one worked for me, except you should use onkeydown as onkeypress is deprecated
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43741218
has text: Okay, how are you managing your url transition? Are you using ui-router or something? How these two controllers are mapped?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27662019

http://stackoverflow.com/a/27679383
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: Regular expression is one way i think you can use this method also ---> function lastCharacter(sentence){ var length = sentence.length; return sentence.charAt(length-1); } Example :- Input ---> Hey JavaScript is damm good. Use ---> lastCharacter('Hey JavaScript is damm good.'); Output ---> '.' In other cases you can check with if condition for dot('.').
answers question: http://stackoverflow.com/q/27679097

http://stackoverflow.com/a/42710105
type: Answer
score: 0
has body: Adding to @Kirill Fuchs excellent solution and answering @StackUser's doubt - while starting the http-server, set the path till the app folder only, NOT till the html page! http-server C:\location\to\app and access index.html under app folder
answers question: http://stackoverflow.com/q/27742070

http://stackoverflow.com/comment/43806569
has text: This code is efficient and easy to use! It works well with my page. Thank you a lot :)
comment on: http://stackoverflow.com/a/27695640
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/27701163
answers question: http://stackoverflow.com/q/27700699
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27700699
score: 0
has body: You can't do that with the dataTable component. You have to declare id attribute for component before everything else. Also, it cannot be modified in the runtime. Repeat has repeatControls="true" attribute which creates controls inside the repeat iterator once and reuse them for all subsequent updates. Therefore it can provide value bindings for id attribute. However, dataTable component has no such an ability.
type: Answer

http://stackoverflow.com/q/27722663
has comment: http://stackoverflow.com/comment/43857818
upvote count: 2
has body: My javascript code: $.ajax({ type: "PUT", url: "/api/WordsAPI/"+wordData.ID, data: { word: wordData} }); Part of my C# code: // PUT: api/WordsAPI/5 [ResponseType(typeof(void))] public IHttpActionResult PutWord(int id, Word word) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != word.ID) { return BadRequest(); } [...] } In VisualStudio debugger I can see that app executes second BadRequest. All data in variable "word" on server side is null. I have no idea why. "id" variable is OK, it stores proper ID. In javascript debugger in Firefox everything seems to be ok. wordData isn't null (wordData.id is sent properly to server) and I can see that all data was succesfully sent to server. What could be wrong? What should I do? EDIT: Request in firefox (this is what is sent by browser):
has title: How to send PUT request properly to webAPI application?
has comment: http://stackoverflow.com/comment/43857221
has comment: http://stackoverflow.com/comment/43857141
has comment: http://stackoverflow.com/comment/43857515
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/43857914
has answer: http://stackoverflow.com/a/27723153
possible better answer: http://stackoverflow.com/a/27723100
has comment: http://stackoverflow.com/comment/43858013
type: Question
has answer: http://stackoverflow.com/a/27723100
tagged with: c#
has comment: http://stackoverflow.com/comment/43858109
tagged with: javascript
has comment: http://stackoverflow.com/comment/43857701
answer count: 2
accepted answer: http://stackoverflow.com/a/27723153
downvote count: 0
tagged with: asp.net-web-api
tagged with: asp.net
favorite count: 0

http://stackoverflow.com/q/27651389
has comment: http://stackoverflow.com/comment/43720535
upvote count: 4
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27651690
downvote count: 0
has answer: http://stackoverflow.com/a/27651690
has body: I have a set of div elements inside &lt;a&gt; tag with it's href. The question is that there is a div inside of it with its own click event and I want that in case the div element trigger the click event, the &lt;a&gt; tag should not be triggered. The function that manage the div click event try to stop propagation with no success. if (!e) var e = window.event; e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); What's wrong?
has answer: http://stackoverflow.com/a/27651535
has comment: http://stackoverflow.com/comment/43719827
type: Question
has answer: http://stackoverflow.com/a/27651427
accepted answer: http://stackoverflow.com/a/27651427
tagged with: javascript
has title: click on div element inside an tag
score: 4
answer count: 3
has comment: http://stackoverflow.com/comment/43719894
favorite count: 0
has comment: http://stackoverflow.com/comment/43720458
has comment: http://stackoverflow.com/comment/43719856

http://stackoverflow.com/a/27813878
score: 1
answers question: http://stackoverflow.com/q/27763655
downvote count: 0
has body: Setting js: true in your rspec block is a shortcut to use the javascript-enabled driver for the whole example. So this driver will be available and used during the whole execution or the example, which includes all before/after/around blocks. To work around this, instead of using js: true, you can manually set which driver to use at the point(s) of your example where you need to. it { do_some_stuff_with_default_driver Capybara.current_driver = :webkit do_some_stuff_with_webkit Capybara.current_driver = :selenium do_some_stuff_with_selenium } EDIT Oops I just read this, so perhaps that solution will not be working. please let me know Note: switching the driver creates a new session, so you may not be able to switch in the middle of a test.
type: Answer
upvote count: 1

http://stackoverflow.com/q/27687644
type: Question
tagged with: javascript
has title: JQuery DatePicker on ASP.net
has answer: http://stackoverflow.com/a/27687884
answer count: 3
has answer: http://stackoverflow.com/a/27687819
tagged with: validation
has answer: http://stackoverflow.com/a/27687686
has body: Well, Im trying to put Date Picker on ASP.net form.. I saw that this code can do it.. &lt;script&gt; $(function() { $( "#&lt;%= txtDate.ClientID %&gt;" ).datepicker(); }); &lt;/script&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:TextBox ID="txtDate" runat="server" /&gt; &lt;/div&gt; &lt;/form&gt; Im just wondering how to apply validations on this and how display the error messages..? Validations such as format, if i put 2 dates, 1st &lt; 2nd.. and Date>Today etc.. Very new to JQuery, any help would be appreciated!
tagged with: jquery
tagged with: asp.net
has comment: http://stackoverflow.com/comment/43788993
favorite count: 0
type: UnansweredQuestion
tagged with: datepicker
has comment: http://stackoverflow.com/comment/43788962
upvote count: 2
score: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43788920

http://stackoverflow.com/comment/43732057
type: Comment
comment on: http://stackoverflow.com/a/27657432
has text: Register to the [`onConsoleMessage`](http://phantomjs.org/api/webpage/handler/on-console-message.html), [`onError`](http://phantomjs.org/api/webpage/handler/on-error.html), [`onResourceError`](http://phantomjs.org/api/webpage/handler/on-resource-error.html), [`onResourceTimeout`](http://phantomjs.org/api/webpage/handler/on-resource-timeout.html) events. Maybe there are errors.
score: 1
type: AnswerComment

http://stackoverflow.com/q/27774655
answer count: 5
has answer: http://stackoverflow.com/a/27774954
has comment: http://stackoverflow.com/comment/43960058
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/27774752
has answer: http://stackoverflow.com/a/27774730
has answer: http://stackoverflow.com/a/27774865
type: Question
has comment: http://stackoverflow.com/comment/43960111
has title: Cannot read property 'length' of undefined in ajax
has body: I try to get the number of object within an array but I got 'length' of undefined. My js .. success: function(data){ console.log(data.item.length); }, My PHP &lt;?php $arr = array(); $arr["item"]["book"] = "harry porter"; $arr["item"]["available"] = true; echo json_encode($arr); ?&gt; output {"item":{"book":"harry porter","available":true}}
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/27774683
score: 0

http://stackoverflow.com/comment/43922261
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27741480
has text: req.files print following error: No Message provided

http://stackoverflow.com/comment/43856688
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27722267
has text: I will, purely on the JavaScript code in his example, but either one of us could be right and it's certainly not worth debating so I'll say no more about it ;-)
score: 0

http://stackoverflow.com/a/27710921
type: Answer
has body: Since you are working with deferred objects, you will want to return the correct chain of events with each method. Take a look at the angular docs: https://docs.angularjs.org/api/ng/service/$q It could probably look something like: deleteByDistGroupId: function(groupDistId) { var deferred = $q.defer(); $http.delete(distributeJsonPath + '/group-dist/' + groupDistId).then(function(res) { deferred.resolve(res.data); }); return deferred.promise; } delete: function(id) { var deferred = $q.defer(); $http.delete(distributeJsonPath + '/' + id).then(function(res) { deferred.resolve(res.data); }); return deferred.promise; },
has comment: http://stackoverflow.com/comment/43857088
answers question: http://stackoverflow.com/q/27701796
score: 0

http://stackoverflow.com/comment/43708320
type: Comment
comment on: http://stackoverflow.com/q/27644694
has text: I would not write code where you have a variable x and a function x. x has already been defined. Its confusing code and doesn't need to be. In a code review, this is something I would make the programmer change. Variables are hoisted to the top of scope, then assigned in place where they were called.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43968006
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27778953
has text: Yes, read the manual on INSERT http://dev.mysql.com/doc/en/insert.html and remember to use prepared statements.

http://stackoverflow.com/q/27773476
has comment: http://stackoverflow.com/comment/43957766
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27773565
type: Question
accepted answer: http://stackoverflow.com/a/27773565
tagged with: function
tagged with: javascript
has title: Validating users input between min and max using a function
score: 0
answer count: 1
has body: I'm trying to make a function that asks the user for a number in between whatever number is passed to the functions min and max, eg.(1,10) I can't seem to get it to work though, what am I missing/ doing wrong here? function getProductChoice(min, max) { do { var productIndex = parseInt(prompt('Enter your product choice', '0')); } while( isNaN(productIndex) || productIndex &lt;= max || productIndex &gt;= min); getProductChoice(1,6); };

http://stackoverflow.com/comment/44004995
has text: True, I didn't notice it. Why are you loading jQuery twice in head and body? Remove the one in body.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27797392

http://stackoverflow.com/comment/43955816
comment on: http://stackoverflow.com/a/27772071
score: 0
type: AnswerComment
has text: alex, how did u mean to do then() inside make_slug function?
type: Comment

http://stackoverflow.com/comment/43708981
has text: @Toucouleur Check the edit. Regarding the case conversions, I am changing only those chars that are all in uppercase.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27642853
type: Comment

http://stackoverflow.com/a/27704121
type: Answer
has body: Your directive only knows build variable since your (isolated) scope is defined like this: scope:{ build:"=", }, Sounds like your buildData variable is defined on the controller where builds is defined, so you should extend your scope to look like: scope:{ build:"=", buildData:"=" }, And your HTML directive declaration: &lt;build-input build="build" build-data="buildData" &gt;&lt;/build-input&gt;
has comment: http://stackoverflow.com/comment/43821309
has comment: http://stackoverflow.com/comment/43821877
has comment: http://stackoverflow.com/comment/43820496
accepted answer of: http://stackoverflow.com/q/27704004
has comment: http://stackoverflow.com/comment/43820470
answers question: http://stackoverflow.com/q/27704004
type: AcceptedAnswer
score: 0

http://stackoverflow.com/comment/58665600
type: Comment
comment on: http://stackoverflow.com/a/27770204
type: AnswerComment
has text: I'm very much bumping this up but I'd just like to say that this can be made simpler if you're using async/await like so: `await netSocket.write(messages); netSocket.end()` :)
score: 0

http://stackoverflow.com/comment/43824761
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27706463
has text: Just to help, remember that if you do your navigation on this way, you will not be able to use the "Open link in ..." options from the browser (mouse 3 click, etc)

http://stackoverflow.com/comment/43727253
comment on: http://stackoverflow.com/a/27655301
score: 0
type: AnswerComment
type: Comment
has text: @Newbie you have posted another question just delete that or accept the proper answer to maintain the site image.`please` do not create unnecessary content here it will be good for all of us.

http://stackoverflow.com/comment/43958456
type: AnswerComment
has text: *"Using plain old `==` ignores the datatype"* It doesn't ignore it, it treats it differently.
type: Comment
comment on: http://stackoverflow.com/a/27773739
score: 0

ppapi
tag name: ppapi
type: Tag
tags question: http://stackoverflow.com/q/27652263

http://stackoverflow.com/comment/43816013
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27701620
has text: I don't get it. In single page application build with Angular all submits are done using AJAX. Why do you want to have regular submit?

http://stackoverflow.com/q/27753380
tagged with: angularjs
tagged with: php
tagged with: laravel
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43917849
upvote count: 2
has answer: http://stackoverflow.com/a/27753546
type: Question
has title: Scope variable not changing after ajax post request
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/43918104
has body: I'm making a Yahtzee SPA. Here's my js file var game = angular.module('yahtzee',[]); game.controller('RollDicesController', function($scope, $http) { $scope.img1 = "style/img/dice1.jpg"; $scope.img2 = "style/img/dice2.jpg"; $scope.img3 = "style/img/dice3.jpg"; $scope.img4 = "style/img/dice4.jpg"; $scope.img5 = "style/img/dice5.jpg"; $scope.result = { Ones : '0', Twos : '0', Threes : '0', Fours : '0', Fives : '0', Sixes : '0', ThreeOfAKind : '0', FourOfAKind : '0', FullHouse : '0', SmallStraight : '0', LargeStraight : '0', Chance: '0', Yahtzee : '0' }; $scope.notSorted = function(obj){ if (!obj) { return []; } return Object.keys(obj); } $scope.rollDices = function() { $dice1 = Math.floor((Math.random() * 6) + 1); $dice2 = Math.floor((Math.random() * 6) + 1); $dice3 = Math.floor((Math.random() * 6) + 1); $dice4 = Math.floor((Math.random() * 6) + 1); $dice5 = Math.floor((Math.random() * 6) + 1); $scope.img1 = "style/img/dice" + $dice1 + ".jpg"; $scope.img2 = "style/img/dice" + $dice2 + ".jpg"; $scope.img3 = "style/img/dice" + $dice3 + ".jpg"; $scope.img4 = "style/img/dice" + $dice4 + ".jpg"; $scope.img5 = "style/img/dice" + $dice5 + ".jpg"; $http.post('calculate', {'dice1': $dice1, 'dice2': $dice2, 'dice3': $dice3, 'dice4': $dice4, 'dice5': $dice5 }).success(function(data) { $scope.result = data; }).error(function(data, status) { $scope.errors.push(status); }); }; }); What the request does is pretty much attribute values to the according moves. I have a php controller connected to the calculate route (I'm using Laravel) that does all the math work. Now the issue is that although I'm receiving the values correctly (I've tested this), my table isn't updating. I already have a main div in my webpage that has the controller defined: Roll Dice! {{ key }} {{ val }} And for some reason, the table never changes, although $scope.result and the dice images do. I really don't understand what I'm doing wrong, so I need your help. Edit 1: I've found that after deleting this: $scope…
accepted answer: http://stackoverflow.com/a/27753546
downvote count: 0
possible better answer: http://stackoverflow.com/a/27753578
has comment: http://stackoverflow.com/comment/43918327
has answer: http://stackoverflow.com/a/27753578
favorite count: 0
tagged with: ajax

http://stackoverflow.com/q/27754760
has answer: http://stackoverflow.com/a/27781745
has answer: http://stackoverflow.com/a/27755817
favorite count: 0
tagged with: python
tagged with: regex
has answer: http://stackoverflow.com/a/27756314
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43921490
has title: Extract multi-line javascript content from tag using Scrapy
tagged with: scrapy
type: Question
has body: I'm trying to extract data from this script tag using Scrapy: &lt;script&gt; var hardwareTemplateFunctions; var storefrontContextUrl = ''; jq(function() { var data = new Object(); data.hardwareProductCode = '9054832'; data.offeringCode = 'SMART_BASIC.TLF12PLEAS'; data.defaultTab = ''; data.categoryId = 10001; data.bundles = new Object(); data.bundles['SMART_SUPERX.TLF12PLEAS'] = { signupFee: parsePrice('0'), newMsisdnFee: parsePrice('199'), upfrontPrice: parsePrice('1099'), monthlyPrice: parsePrice('499'), commitmentTime: parsePrice('12'), offeringTitle: 'SMART Super', offeringType: 'VOICE', monthlyPrice: parsePrice('499'), commitmentTime: 12 }; data.bundles['SMART_PLUSS.TLF12PLEAS'] = { signupFee: parsePrice('0'), newMsisdnFee: parsePrice('199'), upfrontPrice: parsePrice('1599'), monthlyPrice: parsePrice('399'), commitmentTime: parsePrice('12'), offeringTitle: 'SMART Pluss', offeringType: 'VOICE', monthlyPrice: parsePrice('399'), commitmentTime: 12 }; data.bundles['SMART_BASIC.TLF12PLEAS'] = { signupFee: parsePrice('0'), newMsisdnFee: parsePrice('199'), upfrontPrice: parsePrice('2199'), monthlyPrice: parsePrice('299'), commitmentTime: parsePrice('12'), offeringTitle: 'SMART Basis', offeringType: 'VOICE', monthlyPrice: parsePrice('299'), commitmentTime: 12 }; data.bundles['SMART_MINI.TLF12PLEAS'] = { signupFee: parsePrice('0'), newMsisdnFee: parsePrice('199'), upfrontPrice: parsePrice('2999'), monthlyPrice: parsePrice('199'), commitmentTime: parsePrice('12'), offeringTitle: 'SMART Mini', offeringType: 'VOICE', monthlyPrice: parsePrice('199'), commitmentTime: 12 }; data.bundles['KONTANT_KOMPLETT.REGULAR'] = { signupFee: parsePrice('0'), newMsisdnFee: parsePrice('0'), upfrontPrice: parsePrice('3499'), monthlyPrice: parsePrice('0'), commitmentTime: parsePrice('0'), offeringTitle: 'SMART Kontant', offeringType: 'PREPAID', monthlyPrice: parsePrice('0'), commitmentTime: 0 }; data.reviewJson = new Object(); hardwareTemplateFunctions = hardwareTemplateFunctions(data); hardw…
accepted answer: http://stackoverflow.com/a/27756314
tagged with: javascript
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/43921987
answer count: 3
has comment: http://stackoverflow.com/comment/43920937
possible better answer: http://stackoverflow.com/a/27781745
downvote count: 0

http://stackoverflow.com/comment/43914493
type: Comment
score: 0
has text: Hi, Ahmad. Web console and firebug don't show any errors. I don't think those lines have a problem because as I said, the code in those lines execute as expected.
type: AnswerComment
comment on: http://stackoverflow.com/a/27751704

http://stackoverflow.com/q/27731812
tagged with: if-statement
has comment: http://stackoverflow.com/comment/43875283
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/27732308
has answer: http://stackoverflow.com/a/57511811
has answer: http://stackoverflow.com/a/27732218
has title: Simple if else onclick then do?
has answer: http://stackoverflow.com/a/67169669
has comment: http://stackoverflow.com/comment/43875166
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27732308
favorite count: 0
has comment: http://stackoverflow.com/comment/43875078
upvote count: 9
has comment: http://stackoverflow.com/comment/43875029
has answer: http://stackoverflow.com/a/27731892
has comment: http://stackoverflow.com/comment/43875410
has comment: http://stackoverflow.com/comment/43875373
has comment: http://stackoverflow.com/comment/43875496
tagged with: css
type: AnsweredQuestion
downvote count: 0
has body: How do I make it so if yes button clicked change colour? Is using .onclick the best option for this? Am I doing it the optimal way? Thanks. html: yes no css: #box { width: 200px; height: 200px; background-color: red; } js: function Choice () { var box = document.getElementById("box"); var yes = document.getElementById("yes"); var no = document.getElementById("no"); if (yes.clicked == true) { box.style.backgroundColor = "red"; } else if (no.clicked == true) { box.style.backgroundColor = "green"; } else { box.style.backgroundColor = "purple"; }; }; Choice ();
tagged with: onclick
has comment: http://stackoverflow.com/comment/43875049
has comment: http://stackoverflow.com/comment/43874986
score: 9
type: Question
has answer: http://stackoverflow.com/a/27733156
accepted answer: http://stackoverflow.com/a/27732218

http://stackoverflow.com/comment/43714365
type: QuestionComment
comment on: http://stackoverflow.com/q/27648189
has text: I quote: "The first jQuery part is not running on my pc / mmobile browser unlike the code on the JSfiddle that does work very strangely. I dont get any error messages so I don't know where is the problem. I have a feeling that is has to be something with the CSS." The search bar isn't working on my pc. and pasted the updated css code I have because I think it causes the problems.
score: 0
type: Comment

http://stackoverflow.com/comment/43770235
comment on: http://stackoverflow.com/q/27677601
type: QuestionComment
has text: How do you want to access your images? Do you want to access them via a click? What do you mean there 'is no such thing as a click'?
score: 0
type: Comment

http://stackoverflow.com/q/27792552
has answer: http://stackoverflow.com/a/27792602
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27792602
downvote count: 0
tagged with: onclick
score: 1
type: Question
has body: I feel like this should be the easiest thing in the world. I just want to make a button with an onclick call and have it run javascript. Yet every time I do that I get the Uncaught TypeError: undefined is not a function error. I've read up on this but don't seem to understand why it can't find the function. To recap: Hitting the button should run ThePush() but I get an error on the console. Code: Player One: Level: Submit A: 0-999 B: 1,000-9,999 C: 10,000-99,999 D: 100,000-499,999 E: 500,000-1,499,999 F: 1,500,000+ Sub Level: Any thoughts? Thank you in advance for your help!
has answer: http://stackoverflow.com/a/69228131
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/43994836
upvote count: 1
has title: button onclick Undefined is not a function
tagged with: button
possible better answer: http://stackoverflow.com/a/27792601
favorite count: 0
has answer: http://stackoverflow.com/a/27792601
has comment: http://stackoverflow.com/comment/43994798
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43789873
type: Comment
has text: Thank you fgb. After using this encodeForHTMLAttribute() for the form action url, How can I test whether it is encoding the URl?. - Will there be any difference to the form action url after using the encodeForHTMLAttribute(), when I check through the developer console of chrome browser?
comment on: http://stackoverflow.com/a/27685354
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45573665
score: 9
type: AnswerComment
comment on: http://stackoverflow.com/a/27736383
type: Comment
has text: This is jQuery's warning then. I can ignore it? I don't use synchronous calls to the server. The perfectionist side of me doesn't like having warnings at all.

http://stackoverflow.com/q/27768472
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43951125
tagged with: forms
type: Question
has title: Submit form and bypass jQuery validation submitHandler
tagged with: javascript
tagged with: jquery
tagged with: jquery-validate
accepted answer: http://stackoverflow.com/a/27768599
score: 0
has body: Consider the following script. After validating the script, if they changed their email, I wish to display a dialog prompting them for their password. The server will then only update the database if the password checks out. The problem is it results in an endless loop since the dialog button submits the form which in turn initiates the dialog. I realize I could just not trigger the dialog if $('#password') is not empty, however, my actual script is more complicated, and it would be "nice" to somehow submit the form and bypass the jQuery validation submitHandler. Is this possible? If so, how? var validator=$("#main_form").validate({ rules: {}, messages: {}, submitHandler: function(form) { if(emailedChanged) { $("#dialog-password").dialog("open"); } else {form.submit();} } }); $('#dialog-password').dialog({ buttons : [ { text : 'SAVE', click : function() { $('#password').val($(this).find('input').val()); $('#main_form').submit(); } }, { text : 'CANCEL', click : function() {$(this).dialog("close");} } ] });
answer count: 1
has answer: http://stackoverflow.com/a/27768599

http://stackoverflow.com/a/34108006
type: Answer
has comment: http://stackoverflow.com/comment/55966008
answers question: http://stackoverflow.com/q/27661306
has comment: http://stackoverflow.com/comment/120430407
downvote count: 21
has comment: http://stackoverflow.com/comment/128413821
has comment: http://stackoverflow.com/comment/110208835
score: 167
has comment: http://stackoverflow.com/comment/98177421
upvote count: 188
has comment: http://stackoverflow.com/comment/89424632
has comment: http://stackoverflow.com/comment/105883614
has comment: http://stackoverflow.com/comment/55967287
has body: The difference between Inline-functions and Arrow-functions First of all Arrow-functions () =&gt; {} are not made to replace Inline-functions function(){} and they are different. Inline-Functions are simply Functions, so the question is what the difference between Arrow-functions and Inline-Functions are. An arrow function expression (also known as arrow function) has a shorter syntax compared to function expressions and does not bind its own this, arguments, super, or new.target). Arrow functions are always anonymous. Some more quick details here Why Arrow-function can not be used as generators https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions Use of the yield keyword The yield keyword may not be used in an arrow function's body (except when permitted within functions further nested within it). As a consequence, arrow functions cannot be used as generators. Note that generators without yield don't make sense. Why Arrow-function can not use yield http://tc39wiki.calculist.org/es6/arrow-functions/ Arrow functions bind this lexically, bind return in the Block body case so it returns from the immediately enclosing arrow function, and preclude break and continue from referencing statements outside the immediately enclosing arrow function. The Identifier primary expression arguments may not be used in an arrow function's body (whether expression or block form). Likewise, yield may not be used in an arrow function's body. Arrows cannot be generators and we do not want deep continuations. Yield in an Arrow-Function will throw Semantic Error: http://www.ecma-international.org/ In the End the reason is in the deep complexity in the implementation of ECMA6. C# does not allow this as well for somewhat similar reasons.
has comment: http://stackoverflow.com/comment/55966104
has comment: http://stackoverflow.com/comment/55967312
has comment: http://stackoverflow.com/comment/72901176
has comment: http://stackoverflow.com/comment/113793530
has comment: http://stackoverflow.com/comment/113783465
has comment: http://stackoverflow.com/comment/66499015

http://stackoverflow.com/comment/89712093
type: Comment
comment on: http://stackoverflow.com/a/27758612
score: 0
type: AnswerComment
has text: I prefer the indexOf solution but if you want the flexibility of the Regex try using `\S` instead of `\w` which will split it at the nearest [white-space like character](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp)

http://stackoverflow.com/comment/43871363
score: 0
has text: @Manish, datatype/mimetype is matter for CORS, sometime server is configured to type of request (PUT/POST/DELETE/..) and content-type should be pass over cross domain requests.
type: Comment
comment on: http://stackoverflow.com/q/27716777
type: QuestionComment

http://stackoverflow.com/a/27731745
answers question: http://stackoverflow.com/q/27731484
upvote count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43874998
type: Answer
has body: try changing image on complete of slide toggle: see here:http://api.jquery.com/slidetoggle/ $(document).ready(function(){ var pull = $('#mmTrigger'); menu = $('.ulMM'); menuHeight = menu.height(); $(pull).on('click', function(e) { e.preventDefault(); menu.slideToggle("slow", function() { alert( ! menu.is(":visible") ); if (! menu.is(":visible")) { $(".imgMenu").attr("src", "https://maps.google.com/mapfiles/kml/shapes/schools_maps.png");// icons added to show demo use your own icons. } else { $(".imgMenu").attr("src", "http://labs.google.com/ridefinder/images/mm_20_black.png"); } }); }); }); Portfolio About Contact Forum
score: 2

http://stackoverflow.com/q/27770968
tagged with: http://stackoverflow.com/tag/json
score: -1
has answer: http://stackoverflow.com/a/27771027
tagged with: cross-domain
upvote count: 0
has title: Cross-Domain AJAX issue trying to load JSON
answer count: 1
has body: I have a URL(that i am not in control of) that returns a JSON string. This JSON string contains a URL that i am trying to load with JavaScript/jQuery AJAX. What I’m running in to when loading the JSON string is a Cross-Domain issue. I know a couple of workarounds for fixing Cross-Domain issues like: Using JSONP by adding "callback=?” as a parameter. Call for example a PHP script and letting it load and return the JSON. My issue is that i JSONP is not supported and i can’t do the convinient method of using PHP on the server because of the problem below: The URL in the JSON data has one dynamically generated parameter. As from what i understand when playing around with it the dynamically generated parameter is that it is defined by whats loading the JSON, specifically the User-Agent string. But it is also depending on the IP loading the JSON. This is important because the URL inside the JSON string will return 403 forbidden if whats loading the JSON is not matching whats loading the URL. I hope i have explained my issue well and i appreciate all help i can get.
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43954715
type: UnansweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/43952954
type: Question

http://stackoverflow.com/a/27759617
has comment: http://stackoverflow.com/comment/104754064
has comment: http://stackoverflow.com/comment/67980436
has comment: http://stackoverflow.com/comment/132040580
upvote count: 95
accepted answer of: http://stackoverflow.com/q/27759593
has comment: http://stackoverflow.com/comment/140221852
score: 88
has comment: http://stackoverflow.com/comment/128375595
answers question: http://stackoverflow.com/q/27759593
has comment: http://stackoverflow.com/comment/140212194
has comment: http://stackoverflow.com/comment/67981628
has comment: http://stackoverflow.com/comment/140225680
has comment: http://stackoverflow.com/comment/67979596
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/128389039
has comment: http://stackoverflow.com/comment/140223011
downvote count: 7
has comment: http://stackoverflow.com/comment/67982536
type: Answer
has body: Instead of returning a resultsArray you return a promise for a results array and then then that on the call site - this has the added benefit of the caller knowing the function is performing asynchronous I/O. Coding concurrency in JavaScript is based on that - you might want to read this question to get a broader idea: function resultsByName(name) { var Card = Parse.Object.extend("Card"); var query = new Parse.Query(Card); query.equalTo("name", name.toString()); var resultsArray = []; return query.find({}); } // later resultsByName("Some Name").then(function(results){ // access results here by chaining to the returned promise }); You can see more examples of using parse promises with queries in Parse's own blog post about it.

http://stackoverflow.com/comment/43703396
has text: ah... I see the use of e.preventDefault(); how dumb i am..thanks a lot
score: 0
comment on: http://stackoverflow.com/q/27642276
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43710996
comment on: http://stackoverflow.com/q/27646559
type: Comment
has text: `find` doesn't return a boolean value.
score: 0
type: QuestionComment

http://stackoverflow.com/a/27743015
score: 1
has body: You can design your service so that it returns an empty reference and populates itself when the service call returns successfully. Use angular.copy to preserve the reference: Service app.factory('avengersService', function($http) { return { getAvengers: function() { var avengers = []; avengers.$promise = $http.get('/api/v1/movies/avengers').then(function(result) { angular.copy(result.data, avengers); return result; }); return avengers; } } }); Controller app.controller('ctrl', function($scope, avengersService) { $scope.movieContent = avengersService.getAvengers(); // or call the promise version avengersService.getAvengers().$promise.then(function(result) { $scope.movieContent = result.data; }); });
upvote count: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27742763

http://stackoverflow.com/q/27727781
tagged with: http://stackoverflow.com/tag/html
has title: Unchecking a radio button after clicking a different one
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43867864
score: 3
upvote count: 3
has answer: http://stackoverflow.com/a/27727871
type: Question
downvote count: 0
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/27727871
has body: I'm making a voting system with two buttons (upvote / downvote). I've used input and label tags to create this, but there is a problem: If I use radio buttons, I can either vote up or down, but I can't un-vote. If I use checkboxes, I can un-vote, but I can also vote both up and down. What I want to achieve is being able to only vote up or down while also being able to remove the vote (think reddit). I've thoroughly looked for an answer and I've come to find that this is not possible to do with CSS. There are a lot of scripts out there, the problem is I have no idea about JavaScript or jQuery, so I don't know how to implement the code. I think the easiest solution would be unchecking the downvote button when I click on upvote and vice versa, but again, I have no idea how this code would look like or how to implement it. Maybe there's an easier solution using pure CSS to change the appearance of the other button even after it has been checked? I don't know, but I'd much rather use such a solution if it exists. My code: input[type=radio] { display: none } #up { width: 20px; height: 16px; background: url(http://c.thumbs.redditmedia.com/Y5Gt7Gtk59BlV-3t.png) left top; position: absolute; left: 50px; top: 50px } #down { width: 20px; height: 16px; background: url(http://c.thumbs.redditmedia.com/Y5Gt7Gtk59BlV-3t.png) left bottom; opacity: 0.5; position: absolute; left: 50px; top: 84px } #vote { width: 21px; height: 18px; text-align: center; font-size: 26px; line-height: 18px; position: absolute; left: 50px; top: 66px; z-index: -1 } #up:hover { background-position: top; cursor: pointer } #upvote:checked ~ #up { background-position: top; } #upvote:checked ~ #vote { color: #DC5B28; z-index: 1 } #down:hover { background-position: bottom; cursor: pointer; opacity: 1 } #downvote:checked ~ #down { background-position: bottom; opacity: 1 } #downvote:checked ~ #vote { color: #3580DD } #no { position: absolute; display: none; background: url(http://c.thumbs.redditmedia.com/Y5Gt7Gtk59…
possible better answer: http://stackoverflow.com/a/27728536
favorite count: 0
has answer: http://stackoverflow.com/a/27728536

http://stackoverflow.com/comment/63343251
has text: Yes, I think it is.
type: AnswerComment
comment on: http://stackoverflow.com/a/27699684
score: 0
type: Comment

http://stackoverflow.com/q/27740378
has comment: http://stackoverflow.com/comment/43891990
has title: Click issue on iPad
type: Question
tagged with: javascript
has body: I have some Javascript opening a modal window containing a Vimeo video but I'm having some issue with iPads on the click function (obviously) but my javascript skills aren't strong enough to confidently make the correct change. My code is: &lt;script type="text/javascript"&gt; jQuery(document).ready(function($) { $('body').live('click',function(){ if($('div.reveal-modal-bg').is(':visible')){ $('div[id*=myModal] iframe').each(function() { $(this).attr('src', $(this).attr('src')); }); }; }) }); &lt;/script&gt; Would someone please help with making this iPad friendly. The click function in the third line is the issue. Any help would be appreciated. Kind regards
tagged with: ipad
tagged with: click
has comment: http://stackoverflow.com/comment/43891556
score: 0
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/27738530
tagged with: jquery
has answer: http://stackoverflow.com/a/27738721
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27739063
has body: Hi I am working with mvc4 I have a razor view page for the action public ActionResult DeliveryAddress(string userid,int productid) { .... return View(m); } that contain DELIVER HERE when clicking on this i am collecting somedata ifrom this page using jquery, $(document).ready(function () { $("#place-order").click(function () { var userid = $('#selected-userId').html(); var productid = $('#selected-productId').html(); $.get("Products/PlaceOrder/"+ userid, function (data) { }); }); }); and i want to pen another view of action [HttpGet] public ActionResult PlaceOrder(int uid) { return View(); } and paste the variable content, but $.get("Products/PlaceOrder", function (data) { }); is not hitting this action.. please help me.
tagged with: razor
answer count: 4
tagged with: asp.net-mvc-4
score: 2
has comment: http://stackoverflow.com/comment/43888248
has comment: http://stackoverflow.com/comment/43888400
type: Question
has title: get a view page using jquery in mvc4
tagged with: asp.net-mvc
tagged with: javascript
has answer: http://stackoverflow.com/a/27738921
has answer: http://stackoverflow.com/a/27738953
downvote count: 0
has comment: http://stackoverflow.com/comment/43888433

http://stackoverflow.com/a/27690217
has comment: http://stackoverflow.com/comment/43834709
type: Answer
answers question: http://stackoverflow.com/q/27689925
has body: In example 1: You have written d=data. It means that d is pointing to the element data. You have not just copied the values. Example 2: You have written d=data.slice(0,10). It actually copies the element of data rather than copying the address of data. Now, to write the function minT without affecting data, and without using function data.slice(), you just need to replace the line data.slice() with your own simple code to copy element of one array to another. Here's what I've done : function minT(data){ var d = []; for(var i=0;i&lt;data.length;i++) d[i]=data[i]; d.sort(function(a, b){return a-b}); return d; };
has comment: http://stackoverflow.com/comment/43826200
score: 0

http://stackoverflow.com/a/27707826
downvote count: 0
answers question: http://stackoverflow.com/q/27707680
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27707680
has body: Instead of setting a "value" property on an "a" tag which is not a valid attribute you want to set a "data-value" attribute instead, like so: out += '&lt;li&gt;&lt;a href="" onclick="myfunction(this)" id="'+arr[i].code+'" data-value="'+arr[i].name+'"&gt;' + These "data-" attributes are a way to allow you to add your own attributes to elements that do not affect how they are rendered by the browser. You also can't simply access attributes on DOM elements in the way you are attempting, you need to do it like this var c=document.getElementById(x).getAttribute('data-value')
type: AcceptedAnswer

http://stackoverflow.com/comment/43807843
type: QuestionComment
comment on: http://stackoverflow.com/q/27697270
has text: You can read the color value from the page element or CSS rule.
score: 0
type: Comment

http://stackoverflow.com/a/27651180
has body: You should use tigger: 'click'. $('.BookAppButton').popover({ title : '', html : 'true', trigger: 'click', content:' Enter name : ' }); });
score: 1
answers question: http://stackoverflow.com/q/27648587
upvote count: 2
downvote count: 1
type: Answer

http://stackoverflow.com/comment/43864113
comment on: http://stackoverflow.com/q/27725996
type: Comment
score: 1
type: QuestionComment
has text: @UweKeim Linters will complain if you don't put a semicolon after e.g. `var o = { foo: 1 };`.

http://stackoverflow.com/comment/43936289
has text: @charlietfl that makes perfect sense and I bet that is the issue here. Can you give me a brief ex on how to get started on that?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27762526
score: 0

http://stackoverflow.com/comment/43903325
type: AnswerComment
type: Comment
has text: FYI, to run elementexplorer.js, we need to start selenium server first. `java -jar node_modules/protractor/selenium/selenium-server-standalone-2.44.0.jar -Dwebdriver.chrome.driver=node_modules/protractor/selenium/chromedriver`
comment on: http://stackoverflow.com/a/27698180
score: 0

http://stackoverflow.com/q/27660474
has answer: http://stackoverflow.com/a/27660652
score: 1
has title: Trigger touch events on mobile web
has body: I am trying to figure out how I can trigger touch events in a mobile browser for testing purposes. I am not a web dev, so this is a bit unfamiliar territory for me. At this point I am trying to capture actual touch events that are created by me touching the screen, and re-firing them to trigger the same response. Below is what I do on the mobile amazon.com page, expecting the carousel to repeat the sliding, just as if I were to actually slide it with my finger. However, the carousel does not slide. It seems that the browser treats my re–fired events differently from native ones. I’m running this in Chrome on Android. Has anyone seen this behavior and knows what should I fix? // EDITED after taking into consideration @Palpatim's suggestion // stash away events on a carousel var element = document.querySelector('.gw-carousel-viewport'); document.test_touch_move = [] element.addEventListener('touchstart', function(e){document.test_touch_start = e;}, false); element.addEventListener('touchmove', function(e){document.test_touch_move.push(e);}, false); element.addEventListener('touchend', function(e){document.test_touch_end = e;}, false); // // physically slide the carousel with my finder to trigger events // // store captured events from being overriden var touch_start = document.test_touch_start; var touch_move = document.test_touch_move; var touch_end = document.test_touch_end; // // physically slide the carousel back to its initial position to make sure all event screen coordinates match // element.dispatchEvent(touch_start); touch_move.forEach(function(e){element.dispatchEvent(e);}); element.dispatchEvent(touch_end); // I do not see the same sliding behavior as I see when actually swiping with my finger
type: Question
tagged with: mobile
upvote count: 1
downvote count: 0
tagged with: javascript
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: google-chrome

http://stackoverflow.com/comment/43944185
type: QuestionComment
comment on: http://stackoverflow.com/q/27766814
has text: My form is set on an app server (glassfish), so I suppose that shouldn't be a problem, if that is what you mean
score: 0
type: Comment

http://stackoverflow.com/a/27731321
has body: According to ECMAScript Language Specification: 15.2.4.2 Object.prototype.toString ( ) When the toString method is called, the following steps are taken: If the this value is undefined, return "[object Undefined]". If the this value is null, return "[object Null]". Let O be the result of calling ToObject passing the this value as the argument. Let class be the value of the Class internal property of O. Return the String value that is the result of concatenating the three Strings "[object ", class, and "]". The language is designed like this. You'd have to ask Brendan Eich, or TC39, I guess.
upvote count: 9
answers question: http://stackoverflow.com/q/27731303
score: 9
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43956558
score: 0
type: AnswerComment
has text: What I am expecting is { typeExp: 'Research', organization: 'bleh', startDate: '01/01/2015', endDate: '05/01/2015', role: 'bleh', description: 'bleh', achievements: 'bleh', _id: 54a9fcf541aa72381548c9d6 },{ typeExp: 'Intern', organization: 'meh', startDate: '06/01/2015', endDate: '10/01/2015', role: 'meh', description: 'meh', achievements: 'meh', _id: 54a9fcf541aa72381548c9d6 }
comment on: http://stackoverflow.com/a/27772612
type: Comment

http://stackoverflow.com/a/27690880
answers question: http://stackoverflow.com/q/27690834
has comment: http://stackoverflow.com/comment/43795272
has comment: http://stackoverflow.com/comment/43795188
has comment: http://stackoverflow.com/comment/43795704
has comment: http://stackoverflow.com/comment/47279544
has body: Use ui-sref-opts. Here you go: new post https://ui-router.github.io/ng1/docs/0.3.1/index.html#/api/ui.router.state.directive:ui-sref
has comment: http://stackoverflow.com/comment/43799564
has comment: http://stackoverflow.com/comment/43795107
has comment: http://stackoverflow.com/comment/43795266
type: AcceptedAnswer
downvote count: 0
score: 75
upvote count: 75
has comment: http://stackoverflow.com/comment/43795013
accepted answer of: http://stackoverflow.com/q/27690834
type: Answer
has comment: http://stackoverflow.com/comment/43799615

http://stackoverflow.com/q/27656722
answer count: 1
tagged with: javascript
has title: how to make transition of stacked Divs. in JavaScript
has answer: http://stackoverflow.com/a/27660822
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43729692
accepted answer: http://stackoverflow.com/a/27660822
has body: i am trying to make "memory game" using html5, CSS3 and JS. I have completed the view and model part of this game and now trying to make the Controller. What i want is call a function i.e. flip in JS and want that function to perform transition instead of using hover effect of CSS3. Basically i am trying to follow this approach. I checked that flipping in css3 using hover as can be seen in sass code below, but for the game, the user decides where to click. For simplicity, i have concised the code in html5 since it repeats for all other divs. I Don't Know card1 what the hell? <--sub1 Ends--> card2 what the hell? <--sub1 Ends--> <-- container Ends --> and the SASS code for css .container { position: absolute; left: 115px; width: 1150px; height: 700px; background-color: silver; /* SUB-CONTAINER to stack two cards */ .sub1 { width: 200px; height: 200px; float:left; margin: 5px; .front { position:absolute; width: 200px; height: 200px; background-color: #498010; transform: perspective( 600px) rotateY(0deg); backface-visibility: hidden; transition: transform 0.5s linear 0s; } .back { position: absolute; width: 200px; height: 200px; float:left; background-color: #689; transform: perspective( 600px) rotateY(180deg); backface-visibility: hidden; transition: transform 0.5s linear 0s; } } .sub1:hover > .front { /* transform: perspective(600px) rotateY(-180deg); */ } .sub1:hover > .back { /* transform: perspective(600px) rotateY(0deg); */ } } and JavaScript function flip(front) { document.getElementById("front").style.transition = opacity 0.5s linear 0s; document.getElementById("front").style.opacity = 0; } Note: the link, above, is trying to pass id to JS function where the transition takes place. Exactly same is being done here, just to get input from user instead of just hovering, but nothing happens! I copy/pasted the link code in my editor and smooth transitions are performed but when it comes of my code, nothing! Could you tell me where is my flaw?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43732396
has comment: http://stackoverflow.com/comment/43729431
type: Question

http://stackoverflow.com/q/27686119
possible better answer: http://stackoverflow.com/a/27697164
answer count: 2
has body: I have a javascript function that I am trying to convert to typescript. Here's a part of the function: // needs Markdown.Converter.js at the moment (function () { var util = {}, position = {}, ui = {}, doc = window.document, re = window.RegExp, I am getting an error telling me that: The property RegExp does not exist on type Window. Is there any kind of definition file that I could include for window?
has answer: http://stackoverflow.com/a/27686170
has answer: http://stackoverflow.com/a/27697164
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/27686170
type: AnsweredQuestion
type: Question
tagged with: typescript
has title: Is there a typescript definition for window?
tagged with: javascript
score: 4
upvote count: 4

http://stackoverflow.com/comment/43857545
has text: `$('#m').bind('keypress');` is missing handler function
comment on: http://stackoverflow.com/q/27722861
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43817294
type: QuestionComment
comment on: http://stackoverflow.com/q/27702413
score: 1
has text: See http://stackoverflow.com/questions/11483216/why-are-leading-zeroes-used-to-represent-octal-numbers
type: Comment

http://stackoverflow.com/q/27658898
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43756866
accepted answer: http://stackoverflow.com/a/27659049
possible better answer: http://stackoverflow.com/a/27659035
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27659035
has comment: http://stackoverflow.com/comment/43733556
upvote count: 1
has title: JavaScript function doesn't execute everything
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43733550
has answer: http://stackoverflow.com/a/27659049
has comment: http://stackoverflow.com/comment/43733610
has comment: http://stackoverflow.com/comment/43733606
answer count: 2
tagged with: for-loop
has body: I have an array Orte that contains postcode and the name of the city. Now I want to change the dropdown depending on the number entered in the input field. The input field has an onchange function. The function is the one below. The script works so far except the last line after the for loop. It never adds the last part and I don't know why. Can someone help me please. Thanks in advance for the anwsers! Burzi function updateOrt(eingabe){ document.getElementById("ort_platzhalter").innerHTML = '&lt;select name="ort"&gt;' for (var i = 1; i &lt;= Orte.length; i++){ if(Orte[i].PLZ == eingabe){ document.getElementById("ort_platzhalter").innerHTML += '&lt;option value="' + Orte[i].id + '"&gt;' + Orte[i].Ort + '&lt;/option&gt;' } } document.getElementById("ort_platzhalter").innerHTML += "&lt;/select&gt;" }

http://stackoverflow.com/q/27729358
has comment: http://stackoverflow.com/comment/43870254
accepted answer: http://stackoverflow.com/a/27729379
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/43870249
answer count: 1
has comment: http://stackoverflow.com/comment/43870492
has comment: http://stackoverflow.com/comment/43870269
upvote count: 3
tagged with: http://stackoverflow.com/tag/json
downvote count: 1
has answer: http://stackoverflow.com/a/27729379
tagged with: javascript
tagged with: jquery
has body: I have the following JSON in JS. { "url":"http://example.com/main.aspx", "report_template_id":"1", "interval_secs":"86400", "analysis_type":"lite", "email":"rokumar@example.com", "alerts":["num_domains", "med_load_time", "avg_load_time", "tot_req"] } I want the list of alerts to be removed and replaced with comma separated values as follows. { "url":"http://example.com/main.aspx", "report_template_id":"1", "interval_secs":"86400", "analysis_type":"lite", "email":"rokumar@example.com", "alerts":"num_domains,med_load_time,avg_load_time,tot_req" }
has title: Get comma separated string from array
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/43892751
type: Comment
comment on: http://stackoverflow.com/a/27740776
score: 0
type: AnswerComment
has text: Try the code of my new answer

http://stackoverflow.com/q/27725893
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27725933
score: 0
has answer: http://stackoverflow.com/a/27725911
answer count: 3
has answer: http://stackoverflow.com/a/27725922
has body: I'm having trouble getting an onclick to fire. I've read the docs and several other posts, but nothing seems to help. Any ideas? Thanks var inputDiv=document.createElement("div") inputDiv.className="form-grooup" var input=document.createElement("input") input.id="inputCommentField" input.class="form-contrrol" input.type="text" input.placeholder="Comments are anonymous" inputDiv.appendChild(input) actionDiv.appendChild(inputDiv) var commentButton=document.createElement("button") commentButton.id="sendButton" &lt;!-- commentButton.type="button"--&gt; commentButton.innerHTML="Reply" commentButton.onclick="comment();" inputDiv.appendChild(commentButton) var clearDiv=document.createElement("ul") actionDiv.appendChild(clearDiv) clearDiv.style="clear:both;" definition of comment(): function comment() {alert("you commented!")}
has comment: http://stackoverflow.com/comment/43863859
type: UnansweredQuestion
tagged with: button
tagged with: javascript
type: Question
has title: onclick not called html button

shadow-dom
tags question: http://stackoverflow.com/q/27693538
tags question: http://stackoverflow.com/q/27644154
tag name: shadow-dom
tags question: http://stackoverflow.com/q/27746590
type: Tag
tags question: http://stackoverflow.com/q/27679394
tags question: http://stackoverflow.com/q/27747975

http://stackoverflow.com/q/27714518
has answer: http://stackoverflow.com/a/27714574
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
upvote count: 3
tagged with: underline
accepted answer: http://stackoverflow.com/a/27714574
downvote count: 1
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27714658
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27714658
has title: CSS underline text with number below line
has comment: http://stackoverflow.com/comment/43841141
has body: How can I underline text and add a small number underneath the underline like in this image using css, html, or javascript?
tagged with: javascript

http://stackoverflow.com/q/27703745
has answer: http://stackoverflow.com/a/27704221
has body: I have a datepicker with an onClose function that is called when user select a date (correct), but also when the calendar is shown but user clicks anywhere in the document (wrong). Inside onClick, is there a way to distinguish between user's click on a date (then calendar is closed) and user's click in the document? $( "#datePicker" ).datepicker({ ... onClose: myFunction(), ... }); The same calendar is used in 2 ways: sometimes user can select a day (click on a day -> myFunction() must be called) sometimes user must select a month (select month -> click 'ok' button -> myFunction() must be called) I tried use 'onSelect': it works only when user clicks on a day, but myFunction isn't called when calendar is "select month mode" thanks. This is the code I tried with @Prashant Kumar solution: my={}; (function(){ my.customCalendar={ closedBySelect:false, init: function() { $( "#datePicker" ).datepicker({ ... onSelect: function () { my.customCalendar.myFunction(); this.closedBySelect = true; }, onClose: function (){ console.log('fired on close'); if (this.closedBySelect) { console.log('logic when closed on select'); this.myFunction(); } else { console.log('logic when closed on document click'); } my.customCalendar.closedBySelect = false; }, ... showButtonPanel: true }); ... myFunction:function (dateText, inst) { ... }, ... }
tagged with: datepicker
accepted answer: http://stackoverflow.com/a/27704221
type: AnsweredQuestion
score: 0
has title: jQuery UI Datepicker onClose: distinguish between date click and document click
type: Question
tagged with: javascript
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/43757110
comment on: http://stackoverflow.com/q/27671188
type: QuestionComment
type: Comment
has text: @JuanRocamonde - `.click()` won't work with dynamically added content.
score: 2

http://stackoverflow.com/q/27702527
tagged with: soundcloud
tagged with: javascript
tagged with: jquery
has title: Soundcloud widget & for loop
accepted answer: http://stackoverflow.com/a/27707597
answer count: 2
has answer: http://stackoverflow.com/a/27702982
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/27702982
has body: i created music blog using soundcloud widgets. I trigger a button "Play all", so when you hit it, it plays all widgets. $(function(){ var playAll = $('.playAll'); var widget0 = SC.Widget(playAll.find('iframe')[0]); var widget1 = SC.Widget(playAll.find('iframe')[1]); var widget2 = SC.Widget(playAll.find('iframe')[2]); widget0.bind(SC.Widget.Events.FINISH,function() { widget1.play(); widget0.unbind(SC.Widget.Events.FINISH); }); widget1.bind(SC.Widget.Events.FINISH,function() { widget2.play(); widget1.unbind(SC.Widget.Events.FINISH); }); $("#playSound").click(function() { widget0.toggle(); }); }); It works, but what i'm trying to do is "for" loop, but because lack of js / jquery skills, it doesn't work.
type: AnsweredQuestion
tagged with: widget
has answer: http://stackoverflow.com/a/27707597
score: 1
upvote count: 1
type: Question
tagged with: for-loop

http://stackoverflow.com/comment/43911871
comment on: http://stackoverflow.com/q/27750016
score: 0
type: Comment
type: QuestionComment
has text: Please show us some effort. It might have been better if you posted your question as a challenge to find the shortest/nicest solution, at codegolf.stackexchange.com

http://stackoverflow.com/comment/43892965
has text: oh, you're going for another approach. Your approach is unset the `onClick` event listener, but you would need to attach it back later on after the playing was complete. For me this would be a little bit tricky, i still prefer the approach that introduce a `flag` variable to hold the state, and use that flag (isPlaying) to determine if we want to play the music as suggested above
type: AnswerComment
comment on: http://stackoverflow.com/a/27737765
score: 0
type: Comment

http://stackoverflow.com/comment/43818870
type: Comment
has text: this mouseover is not working on my page , i am running it on localhost wamp server but its working on jsfiddle@Gaurav Kalyan
comment on: http://stackoverflow.com/a/27667415
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43851233
has text: http://jsfiddle.net/b0efyzcc/4/
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27718196

http://stackoverflow.com/q/27750016
accepted answer: http://stackoverflow.com/a/27750225
has comment: http://stackoverflow.com/comment/43911205
score: -4
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43911871
downvote count: 5
type: Question
has answer: http://stackoverflow.com/a/27750512
tagged with: javascript
has title: There is a function to shorten nicely a string to one, two or three letters
has body: There is a nice function/lib etc. to shorten nicely a string (like ios circle contact but more evolved)? For example : John Doe -> JD My board -> Mb Something very long -> Svl My Very long board -> MVl Dash-board -> Db title -> t Title -> T JohnDoe -> JD John_Doe -> JD etc............................ I really can write it by myself each case I can see, but I'm looking for something nice and maybe more clever that my example (omit article for more than 3 words, omit dash if more than 3 words etc.). Precision : the nice is my question. I'm looking for a library like stringjs.com/underscorejs (normalize, capitalize, slugify...) or a simple function but with a nice shorten method. For the moment, I use this piece of code (update w/terabaud answer, thx dude) : function shortener(label) { //http://www.ranks.nl/stopwords var stopWords = "alors au aucuns aussi autre avant avec avoir bon car " + "ce cela ces ceux chaque ci comme comment dans des du " + "dedans dehors depuis deux devrait doit donc dos droite " + "début elle elles en encore essai est et eu fait faites " + "fois font force haut hors ici il ils je juste la le les " + "leur là ma maintenant mais mes mine moins mon mot même " + "ni nommés notre nous nouveaux ou où par parce parole " + "pas personnes peut peu pièce plupart pour pourquoi quand " + "que quel quelle quelles quels qui sa sans ses seulement " + "si sien son sont sous soyez sujet sur ta tandis tellement " + "tels tes ton tous tout trop très tu valeur voie voient " + "vont votre vous vu ça étaient état étions été être"; var articles = stopWords.split(' '); return (label || "") .replace(/[A-Z]/g, " $&amp;") // add space before each capital .replace(/[_\-']/g, " ") // replace _ - with spaces .split(" ") .filter(function (word) { return word !== "" }) .map(function (word, idx, arr) { // return the first letter of each word // if there are more than 2 words, omit articles return (arr.length &gt; 2 &amp;&amp; articles.indexOf(word.toLowerCase()) &gt; -1) ? "" …
has answer: http://stackoverflow.com/a/27750225
has answer: http://stackoverflow.com/a/27750069
answer count: 4
favorite count: 0
possible better answer: http://stackoverflow.com/a/27750210
has answer: http://stackoverflow.com/a/27750210

http://stackoverflow.com/a/27646113
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has body: You can have your result with like 4 lines of codes and little efforts ! Just use the new blending modes of the canvas, that will do the math for you and will be faster than handling the r,g,b bytes by yourself. Another bonus is you won't have any CORS security issue with your images. Here's a fiddle, it would work quite the same with a base64 src : http://jsfiddle.net/gamealchemist/7woa7oyp/ The idea is to fill the canvas in white, then using the luminosity mode, the image will be drawn keeping current saturation(0) and hue(not relevant since saturation of white is 0) ==>> you end up with only the luminosity of the image, with no saturation == B&amp;W version of the image. ctx.save(); ctx.fillStyle = '#FFF'; ctx.fillRect(0, 0, cv.width, cv.height); ctx.globalCompositeOperation = 'luminosity'; ctx.drawImage(coloredImage, 0, 0); ctx.restore(); (blending modes specification : http://dev.w3.org/fxtf/compositing-1/ )
has comment: http://stackoverflow.com/comment/43718113
accepted answer of: http://stackoverflow.com/q/27644374
answers question: http://stackoverflow.com/q/27644374
upvote count: 2
has comment: http://stackoverflow.com/comment/43717864
has comment: http://stackoverflow.com/comment/43717888

http://stackoverflow.com/q/27730967
tagged with: reload
type: Question
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/27731018
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27731073
has title: How to reload number without refresh
answer count: 5
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/27731008
has answer: http://stackoverflow.com/a/27731239
upvote count: 0
has body: My .php is reading some variables from pos.txt and I need to show them live, without refreshing the page. I've used &lt;meta http-equiv="refresh" content="&lt;?php echo $sec?&gt;;URL='&lt;?php echo $page?&gt;'"&gt;, but it's annoying. I've read something about ajax, but I can't really understand how it works. $line = file_get_contents('pos.txt'); list($date, $time, $x, $y, $z) = explode(' ', $line);
has answer: http://stackoverflow.com/a/27731003

http://stackoverflow.com/a/27736783
has body: The error "Array to string conversion" means you are using an array as a string somewhere in your code. That error message is usually followed by a filename and line number which should help you narrow down your search. One helpful way to see what is contained within a variable is to use the following: echo '&lt;pre&gt;'; print_r($stuff); die(); If the error is happening on a line inside of a while loop you should put the echo '' before the while and the die(); after so that you can see all instances of the problem within the loop.
score: 0
answers question: http://stackoverflow.com/q/27736634
has comment: http://stackoverflow.com/comment/43885053
type: Answer
has comment: http://stackoverflow.com/comment/43885068

transclusion
type: Tag
tags question: http://stackoverflow.com/q/27756661
tags question: http://stackoverflow.com/q/27650044
tag name: transclusion

http://stackoverflow.com/q/27750780
has title: How to reset email input type selector in Javascript?
tagged with: forms
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/27750793
tagged with: javascript
type: AnsweredQuestion
tagged with: email
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/27750793
linked to: http://stackoverflow.com/q/680241
type: Question
has body: So I've just come across this answer: Resetting a multi-stage form with jQuery But this doesn't mention how to reset the email input type? I've tried currentForm.find(':input:email').val('');, but this isn't recognised as a selector. What's the correct way to reset all inputs of type email on a form? I'm using a html element of type email: &lt;input placeholder="Email" type="email" name="email" required&gt; So this must be possible without having to reset it explicitly.
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43967758
has text: I assume you are using https://github.com/brainshave/grunt-zetzer so this link should help, in your Gruntfile.js you should have a grunt.initConfig where zetner options are defined such as templates. In that github link it should give you some examples, I have not used zetzer before so I'm not certain on its usage but your error seems to refer to templates not being defined in the zetzer config.
comment on: http://stackoverflow.com/q/27778437
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27772320
has comment: http://stackoverflow.com/comment/43955581
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27772335
accepted answer: http://stackoverflow.com/a/27772335
has comment: http://stackoverflow.com/comment/43955576
type: Question
has body: Please have a look at the following JavaScript snippet of code. This has to do with function scoping and hoisting in javascript. I can't call window.innermost() as it is undefined as it's not in scope. Anyone know another way besides attaching it to the windows object. Windows Object still doesn't work in this case. function outer(){ function callback() { window.innermost = function() { alert("hello from inner most") } } } (function caller() { window.innermost(); // this is undefined }());
upvote count: 1
has title: How do you access an nested inner function from another outer function in JavaScript?
answer count: 1
tagged with: javascript
favorite count: 0
score: 0
downvote count: 1

http://stackoverflow.com/comment/43887730
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27738262
score: 0
has text: Thank you. Will this work in Chrome? Wondering how I can have it function for both browsers.

http://stackoverflow.com/q/27714977
has answer: http://stackoverflow.com/a/27715234
score: 2
has comment: http://stackoverflow.com/comment/43842208
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43842468
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43842377
has comment: http://stackoverflow.com/comment/43842127
type: Question
linked to: http://stackoverflow.com/q/171251
has comment: http://stackoverflow.com/comment/43842327
has comment: http://stackoverflow.com/comment/43842397
has body: I have a few objects with the same structure; some of them have null values for some fields, whereas one of the objects (here obj2) has values for the field which has null values in other objects; I want ro merge them and cosider the one which has value: var obj2 = { options: [ null ], name: "name1", } var obj1 = { options: [ {"option": "option1"} ], name: "name1", } desiredOutput = { options: [ {"option": "option1"} ], name: "name1", } My attempt: I tried lodash; but the prpoblem with lodash is that the order has effects; that is, whichever object comes last that one overwrites the previous ones for the mentioned field: I tried lodash; here myArray is an array of obj1, obj2,... var newResults = {}; for (var i = 0; i &lt; myArray.length; i++) { newResults = lodash.extend(newResults, myArray[i]); } What is the cleanest solution for this one? Thanks
has comment: http://stackoverflow.com/comment/43842143
tagged with: lodash
tagged with: node.js
duplicate of: http://stackoverflow.com/q/171251
accepted answer: http://stackoverflow.com/a/27715234
upvote count: 2
has comment: http://stackoverflow.com/comment/43842441
answer count: 1
has comment: http://stackoverflow.com/comment/43842239
has comment: http://stackoverflow.com/comment/43842286
has title: Cleanest way to merge objects
has comment: http://stackoverflow.com/comment/43842312

http://stackoverflow.com/a/27756242
has comment: http://stackoverflow.com/comment/61906190
type: Answer
answers question: http://stackoverflow.com/q/27756069
has comment: http://stackoverflow.com/comment/61904711
has body: You should add another filter (or simply a custom filter) such as &lt;div ng-repeat="user in users | filter:getList(user, index)"&gt; {{user.name}} {{user.email}} &lt;/div&gt; and then in the scope $scope.users = //full users object here $scope.paginate = {}; $scope.paginate.size = 10; $scope.paginate.start = 0; $scope.prevPage = function(){ //load the previous 10 users if ($scope.paginate.start) { $scope.paginate.start -= $scope.paginate.size; } } $scope.nextPage = function(){ //load the next 10 users $scope.paginate.start += $scope.paginate.size; } $scope.getList = function (user, index) { return (index &gt;= $scope.paginate.start &amp;&amp; index &lt; $scope.paginate.start + $scope.paginate.size); };
has comment: http://stackoverflow.com/comment/61897077
has comment: http://stackoverflow.com/comment/61900223
score: 0

http://stackoverflow.com/q/27789443
tagged with: javascript
tagged with: ember.js
has title: Ember nested component action
favorite count: 0
type: UnansweredQuestion
has body: I have looked through all the answers and google results I could find about it and all I got out of it is that it is quite a common problem. Unfortunately non helped me to solve my case. I have this custom button: App.ButtonCmpComponent = Ember.Component.extend({ tagName: 'button', classNameBindings: ['btn', 'class'], btn: 'btn', class: 'btn-default', attributeBindings: ['type'], type: 'button', click : function () { this.sendAction(); } }); As well as a button group component: App.ButtonGroupCmpComponent = Ember.Component.extend({ }); With this template: {{#each btn in definition}} {{button-cmp action=btn.action}} {{/each}} In my index controller I have the following: App.IndexController = Ember.ObjectController.extend({ actions: { test : function () { alert('test in index controller') } } }); And index view defined the content via a simple hash: App.IndexView = Ember.View.extend({ templateName: 'views/index', buttonGroup : [ { label : "Test Action", action : 'test' }, { label : 'Other Btn', action : 'test' } ] }); And finally in index view: {{button-cmp action="test"}} {{btn-group-cmp definition=view.buttonGroup}} My problem is that the first button defined directly on the view does trigger correct action in index controller but the two buttons inside button group controller do not. In fact I can't even identify the target where those actions are being sent to from within the nest component at all. What am I doing wrong here? How can I define a nested button component in such a way that it would still send the action to the same index controller handler? Thank you EDIT: By trial and error I have found how to direct the action to the correct controller. I don't think that I quite understand how it works though so Please post an answer with the explanation of what really is going on here... I'd really like to get my head around this eventually. This is how I made it to work: In index view I have added a target=this to the component invocation like this: {{btn-group-…
answer count: 0
score: 1
upvote count: 1
type: Question
downvote count: 0

http://stackoverflow.com/q/27772577
has comment: http://stackoverflow.com/comment/43971720
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/43973641
has comment: http://stackoverflow.com/comment/43972423
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/43956088
has answer: http://stackoverflow.com/a/27772620
type: AnsweredQuestion
has title: AngularJS: data is being updated in controller but it is not shown in the HTML
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43973487
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/43973939
tagged with: http://stackoverflow.com/tag/html
has body: In my AngularJS application, I have the following code: example.html &lt;div&gt; &lt;p&gt;{{name}}&lt;/p&gt; &lt;/div&gt; &lt;div&gt; &lt;button ng-click="someFunction()"&gt; &lt;/button&gt; &lt;/div&gt; exampleController.js angular.module('myApp').controller('exampleController', ['$scope', 'myService', function($scope, myService) { $scope.someFunction = function() { } function updateName() { $scope.name = myService.getName(); } updateName(); }]); The problem is that {{name}} is only updated in the html when I click in the button. The updateName() function is running correctly and $scope.name is being correctly defined, but {{name}} is only shown when I click in some button to call some function. I don’t know why {{name}} is not shown when the page is loaded. Can someone help me?
score: -1
accepted answer: http://stackoverflow.com/a/27772620
downvote count: 2

http://stackoverflow.com/q/27656375
tagged with: canvas
answer count: 1
tagged with: jquery
has title: Random letters wrapped with rectangles
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: Question
has body: How the random letters wrapped with rectangles can be generated using canvas??? I used j-query for it but dont know how to do it with canvas. here is the code which generates random letter using j-query. &lt;script&gt; var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; function randomNumber(max) { var randomNum = Math.random(); var numExpanded = randomNum * max; var numFloored = Math.floor(numExpanded); return numFloored; } //create a function returning a random letter function randomLetter() { var random0to25 = randomNumber(letters.length); var randomLetter = letters.charAt(random0to25); return randomLetter; } //create a function creating a span containing a random letter and attaching it to body function createLetter() { var span = $("&lt;span/&gt;"); span.css("position", "absolute"); span.css("top", 0); randomCol=randomNumber(760); randomCol=randomCol+20; //concatenation span.css("left", randomCol+"px"); span.text(randomLetter()); span.appendTo("body"); return span; } //explain how to animate an element function makeLetterFall() { var letterElement = createLetter(); letterElement.animate({"top":"95%"}, 5000); //any ideas how not to use {} here? } //handle keyup, find a letter and remove it /*function removeTypedLetter(pressedKey) { var typedLetter = String.fromCharCode(pressedKey.keyCode); var letterElement = $("span:contains("+typedLetter+")").first(); letterElement.remove(); }*/ //$(document).on("keyup", removeTypedLetter); //make a new letter every second setInterval(makeLetterFall, 1000); &lt;/script >
has answer: http://stackoverflow.com/a/27660114
tagged with: javascript
score: 0

http://stackoverflow.com/q/27696845
has comment: http://stackoverflow.com/comment/43806934
answer count: 3
has comment: http://stackoverflow.com/comment/43807007
tagged with: carousel
tagged with: twitter-bootstrap
has body: On my current project I am using Bootstrap (3.3.1) standard carousel for testimonials area. According to the design requirements I have an absolutely positioned section where the actual testimonials (text) should show up. So I have all the testimonials hidden with a special class applied (.hide_testimo {display: none !important;}). Here's an example of one of them: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis imperdiet neque ut ex porttitor tincidunt. Vivamus at efficitur metus. Linda Plumer Clonix, CTO What I would like to achieve is to check when the slide (.item) gets its 'active' class (i.e. the given slide is shown) and logically remove the testimonials (.hide_testimo) to make a particular testimonial visible. So, I'm checking the items with the following piece of jQuery: $('.item').each(function(){ if ($('.item').hasClass('active')){ // what's next..? } }) IMPORTANT: I didn't mention that the .item class is in a different part of the actual markup and it refers to the carousel itself, while .testimonial_holder is just an area that is placed above the slider and contains text. Here is the complete markup for better understanding: "Call you up in the middle of the night like a firefly without a light. You were there like a blowtorch burning I was a key that could use a little turning, so tired that i couldn't even sleep..." Janet Aghajanian Lahmajo Systems, CTO "In 1997, Beauty changed my life Who would've known that she would be my future wife or the mother of a child so beautiful see. I had to have them all to be satisfied and on an average night, I'd take four or five" Ishita Mehta ORACLE, CSR "Remarkable, incredible, confrontational, yet irreplaceable RAION is fantastic, so I let it go! But it's got the kind of love that you can't let go and still I loved her unconditionally so I wish she had've told me that she didn't love me" Monica Lee FAIP Inc., Blogger "Aiyyo whasup kid, feel the rush, glad you kept in touch with RAION, who be puffin on…
upvote count: 1
has comment: http://stackoverflow.com/comment/43806966
has comment: http://stackoverflow.com/comment/43807055
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27709063
score: 1
has answer: http://stackoverflow.com/a/27697002
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27698005
favorite count: 0
has answer: http://stackoverflow.com/a/27698005
has comment: http://stackoverflow.com/comment/43807636
has title: How to sequently apply a function on a particular event in jQuery?
accepted answer: http://stackoverflow.com/a/27709063

http://stackoverflow.com/a/27837178
has body: Done, The problem was with the format of FileList object that was provided to the myZone.addFile().If you open dropzone.js file and go to Dropzone.prototype.init function in there you will see a check if (this.clickableElements.length) { inside this check dropzone creates &amp; configures the hidden file input and then attaches that input element to the body document.body.appendChild(_this.hiddenFileInput); and right after this line dropzone adds the change eventlistener to file type input that was created which fires as soon as we provide the file via browse file window. return _this.hiddenFileInput.addEventListener("change", function() { When we provide the file it fires and creates the FileList object see files = _this.hiddenFileInput.files; if you try to log it in console console.log(files) you will see a FileList that is created FileList { 0=File, length=1, item=item(), more...} on clicking this object inside firebug you will see detail below 0 File { size=21789, type="image/png", name="1-7-2013 6-19-44 PM.png", more...} length 1 __proto__ FileListPrototype { item=item(), @@iterator=@@iterator()} now the way i was creating the filelist object the result was following _removeLink ----- a.dz-remove javascrip...defined; accept ----- "image/jpg,image/gif,image/png,image/jpeg" accepted ----- true mozFullPath ----- "http://mysite/img/imageUploadTestJPG.jpg" name ----- "imageUploadTestJPG.jpg" path ----- "http://mysite/img/imageUploadTestJPG.jpg" previewElement -- div.dz-preview previewTemplate --- div.dz-preview processing ----- true size 30170 status ----- "uploading" type "image/jpeg" upload ----- Object { progress=0, total=30170, bytesSent=0} xhr XMLHttpRequest { readyState=1, timeout=0, withCredentials=false, more...} length 0 __proto__ FileListPrototype { item=item(), @@iterator=@@iterator()} Notice the index 0 on the first detail which contains the detail of the file whereas the second one which is the result of my custom built FileList object has all the detai…
answers question: http://stackoverflow.com/q/27785721
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/51592987
score: 3
accepted answer of: http://stackoverflow.com/q/27785721
has comment: http://stackoverflow.com/comment/51988564
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27792364
score: 0
answers question: http://stackoverflow.com/q/27792211
type: Answer
has body: There's something off with your code, specifically for the setInterval function. The first parameter should be a function object, NOT the invokation of a function: Should be this: setInterval( condition, 2000 );

http://stackoverflow.com/a/27731331
upvote count: 2
type: Answer
has body: From Mozilla https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString: Every object has a toString() method that is automatically called when the object is to be represented as a text value or when an object is referred to in a manner in which a string is expected. By default, the toString() method is inherited by every object descended from Object. If this method is not overridden in a custom object, toString() returns "[object type]", where type is the object type.
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27731303

http://stackoverflow.com/comment/43790290
has text: Well, That worked perfect now. Will wait for the update from google for more browser support.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27686465
score: 0

http://stackoverflow.com/q/27798326
has answer: http://stackoverflow.com/a/27798946
has answer: http://stackoverflow.com/a/27799486
type: Question
answer count: 2
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44005167
has body: I have a directive which data is dependent on the API response. Because $compile of directive is run before the API is done, the directive state is wrong. How could I fix this? Is there a configuration for directive, controller or anything in AngularJs that will tell the element to wait until the API is done?
has title: Initialise directive when API is done
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44006976
has comment: http://stackoverflow.com/comment/44005294
type: UnansweredQuestion
tagged with: angularjs-directive

http://stackoverflow.com/a/27796814
downvote count: 0
type: Answer
has body: try this &lt;input class="btn" type=button name=Ok data-href="location"&gt; $( document ).ready(function() { $('.btn').click(function(){ // as you have used jQuery selector you can use it here like this $('#contact').submit(); var location = $(this).attr("data-href"); window.location.href = location; }); });
has comment: http://stackoverflow.com/comment/44002265
has comment: http://stackoverflow.com/comment/44002804
upvote count: 2
has comment: http://stackoverflow.com/comment/44002367
score: 2
answers question: http://stackoverflow.com/q/27796747

http://stackoverflow.com/a/27666040
has body: you can do this with small tweak: script: var flag=0; $(document).ready(function(){ $('#img1').imageLens(); $('#zoom').click(function() { flag=flag+1; if(flag%2 == 0){ $('#img1').off(); }else{ $('#img1').imageLens({ lensSize: 150 }); } }); }); html: Pan/Zoom
answers question: http://stackoverflow.com/q/27665878
has comment: http://stackoverflow.com/comment/43747372
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/27781989
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43974294
has comment: http://stackoverflow.com/comment/43978604
has comment: http://stackoverflow.com/comment/43980735
tagged with: task
type: Question
has body: What is wrong with this script? I'm trying to get the tasklists from google using ggogle apis for javascript. This is the code: Google auth GET CONTACTS FEED Error: gapi.tasks is undefined Thank you
tagged with: javascript
tagged with: google-api-js-client
has title: How to use google apis tasks for javascript
answer count: 0

http://stackoverflow.com/comment/43822274
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/27705204
has text: Return an object (or an array)

http://stackoverflow.com/comment/43742444
has text: Since I don't know the true meaning of the type attribute and have always used it, I will sure try this.
type: AnswerComment
comment on: http://stackoverflow.com/a/27663299
score: 0
type: Comment

http://stackoverflow.com/a/27741928
score: 1
has comment: http://stackoverflow.com/comment/43895021
has comment: http://stackoverflow.com/comment/43895491
upvote count: 1
has comment: http://stackoverflow.com/comment/43894832
answers question: http://stackoverflow.com/q/27741891
downvote count: 0
has comment: http://stackoverflow.com/comment/43895440
has body: Dont think there is a way you can do this with javascript. Javascript is a way for having less code running on your server and make that work on the client freeing resources on you server. Think of it like this. If you had all the code on your server the more users you would have the more work your server would have to perform. By using javascript a lot of work can be done on the client side freeing up resources on you server.
type: Answer

http://stackoverflow.com/comment/43799910
type: AnswerComment
has text: @T.J.Crowder did that already ;) But sure, smaller = more fun :)
comment on: http://stackoverflow.com/a/27693369
type: Comment
score: 0

http://stackoverflow.com/comment/43729145
comment on: http://stackoverflow.com/a/27656355
type: AnswerComment
type: Comment
score: 1
has text: Yes, the event handlers trigger twice as the click is picked up on two elements, and as the event handler is a "toggle" function of sorts, it toggles twice, making it so the first change is zeroed out by the second change.

http://stackoverflow.com/q/27686769
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/4326910
type: Question
has comment: http://stackoverflow.com/comment/43787288
has title: Change content with jQuery
has comment: http://stackoverflow.com/comment/43787415
has comment: http://stackoverflow.com/comment/43787300
has comment: http://stackoverflow.com/comment/43787298
downvote count: 3
has comment: http://stackoverflow.com/comment/43787389
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27686854
favorite count: 0
has comment: http://stackoverflow.com/comment/43787303
has comment: http://stackoverflow.com/comment/43787290
has comment: http://stackoverflow.com/comment/43787320
tagged with: http://stackoverflow.com/tag/html
score: -3
has comment: http://stackoverflow.com/comment/43787283
upvote count: 0
has body: I'm trying to change content when I click a toggle. I've managed to make it change the text when I click the toggle, but when I hit it again it stays the same. I want it to revert it back to initial value so it works like a real toggle. Javascript: $( ".switch a" ).on("click", function() { $(".switch a").removeClass("active"), $(this).addClass("active"),$('.interval').text('yearly'); }); Codepen: http://codepen.io/anon/pen/xbEmrM

http://stackoverflow.com/a/27674109
score: 1
has body: check code on following link http://jsfiddle.net/hjo3kb4b/5/ $("#round-button").click(function () { // do something $("#button-text").html("new text"); }); This should be defined where button is inserted on page .. you called this script on document load.
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27674069
downvote count: 0

http://stackoverflow.com/comment/43865184
type: Comment
has text: try `JSON.stringify(getCarData())` then push the result to your backend
comment on: http://stackoverflow.com/q/27726034
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43701042
has text: don't care really how you get it, what does the full structure look like? You can't do `a.Date` needs to be something like: `a.6655480.Date` but the ID keys will all be different. Much simpler without those ID objects
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27640919
score: 0

http://stackoverflow.com/comment/43708044
has text: @thefourtheye No, neither necessarily takes precedence. The point is that variable declarations and function definitions are hoisted differently. For variable declarations, only the declaration part is hoisted, whereas for function definitions, the entire function is hoisted.
type: AnswerComment
comment on: http://stackoverflow.com/a/27644729
score: 0
type: Comment

http://stackoverflow.com/a/27652922
answers question: http://stackoverflow.com/q/27652762
has comment: http://stackoverflow.com/comment/43722875
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43722764
has comment: http://stackoverflow.com/comment/43722816
type: AcceptedAnswer
has body: The function clearTimeout takes not just a setTimeout, but its ID. Here's what I found it on MDN: So, when you set a timeout, it returns a specific ID for reference and so clearTimeout will work. Again, per MDN: Since you set timer on the global scope, each of your functions has access to it. Thanks for asking a question that taught me something! (I didn't know setTimeout returned anything)
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27652762
type: Answer

http://stackoverflow.com/q/27698480
type: Question
has title: Azure mobile service invokeApi not working from cordova project
tagged with: azure-mobile-services
tagged with: javascript
score: 0
answer count: 1
tagged with: cordova
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/27669302
has answer: http://stackoverflow.com/a/29803490
has body: I'm using Azure Mobile Services(AzMS) in VisualStudio JS-Apache Cordova project where I call a AzMS's custom API to insert user data in storage. This very same code I have previously used in a VS web app javascript and there it is working fine. However here in the cordova project, I get an "unexpected connection failure" error when calling invokeApi. When I try from VS web app, it works fine, which means the custom API service code is good. Here is my js client code: azmsClient.login(oAuthProvider).done(function (results) { console.log("You are now logged in as: " + results.userId); var theUserAuthId = results.userId; azmsClient.invokeApi('Users/insert', { method: 'POST', body: { userAuthId: theUserAuthId } }).done(function (response) { //.... success code }, function (error) { console.log("Error: " + err.request.responseText); //.... error handling }); }, function (err) { console.log("Error: " + err.request.responseText); //.... error handling }); In the console log, the first log ("You are now logged in as: "..) gets logged, after that the error - unexpected connection failure. And my azure custom Api code - var logger = require('../api/logUtils.js').logger; exports.register = function(api){ api.post('insert', insertUser); }; /****************************************************************** * @param request * @param response *******************************************************************/ function insertUser(request, response){ var user = request.user; var iM = "api.User.insertUser-"; logger.info( iM + ' called: - ' , request, response, user); // Data validation if ( user.level === 'anonymous' ) { logger.error( iM + 'Anonymous User' ); response.send(500, { error: "Anonymous user." }); } user.getIdentities({ success: function (identities) { var req = require('request'); var userId = user.userId.split(':')[1]; var theProvdr = user.userId.split(':')[0]; var reqParams; logger.info(iM + ': calling getOAuthUserDetails for Identities: - ' , identities); try { reqPa…
has comment: http://stackoverflow.com/comment/51702900
has comment: http://stackoverflow.com/comment/51715817

http://stackoverflow.com/q/27698584
accepted answer: http://stackoverflow.com/a/27698727
has comment: http://stackoverflow.com/comment/43810491
has title: if else in php for choose and play iframe from two option
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43812074
score: 0
tagged with: iframe
type: Question
linked to: http://stackoverflow.com/q/14414705
has body: I want to add an auto select one iframe "which is running" between two to play videos on my website. I need decision block in PHP/JavaScript to automatically choose 1 iframe from the two. In some countries the videos plays from one iframe and in other countries it plays from both iframes. So I want to add a way so any user from anywhere can watch videos. Normally I'm using this one directly &lt;div id="video" style="margin-top:10px;"&gt;&lt;iframe width="940" height="420" src="http://www.youtube.com/embed/&lt;?php echo $_GET['v'] ;?&gt;?autoplay=1&amp;vq=medium&amp;modestbranding=1&amp;showinfo=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt; But now I want to add one more iframe, which is here &lt;div id="video" style="margin-top:10px;"&gt;&lt;iframe width="940" height="420" src="http://www.v.ytapi.com/embed/&lt;?php echo $_GET['v'] ;?&gt;?autoplay=1&amp;vq=medium&amp;modestbranding=1&amp;showinfo=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt; plz help me. thanks, Medipalace
has comment: http://stackoverflow.com/comment/43812102
tagged with: javascript
has answer: http://stackoverflow.com/a/27698727
answer count: 1
has comment: http://stackoverflow.com/comment/43810301

http://stackoverflow.com/comment/43962604
comment on: http://stackoverflow.com/q/27775988
has text: I would assume the same
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27777344
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27777544
has answer: http://stackoverflow.com/a/27777503
tagged with: angularjs
type: UnansweredQuestion
has body: I am new in Angularjs. I want to show the list of customers after login. After login I get the access token which I want to save in cookie. When I am using console.log(data), data is coming but in view page it is coming blank. index.html &lt;html lang="en" ng-app="customersApp"&gt; &lt;head&gt; &lt;link rel="shortcut icon" href="img/favicon.html"&gt; &lt;title&gt;Vizavoo&lt;/title&gt; &lt;!-- Bootstrap core CSS --&gt; &lt;link href="css/bootstrap.min.css" rel="stylesheet"&gt; &lt;link href="css/bootstrap-reset.css" rel="stylesheet"&gt; &lt;link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" /&gt; &lt;!--external css--&gt; &lt;link href="css/slidebars.css" rel="stylesheet"&gt; &lt;!-- Custom styles for this template --&gt; &lt;link href="css/style.css" rel="stylesheet"&gt; &lt;link href="css/style-responsive.css" rel="stylesheet" /&gt; &lt;/head&gt; &lt;body&gt; &lt;div ng-view&gt;&lt;/div&gt; &lt;!-- js placed at the end of the document so the pages load faster --&gt; &lt;script src="scripts/angular.js"&gt;&lt;/script&gt; &lt;script src="scripts/angular-route.js"&gt;&lt;/script&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular-cookies.js"&gt;&lt;/script&gt; &lt;script src="app/app.js"&gt;&lt;/script&gt; &lt;script src="app/controllers/loginController.js"&gt; &lt;/script&gt; &lt;script src="js/jquery.js"&gt;&lt;/script&gt; &lt;script src="js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;/body&gt; &lt;!-- Mirrored from thevectorlab.net/flatlab/login.html by HTTrack Website Copier/3.x [XR&amp;CO'2014], Mon, 08 Dec 2014 06:09:06 GMT --&gt; &lt;/html&gt; app.js (function(window){ var app= angular.module('customersApp',['ngRoute','ngCookies']); app.config(['$routeProvider', function ($routeProvider) { $routeProvider. when('/login', { title: 'Login', controller: 'loginController', templateUrl: 'app/views/loginuser.html' }) .when('/logout', { title: 'Logout', templateUrl: 'partials/login.html', controller: 'loginController' }) .when('…
type: Question
has title: How to show data using Angularjs?
answer count: 2

http://stackoverflow.com/a/27715377
has body: I've read a couple of posts to the developer or ChartNew.js and it seems like functions like destroy() or clean() are missing from the original Chart.js Now, I'm not familiar with the library but maybe this thread lights up one of your lightbulbs. Sorry if not very useful :)
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43846090
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/27715299
has comment: http://stackoverflow.com/comment/43846158
answers question: http://stackoverflow.com/q/27715299
has comment: http://stackoverflow.com/comment/43843461
has comment: http://stackoverflow.com/comment/43843155
upvote count: 1

http://stackoverflow.com/q/27768389
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/44169737
has title: sending post request in keystonejs on index.js
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/44212737
tagged with: keystonejs
type: Question
tagged with: javascript
has body: I have a contact form that I added to my index.jade file and I am trying to send a post request to the / route using the following code in the jade template which renders fine. if enquirySubmitted .row h3 Thanks for getting in touch. else .row form.contact-form(method="post" ) input(type='hidden', name='action', value='contact') .col-lg-4.col-sm-4(class=validationErrors.name ? 'has-error' : null) input.form-control.input-box(type='text', name='name.full', value=formData['name.full'], placeholder='Your Name') .col-lg-4.col-sm-4 input.form-control.input-box(type='email', name='email', value=formData.email, placeholder='Your Email') .col-lg-4.col-sm-4 div(class=validationErrors.enquiryType ? 'has-error' : null) input.form-control.input-box(type='text', name='enquiryType' value=formData.enquiryType) .col-md-12(class=validationErrors.message ? 'has-error' : null) .col-md-12 textarea.textarea-box(name='message')= formData.message button(type='submit') Send Message Here is the on post code in the index.js file locals.section = 'contact'; locals.formData = req.body || {}; locals.validationErrors = {}; locals.enquirySubmitted = false; // On POST requests, add the Enquiry item to the database view.on('post', { action: 'contact' }, function(next) { console.log('here'); var newEnquiry = new Enquiry.model(), updater = newEnquiry.getUpdateHandler(req); updater.process(req.body, { flashErrors: true, fields: 'name, email, phone, message', errorMessage: 'There was a problem submitting your enquiry:' }, function(err) { if (err) { locals.validationErrors = err.errors; } else { locals.enquirySubmitted = true; } next(); }); }); The problem that I am having is that there are no errors or 'here' being displayed to show that the post request in being received on the backend. I have been unable to solve this and am confused on what else I need to do get the contact form to get working. Looking at the keystone demo didn't help. Also the index.js file is located under routes/views/index.js
upvote count: 3
favorite count: 0
answer count: 0

http://stackoverflow.com/a/27678127
score: 0
type: AcceptedAnswer
has body: add event.preventDefault(); for click event and directly write onclick no need to write function $("#home").on("click", function(event) { event.preventDefault(); $('.indexPicWrapper').css('display', 'block'); $('.aboutPicWrapper').css('display', 'none'); }) $("#about").on("click", function(event) { event.preventDefault() $(".indexPicWrapper").css("display", "none") $('.contactPicWrapper').css('display', 'none'); $('.aboutPicWrapper').css('display', 'block'); }) nav { height: 50px; background-color: #eaeaea; line-height: 50px; text-align: center; } .indexPicWrapper { min-height: 100%; height: 100%; width: 100%; overflow-y: hidden; background: #FFA10D; position: absolute; } .aboutPicWrapper { display: none; position: absolute; height: 100%; width: 100%; overflow-y: hidden; background-color: #FF510D; } Home About Things... About...
type: Answer
accepted answer of: http://stackoverflow.com/q/27678012
answers question: http://stackoverflow.com/q/27678012

http://stackoverflow.com/comment/44012769
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27801258
has text: Your script is quite strange. 1. You click after submitting the loginform. 2. At the end you use `renderResults` which is from the tester module and not from the casper module. 3. You add jquery to the page, but never use it. 4. If it works when you call `addPeriode()` in Chrome, why don't you do this in CasperJS?
type: Comment

http://stackoverflow.com/comment/43846831
type: Comment
has text: yes, it worked with keyup. Thanks
type: QuestionComment
comment on: http://stackoverflow.com/q/27717406
score: 0

http://stackoverflow.com/comment/43893307
comment on: http://stackoverflow.com/a/27741093
has text: What ng-click? I have no idea what you are talking about. Do you suggest hiding unused elements in CSS? How is it any better than what I'm doing now?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27759215
has comment: http://stackoverflow.com/comment/43939737
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43944754
has comment: http://stackoverflow.com/comment/43943387
type: Answer
has comment: http://stackoverflow.com/comment/43933300
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27759196
has comment: http://stackoverflow.com/comment/43944977
answers question: http://stackoverflow.com/q/27759196
has body: What's wrong is that FeedList.get() uses asynchrony and $scope.feeds will not be populated right away. Try this: $scope.feeds = FeedList.get(); $scope.feeds.then(function () { // $scope.feeds is done loading now window.localStorage.setItem('savedData', JSON.stringify($scope.feeds)); console.log('TEST : ' + window.localStorage['savedData']); console.log('TEST : ' + JSON.parse(window.localStorage.getItem('savedData'))); console.log('TEST : ' + JSON.parse(window.localStorage['savedData'])); }); Edit: Now that you've provided the code for your service, it's clear that it doesn't return a promise. You need to do that in order for the consumers of your service to be able to wait on the results: .service('FeedList', function ($rootScope, $q, FeedLoader) { var feeds; this.get = function() { var feedSources = [ {title: 'rss1', url: 'http://www.website.com/rss/feed/rss_feed_25300'}, {title: 'rss2', url: 'http://www.website.com/rss/feed/rss_feed_10720'}, ]; if (!feeds) { var feedPromises = feedSources.map(function (source) { return FeedLoader.fetch({q: source.url, num: 10}, {}).$promise .then(function (data) { return data.responseData.feed.entries; }); }); feeds = $q.all(feedPromises) .then(function (retrievedFeeds) { return Array.prototype.concat([], retrievedFeeds); }); } return feeds; }; })
upvote count: 2
has comment: http://stackoverflow.com/comment/43944794

http://stackoverflow.com/comment/43784210
type: QuestionComment
has text: You can shorten your condition to `if (!document.getElementById("username").value)`.
comment on: http://stackoverflow.com/q/27685112
score: 0
type: Comment

http://stackoverflow.com/q/27713015
upvote count: 2
has comment: http://stackoverflow.com/comment/43838695
accepted answer: http://stackoverflow.com/a/27713491
tagged with: iis-express
type: Question
score: 2
type: AnsweredQuestion
has title: JSON mime type on IIS Express with a POST request
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43838992
has comment: http://stackoverflow.com/comment/43838282
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27713491
tagged with: extjs
has comment: http://stackoverflow.com/comment/43838478
has body: I am using Visual Studio 2013 with IIS Express. My html page has a JavaScript (EXTJS) which is calling a file.json on HTTP POST method. and I get "HTTP Error 405.0 - Method Not Allowed" I tried adding below stuff in web.config &lt;system.webServer&gt; &lt;staticContent&gt; &lt;mimeMap fileExtension=".json" mimeType="application/json" /&gt; &lt;/staticContent&gt; &lt;/system.webServer&gt; Ran below command on command prompt appcmd set config /section:staticContent /+[fileExtension='JSON',mimeType='application/x-javascript'] Nothing helps. I am able to access the .json file with GET request, like http://localhost/file.json, but not with POST request. Here is my ExtJS code calling that JSON file Ext.onReady(function () { var tree = new Ext.tree.TreePanel({ renderTo: 'tree-div', title: 'My Task List', height: 300, width: 400, useArrows: true, autoScroll: true, animate: true, enableDD: true, containerScroll: true, rootVisible: false, frame: true, root: { nodeType: 'async' }, dataUrl: 'file.json' }); tree.getRootNode().expand(true); }); file.json has below structured JSON [{ text: 'To Do', cls: 'folder', children: [{ text: 'Go jogging', leaf: true, checked: false },{ text: 'Take a nap', leaf: true, checked: false },{ text: 'Climb Everest', leaf: true, checked: false }] },.....

http://stackoverflow.com/q/27766647
has body: I drawn a circle in canvas and put an image near the border. Now I have absolutely no idea..I want to drag the image around the circle but the top of the arrow image should always be on the border. For Example: I drag the arrow from the top to the left at nine o'clock. Now the arrow image needs to be rotated 90 degrees. http://jsfiddle.net/L5twk3ak/1/ canvas = document.getElementById('test'); var context = canvas.getContext("2d"); var points = []; var radius = 55; imageBG = new Image(); imageBG.onload = function() {context.drawImage(imageBG, 148, 100, 15, 15);}; imageBG.src = 'https://www.nanamee.com/upload/images/5945/5945_p.jpg'; for(var degree = 0; degree < 360; degree++) { var radians = degree * Math.PI / 179; var x = 150 + radius * Math.cos(radians); var y = 150 + radius * Math.sin(radians); points.push({x : x, y : y}); } context.beginPath(); context.moveTo(points[0].x + 4, points[0].y + 4) for(var i = 1; i < points.length; i++) { var pt = points[i]; context.lineTo(pt.x + 4, pt.y + 4); } context.strokeStyle = "black"; context.lineWidth = 1; context.stroke(); context.closePath(); Your browser does not support the HTML5 canvas tag.
has title: Drag Move an Image inside a Circle (circular movement)
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43944008
has answer: http://stackoverflow.com/a/27767967
type: Question
upvote count: 2
tagged with: canvas
answer count: 1
tagged with: javascript
tagged with: jquery
downvote count: 1
favorite count: 0

http://stackoverflow.com/comment/43748436
has text: As someone else said, this will require you to be pci compliant. This goes far beyond everything being behind SSL
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27666704

http://stackoverflow.com/comment/43845907
type: Comment
score: 0
has text: Start by learning about Ajax https://developer.mozilla.org/en-US/docs/AJAX/Getting_Started Than you can make a call to the server, get the table rows and replace the content of the table. Using setTimeout to trigger the next fetch.
comment on: http://stackoverflow.com/q/27716986
type: QuestionComment

http://stackoverflow.com/comment/43987523
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27788676
score: 0
has text: it seems you are using MVC, man you have better way to validate your form on client and on server if you want, why you are using this way?

http://stackoverflow.com/comment/43927631
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27758469
type: Comment
has text: you need to wrap your event listener handler within a closure

http://stackoverflow.com/comment/44229342
has text: Sorry it took me so long to respond. I've actually tried to do a simpler post and it is not working either. If I do an .ajax response I get the error function thrown, but the only thing that gets thrown is the 'error' status. The error message is null. I'm thinking that something is wrong with access to my localhost php script, I don't know about permissions or what needs changed, but it's the only thing I can think of that would be wrong.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27792379

http://stackoverflow.com/comment/43886160
type: AnswerComment
comment on: http://stackoverflow.com/a/27737381
score: 0
type: Comment
has text: thanks for the response. This didn't work, I was able to get the right path, but the `GET` request was performed and not `POST`

http://stackoverflow.com/comment/44143710
type: Comment
has text: console.log is a builtin method for browsers- if you open up dev tools in chrome (cmd/ctrl + shift + I ), then hit esc, then type console.log('log a message'); the console will log a message. If you're getting an error, just add this to the top of the script : var console = { log: function(thing){ return thing; }}
type: AnswerComment
comment on: http://stackoverflow.com/a/27695887
score: 0

http://stackoverflow.com/comment/43892121
score: 0
type: Comment
has text: The categories are not supported in the highstock,so so you need to use datetime of xAxis.
comment on: http://stackoverflow.com/a/27718266
type: AnswerComment

http://stackoverflow.com/comment/43901650
score: 2
comment on: http://stackoverflow.com/q/27745358
has text: Your script has to occur after the place where jQuery is loaded.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43754016
comment on: http://stackoverflow.com/q/27669347
score: 0
has text: In addition to ebidels answer - you are missing a comma right before `myFilter`
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44005735
type: Comment
has text: I think, that getting instance of the grid using var grid = $("#locations_grid").data('kendoGrid'); is not dependent on Angular. Could You please provide updated code snippet, because i'm not exactly understand how did you mean it.
comment on: http://stackoverflow.com/a/27779513
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44014708
comment on: http://stackoverflow.com/q/27800088
score: 0
has text: So I can load a remote script with getScript. But what to do with the json object, which is below the script tag?
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27748807
tagged with: javascript
tagged with: prettify
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: highlight
score: 2
upvote count: 2
has title: Highlighting and formatting code snippets using JavaScript
tagged with: formatting
tagged with: syntax-highlighting
type: Question
has body: I'm looking for a way to highlight and format code snippets passed as string for a live style guide. I'm playing around with highlighjs and prettify. They are really helpful and easy for highlighting, but I can't seem to figure out a way to format or whether they can actually do that or not. By formatting, I mean tabs and newlines to make code legible. I need to pass code as a string to automate the output of dust template I'm using for the style guide. That is, I want to pass: " Name Category Results " And get something like: Name Category Results Any ideas on how to accomplish this? Thanks!
has answer: http://stackoverflow.com/a/27748855

http://stackoverflow.com/comment/43909802
type: AnswerComment
comment on: http://stackoverflow.com/a/27743894
has text: @nnnnnn You are right!
type: Comment
score: 0

http://stackoverflow.com/comment/43956897
type: Comment
comment on: http://stackoverflow.com/a/27772996
has text: @SamSamet Yes you could, it will not let you keep things DRY though and more code to maintain the state. WHy do you need it that way?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43731708
type: AnswerComment
has text: @vadimyer i am not able to do the same thing with `z-index` http://codepen.io/anon/pen/pvEdMw i am going to ask about this here
comment on: http://stackoverflow.com/a/27656261
type: Comment
score: 0

http://stackoverflow.com/q/27666360
tagged with: http://stackoverflow.com/tag/html
has title: how to implement mapbox.js offline caching
tagged with: cordova
tagged with: mapbox
accepted answer: http://stackoverflow.com/a/27666623
type: AnsweredQuestion
has body: I'm creating a phonegap mobile app that have a map in it. I'm using mapbox.js i know that it allows offline capability but i couldn't figure out how to do it i searched on how to but i could not find the documentation this is my code so far &lt;div id='map'&gt;&lt;/div&gt; &lt;script&gt; L.mapbox.accessToken = 'accessToken'; var map = L.mapbox.map('map', 'id') .setView([-37.82, 175.215], 14); var markers = new L.MarkerClusterGroup(); for (var i = 0; i &lt; addressPoints.length; i++) { var a = addressPoints[i]; var title = a[2]; var marker = L.marker(new L.LatLng(a[0], a[1]), { icon: L.mapbox.marker.icon({'marker-symbol': 'post', 'marker-color': '0044FF'}), title: title }); marker.bindPopup(title); markers.addLayer(marker); } map.addLayer(markers); &lt;/script&gt;
type: Question
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27666623

http://stackoverflow.com/a/40558586
type: Answer
has body: You don't even need a plugin to auto indent in vim. As soon as you open the file in vim, press these keys: gg Your cursor should move to the beginning of the file. And then type this: =G which is basically saying, "remove trailing spaces from the cursor position to the end of the file". Happy coding!
upvote count: 4
has comment: http://stackoverflow.com/comment/74075178
downvote count: 0
answers question: http://stackoverflow.com/q/27777507
has comment: http://stackoverflow.com/comment/80995826
score: 4

http://stackoverflow.com/a/27689226
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27687088
type: Answer
answers question: http://stackoverflow.com/q/27687088
downvote count: 0
has body: Extending My comment: function GetDates(startDate, daysToAdd) { var aryDates = []; for(var i = 0; i &lt;= daysToAdd; i++) { var currentDate = new Date(); currentDate.setDate(startDate.getDate() + i); aryDates.push(DayAsString(currentDate.getDay()) + ", " + currentDate.getDate() + " " + MonthAsString(currentDate.getMonth()) + " " + currentDate.getFullYear()); } return aryDates; } function MonthAsString(monthIndex) { var d=new Date(); var month=new Array(); month[0]="Jan"; month[1]="Feb"; month[2]="March"; month[3]="April"; month[4]="May"; month[5]="June"; month[6]="July"; month[7]="Aug"; month[8]="Sep"; month[9]="Oct"; month[10]="Nov"; month[11]="Dec"; return month[monthIndex]; } function DayAsString(dayIndex) { var weekdays = new Array(7); weekdays[0] = "Sun"; weekdays[1] = "Mon"; weekdays[2] = "Tue"; weekdays[3] = "Wed"; weekdays[4] = "Thu"; weekdays[5] = "Fri"; weekdays[6] = "Sat"; return weekdays[dayIndex]; } var startDate = new Date(); var aryDates = GetDates(startDate, 7); console.log(aryDates); Fiddle: http://jsfiddle.net/u93g87qc/2/

http://stackoverflow.com/q/27754126
has title: Elements are floating outside of bootstrap modal
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43919166
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/43919173
has answer: http://stackoverflow.com/a/27754309
accepted answer: http://stackoverflow.com/a/27754309
type: Question
has body: I have a form insite a modal. When the size of the window is small then everything is fine. If I maximise the window then the elements of the form are floating outside of the modal. I have checked all my css styling etc, but nothing seems to conflict. I have also set this up on JSFiddle, and it seems to happen and there aswell, with just JQuery and Bootstrap. Its seems to be something on my code but I cant figure out what. Could you please take a look on it and help me out? http://jsfiddle.net/dsryycbq/ &lt;div id="editPassword" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="editPasswordlbl" aria-hidden="true"&gt; &lt;div class="vertical-alignment-helper"&gt; &lt;div class="modal-dialog modal-sm vertical-align-center"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt; &lt;h4 class="modal-title" id="editPasswordlbl"&gt;Change Password&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;form action="{{url_for('admin')}}" role="form" id="editPasswordForm" method="post"&gt; &lt;input type="hidden" name="formType" value="changePassword"&gt; &lt;div class="form-group"&gt; &lt;label class="col-sm-3 control-label"&gt;Password&lt;/label&gt; &lt;div class="col-sm-5"&gt; &lt;input type="password" class="form-control" name="password" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label class="col-sm-3 control-label"&gt;Repeat Password&lt;/label&gt; &lt;div class="col-sm-5"&gt; &lt;input type="password" class="form-control" name="confirmPassword" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;div class="col-sm-9 col-sm-offset-3"&gt; &lt;!-- Do NOT use name="submit" or id="submit" for the Submit button --&gt; &lt;button type="submit" class="btn btn-default"&gt;Confirm&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43919194
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43919324

http://stackoverflow.com/q/27785398
downvote count: 0
type: Question
tagged with: angularjs-directive
tagged with: javascript
upvote count: 2
has title: Using $document.off in link function of custom directive
answer count: 1
has answer: http://stackoverflow.com/a/27785459
tagged with: dom-events
accepted answer: http://stackoverflow.com/a/27785459
favorite count: 0
has body: I am using AngularJS 1.3.8. Within the link-function of a custom directive I have following code: $document.on("keydown", function(event) { HandleKeys(event); }); scope.$on("$destroy", function () { $document.off("keydown", HandleKeys); }); $document.on works as expected and the keydown-event is registered. The scope.$on-event is called as well (once the scope is destroyed of course), how ever the $document.off("keydown", HandleKeys);-line doesn't work. "Doesn't work" means that the keydown event is still registered. If I remove the HandleKeys-parameter to have have following line, it does work: $document.off("keydown"); This is not what I want, as I want to specifically unbind the HandleKeys-function. Does anybody have an idea, why this doesn't work for me?
tagged with: angularjs
score: 2
type: AnsweredQuestion

http://stackoverflow.com/a/27795402
answers question: http://stackoverflow.com/q/27794945
type: Answer
has comment: http://stackoverflow.com/comment/44000414
has comment: http://stackoverflow.com/comment/44001100
has comment: http://stackoverflow.com/comment/44000232
accepted answer of: http://stackoverflow.com/q/27794945
score: 4
has comment: http://stackoverflow.com/comment/44000742
upvote count: 4
has body: You can do it with only Javascript (there's no need for jQuery): function inputFocus(){ document.getElementById("searchBox").focus(); } window.onkeydown = inputFocus; See the working DEMO.
type: AcceptedAnswer
downvote count: 0

meteor-blaze
tags question: http://stackoverflow.com/q/27784646
tags question: http://stackoverflow.com/q/27779783
type: Tag
tags question: http://stackoverflow.com/q/27718725
tag name: meteor-blaze

http://stackoverflow.com/a/27649125
type: AcceptedAnswer
score: 0
has body: You can choose either Embedded or Referenced approaches. In the following examples, I assume that the relationship of Transaction - Bills is 1:1. Embedded Relationship { "_id":ObjectId("TRANSACTION_ID"), "bill": { "billName": "Bill #1", "type": "income", "amount": 100, "start_date": "xxx", "end_date": "yyy", "timestamp": "zzz" } } Referenced Relationship { "_id":ObjectId("TRANSACTION_ID"), "bill_id": ObjectId("BILL_ID_1") } Query: &gt;var result = db.transaction.findOne({"_id":"TRANSACTION_ID"}); &gt;db.bills.find({"_id":result["bill_id"]}); Reference doc: http://www.tutorialspoint.com/mongodb/mongodb_data_modeling.htm
type: Answer
accepted answer of: http://stackoverflow.com/q/27648177
answers question: http://stackoverflow.com/q/27648177

http://stackoverflow.com/q/27800446
has answer: http://stackoverflow.com/a/27800719
accepted answer: http://stackoverflow.com/a/27800719
has body: I am not the greatest at jQuery and still learning bits and bobs. I currently have the below function and I would like to expand on it to post data to referrer-ajax2.php. $(document).ready(function() { $('#clickthrough').click(function(){ $('#declined').load('referrer-ajax2.php #declined2'); }); }); Can I just add another function such as: $(document).ready(function() { $('#clickthrough').click(function(){ $('#declined').load('referrer-ajax.php2 #declined2', function() { $.post('referrer-ajax.php2', { company_selected: $('#refselect').val(), ref_date_from: $('#ref_date_from').val(), ref_date_to: $('#ref_date_to').val() }, }); }); }); Is this the correct way to do things or is there a more sensible way? Would this not reload the div and THEN post the data (which would be the wrong way round) I assume I can just switch the functions round? Not really tried anything yet just looking to understand the correct way to do this and develop my knowledge of jQuery. Appreciate your input guys.
type: Question
downvote count: 2
answer count: 1
tagged with: javascript
tagged with: jquery
score: -1
upvote count: 1
favorite count: 0
has title: Best practice to reload div on click and post data
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/q/27650276
answer count: 1
tagged with: button
tagged with: facebook
accepted answer: http://stackoverflow.com/a/27650399
type: AnsweredQuestion
tagged with: toggle
type: Question
has title: Create button in Facebook API to show/hide (toggle)
tagged with: javascript
has body: I am using the Facebook Javascript API. I want to create something like this: 1. Album Name [show/hide] Album details 2. Album Name [show/hide] Album details 3. Album Name [show/hide] Album details First I retrieved the list of albums There would be a button beside the album name to toggle (show/hide) details of albums using jQuery. The album details are put into p tags with specific IDs ("album1", "album2", etc...) Using jQuery to toggle the specific IDs. However, button in1 created inside the FB.api is not able to toggle. Another button out1 which is out of the FB.api is able to toggle. QNS: Why is it that the button inside the FB.api is unable to do the toggling? I just wish to make a specific button for each album so I can toggle each album's details specifically. Partial code below: out1
has answer: http://stackoverflow.com/a/27650399
score: 0
tagged with: api

http://stackoverflow.com/a/33013447
has comment: http://stackoverflow.com/comment/66116376
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27651268
answers question: http://stackoverflow.com/q/27651268
type: Answer
score: 1
has body: This is a known bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1129806 Be sure to upgrade to the latest Firefox release, as some aspects of the bug have been fixed already.

http://stackoverflow.com/comment/43940466
type: QuestionComment
has text: @PSL Any idea on why is this happening?
score: 0
comment on: http://stackoverflow.com/q/27747679
type: Comment

http://stackoverflow.com/comment/43706152
type: QuestionComment
has text: @fejese Cool, I'll keep that in mind. Thanks for the warm welcome...do you have any advice for me regarding my coding issue?
score: 0
comment on: http://stackoverflow.com/q/27643612
type: Comment

http://stackoverflow.com/a/27747438
has comment: http://stackoverflow.com/comment/43906842
score: 1
answers question: http://stackoverflow.com/q/27747299
type: AcceptedAnswer
downvote count: 0
has body: You can do this in CSS itself using transitions in modern browsers. You can check that here which all browsers support transitions. #header-out { width:100%; height:75px; position:fixed; top:0; left:0; z-index:999; cursor: pointer; background: rgba(125,135,105,.25); transition: all 0.6s linear; } #header-out:hover { transition: all 0.6s linear; background: rgba(45,65,135,.80); height: 400px; color: #fff; } See fiddle
accepted answer of: http://stackoverflow.com/q/27747299
type: Answer
upvote count: 1

http://stackoverflow.com/comment/43847530
comment on: http://stackoverflow.com/q/27716558
score: 0
type: Comment
type: QuestionComment
has text: Yes, the only async call is the `store.find()`. I did try returning the .find() directly, but I was not a fan of having to add an observer to check for the change of length of the `model.pokemon` (it felt wrong.)

http://stackoverflow.com/comment/43745376
type: Comment
comment on: http://stackoverflow.com/q/27665028
type: QuestionComment
has text: can you please edit and write the complete loop so we can understand better
score: 0

http://stackoverflow.com/a/27671750
has body: Found it already in the docs: All moments are mutable. If you want a clone of a moment, you can do so explicitly or implicitly. Calling moment() on a moment will clone it.
answers question: http://stackoverflow.com/q/27671686
score: 0
type: Answer

http://stackoverflow.com/comment/43752179
comment on: http://stackoverflow.com/q/27668677
type: QuestionComment
has text: Looks like $_POST['formName'] contains no type or is not set.
score: 0
type: Comment

http://stackoverflow.com/a/27742712
score: 4
answers question: http://stackoverflow.com/q/27742676
has comment: http://stackoverflow.com/comment/43896556
downvote count: 1
has body: When you do i--, the value of i is used and then decremented. But in case of a prefix --1 operator it is different, as in, it will be decremented and then used. var i = j = 1; console.log(i--); // still 1 console.log(i); // now 0 console.log(--j) // 0 console.log(j); // again 0 Why explain the above? To show you what's going on actually behind when you use pre-fix and post-fix operators, though it is not mainly concerned with the question, but I thought it would be better to know. Now the actual answer What i = i - 1 does is it evaluates as soon as the code is encountered, so i is actually 0, you can say it acts similar to pre-fix decrement operator, in this case, but i-- is still 1 when the condition used in while is evaluated for the first time and then when the second time the while condition is checked, it is 0, which is falsey and hence the loop ends.
upvote count: 5
type: Answer
has comment: http://stackoverflow.com/comment/43896573

http://stackoverflow.com/q/27785786
has answer: http://stackoverflow.com/a/27786086
tagged with: css
has answer: http://stackoverflow.com/a/27785886
has comment: http://stackoverflow.com/comment/43981587
has answer: http://stackoverflow.com/a/27785949
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43981668
accepted answer: http://stackoverflow.com/a/27785886
possible better answer: http://stackoverflow.com/a/27785949
has title: Using JavaScript to create and append nested div elements
has comment: http://stackoverflow.com/comment/43981672
type: Question
score: 0
tagged with: javascript
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to use JavaScript to update the CSS layout as the webpage loads. My code looks like so: var container = 0; // Add Total UI var containerTitle = 0; // Container Title var article = 0; var articleTitle = 0; var divName = 0; // temp variable for article id names var divNameT = 0; // temp variable for title id names function setLayout(id) { container = document.getElementById(id); for(var x = 0; x &lt; 18; ++x) { // CREATE CONTAINER FOR ALL PANELS divName = "articleCon"+ x; article = document.createElement('div'); article.id = divName; // SETUP CSS STYLE article.style.cssText = 'height: 205px; width: 300px; background: red; margin-right: 20px; margin-bottom: 20px; display: block; float: left;'; setNewsTitle(count,divName); // Function Call to set Title Panel container.appendChild(article); } } function setNewsTitle(count,id) { containerTitle = document.getElementById(id); // CREATE CONTAINER FOR TITLE divNameT = "articleTitle"+ count; articleTitle = document.createElement('div'); articleTitle.id = divNameT; // SETUP CSS STYLE articleTitle.style.cssText = 'position: absolute; height: 45px; width: 100px; background: yellow; display: inline;'; containerTitle.appendChild(articleTitle); } When I compile my code without making the call to function setNewsTitle(count,id) all the CSS elements are working fine. The issue I am facing here is whenever the function call is made, my page appears blank. Nothing displays on the screen. I tried adding screenshots for better understanding, but i don't have the reputation yet.

http://stackoverflow.com/a/30174389
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27693535
has body: Your cancel button is mapped as the "submit" button on the plugin side. This means that the plugin recognizes that button to invoke verification when clicked. Verification will happen before actually performing any other actions which is what you are seeing. There are two solutions to working around this. Add another button to your form. The plugin looks for the submit button with this selector "[type=submit], [type=image], [type=button]:last, button:last" Line 48. If you add another button then your cancel button will be free and verification will not be invoked when clicked. When you configure the plugin, set submitVerify to false. See the documentation here. This will disable verification for all buttons on your form. Verification will only happen when you click the plugin checkmark bubble. Note: I work for SmartyStreets
type: Answer
upvote count: 1
score: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27693535

http://stackoverflow.com/q/27657178
has comment: http://stackoverflow.com/comment/43754261
answer count: 0
has comment: http://stackoverflow.com/comment/43733687
has comment: http://stackoverflow.com/comment/43765963
type: UnansweredQuestion
has body: I've got a question regarding client-management socket.io with node.js I'm running a very basic socket.io application where several socket.io-clients connect to a socket.io-server. When I try to populate a list of clients I do it like this: server.js: var clients = []; io.on('connection', function (socket) { socket.emit('whoareyou'); socket.on('hithere', function(name){ clients.push(name); socket.emit('clients', clients); console.log(name+" connected"); socket.on('disconnect', function(){ console.log(name+" disconnected"); clients.splice(clients.indexOf(name), 1); }); }); }); clients.js var socket = io.connect(server, { port: 80 }); socket.on('whoareyou', function(){ socket.emit('hithere',hostname); }); }); The clients-emit is for a webpage to populate the client-list because I don't really know how to exchange this list with a webserver running on the same machine without emitting. Now, what I could do is skipping this whole whoareyou and hithere-crap and saving the socket as a JSON-array in clients. The ugly detail about this is that I just want to use the hostname of the client as a nickname and this is not a part of the socket-JSON (btw: the ip-address is part of it). the socket-io docs show a nice example of a chat-room here: http://socket.io/get-started/chat/ but the interesting parts are left out. Does somebody know a nice way how to do this?
has comment: http://stackoverflow.com/comment/43733813
tagged with: socket.io
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43755098
type: Question
has comment: http://stackoverflow.com/comment/43754733
has comment: http://stackoverflow.com/comment/43733862
tagged with: javascript
has comment: http://stackoverflow.com/comment/43761954
has title: socket-io usernames and connected client list
score: 0
has comment: http://stackoverflow.com/comment/43733917
tagged with: node.js

http://stackoverflow.com/comment/43921238
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27755193
has text: I only mentioned because op could not know it was possible to parse html strings with jquery. I myself didn't know when I started using it - therefore he wouldn't tag as jquery, because he would think it is irrelevant. And I said 'normally every website uses jquery', of course it is not all of them, and there are several reasons not to, but it is still the majority of them :)

http://stackoverflow.com/comment/44007755
type: QuestionComment
comment on: http://stackoverflow.com/q/27799616
has text: var date = currentDate.getMonth() + '/' + currentDate.getDate() + '/' + currentDate.getFullYear(); var currentTime = Date.parse(date + ' ' + currentDate.getHours() + ':' + currentDate.getMinutes() + ':' + currentDate.getSeconds()); var startTime = Date.parse(date + ' ' + '@ViewData["StartTime"]'); var endtime = Date.parse(date + ' ' + '@ViewData["EndTime"]');
score: 0
type: Comment

http://stackoverflow.com/q/27641659
has answer: http://stackoverflow.com/a/27650416
downvote count: 0
tagged with: javascript
tagged with: ckeditor
has body: I'm Looking to disable a button outside of CKEditor during Source view. I've tried it many different ways, but can't seem to get it right. My code: var CKE = CKEDITOR.instances.textarea; CKE.setData(decodeURIComponent(htmlTEXT), function () { this.checkDirty(); }); CKEDITOR.on('key', function (ev) { var state = ev.editor.getCommand('source').state; console.log(state); if (state == true) { // disable button } });
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has title: CKEditor 'Source' button listener
type: Question
score: 1
has answer: http://stackoverflow.com/a/27802278
answer count: 2

http://stackoverflow.com/comment/43825234
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27700619
has text: This was my initial thinking but was hoping the partial application was part of the core language itself. Can I ask what the purpose of assigning the the function to a higherOrder object is? Can't we do the same without creating a new object for it?

http://stackoverflow.com/comment/43935724
comment on: http://stackoverflow.com/q/27762140
type: Comment
score: 0
has text: Excuse me, explain why `9229` should be false, but `9299` should be true.
type: QuestionComment

http://stackoverflow.com/q/27768876
has answer: http://stackoverflow.com/a/27768982
type: AnsweredQuestion
downvote count: 1
type: Question
tagged with: delay
tagged with: javascript
score: -1
possible better answer: http://stackoverflow.com/a/27768982
has comment: http://stackoverflow.com/comment/43948504
answer count: 2
has comment: http://stackoverflow.com/comment/43948544
upvote count: 0
has answer: http://stackoverflow.com/a/27768892
has comment: http://stackoverflow.com/comment/43948484
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27768892
has body: Is there a way to do something like the following, to delay the location.reload() ? $('.thank-you').show().wait(1000); // wait 1s before doing the reload location.reload();
has comment: http://stackoverflow.com/comment/43948585
favorite count: 0
has title: Add a 'wait' in jQuery

http://stackoverflow.com/comment/43940910
has text: You are correct that my userassignment" table has a field named "a_id" set together with userid that references to the assignment table which contains the assignment info
comment on: http://stackoverflow.com/a/27765132
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27710668
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27705759
answers question: http://stackoverflow.com/q/27705759
type: Answer
has body: You're adding a new mousemove listener every time the mouse enters a .homeModelItem. In that handler you set display: block for .black, and this will override the hiding in mouseleave handler. It looks like you want to position .black related to the currently hovered .homeModelItem. You can do it for example like this: $(".homeModelItem").mouseenter(function (e) { $(e.target).append($('.black')); // Move the .black to the target element $(".black").css({ display: "block" }); }); $(".homeModelItem").mouseleave(function (e) { $(".black").css({ display: "none" }); }); Addition to .homeModelItem CSS: position: relative; and to .black CSS: left: 100px; top: 0px; z-index: 100; A live demo at jsFiddle. If you'll need the mousemove somewhere, you can add it, but outside of any event handler (unles you will remove it in another handler).
upvote count: 1
has comment: http://stackoverflow.com/comment/43834930
score: 1
has comment: http://stackoverflow.com/comment/43834702

http://stackoverflow.com/q/27727325
tagged with: javascript
score: 0
upvote count: 1
answer count: 1
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43867252
has comment: http://stackoverflow.com/comment/43867124
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27727874
type: Question
tagged with: google-apps-script
has title: Automatically Detect New entry and create another new row
has body: I have one google spreadsheet with two sheets that have same number of rows. What I want to do: When a new entry is written after the last row of Sheet1, it will automatically copy the last row of Sheet2 and paste it after that. (The new row will be in the last row after this, and both sheets will have same row again) Since I don't use google script too much, I don't know how to accomplish it. Which functions or formula shall I use? Thanks in advance.
tagged with: google-sheets
has answer: http://stackoverflow.com/a/27727874

http://stackoverflow.com/comment/43870467
score: 0
comment on: http://stackoverflow.com/a/27727001
has text: I forgot to update the @moz animation. Please check it again.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27674549
has body: The glob pattern you've set, node_modules/* only matches the files in the root of the node_modules directory, but not all the children with an highter depth. You need to set is as node_modules/**/*, this will match everything. I advice you however to only match js files, with node_modules/**/*.js. You also need to negate the pattern with !, gulp does not know that you want to do that, so it will look like: gulp.src(['**/*.js', '!node_modules/**/*.js']) For nodemon, following the same thing you can use the node_modules/**/* pattern. The library used by gulp for globbing is minimatch.
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43767086
accepted answer of: http://stackoverflow.com/q/27673862
score: 5
answers question: http://stackoverflow.com/q/27673862
upvote count: 5
has comment: http://stackoverflow.com/comment/43768624

http://stackoverflow.com/comment/43827339
has text: Why do you need ajax to do this?
score: 2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27707717

http://stackoverflow.com/q/27744737
type: Question
has title: Panel scrolling in bootstrap
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27744816
score: 0
answer count: 2
tagged with: jquery
has body: I am having bootstrap code as follows Title First Panel Second Panel Title Movable Panel What I want to achieve is when I click on panels with id 'sf' or 'sp' then the panel with id 'movable-container' must be aligned horizontally with this panel. Sample can be seen here What I want to achieve is when user clicks on panel with What I tried to do is get the position of the container I clicked and moving the 'mocable-container' x pixels down where x is the returned position of clicked container. Also the animate() function of jquery is not working multiple times. How to achieve this?
tagged with: twitter-bootstrap
possible better answer: http://stackoverflow.com/a/27744795
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27744795
has answer: http://stackoverflow.com/a/27744816
type: AnsweredQuestion

http://stackoverflow.com/comment/43847566
type: AnswerComment
type: Comment
has text: Your code will work as GET and not as POST `xmlhttp.open('POST', '../Employees1/HandleFileUpload', true); xmlhttp.send("year=2014&otherparam=otherdata")` - this will send data as post request
score: 1
comment on: http://stackoverflow.com/a/27714120

http://stackoverflow.com/a/27794062
type: Answer
has body: It happens because the page gets reloaded when you click Send Offer button. You should add a quick check if a visitor is logged in or not before you send the form. So if a visitor is not authorized then show login form, if he is authorized - send the form. You should pass the login status variable to the template or whatever and check it with Javascript.
score: 0
answers question: http://stackoverflow.com/q/27793908

http://stackoverflow.com/q/27674758
answer count: 1
tagged with: jquery
has title: How can I set ul background image fadeIn with CSS3?
favorite count: 0
has body: I have an Unordered List in my page. Each li elements displayed with CSS3 rotate animation. I want to set background image with FadeIn effect just after li animation finished. I write "addbg" Class for ul like this: ul.addbg{ background: transparent url(../img/circle-line.png) no-repeat 49% 94px; -webkit-transition:background 5.6s; -moz-transition:background 5.6s; -o-transition:background 5.6s; transition:background 5.6s; } but nothing happen! How can I do that? My ul is like this: Text1 Text2 Text3 Text4
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27674810
accepted answer: http://stackoverflow.com/a/27674810
type: AnsweredQuestion
score: 2
downvote count: 0
type: Question
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/43764419

http://stackoverflow.com/comment/43743567
type: Comment
has text: Unless you authenticate them, you can't stop someone from making an HTTP request the same way a browser would. And even then, they can still steal your data.
score: 0
comment on: http://stackoverflow.com/q/27663858
type: QuestionComment

http://stackoverflow.com/q/27736624
has comment: http://stackoverflow.com/comment/43884753
type: Question
has comment: http://stackoverflow.com/comment/43884807
has body: I have javascript code that will validate alphanumeric and dashes for any field it is assigned to. The regex completes successfully and the error message displays. What I would like to happen is upon hitting a key that would make the regex true it would delete the variable that set it to true (for example if someone where to hit the @ key it would only delete the @ character). Right now I have it set to erase the entire field. function validateAlphaNumericField(field) { var value = field.value; var reg = /[^A-Za-z0-9-]/; var newVal = reg.test(value) if (newVal == true) { alert("This field must contain only alphanumeric and dashes."); field.value=""; } }
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43884866
tagged with: validation
answer count: 1
has comment: http://stackoverflow.com/comment/43884847
has answer: http://stackoverflow.com/a/27736708
has comment: http://stackoverflow.com/comment/43895550
accepted answer: http://stackoverflow.com/a/27736708
has comment: http://stackoverflow.com/comment/43895568
tagged with: regex
type: AnsweredQuestion
has title: Delete last value entered JavaScript

http://stackoverflow.com/a/27721547
has comment: http://stackoverflow.com/comment/43854721
type: Answer
has comment: http://stackoverflow.com/comment/43854895
has comment: http://stackoverflow.com/comment/43855323
answers question: http://stackoverflow.com/q/27721133
score: 0
has body: You can use the setDate and getDate. Example: &lt;input id="StartDate" class="datepicker setNext hasDatepicker" type="text" value="13/02/2015" name="StartDate"&gt; &lt;script&gt; function convertInputtoDate(){ var input = document.getElementById("StartDate").value; var date = input.split('/'); var selectdate = new Date(date[2], date[1], date[0]); return selectdate; } var today = convertInputtoDate(); var tomorrow = new Date(convertInputtoDate()); tomorrow.setDate(today.getDate() + 1); alert('Today : ' + today + ' Tommorow :' + tomorrow.toLocaleString()); &lt;/script&gt; If you want to change the date format, use: tomorrow.toLocaleString(); // output will be : d/m/Y H:M:S And to convert your input to date: function convertInputtoDate(){ var input = document.getElementById("StartDate").value; var date = input.split('/'); var selectdate = new Date(date[2], date[1], date[0]); return selectdate; }
has comment: http://stackoverflow.com/comment/43854872

http://stackoverflow.com/a/27745530
type: Answer
has body: Move the stock objects into an Array, and loop them through to create the rows. Something like this: var stocks = []; stocks.push(new Stock("Bag (F)", "Leather Shoulder Bag", 4, 50.45)); stocks.push(new Stock("Blouse (F)", "Vintage Blue Silk Polka Dot Blouse", 8, 45.99)); stocks.push(new Stock("Boots (F)", "Soft Leather Brown Ankle Boots", 3, 65.35)); stocks.push(new Stock("Belts (F)", "Woven Finish Fashion Belt", 15, 21.99)); stocks.push(new Stock("Shirt (M)", "Jacquard Patter Wrangler Western Shirt", 19, 34.87)); stocks.push(new Stock("Shoes (M)", "Suede Ankle Boots", 6, 55.00)); stocks.push(new Stock("Trousers (M)", "Izod Peach Chinos", 23, 31.75)); stocks.push(new Stock("Belt (M)", "Suede Casual Belt", 4, 22.98)); stocks.push(new Stock("Hat (M)", "Trilby Style Brown Woven Fix", 2, 67.80)); function createTable() { // Create table. var table = document.createElement('table'); // Apply CSS for table table.setAttribute('class', 'article'); for(var i = 0;i&lt;stocks.length;i++){ var row1 = table.insertRow(0); var row1col1 = row1.insertCell(0); var stock = stocks[i] row1col1.innerHTML = stock.product; // Insert New Column for Row1 at index '1'. var row1col2 = row1.insertCell(1); row1col2.innerHTML = stock.description; // Insert New Column for Row1 at index '2'. var row1col3 = row1.insertCell(2); row1col3.innerHTML = stock.stockLevel; // Insert New Column for Row1 at index '3'. var row1col4 = row1.insertCell(3); row1col4.innerHTML = stock.price; } // Append Table into div. var div = document.getElementById('divTable'); div.appendChild(table); }
answers question: http://stackoverflow.com/q/27745362
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27745362
score: 0

http://stackoverflow.com/q/27706845
accepted answer: http://stackoverflow.com/a/27727582
linked to: http://stackoverflow.com/q/1729501
has body: I have a question that may seem slightly vague, but I am not sure how to go about solving it. Our office runs a headless machine that is a print server, connect via third party software. The issue that I am having, is that if for whatever reason, the system becomes disconnected from the host server, by means of connection issues on either our end, or theirs, an Alert dialog appears, and the printing will be halted until the dialog is dismissed. The application is run through Internet Explorer, and appears with with the following dialog. I originally tries using Java, and a Robot to blindly click the okay button, however the issue is that the dialog will appear in different places each time, and sometimes the message will appear multiple times if not dismissed immediately, so blindly clicking a screen coordinate will not work. My next thought was to search for a PID, and kill each message by name, or PID, however because it is an Internet Explorer application, that is not a possibility. Any thoughts as to how I could blindly dismiss these messages, either automatically, or through an external signal? Edit I have determined that the dialog is created using JavaScript, and I now have an alteration to the question, how can I dismiss this alert() call? I have read that using JavaScript, you can not dismiss the message, but would there be a way to inject a custom script, to overrride the call to alert? i.e., a dead function that overrides the system alert? function alert(){ // do nothing } How could I append this to the already loaded page...?
answer count: 1
tagged with: javascript
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/27727582
has title: Dismiss an Alert shown by another application
upvote count: 1
downvote count: 1
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43836182
tagged with: internet-explorer
tagged with: alert

http://stackoverflow.com/q/27702570
tagged with: css
has answer: http://stackoverflow.com/a/27702936
score: 2
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27702809
type: Question
tagged with: javascript
tagged with: jquery
has body: I have a string like content = "content1&lt;br/&gt;content2&lt;br/&gt;" and I add content3 into string the result gonna be like content1 content2 content3 I want the container of content animate height while showing new content. I have tried document.getElementById("detail").innerHTML = content; $("detail").animate({ height: 'auto' }, 1000); it's just appear without animate
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/43818039
accepted answer: http://stackoverflow.com/a/27702936
favorite count: 0
possible better answer: http://stackoverflow.com/a/27702809
has comment: http://stackoverflow.com/comment/43817830
tagged with: http://stackoverflow.com/tag/html
has title: javascript animate height while get new content

http://stackoverflow.com/a/27755281
has body: well niko its gonna be fun moving on with Javascript especially with ko I forked some of you code to make things understandable to you in a better way . In addition to the reasons mentioned by dear Wayne Ellery there are also few things you missing here like you have to use selectedOptions when there is a chance to select multiple list items The error you given us undefined is not a function is because you are selecting multiple list items and trying to push it which is not exactly how ko push works rather you have to loop through and do it. Check here for selectedOptions Documentation Its always good to have a fiddle right. Here we go check the working fiddle here There is no need of doing additional logic as you given in for click it can be done in simple readable way everything provided in fiddle View Model: var vm=function() { var self=this; //observable's declaration self.addItem = function () { ko.utils.arrayForEach(self.selectedItem1(),function(item){ self.availableOwners.push(item); self.ownership.remove(item); }); } self.removeSelected = function () { ko.utils.arrayForEach(self.selectedItem2(),function(item){ self.ownership.push(item); self.availableOwners.remove(item) }); }; }; ko.applyBindings(new vm()); View: &lt;select multiple="multiple" data-bind="options : ownership, optionsText:function(item) { return item.FirstName() + ' ' + item.LastName()}, selectedOptions:selectedItem1"&gt;&lt;/select&gt; &lt;input class="btn btn-primary" id="MoveLeft" type="button" value=" &lt;&lt; " data-bind="click:removeSelected,enable:selectedItem2" /&gt; Any issue on this get back to us .
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/27753925
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27753925
type: Answer

http://stackoverflow.com/comment/43890377
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27739323
has text: I have a question, addEventListener you add "creatureAttack1(5)...What if I have "function creatureAttack1(myObject.kills[], myObject.hp[]) is something like that possible? so I can change addEventListener and change all values at the same time?

http://stackoverflow.com/a/27679835
has body: What you need is the difference between the two arrays. Libraries like lodash have that feature but if you want to build your own you can use the following: var stores = ["1", "2", "3 ", "4", "5"], favStores = ["2", "4"]; function diff(a, b) { var results = []; for(var i = 0; i &lt; a.length; i++) { if(b.indexOf(a[i]) &lt; 0) results.push(a[i]); } return results; } console.log(diff(stores, favStores)); Note that you could use forEach to traverse the array but I am just being legacy proof here.
has comment: http://stackoverflow.com/comment/43774711
upvote count: 1
answers question: http://stackoverflow.com/q/27679764
downvote count: 0
has comment: http://stackoverflow.com/comment/43778262
score: 1
type: Answer

http://stackoverflow.com/comment/43847754
has text: I'm messing around with the fiddle page you posted to understand this. What does the ev.preventDefault() do?
comment on: http://stackoverflow.com/a/27717592
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43742975
comment on: http://stackoverflow.com/a/27662390
type: AnswerComment
score: 0
has text: Thanks, this works flawlessly. I just had to change change method to stop in sortable to get it working.
type: Comment

http://stackoverflow.com/comment/43972393
has text: So your solution is to add potentially 1000s of instances of a class and as many click handlers... hmmm. Not such a great idea when a single handler on `document` can do the same thing using event bubbling (and checking e.target) :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27781233
type: Comment

http://stackoverflow.com/q/27741293
possible better answer: http://stackoverflow.com/a/27741440
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/27741440
has comment: http://stackoverflow.com/comment/43893901
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27741573
has body: inserAfter is working fine but I also want to perform remove. On clicking the button with closequest id, nothing happening even alert-message not coming. //for adding ques ans and comment var qBlock = '&lt;div class="newqandaBlock"&gt;&lt;div class="input-group margin-bottom-20"&gt;&lt;span class="input-group-addon purple"&gt;&lt;i class="fa fa-question"&gt;&lt;/i&gt;&lt;/span&gt;&lt;input type="text" class="form-control" placeholder="Question Asked "&gt;&lt;button type="button" id="closequest" class="btn btn-purple" style="position: absolute;top: 3px;"&gt;&lt;span&gt; &lt;i class="fa fa-close"&gt;&lt;/i&gt;&lt;/span&gt;close&lt;/button&gt;&lt;/div&gt; &lt;div class="input-group margin-bottom-20"&gt; &lt;span class="input-group-addon purple"&gt;&lt;i class="fa fa-reply"&gt;&lt;/i&gt;&lt;/span&gt;&lt;textarea rows="3" class="form-control" name="info" placeholder="Your Answer"&gt;&lt;/textarea&gt; &lt;/div&gt;&lt;div class="input-group margin-bottom-20"&gt;&lt;span class="input-group-addon purple"&gt;&lt;i class="fa fa-comments"&gt;&lt;/i&gt;&lt;/span&gt;&lt;textarea rows="3" class="form-control" name="info" placeholder="Add Your Comments"&gt;&lt;/textarea&gt; &lt;/div&gt;&lt;/div&gt;'; $("#addQuestion").on("click", function() { $(qBlock).insertAfter(".qandaBlock"); }); $(document).ready(function() { $("#closequest").on("click", function() { alert("ok"); $('qblock').remove(".newqandaBlock"); }); }); &lt; /script&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="col-md-12 col-sm-12"&gt;` &lt;form id="resetblock" name="resetblock"&gt; &lt;div class="qandaBlock"&gt; &lt;div class="input-group margin-bottom-20"&gt; &lt;span class="input-group-addon purple"&gt;&lt;i class="fa fa-question"&gt;&lt;/i&gt;&lt;/span&gt; &lt;input type="text" class="form-control" placeholder="Question Asked "&gt; &lt;/div&gt; &lt;div class="input-group margin-bottom-20"&gt; &lt;span class="input-group-addon purple"&gt;&lt;i cl…
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27741574
has title: Nothing happening on clicking on close button in newly inserted variable- block
accepted answer: http://stackoverflow.com/a/27741574

http://stackoverflow.com/comment/43741190
type: QuestionComment
comment on: http://stackoverflow.com/q/27662410
has text: Also, if you want to toggle the value of contentEditable, you could do so using `element.contentEditable = !(element.contentEditable);`. No need for an `if` at all.
score: 0
type: Comment

multithreading
tags question: http://stackoverflow.com/q/27732654
type: Tag
tags question: http://stackoverflow.com/q/27711751
tags question: http://stackoverflow.com/q/27801542
tag name: multithreading

http://stackoverflow.com/comment/43936793
type: QuestionComment
score: 0
has text: Will each student `contact description` always have its corresponding `Contact phone` ?
comment on: http://stackoverflow.com/q/27762864
type: Comment

http://stackoverflow.com/comment/43919143
type: Comment
comment on: http://stackoverflow.com/a/27754139
has text: I am using angular js and server side in java.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43958082
comment on: http://stackoverflow.com/a/27773646
has text: @Ananddeepsingh What is the error message did you get?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27688427
has body: Try to specify the path to the template with extersions templateUrl: 'App/Register.cshtml', Other options for .open look fine.
has comment: http://stackoverflow.com/comment/43792029
score: 0
has comment: http://stackoverflow.com/comment/43790486
has comment: http://stackoverflow.com/comment/43790774
answers question: http://stackoverflow.com/q/27687587
has comment: http://stackoverflow.com/comment/43790738
type: Answer

http://stackoverflow.com/a/27656479
has comment: http://stackoverflow.com/comment/43728994
has comment: http://stackoverflow.com/comment/43736939
downvote count: 0
has body: As @adeneo said in nested li function will call twice unnecessarily. I think the other way to achieve this is divide click grabber in two selectors like below: $('.nav').click(function() { if (currentPosition == 'closed') { alert('open'); $('.nav').addClass('open'); currentPosition = 'open'; } else { alert('close'); $(this).removeClass('open'); currentPosition = 'closed'; } }); $('.nav &gt; li &gt; li').click(function() { if (currentPosition == 'closed') { alert('open'); $(this).addClass('open'); currentPosition = 'open'; } else { alert('close'); $('.nav').removeClass('open'); currentPosition = 'closed'; } }); I wrote a fiddle to do what you expect. Please check and comment if that helpful. http://jsfiddle.net/QMaster/y7d6osoq/
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/43740912
answers question: http://stackoverflow.com/q/27656189
upvote count: 1
has comment: http://stackoverflow.com/comment/43730489

fullpage.js
tags question: http://stackoverflow.com/q/27786716
tag name: fullpage.js
type: Tag
tags question: http://stackoverflow.com/q/27795174
tags question: http://stackoverflow.com/q/27781617

http://stackoverflow.com/comment/43954886
type: Comment
has text: Ohh, ok. I think I get your problem. You'll have one view that has two conceptually different forms of user data in it. One for user content, and for user preferences (fav's etc). How do you manage both in one view. Is that the question?
comment on: http://stackoverflow.com/a/27770106
type: AnswerComment
score: 0

http://stackoverflow.com/a/28342353
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27714432
has body: Refine the bottom lines of .htaccess RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L]

http://stackoverflow.com/a/27802925
type: Answer
has body: Telerik does not support this out of the box. See here and here, and this guy did a brilliant server side solution using a logical datetime filter transformation. However, personally I always found it weird to go to server side for client side matters. So in the end I usually just split the date and time parts into two different columns, OR used datetime without offering the filter option, OR avoided datetime fields if possible in the design. I also have a working datasource hack, but... I don't recommend using it. If you're interested though, here it is... Basically the idea is to duplicate the data column, one is with full date, the other one with only date and no time. Then on the column UI, you want to show the full date, but for underlying data source, you want to use the fake date. The user always sees the full date, but the filters will use the timeless date. Here is a demo. RandDate is my full date. RandDate2 is my fake partial date without time. RandDate: Mon Apr 07 2014 06:15:00 GMT-0400 (Eastern Daylight Time) RandDate2: Mon Apr 07 2014 00:00:00 GMT-0400 (Eastern Daylight Time) In my column definition, I use the partial date as the field, but display the full date with a template { field: "RandDate2", //Set column source to the fake one without time title: "Random Date", template: "#= kendo.toString(RandDate,'g') #", //display the full date and time }
downvote count: 0
answers question: http://stackoverflow.com/q/27785723
score: 3
upvote count: 3

http://stackoverflow.com/a/27654927
downvote count: 0
answers question: http://stackoverflow.com/q/27654892
type: Answer
upvote count: 1
has body: A Javascript function running in one frame will not be able to access DOM of other frame if the domains are different. Your need to have the same method loaded in both frame. One approach to do it can be that you load the find/compare JS function in both frames then call it in one frame. Once the key is found in the present frame then via postMessage, send the event to call the same function in the iframe. If in iframe also, you find the same key then you can do postMessage to parent frame that the key has been found. However if the domains are same then you can access the DOM of an iframe via jQuery like: var iframeElementContents = $("#yourIFrame").contents(); And now you can run your JS function on this element.
score: 1

http://stackoverflow.com/comment/43885557
has text: But my sails version is 0.9.7 only
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27729423
type: AnswerComment

http://stackoverflow.com/a/27711013
has comment: http://stackoverflow.com/comment/43834383
upvote count: 1
type: AcceptedAnswer
has body: Here is the Javascript Code. Add a function to navigate to a page. Like doNavigate: &lt;script type="text/javascript"&gt; function showAlert(toast) { navigate = Android.showAlert('Title example', 'Are you sure you wanna exit?'); } function doNavigate(){ window.location = "http://www.google.com" } &lt;/script&gt; And here is the Android code for show alert. Call the javascript method from onClick positive button: @JavascriptInterface public boolean showAlert(String title, String message) { new AlertDialog.Builder(mContext) .setTitle(title) .setMessage(message) .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { ((Activity)mContext).runOnUiThread(new Runnable() { @Override public void run() { myWeb.loadUrl("javascript:doNavigate()"); } }); result = true; } }) .setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { result = false; } }) .show(); return result; } Keep a reference of the WebView in your WebAppInterface: public static class WebAppInterface{ Context mContext; boolean result; WebView myWeb; /** Instantiate the interface and set the context */ WebAppInterface(Context c, WebView webView) { mContext = c; myWeb = webView; }
type: Answer
has comment: http://stackoverflow.com/comment/43834458
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27709527
answers question: http://stackoverflow.com/q/27709527

http://stackoverflow.com/comment/44779939
type: Comment
has text: Can you edit your question to include a sample document that shows how you want it to look? It's not clear what you're looking for.
type: QuestionComment
comment on: http://stackoverflow.com/q/27716398
score: 0

http://stackoverflow.com/q/27705759
score: 1
type: Question
has answer: http://stackoverflow.com/a/27710668
accepted answer: http://stackoverflow.com/a/27710668
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43824534
upvote count: 1
has body: I'm trying to display a div when mouse is over an element but the div is always inside the container div. Example (hover over any model at the bottom of this page) https://3dexport.com/ I've tried to get mouse position in the page and the mouse position inside the div but didn't work. Thanks in advance. This is the main code I've used to display and hide a big div but the hidden process is not working though the alert is displayed (the black div is hidden by default) $(".homeModelItem").mouseenter(function(){ var mouse = {x: 0, y: 0}; document.addEventListener('mousemove', function(e){ mouse.x = e.clientX || e.pageX; mouse.y = e.clientY || e.pageY; console.log(mouse.x); if(mouse.x&lt;400 &amp;&amp; mouse.x&gt;0){ $(".black").css({"left":"200px","display":"block"}); } }); }); $(".homeModelItem").mouseout(function(){ alert("xxx"); $(".black").css({"display":"none","left":"0"}); });
favorite count: 0
tagged with: position
has title: how to create a popup next to the mouse according to a container div
has comment: http://stackoverflow.com/comment/43824816
type: AnsweredQuestion
tagged with: popup
downvote count: 0

http://stackoverflow.com/comment/43875023
has text: Did you figure out the issues with your undefined error? I was also curious why you needed the document.addEventListener at the the bottom of your page? If you just call the function at the beginning of your script and your script is loaded loaded right before your closing body tag then it will work fine.
comment on: http://stackoverflow.com/a/27722033
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43905932
has text: It seems like the issue was related to an error in the spreadsheet. I started getting a 'Service Error' on my previously working scripts, which I made no changes to. I duplicated the spreadsheet which got rid of the service error and then the alert started working too. I don't know why the service error was occurring, but it seems to be an issue many people have with no real explanation. Thanks for your help, Sandy.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27746421
type: AnswerComment

http://stackoverflow.com/comment/43941399
score: 0
comment on: http://stackoverflow.com/q/27765210
has text: I mean to get the results immediately without having to submit @aokaddaoc
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43722676
type: AnswerComment
has text: Anything in the console?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27652614

http://stackoverflow.com/comment/43973259
type: AnswerComment
has text: This is not safe. `value` can be injected with Javascript.
type: Comment
comment on: http://stackoverflow.com/a/27781678
score: 0

http://stackoverflow.com/a/27718808
score: 0
type: Answer
has body: When you get 403 error, it means you don have permission to access it. For some reason your request is forbidden. For example, I had this problem with login. When I wasn't login my css wouldn't load. But when I logged in it works. You should check your htaccess configuration or anything where you can edit permissions for your project.
answers question: http://stackoverflow.com/q/27714880

http://stackoverflow.com/q/27668519
linked to: http://stackoverflow.com/q/15781540
tagged with: http://stackoverflow.com/tag/html
has body: I am using Google Spreadsheets as a JSON database (I know, not totally reliable or the best option). I was wondering If I could somehow "watch" this database for edits, or if I could send a trigger from the database to a web application upon edits of the content? Thanks
has answer: http://stackoverflow.com/a/27668739
has title: Watch for edits programmatically in Google Spreadsheet Database
type: Question
tagged with: database
tagged with: google-apps-script
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27669274
tagged with: google-sheets
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/27744947
has comment: http://stackoverflow.com/comment/43900983
type: UnansweredQuestion
tagged with: regex
has answer: http://stackoverflow.com/a/27745078
has comment: http://stackoverflow.com/comment/43900976
has answer: http://stackoverflow.com/a/27745032
has comment: http://stackoverflow.com/comment/43900905
type: Question
answer count: 2
has title: match text between comment string in javascript code
tagged with: javascript
has body: I am trying to strip out code between some tags. Its from a JavaScript plugin and it has multiple occurencies. For example: /*&lt;ltIE8&gt;*/ ╗ if (!item.hasOwnProperty) return false; ╣ this should match / go away /*&lt;/ltIE8&gt;*/ ╝ return item instanceof object; // this should not go away/match ... /*&lt;ltIE8&gt;*/ ╗ if (!window.addEvenetListener) return false; ╣ this should match / go away /*&lt;/ltIE8&gt;*/ ╝ return window.addEvent; I would like to match/remove those two blocks. Tried using lookaheads like \/\*&lt;ltIE8&gt;\*\/(?!=\/\*&lt;\/ltIE8&gt;\*\/)([\s\S]+) but it ends up matching from the first ocurrence to the last, and missing the ones in-between. Example: https://regex101.com/r/iD6mL8/1 Any sugestions? (I will be doing these replacements using JavaScript/NodeJS).
score: 0
has comment: http://stackoverflow.com/comment/43900872

http://stackoverflow.com/q/27716211
tagged with: applescript
has answer: http://stackoverflow.com/a/27726584
has comment: http://stackoverflow.com/comment/43860089
has body: I'm trying to write an AppleScript that saves and downloads all the urls from a particular part of a webpage (a table) and saves them into a folder. All the links are either pdfs or videos that link to Youtube. The table I want to get the links from is organized by week, date and material. I want a folder containing all the weeks, and then inside would be a folder for each date, and another folder that contains the material for that date. (MyStuff/Week/Date/Material) e.g. Week Date Material From some research I've seen that some people are using JavaScript in their implementations to open the document? http://macscripter.net/viewtopic.php?id=20287 I tried using something like this but couldn't get it to compile. I'm completely new at this, so any help would be appreciated! :) What I have so far: tell application "Finder" set p1 to path to user/Desktop make new folder at p with properties {name:"AllMaterial"} --Make AllMaterial Folder-- set p2 to path to user/Desktop/AllMaterial repeat with i from 1 to 18 make new folder at p2 with properties {name:"Week" + i} --Make all the weeks-- --in each week, make 3 days-- set p3 to path3 to user/Desktop/AllMaterial/"Week" + i repeat with j from 1 to 3 make new folder at p2 with properties {name:"Day" + j} end repeat end repeat --Make all the days-- end set siteURL to "XXX" tell application " Safari" activate open location siteURL --wait until page loaded if my page_loaded(20) is false then error numner - 128 set numLinks to (do JavaScript "document.links.length" in document1) --(do JavaScript "document.body.table.links.length" in document1)-- --get num of links --(doesn't account for the "table" that I want ^^. There are multiple different links on the page ) set count to numLinks - 1, set thisLink to "", set f to false repeat with i from 0 to count set thisLink to do JavaScript end tell
type: Question
tagged with: javascript
has title: AppleScript saving documents from urls from particular part of webpage
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/q/27681445
tagged with: security
score: 0
has comment: http://stackoverflow.com/comment/84922882
has body: I'm trying to create a web application which will have a component to retrieve 3rd party data from Twitter. Assuming that I've registered my application with Twitter and have a token: Is the preferred location to store my token on my server side code (I'm using Node / Express for my backend)? The alternative would be to store it on my client side code but that seems really dangerous since everyone would be able to inspect my code. Assuming that I do store my token on the server side, does this mean that if I want to make AJAX calls to the 3rd party API (i.e. Twitter), the flow of the request would be from client to server, and then server to 3rd party web service? If the above case is accurate, then would my server side code have to include some asynchronous callback / promise logic such that once the data is ready from the 3rd party web service, the server will execute my callback to send the data back to the client side?
has title: 3rd party API service - web security and AJAX
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/48947618
tagged with: twitter
has answer: http://stackoverflow.com/a/27693798
answer count: 1
tagged with: javascript
tagged with: callback
accepted answer: http://stackoverflow.com/a/27693798
tagged with: ajax

http://stackoverflow.com/q/27669668
answer count: 2
has answer: http://stackoverflow.com/a/27669734
tagged with: javascript
has comment: http://stackoverflow.com/comment/43754170
has comment: http://stackoverflow.com/comment/43754208
downvote count: 3
favorite count: 0
has title: JavaScript simple error
upvote count: 0
has answer: http://stackoverflow.com/a/27669735
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/43754222
has comment: http://stackoverflow.com/comment/43754179
has body: I'm having an error in my JavaScript program. Check it out: HTML: "); Result JS: function apresentar (){ var b = document.getElementById("present").value; var c = document.getElementById("result"); var a = c + b; c.innerHTML = a; }; I want to input some text and this text will be concatenated with the earlier text I introduced.
type: Question

http://stackoverflow.com/comment/44159147
score: 0
type: Comment
type: QuestionComment
has text: @adeneo Okay now both "false"s are back where they were, right after selectize.js.
comment on: http://stackoverflow.com/q/27757666

flux
tag name: flux
tags question: http://stackoverflow.com/q/27763775
type: Tag

http://stackoverflow.com/q/27654466
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
has body: how to validate excel files My JQuery jQuery("#excel").validate({ expression: "if (VAL.match(/^([a-z]\w*)\.(xls[mx]?)$/) &amp;&amp; VAL) return true; else return false;", message: "Please upload valid excel file" });
has answer: http://stackoverflow.com/a/27654473
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27654506
has comment: http://stackoverflow.com/comment/43725516
tagged with: regex
has title: Regex validation code for excel file upload jQuery
tagged with: excel
has comment: http://stackoverflow.com/comment/43725734

http://stackoverflow.com/a/28694101
score: 1
accepted answer of: http://stackoverflow.com/q/27741872
answers question: http://stackoverflow.com/q/27741872
type: Answer
upvote count: 1
has body: Sorted it override func webView(sender: WebView!, runJavaScriptAlertPanelWithMessage message: String!, initiatedByFrame frame: WebFrame!) { println("Alert sent") let myPopup:NSAlert = NSAlert() myPopup.addButtonWithTitle("OK") myPopup.messageText = "Title"; myPopup.informativeText = "Message" if myPopup.runModal() == NSAlertFirstButtonReturn { }
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27786042
answers question: http://stackoverflow.com/q/27785107
type: Answer
score: 0
has body: The Google Maps API supports special 45° imagery for certain locations. This high-resolution imagery provides perspective views towards each of the cardinal direction (North, South, East, West). These images are available at higher zoom levels for supported map types. Any existing Pan control on a map will alter to add a compass wheel around the existing navigation controls. This compass allows you to change the heading of any 45° imagery by dragging the wheel, snapping the direction to the nearest supported direction which contains imagery.

http://stackoverflow.com/q/27653616
has title: jquery click event priority over inline click
has answer: http://stackoverflow.com/a/27653646
has answer: http://stackoverflow.com/a/27653713
upvote count: 1
has answer: http://stackoverflow.com/a/27653663
has body: I have the following code Click me My requirement is to call ClickBack() only when its being confirmed by , and i cannot make any change in ClickBack function , Its ony one case, main thing is I have to add this click2 to a number of elements, and it will basically call the inline events only after confirmation by click2 $(".click2").click(function (event) I am getting two issue, ClickBack is being fired firstly, TypeError: event.stopImediatePropagation is not a function it was type mistake thanks to @manwal its solved How can I achieve my goal. I cannot make any change in ClickBack() function Please advise Thanks
favorite count: 0
downvote count: 5
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27653697
has comment: http://stackoverflow.com/comment/43724067
has comment: http://stackoverflow.com/comment/43724023
has comment: http://stackoverflow.com/comment/43724059
score: -4
type: Question
has answer: http://stackoverflow.com/a/27653667
has comment: http://stackoverflow.com/comment/43724042
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/43846950
comment on: http://stackoverflow.com/q/27717514
has text: thank you, all. why I get minus ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43889954
has text: I know that library. It does not currently implement the AnalyserNode.
type: Comment
comment on: http://stackoverflow.com/a/27735205
score: 2
type: AnswerComment

http://stackoverflow.com/comment/43923452
has text: Then you need to update the server to add HTTP headers (or using the curent server as proxy to download the files), see the update on my answer.
type: Comment
comment on: http://stackoverflow.com/a/27750160
score: 0
type: AnswerComment

arraybuffer
tags question: http://stackoverflow.com/q/27689816
tag name: arraybuffer
tags question: http://stackoverflow.com/q/27666605
tags question: http://stackoverflow.com/q/27707528
type: Tag

http://stackoverflow.com/q/27685188
type: AnsweredQuestion
tagged with: sharepoint-apps
type: Question
has answer: http://stackoverflow.com/a/27685892
answer count: 2
has answer: http://stackoverflow.com/a/27795581
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27685892
has body: I need to Fetch all items from a Announcement List and show each of them by using slider.For Sliding,I am using JQuery.I am facing problem in fetching all items and displaying one by one.I have used below code. function Fetchdata() { var ctx = new SP.ClientContext(appWebUrl);//Get the SharePoint Context object based upon the URL var appCtxSite = new SP.AppContextSite(ctx, hostWebUrl); var web = appCtxSite.get_web(); var list = web.get_lists().getByTitle("Announcement"); var camlQuery = new SP.CamlQuery(); //camlQuery.set_viewXml(' <FieldRef Name=\'Title\'/>' + // ' Annoucement1 10 '); collListItem = list.getItems(camlQuery); ctx.load(collListItem); ctx.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed)); } function onQuerySucceeded(sender, args) { var listItemInfo = ''; var listItemEnumerator = collListItem.getEnumerator(); while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); listItemInfo += oListItem.get_item('Title'); listItemInfo += oListItem.get_item('Body'); } document.getElementById('body1').innerHTML = listItemInfo.toString(); alert(listItemInfo); } function onQueryFailed(sender, args) { alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace()); }
score: 0
accepted answer: http://stackoverflow.com/a/27795581
has title: Fetching all items in SharePoint List

http://stackoverflow.com/comment/84010625
score: 0
type: Comment
has text: **Security notice:** This code is provided for achieve compatibility between different programming languages. It is not necessarily fully secure. Its security depends on the complexity and length of the password, because of only one iteration and the use of MD5. I would recommend to use at least a 20 character password with alphanumeric characters which is ideally randomly generated.
type: AnswerComment
comment on: http://stackoverflow.com/a/27678978

http://stackoverflow.com/q/27748654
tagged with: generated
has body: When i try to drag and drop elements which are normaly created by the html everything is ok, but when i try to drag and drop elements which are generated by javascript returns me this error: Uncaught TypeError: Cannot read property 'parentNode' of null My code: js for drag and drop: var id1; var name; function drag(ev) { name = document.getElementById(ev.target.id).parentNode.id; ev.dataTransfer.setData("text", name); id1 = document.getElementById(name).parentNode.id; } function drop(ev) { var id2 = ev.target.id; if(id1 === id2 + '1'){ ev.preventDefault(); var data = ev.dataTransfer.getData("text"); ev.target.appendChild(document.getElementById(data)); //Add info to arrays holders["\"" + id2 + "\": ["].push("{\"place_holder\":\"" + id2 + "\", \"name\":\"" + name + "\"}", ", "); } } function allowDrop(ev) { ev.preventDefault(); } html example generated by the javascript: Example of the way of generating the html: var items = document.createElement('div'); items.id = "options"; document.getElementsByTagName('body')[0].appendChild(items); var innerDivElem = document.createElement('div'); . . . innerDivElem.id = obj[i][t].name + t; innerDivElem.className = "img" + t; innerDivElem.draggable='true'; innerDivElem.setAttribute('ondragstart', 'drag(event)'); inContainerDiv.appendChild(innerDivElem);
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27756619
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27749030
tagged with: javascript
has title: HTML5 drag & drop elements created by javascript:
score: 0
possible better answer: http://stackoverflow.com/a/27749030
tagged with: drag-and-drop
has answer: http://stackoverflow.com/a/27756619
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27709520
type: Question
accepted answer: http://stackoverflow.com/a/27709540
tagged with: arrays
tagged with: javascript
tagged with: jquery
has body: Would like to create array like this: track[divID][wrapID] I couldn't use track[divID][wrapID] = wrapID cos some more will be added to 2nd dimension in another loop like this: track[divID][wrapID,wrapID2] var track =[]; $("div").each(function() { var wrapID = $(this).parent().attr('id') var divID = $(this).attr('id') track[divID].push(wrapID) }); the Error is "Uncaught TypeError: Cannot read property 'push' of undefined " What did I do wrong ? Many thanks.
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27709540
has title: Jquery, Javascript: Push a 2D array
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43830913

http://stackoverflow.com/comment/43776115
type: AnswerComment
has text: Looks like this will work. Will give it a try. Thanks
type: Comment
comment on: http://stackoverflow.com/a/27680501
score: 0

http://stackoverflow.com/q/27688963
tagged with: jquery
has answer: http://stackoverflow.com/a/27689245
has title: jquery.scrollTo — Scroll on Page Load
possible better answer: http://stackoverflow.com/a/27689227
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27689227
type: AnsweredQuestion
score: 0
accepted answer: http://stackoverflow.com/a/27689245
type: Question
tagged with: javascript
tagged with: jquery-plugins
answer count: 2
has body: I'm using the following jQuery plugin on various parts of my site — https://github.com/flesler/jquery.scrollTo I can get it to work fine with links, so that when they are clicked it scrolls to a certain part of the page like so: $('#button-top').bind('click', function(e) { try { e.preventDefault(); target = this.hash; $('html, body').scrollTo(target, 150); } catch (error) { alert('error - ' + error); } }); But on one page I need it so that it scrolls when the page is loaded, something like: if ($('.gform_validation_error').length &gt; 0) { // scroll here } How would I go about adapting my script so that it scrolls on a page load rather than when clicking a link?
tagged with: scrollto

http://stackoverflow.com/q/27777383
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43965954
has comment: http://stackoverflow.com/comment/43965925
has comment: http://stackoverflow.com/comment/43965649
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/43966019
score: 1
has comment: http://stackoverflow.com/comment/43965556
has comment: http://stackoverflow.com/comment/43965286
has answer: http://stackoverflow.com/a/27777530
type: Question
has comment: http://stackoverflow.com/comment/43966311
has title: How to get current selected value of drop down on OnSubmit event of AjaxUpload while ajax submit
answer count: 2
has body: I am uploading files via AjaxUpload option. I need to pass some dynamic parameters value into action. My code is as below: $("#btnImportUtility_Upload").ajaxSubmit(function () { new AjaxUpload('#btnImportUtility_Upload', { action: 'FileUploader.ashx?path=ExcelImportUtility&amp;companyId=' + $("#ddlCompany option:selected").val() + '', name: 'upload', onSubmit: function (file, ext) { if (!(ext &amp;&amp; /^(txt|csv|xls|xml|xlsx)$/i.test(ext))) { alert('Invalid File Format.'); return false; } }, onComplete: function (file, response) { } }); }); I want to get currently selected drop-down value but it always gets its initial value.
has answer: http://stackoverflow.com/a/27777727
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/43901629
comment on: http://stackoverflow.com/q/27745323
has text: yes I have checked that
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27705942
type: UnansweredQuestion
has title: AngularJS - Cannot set scope value into template
linked to: http://stackoverflow.com/q/12729122
has body: I have following function: $scope.setDetailToScope = function(data) { $scope.$apply(function() { //$scope.order = data; $rootScope.order = data; setTimeout(function() { $scope.$apply(function() { //wrapped this within $apply $scope.order = data[0]; console.log('message:' + $scope.order); console.log($scope.order); }); }, 100); }); }; " console.log($scope.order); Gives me values which has been set into scope. But i cannot get these values in template. {{columns}} {{order}} If i tried to add values into rootscope it works, but in this case i cannot get value into ng-model. What i'm doing wrong please? Many Thanks for any help. EDIT: If i tried solution wit $timeout i got on console.log($scope.order); following object which is not passed into the template: _events: ObjectacrCrCode: "interlos"actionName: ht.extend.initarchived: falsebaseStationInfo: ht.extend.initbsc: "bsc1"btsRolloutPlan: "plan1"candidate: "B"costCategory: ht.extend.initcreatedBy: ht.extend.initdirty: falsefacility: ht.extend.initid: 3location: ht.extend.initmilestoneSequence: undefinednetworkType: "Fix"note: "poznamka"orderNumber: 111113orderType: ht.extend.initotherInfo: ht.extend.initparent: function (){return e.apply(n||this,r.concat(h.call(arguments)))}partner: ht.extend.initpersonalInfo: ht.extend.initproject: ht.extend.initpsidCode: "psid1"sapSacIrnCode: "sap1"uid: "924c0278-88d0-4255-b8ac-b004155463fa"warehouseInfo: ht.extend.init__proto__: i
type: Question
has comment: http://stackoverflow.com/comment/43823954
tagged with: javascript
tagged with: angularjs-scope
tagged with: scope
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27706470
tagged with: angularjs

http://stackoverflow.com/q/27649863
accepted answer: http://stackoverflow.com/a/27699417
score: 2
type: AnsweredQuestion
downvote count: 0
type: Question
upvote count: 2
tagged with: javascript
has body: I'm facing this problem when combining Laravel and Angular: Following a very simple tutorial I found online, I was trying to load a view using the ng-view directive. However, I am unable to actually load the template. This is my app.js code: (function() { var app = angular.module('profuApp', ['ngRoute']); app.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { $routeProvider .when('/inicio', { templateUrl: '../templates/inicio.html', controller: 'homeCtrl' }) .otherwise({ redirectTo: '/' }); }]); app.controller('homeCtrl', ['$scope', '$http', function($scope, $http) { $http.get('http://localhost:8888/profucom/public/getData').success(function(data) { $scope.datos = data; }); }]) })(); My file tree: app/ bootsrap/ public/ js/ angular.min.js angular-route.min.js app.js templates/ inicio.html . . . The site loads normally, but when I watch the source code, instead of watching the template inside of inicio.html, this happens... Code with within my index.blade.php file &lt;div ng-view&gt;&lt;/div&gt; Code I see in the browswer's source code &lt;!-- ng-view: --&gt; The network tab on Chrome does not show a 404 error trying to load the view. What I've tried so far: Placing templates inside the js folder (templateUrl: 'templates/inicio.html') Placing templates inside the public folder (templateUrl: '../templates/inicio.html') also, templateUrl: '/public/templates/inicio.html' Placing templates inside the root folder (templateUrl: '/templates/inicio.html') Placing just the file inside the js folder: (templateUrl: 'inicio.html') None of the above seem to work. Any help, please? EDIT I also see this happenning in the url: instead of myapp/public/inicio it loads like myapp/public/inicio#/
has answer: http://stackoverflow.com/a/27650202
has title: Angular + Laravel : loading view via ngRoute
has comment: http://stackoverflow.com/comment/43717225
answer count: 2
linked to: http://stackoverflow.com/q/14319967
has comment: http://stackoverflow.com/comment/43717126
tagged with: ng-view
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/16569841
tagged with: php
possible better answer: http://stackoverflow.com/a/27650202
tagged with: laravel
has answer: http://stackoverflow.com/a/27699417

http://stackoverflow.com/q/27758432
score: 1
tagged with: stream
upvote count: 1
type: Question
tagged with: javascript
tagged with: playback
has title: node.js - share sync mp3 stream to several clients
has answer: http://stackoverflow.com/a/28685719
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
tagged with: audio
has body: I'm using binary.js (http://binaryjs.com/) to stream mp3 file to several clients. Server just starts to stream mp3 and what I want to achieve is that when client connects it starts to broadcast the stream not from the beginning but from the specific point of time in which playback is currently positioned. Some kind of synchronized playback for all clients. Server: var BinaryServer = require('binaryjs').BinaryServer; var fs = require('fs'); var server = require('http').createServer(handler); server.listen(9000); function handler (req, res) { fs.readFile(__dirname + '/index.html', function (err, data) { if (err) { res.writeHead(500); return res.end('Error loading index.html'); } res.writeHead(200); res.end(data); }); } var binaryserver = BinaryServer({server: server}); binaryserver.on('connection', function (client) { var trackStream = fs.createReadStream(__dirname + '/longAudio.mp3'); client.send(trackStream); }); Client: var client = new BinaryClient('ws://localhost:9000'); client.on('stream', function (stream, meta) { var parts = []; stream.on('data', function(data){ parts.push(data); }); stream.on('end', function () { var audio = document.createElement('audio'); audio.src = (window.URL || window.webkitURL).createObjectURL(new Blob(parts)); audio.controls = 'controls'; document.body.appendChild(audio); }); }); Is there a way to implement this?
linked to: http://stackoverflow.com/q/9231182

http://stackoverflow.com/comment/43748052
has text: @BurakÖzmen, you had "wrap onload" set in the fiddle, remove this (your own site is not wrapped anyway) -> http://jsfiddle.net/p4Lsua8f/1/
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27666441
score: 0

http://stackoverflow.com/comment/43976697
type: AnswerComment
has text: [HTML](http://pastebin.com/raw.php?i=cr4mCdcn) and [PHP](http://pastebin.com/raw.php?i=YFpJFV7T). Thank you for the help!
type: Comment
comment on: http://stackoverflow.com/a/27783006
score: 0

http://stackoverflow.com/q/27731159
answer count: 3
upvote count: 1
has title: Initializing JS object from another instance (runtime inheritance)
has body: I want to achieve this: var player = new Player (socket, x, y) player.on ('event1', function () {}); player.emit ('event2', data); where socket is an instance of Socket supplied externally. So basically I need to inherit Player from Socket, but initialize it from Socket's instance: var Player = function (socket, x, y) { .....? this.x = x; this.y = y; } Any idea how I to do it the simplest and the most elegant way?
accepted answer: http://stackoverflow.com/a/27731195
tagged with: javascript
tagged with: inheritance
possible better answer: http://stackoverflow.com/a/27731284
tagged with: prototype
has answer: http://stackoverflow.com/a/27731284
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/27731227
has answer: http://stackoverflow.com/a/27731195

http://stackoverflow.com/comment/43701972
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27641306
type: Comment
has text: problem number 2 .. if you select Male and then you decide to select Female it keeps both of the choices and it doesn't unchecked the other one. I checked my code and still can't find the solution. Can you help me?

http://stackoverflow.com/comment/43949025
type: AnswerComment
has text: It didn't worked as I expected. I still need to press F5 to reload in order to go in the profile page. I will be very glad if you can show me the process with the states and changing the state after loading.
type: Comment
comment on: http://stackoverflow.com/a/27768784
score: 0

http://stackoverflow.com/a/27703574
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27703211
score: 1
accepted answer of: http://stackoverflow.com/q/27703211
has body: RegularExpressionValidators don't check for empty strings - they leave that to the RequiredFieldValidator. When you have both validators, the RequiredFieldValidator will set the className="ErrorControl" but then the RegularExpressionValidator will reset it to className="". This is why it is not changing border color. One fairly clean and simple way around this would be to remove all ErrorControl classes from the form before you check the validators, then just add it for invalid ones: function WebForm_OnSubmit() { if (typeof (ValidatorOnSubmit) == "function" &amp;&amp; ValidatorOnSubmit() == false) { // find and remove all .ErrorControl classes var errorControls = document.querySelectorAll('.ErrorControl'); for (var ec = 0; ec &lt; errorControls.length; ec++) { errorControls[ec].className = ""; } for (var i in Page_Validators) { try { var control = document.getElementById(Page_Validators[i].controltovalidate); alert(i); alert(Page_Validators[i].isvalid); if (!Page_Validators[i].isvalid) { control.className = "ErrorControl"; } // no need to remove ErrorControl if valid } catch (e) { } } return false; } }

http://stackoverflow.com/comment/44014950
type: AnswerComment
has text: This might make you laugh but I have copied the files word for word and it doesn't work. It works fine in Jsfiddle though.
type: Comment
comment on: http://stackoverflow.com/a/27802120
score: 0

http://stackoverflow.com/q/27714600
has comment: http://stackoverflow.com/comment/43842139
linked to: http://stackoverflow.com/q/14220321
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43842352
type: Question
has answer: http://stackoverflow.com/a/27714705
has comment: http://stackoverflow.com/comment/43841343
tagged with: conditional-statements
has body: I'm having a strange issue using NodeJS v0.10.33 / Javascript. I'm also using Hapi 8.0.0, mongoose, moment and request libs. I'm trying to run a simple IF that must waits for a method call to know if the conditional is TRUE or FALSE. Instead the default run, my code is running the conditional contents BEFORE the conditional itself. It's like always running "TRUE" without waiting the return from the called method. I have something like that: function isUpdated(){ var updated = true; if (updated) { console.log("Updated (inside isUpdated)"); } else { console.log("Not updated (inside isUpdated)"); } } if (!isUpdated()) { console.log("Not updated. Updating.."); } else { console.log("Updated"); } But when I run my server, I got: [paladini@pet01 myFolder]$ node server.js Server running at: http://pet01.inf.ufsc.br:3000 Not updated. Updating.. Updated (inside isUpdated) As you can see, the IF content is running before the conditional itself. My full code is following (update() is executed first): function isUpdated(myTicker) { myTicker = myTicker || undefined Ticker.count({}, function(err, count){ if (!err) { // Verify if must check all tickers or just one. if (myTicker == undefined) { if (count == 0) { console.log("Exchanges count = 0"); } else { // Checking if the database is outdated (must update every 2 minutes). Ticker.find().lean().exec(function(err, allTickers){ if (!err) { if (moment(allTickers[0].updatedAt) &gt;= moment().subtract(2, 'm')) { console.log("Entered IF, already updated."); return true; } } else { console.log("Erro!"); } }); } } else { console.log("Ticker defined, nothing to do."); } } return false; }); } function update(callback) { var atualizado = isUpdated(); if (!atualizado) { // Updating exchanges informations. var exchangesUpdated = {value: 0}; var updateAll = function() { api.bitcoinToYou.updateTicker(exchangesUpdated); } console.log("Not updated. Updating.."); updateAll(); // Waiting to run the callback. var timeoutTime = 50; var myFunctionToTim…
has comment: http://stackoverflow.com/comment/43841495
has title: Javascript executing conditional AFTER executing it's content
answer count: 1
has comment: http://stackoverflow.com/comment/43841317
downvote count: 0
tagged with: hapi.js
tagged with: javascript

http://stackoverflow.com/q/27671380
upvote count: 1
has answer: http://stackoverflow.com/a/27671429
type: Question
has answer: http://stackoverflow.com/a/27671426
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/43757522
possible better answer: http://stackoverflow.com/a/27671426
answer count: 2
has title: value of another object as value in another associative array in Javascript
accepted answer: http://stackoverflow.com/a/27671429
has body: So I have an array called xyz containing keys a and b. I want to input these into another array as follows : seats =[{ name : xyz.a. address: xyz.b}]; however the xyz.a is being stored as an object and not by it's value in seats.name and prints undefined when i use console.log I want to store xyz.a by its value such that seats.name gives the value stored in xyz.a
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43757542
downvote count: 2

http://stackoverflow.com/a/27795025
has comment: http://stackoverflow.com/comment/46572477
has body: What are you trying to achieve? Panel has a config option that you can use to render the required markup in its body so you don't need to fiddle with elements. It is html:'your markup' If you need to set it at runtime, call panel.setHtml('your markup')
has comment: http://stackoverflow.com/comment/46572910
answers question: http://stackoverflow.com/q/27793369
score: 0
type: Answer

http://stackoverflow.com/comment/43720469
type: Comment
has text: Parsing 1/10000000 returns a float... not an int. parseFloat(1/10000000) works fine.
comment on: http://stackoverflow.com/a/27650481
type: AnswerComment
score: 0

http://stackoverflow.com/q/27697433
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27697512
answer count: 1
tagged with: javascript
score: 0
has body: &lt;div id=player&gt;&lt;/div&gt; &lt;div id=share style="width:100px; height:50px; background-color:#c33333"&gt;&lt;/div&gt; &lt;script src="https://apis.google.com/js/platform.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player; function onYouTubeIframeAPIReady() { player = new YT.Player('player', { height: '448', width: '763', playerVars: { 'showinfo': 0, 'controls': 0, listType: 'playlist', list: 'PLD7SqVUGDdDBw_xmMKTDF5MlBwys_KlUk' }, events: { 'onReady': onPlayerReady, 'onStateChange': onPlayerStateChange } }); } function onPlayerReady(event) { // event.target.playVideo(); } function play_this_video(){ player.playVideo(); } function onPlayerStateChange(event) { if (event.data == YT.PlayerState.ENDED) { player.stopVideo(); } } &lt;/script&gt; Hi, I'm a newbie about JavaScript so I can't figure out how to make that. I have an embedded code like shown above, and I want that div named "share" act as a Facebook share button, but the main problem is I want it to share last played or active video from the embedded playlist. Does anyone know how to handle this situation?
accepted answer: http://stackoverflow.com/a/27697512
tagged with: facebook
has title: How to add a Facebook share button for my embed YouTube playlist
tagged with: youtube
type: Question

http://stackoverflow.com/comment/43944336
has text: Even by allowing the user to do so by using a button? ("save this text to file") - would that be able to surpass this restriction? Also, if I do what you suggest - would I then be able to save the text to my local machine? Appreciate the help, I'm a newbie :)
score: 0
comment on: http://stackoverflow.com/q/27766814
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27751724
linked to: http://stackoverflow.com/q/27751096
linked to: http://stackoverflow.com/q/14499783
type: UnansweredQuestion
score: -4
type: Question
has body: http://jsfiddle.net/58gw8sr7/ My html &lt;input type="datetime-local" onblur="formatDate(this.value)" /&gt; my function function formatDate(date) { .. .. }
downvote count: 5
has comment: http://stackoverflow.com/comment/43914495
upvote count: 1
has answer: http://stackoverflow.com/a/27752371
duplicate of: http://stackoverflow.com/q/14499783
answer count: 1
has title: function is not defined in onblur?
tagged with: javascript
has comment: http://stackoverflow.com/comment/43914540
has comment: http://stackoverflow.com/comment/43914601
has comment: http://stackoverflow.com/comment/43914492
favorite count: 0

http://stackoverflow.com/comment/43700747
comment on: http://stackoverflow.com/q/27640753
has text: I get that, so how do I calculate the dates, then convert it to a php variable so the mySql script can read it using the datepicker dates?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43823263
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27705690
type: Comment
has text: Thanks. The pre tag solved my problem. I totally forgot about it.

http://stackoverflow.com/q/27666196
linked to: http://stackoverflow.com/q/25098021
has body: i want to change color of a &lt;p&gt; that is in an iframe and i tried this: &lt;script type="text/javascript"&gt; $(document).ready(function() { $('iframe').contents().find('#red').css('color','red'); }); &lt;/script&gt; its didn't work. what's the problem? Sorry I'm a beginner.
tagged with: iframe
score: 0
tagged with: css
answer count: 1
has comment: http://stackoverflow.com/comment/43747415
has answer: http://stackoverflow.com/a/27666883
tagged with: javascript
type: UnansweredQuestion
type: Question
has title: change css style of an element by id in iframe with javascript
has comment: http://stackoverflow.com/comment/43747392

http://stackoverflow.com/a/27720142
type: AcceptedAnswer
downvote count: 0
has body: you can try something like this: Example of Twitter Bootstrap 3 Accordion Local Map **Google Map JS** Street View
type: Answer
has comment: http://stackoverflow.com/comment/43854326
upvote count: 1
has comment: http://stackoverflow.com/comment/43854991
score: 1
accepted answer of: http://stackoverflow.com/q/27719931
answers question: http://stackoverflow.com/q/27719931
has comment: http://stackoverflow.com/comment/43852709

http://stackoverflow.com/q/27736568
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43899119
upvote count: 1
type: Question
tagged with: testing
tagged with: protractor
has title: Consecutive browser tests, not concurrent
has answer: http://stackoverflow.com/a/27744222
downvote count: 0
has comment: http://stackoverflow.com/comment/43884632
answer count: 1
tagged with: javascript
score: 1
tagged with: jasmine
favorite count: 0
tagged with: angularjs
has body: I am using multiCapabilities to setup multiple browsers. Is there a way to make them consecutive and not concurrent?

http://stackoverflow.com/q/27685369
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/43784888
score: 1
type: Question
has title: Filtration with multiple check boxes in PHP
tagged with: javascript
has body: I want to do filtration in PHP. I have done this but in gender category it is work like radio button. When I click on both male and femele no record will found. So please can any one solve my problem. My code is here: index.php Snowboards ID Gender Price Range Brand Model Rocker Type Flex Size Range Image Path Filter options Gender Male Female Brand xyz burton abc www Price Range $200 - $299 $300 - $399 $400 - $499 and my submit.php is: <?php $pdo = new PDO('mysql:host=localhost;dbname=abc', 'root', ''); $select = 'SELECT *'; $from = ' FROM snowboards'; $where = ' WHERE TRUE'; $opts = isset($_POST['filterOpts'])? $_POST['filterOpts'] : array(''); if (in_array("male", $opts)){ $where .= " AND gender = 'male'"; } if (in_array("female", $opts)){ $where .= " AND gender = 'female'"; } if (in_array("cheap", $opts)){ $where .= " AND price_range > 199 AND price_range < 300"; } if (in_array("medium-priced", $opts)){ $where .= " AND price_range > 299 AND price_range < 400"; } if(in_array("expensive", $opts)){ $where .= " AND price_range > 399 AND price_range < 500"; } if(in_array("xyz", $opts) || in_array("burton", $opts) || in_array("abc", $opts) || in_array("www", $opts)){ $brand = " AND ("; if (in_array("xyz", $opts)){ $brand .= " AND brand = 'xyz'"; } if (in_array("burton", $opts)){ if($brand != " AND (") $brand .= " OR "; $brand .= " AND brand = 'burton' "; } if(in_array("abc", $opts)){ if($brand != " AND (") $brand .= " OR "; $brand .= "AND brand = 'abc'"; } if(in_array("www", $opts)){ if($brand != " AND (") $brand .= " OR "; $brand .= "AND brand = 'www'"; } $brand .= ")"; $where .= $brand; } $sql = $select . $from . $where; $statement = $pdo->prepare($sql); $statement->execute(); $results=$statement->fetchAll(PDO::FETCH_ASSOC); $json=json_encode($results); echo($json); ?> Thanks in advance.
upvote count: 1
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27687070
accepted answer: http://stackoverflow.com/a/27687070

http://stackoverflow.com/a/27688968
answers question: http://stackoverflow.com/q/27688903
has comment: http://stackoverflow.com/comment/43791643
has comment: http://stackoverflow.com/comment/43791708
score: 0
has comment: http://stackoverflow.com/comment/43791181
has body: This is because the click handler is not assigned to the new content. Set them again after you have changed the content like so: &lt;script type="text/javascript"&gt; //Script to refresh Div function show_data() { $('#refreshOnline').load('main.php #refreshData'); setClickers(); } function setClickers(){ //Script to oprn link in new window $('#popup-game').click(function (event) { event.preventDefault(); alert("Working"); window.open($(this).attr("href"), "popupWindow","width=600,height=600,scrollbars=yes"); }); } $(function(){ setClickers(); setInterval('show_data()', 25000); }); &lt;/script&gt;
type: Answer
has comment: http://stackoverflow.com/comment/43792119

http://stackoverflow.com/q/27672784
score: 2
has title: AngularJS ng-repeat filter performance: custom filter or ng-show / hide
upvote count: 2
type: Question
tagged with: performance
tagged with: filtering
has body: tl;dr What's the optimal way to filter large lists in Angular? This is mainly about performance. I have an array of objects that I list with ng-repeat. There will be hundreds to thousands of items. I now need to filter the list based on either: A. a single, simple property (e.g. number) B. multiple conditions (some expression) What option is best: use a custom filter use ng-show / ng-hide use ng-if don't filter in the view at all -- maybe use service + controller (?) use ReactJS (?) Details about the usecase: I want to bind most of the objects' properties with :: one time binding, though some properties need two-way binding (score for sorting) The list will be sorted dynamically, on fields independent from the fields used for filtering. Items filtered out probably should not be included in the sorting The filtering needs to be dynamic So I found Ben Nadel's post http://www.bennadel.com/blog/2487-filter-vs-nghide-with-ngrepeat-in-angularjs.htm but my question is meant to address general, standard usecases.
tagged with: javascript
has answer: http://stackoverflow.com/a/27673338
answer count: 1
downvote count: 0
tagged with: sorting
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/43814869
comment on: http://stackoverflow.com/q/27700699
has text: The question seem a bit odd, what have you tried and what happend? use the source pane and type the new id
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27677565
has comment: http://stackoverflow.com/comment/43769509
downvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/27677686
has title: I need to find the prime index but my while loop is exiting?
has comment: http://stackoverflow.com/comment/43770126
has body: var doSearch = function(array, targetValue) { var min = 0; var max = array.length - 1; var guess = Math.floor((min + max) / 2); var values = array[guess]; while (min &lt; max) { if (values &lt; targetValue) { min = guess + 1; } else if (values &gt; targetValue) { max = guess - 1; } return guess } return -1; }; var primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]; var result = doSearch(primes, 73); alert("Found prime at index " + result);
possible better answer: http://stackoverflow.com/a/27677686
accepted answer: http://stackoverflow.com/a/27677678
has comment: http://stackoverflow.com/comment/43770013
has comment: http://stackoverflow.com/comment/43770354
has comment: http://stackoverflow.com/comment/43769579
has comment: http://stackoverflow.com/comment/43770058
type: AnsweredQuestion
upvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43769882
tagged with: binary-search
type: Question
has comment: http://stackoverflow.com/comment/43769651
has comment: http://stackoverflow.com/comment/43770039
score: -2
has comment: http://stackoverflow.com/comment/43770102
has answer: http://stackoverflow.com/a/27677678

http://stackoverflow.com/comment/43803528
type: Comment
has text: I can't even make sense of the way the OP has presented the desired input and output
type: QuestionComment
comment on: http://stackoverflow.com/q/27694873
score: 0

http://stackoverflow.com/q/27696999
tagged with: ajax
score: 0
answer count: 1
has body: I'd like to use the ajax() method to perform an AJAX Request. I've tried to create the below functions within scripts.google.com, but I get the following error: function AjaxCall() { var arr = { City: 'Moscow', Age: 25 }; $.ajax({ url: 'https://worker-aws-us-east-1.iron.io/2/projects/', type: 'POST', data: JSON.stringify(arr), contentType: 'application/json; charset=utf-8', dataType: 'json', async: false, success: function(msg) { alert(msg); } }); } Error: ReferenceError: "$" is not defined. (line 5, file "Code") Is there a way to get around this issue?
has answer: http://stackoverflow.com/a/27706478
type: UnansweredQuestion
tagged with: google-app-engine
has comment: http://stackoverflow.com/comment/43807537
type: Question
has comment: http://stackoverflow.com/comment/43807265
tagged with: javascript
tagged with: jquery
has title: How to create an ajax request within google scripts with '$' variable error?

http://stackoverflow.com/q/27711004
tagged with: koa
has body: My application uses Koa.js, with koa-passport for it's authentication logic. The way I set it up, is that the middleware (passport) is inserted between the public content (js, css, img, etc.), or more precisely the static middleware, and the private controllers (using trie-router). Then, the request is simply redirected to a login url if an unauthenticated user tries to access the router. Now, the problem I have is that, when some images are missing in the public asset folder, I get to the authentication middleware, and redirected to the login url, again. This is problematic as I get several 302 redirections in my logs and I would like to prevent this. Is there anyway to safely know that the request would match a route within the trie-router as a precondition to redirect, otherwise return a 404 instead?
tagged with: passport.js
favorite count: 0
has title: Only redirect unauthenticated users for missing resources, within Koa.js?
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: http
has answer: http://stackoverflow.com/a/27711311
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27712127
answer count: 2
has answer: http://stackoverflow.com/a/27712127
downvote count: 0
accepted answer: http://stackoverflow.com/a/27711311

http://stackoverflow.com/comment/43983773
comment on: http://stackoverflow.com/q/27786815
score: 0
type: Comment
type: QuestionComment
has text: why do you ask something that you've been able to solve yourself in less than 4 min?

http://stackoverflow.com/comment/43755181
type: QuestionComment
has text: Made fixes. Still is undefined.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27670048

http://stackoverflow.com/q/27657067
has comment: http://stackoverflow.com/comment/43730147
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27690586
has answer: http://stackoverflow.com/a/27687783
type: Question
has body: I have a highchart (column), categories on x axis are evaluated dynamically. I have two options max and min in x-axis configuration. But when x axis categories are greater than max , it shows numbers like 13,14...etc on x-axis. I want that x-axis should show labels only for categories supplied and not pad numbers to reach up to max limit. here is fiddle showing the problem jsfiddle
tagged with: javascript
score: 0
has title: Highcharts x axis shows numbers after max limit
answer count: 3
has comment: http://stackoverflow.com/comment/43730208
tagged with: highcharts
has comment: http://stackoverflow.com/comment/43730265
has comment: http://stackoverflow.com/comment/43739110
has answer: http://stackoverflow.com/a/27693466

http://stackoverflow.com/q/27737657
type: Question
has comment: http://stackoverflow.com/comment/43886691
tagged with: internet-explorer
has title: window.open not working properly only IE versions
has comment: http://stackoverflow.com/comment/43886715
tagged with: javascript
score: 0
answer count: 1
has body: The following is my code. function a(videoId){ var width = screen.width * 0.8; var height = screen.height* 0.8; var left = (screen.width - width)/2; var top = (screen.height - height)/2; params = 'width='+width; params += ', height='+height; params += ', top='+top+', left='+left; params += ', directories=no'; params += ', location=no'; params += ', menubar=no'; //params += ', resizable=no'; params += ', scrollbars=yes'; params += ', status=no'; params += ', toolbar=no'; params += ', fullscreen=yes'; var url ="/static/abc.html?videoId="+videoId; var newwin=window.open(url,'Video Help', params); if (window.focus) {newwin.focus()} return false` } In all other browsers new window height and width working as expected.But in IE it's giving full window size(Like f11 mode) I am not able come back from that new window screen.Please help me.
has answer: http://stackoverflow.com/a/27737741
has comment: http://stackoverflow.com/comment/43886727
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43886797
accepted answer: http://stackoverflow.com/a/27737741

http://stackoverflow.com/a/27668697
type: Answer
score: 2
upvote count: 2
has body: One way is using a selection range that starts at where you want the caret to be: var sel = window.getSelection(), range = sel.getRangeAt(0); range.setStartBefore(div.children().last()[0]); sel.removeAllRanges(); sel.addRange(range); Updated fiddle: http://jsfiddle.net/techfoobar/mxtasnbL/2/
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27668659
answers question: http://stackoverflow.com/q/27668659

http://stackoverflow.com/a/27659106
type: Answer
answers question: http://stackoverflow.com/q/27658978
has comment: http://stackoverflow.com/comment/50641217
accepted answer of: http://stackoverflow.com/q/27658978
score: 7
upvote count: 7
downvote count: 0
type: AcceptedAnswer
has body: actually I just figured that out, just place the accordion-heading content into a div:

http://stackoverflow.com/comment/43806415
type: AnswerComment
score: 0
has text: Very good point. I think I just got thrown off by the ability to set isVisible() as I was learning the Ember way.
type: Comment
comment on: http://stackoverflow.com/a/27696160

http://stackoverflow.com/comment/43989098
comment on: http://stackoverflow.com/q/27789558
has text: So where is the code you have a problem with? [Or try google... (link - "learning to code")](https://www.google.de/search?q=learning+to+code&ie=utf-8&oe=utf-8&gws_rd=cr&ei=iBurVMS2HMrDPJaGgfAC)
score: 3
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43880202
score: 0
has text: Possibly it was expecting a `:` but saw a `"`
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27734159

http://stackoverflow.com/q/27650960
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27651033
tagged with: javascript
has body: Similar to this question: jQuery append fadeIn But the solution isn't working for me. Basically trying to ask the user their name and then append a greeting below. Preferably on a fade in, I've tried a few solutions I came across here but to no avail. The "document.name_form..etc) works fine when called inside an alert as well. Can anyone see where I'm going wrong? function doit() { $('#item2').append( document.name_form.fname.value +"U WOT"); } (The function doit gets triggered from the html forms "onSubmit", and has triggered alerts etc successfully) Code snippet: var greeting = "hello " var div = document.getElementById('#item2'); function doit() { $('#item2').append(document.name_form.fname.value + "U WOT"); } // alert(greeting + document.name_form.fname.value) // // // $( " HEYTHERDUDE " + document.name_form.fname.value).appendTo($( " #item2 " )); // // div.innerHTML = div.innerHTML + 'LOOK AT ME' + document.name_form.fname.value; /***************************/ /*****CONTAINER STYLES******/ /***************************/ body { background-color: #212130; } #container { font-family: 'Exo 2', sans-serif; color: #c5c520; font-weight: 300; width: 100%; min-width: 225px; max-width: 325px; } /***************************/ /*******INPUT STYLES********/ /***************************/ .input { height: 25px; width: 100%; background-color: transparent; border-style: solid; border-width: 0px 0px 1px 0px; border-color: #c5c520; outline: 0; -webkit-transition: background-color 0.2s; -o-transition: background-color 0.2s; transition: background-color 0.2s; -webkit-transition: box-shadow 0.2s; -o-transition: box-shadow 0.2s; transition: box-shadow 0.2s; font-family: 'Exo 2', sans-serif; color: #c5c520; font-weight: 300; } .input:hover { box-shadow: inset 0 -10px 20px -10px #131322; -moz-box-shadow: inset 0 -10px 20px -10px #131322; -webkit-box-shadow: inset 0 -10px 20px border-right-width: 1px; border-left-color: #181825; border-right-color: #181825; } .input:focus { background-col…
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27651050
tagged with: jquery
favorite count: 0
has title: Append does not work for appending text to an element
tagged with: http://stackoverflow.com/tag/html
tagged with: append
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27651033
has answer: http://stackoverflow.com/a/27651050
linked to: http://stackoverflow.com/q/978708

http://stackoverflow.com/comment/43709029
score: 0
comment on: http://stackoverflow.com/q/27643714
type: Comment
type: QuestionComment
has text: @torazaburo: Neither of those is exactly canonical. This one may not be either, but I think it's now in pretty decent shape to be duped to, although any more tweaks would probably still be helpful.

http://stackoverflow.com/a/27644496
answers question: http://stackoverflow.com/q/27644473
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27644473
upvote count: 3
has comment: http://stackoverflow.com/comment/43707668
has body: Reference Link var string = " hello world to everyone. "; string = string.trim().replace(/\s+/g, " "); alert(string); JS Fiddle
type: AcceptedAnswer
type: Answer
score: 3

http://stackoverflow.com/a/27753419
has body: First, let's assume you have included the files Next, you must include it in your module, with: angular.module('myApp', ['duParallax']) Next, inject parallaxHelper in your controller (see Angular Dependency Injection), and use parallaxHelper.createAnimator(transition): .controller('MyCtrl', function($scope, parallaxHelper){ $scope.background = parallaxHelper.createAnimator(-0.3); } Finally, insert in your html the points you want to apply parallax, using the respective scope vars that you have used in the controller. In the previous case: That should be all! Source: Quick start guide
has comment: http://stackoverflow.com/comment/44232246
has comment: http://stackoverflow.com/comment/43918569
has comment: http://stackoverflow.com/comment/44191615
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44201819
has comment: http://stackoverflow.com/comment/43940840
has comment: http://stackoverflow.com/comment/43918577
has comment: http://stackoverflow.com/comment/43994298
accepted answer of: http://stackoverflow.com/q/27752771
type: Answer
has comment: http://stackoverflow.com/comment/43917825
has comment: http://stackoverflow.com/comment/44134725
answers question: http://stackoverflow.com/q/27752771
has comment: http://stackoverflow.com/comment/44134612
has comment: http://stackoverflow.com/comment/43918120
has comment: http://stackoverflow.com/comment/44149497
score: 1
upvote count: 1

http://stackoverflow.com/q/27764508
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27765009
tagged with: javascript
tagged with: jquery
tagged with: asp.net
possible better answer: http://stackoverflow.com/a/27765009
type: Question
has answer: http://stackoverflow.com/a/27764734
tagged with: css
has title: how to hide/show the panels with drop down list change in asp with jQuery
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/27764734
has body: I have one dropdownlist and 5 panel I want when the drop down list is changed only one panel show for panels add css code(display:none;) now if dropdownlist is changed :value of drop down list compare with one value then one panel show and others panel hide. My code is: $(document).ready(function () { $('#DropDownList1_collection').change(function () { if ($("#DropDownList1_collection").val() === "abcdef") $('#Panel1_LavazemElectroniki').show(); }); });

http://stackoverflow.com/q/27664194
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43744224
tagged with: jquery
has answer: http://stackoverflow.com/a/27664286
has title: Check if div contains any overflowing inline-block spans
answer count: 2
has comment: http://stackoverflow.com/comment/43744235
possible better answer: http://stackoverflow.com/a/27664286
favorite count: 0
has body: I'm trying to detect if there are any spans in a container that are overflowing and hidden. onetwothreefourfivesixseveneight . .container { width: 150px; white-space: nowrap; overflow: hidden; } span { display: inline-block; margin-right: 6px; } The only way I could think of doing this is by selecting the last span element, and determining whether it's within the container. my jsfiddle
has answer: http://stackoverflow.com/a/27664248
has comment: http://stackoverflow.com/comment/43744244
type: AnsweredQuestion
score: 3
upvote count: 3
accepted answer: http://stackoverflow.com/a/27664248
type: Question

http://stackoverflow.com/comment/43784680
type: Comment
has text: Of course, what you said above is correct. But what I'm asking about here is how to extract the value from the res variable inside a javascript function in OrientDB when this variable contains the result of a query. When I return the variable itself ```return( res);``` I get this: ```[ { "@type": "d", "@rid": "#-2:1", "@version": 0, "lower_num": 2 } ]``` But, for some reason, the following ```return( res[0].lower_num )``` returns nothing. Perhaps, the res variable has some other internal structure..
type: AnswerComment
comment on: http://stackoverflow.com/a/27657903
score: 0

http://stackoverflow.com/comment/43823457
score: 0
comment on: http://stackoverflow.com/a/27693766
type: Comment
type: AnswerComment
has text: You must remove the .val() from the code. But now I am getting a log in console but all values are true when I toggle

http://stackoverflow.com/q/27665129
tagged with: http://stackoverflow.com/tag/html
tagged with: php
linked to: http://stackoverflow.com/q/55223
tagged with: mysql
has title: Cache html page but not data
upvote count: 1
has answer: http://stackoverflow.com/a/27665167
answer count: 1
tagged with: javascript
score: -3
downvote count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27665167
favorite count: 0
type: Question
has body: I have html_page.php that contains my html page, javascript.js contains ajax to call process.php which lookup data from MySQL and populate into html_page.php. Is it possible for me to cache the HTML structure of html_page.php but not the data in the fields?

http://stackoverflow.com/comment/43891734
type: Comment
score: 0
type: AnswerComment
has text: It is not working. Although didn't prompt any error and there is source, but the page is blank...
comment on: http://stackoverflow.com/a/27740197

http://stackoverflow.com/a/27798664
answers question: http://stackoverflow.com/q/27798530
has body: This is due to the clients timezone. Use Date.prototype.getTimezoneOffset to get the offset: var date = new Date(1412101800000); var gmtDate = new Date(date.valueOf() + date.getTimezoneOffset() * 60 * 1000);
has comment: http://stackoverflow.com/comment/44006363
score: 0
type: Answer

http://stackoverflow.com/comment/43777035
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27681096
score: 0
has text: I guess the function that executes the callback can inspect the source of the callback and swap the paramters based on their names.

http://stackoverflow.com/comment/43729787
score: 0
type: QuestionComment
type: Comment
has text: Where is the code that separates the points out by salesperson?
comment on: http://stackoverflow.com/q/27656515

encode
tags question: http://stackoverflow.com/q/27665902
tags question: http://stackoverflow.com/q/27786056
type: Tag
tag name: encode

http://stackoverflow.com/comment/43935966
has text: no, i want image draggable horizondally after dropped in the box
comment on: http://stackoverflow.com/q/27762406
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/44006838
type: Comment
comment on: http://stackoverflow.com/a/27799035
score: 0
type: AnswerComment
has text: I've made an edit to be more specific but I guess my problem is related dependency injection as you mentioned

http://stackoverflow.com/a/27831098
answers question: http://stackoverflow.com/q/27768336
has body: Personally I use Thymeleaf's own dynamic field management to ensure clean addition of objects and fields to object. So I will recommend option 4: Dynamic Field management by Thymeleaf. Have a read of http://www.thymeleaf.org/doc/tutorials/2.1/thymeleafspring.html#dynamic-fields. I use that for both single field additions as well as addition of nested forms. Does the trick no questions asked. Hope that helps.
upvote count: 5
score: 5
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43908221
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27747145
score: 0
has text: No there are no JS errors reported

http://stackoverflow.com/q/27707751
tagged with: selection
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27707810
has title: Jquery - Select Manipulating with Checkboxes
has body: I got a problem with my Script. Its working great with a "normal" name for the Selection, but I use a Shop CMS which names the Selection like this: "ItemOrderParams[0][g19]" and the script isnt working anymore with that name. Can somebody solve this problem? I have no Idea how to fix it. $("input[id=steckdose]").on("change", function(){ if($(this).is(":not(:checked)")) $(function() { $('[name=ItemOrderParams[0][g19]]').val( '3' ); }) }); $("input[id=steckdose]").on("change", function(){ if($(this).is(":checked")) $(function() { $('[name=ItemOrderParams[0][g19]]').val( '2' ); }) }); -- Red Green Blue
linked to: http://stackoverflow.com/q/2364982
type: Question
has answer: http://stackoverflow.com/a/27707789
score: 0
answer count: 2
duplicate of: http://stackoverflow.com/q/2364982
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27707789
tagged with: checkbox
has answer: http://stackoverflow.com/a/27707810

http://stackoverflow.com/a/61813567
upvote count: 0
score: -2
has body: ./assets/CSS/filename.css Did the job for me.
answers question: http://stackoverflow.com/q/27706133
type: Answer
downvote count: 2

http://stackoverflow.com/comment/43991915
type: Comment
type: QuestionComment
has text: not to mention the value of the radios never get changed. You want to evaluate for `checked` after you fix ID's
score: 0
comment on: http://stackoverflow.com/q/27791034

http://stackoverflow.com/q/27686012
tagged with: webrtc
possible better answer: http://stackoverflow.com/a/27778824
has answer: http://stackoverflow.com/a/27778824
type: Question
has comment: http://stackoverflow.com/comment/43793701
has answer: http://stackoverflow.com/a/27813879
score: 0
answer count: 2
tagged with: camera
tagged with: javascript
tagged with: html5-video
has body: How can I take snapshots from webcam in Internet Explorer 11? Is there a plugin for that purpose? I tried Temasys WebRTC Plugin but it just made access to webcam which replace video tag to an object element. And from an object I cannot take snapshot to a canvas.
has title: How can I take snapshots from webcam in Internet Explorer 11?
accepted answer: http://stackoverflow.com/a/27813879
type: AnsweredQuestion
tagged with: html5-canvas

http://stackoverflow.com/a/27756231
has body: Try to this, use your function name instead call_function setInterval(function(){ call_function(); }, 30000);
has comment: http://stackoverflow.com/comment/43923130
answers question: http://stackoverflow.com/q/27756183
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27756183
score: 0
upvote count: 1
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/43923247
has comment: http://stackoverflow.com/comment/43923154

http://stackoverflow.com/q/27717325
answer count: 3
has answer: http://stackoverflow.com/a/32391930
has body: I am new to jQuery. I have to reload a div after sending some values to server using ajax. My jQuery code is selectionChanged: function () { var $selectedRows = $('#PersonTableContainer').jtable('selectedRows'); $selectedRows.each(function () { var record = $(this).data('record'); var columnname = record.columnname; var datatype = record.datatype; var columnlength = record.columnlength; $.post('meta?action=dataload', { columnname: columnname, datatype: datatype, columnlength: columnlength }); }); after this code is executed I want to reload a div &lt;div id="loadedtablecontainer"&gt;&lt;/div&gt; this div will get the selected data of 1st jtable .. and display it in this jtable. So by using this div id I have to call or reload this div soon after above jQuery function got executed Something like $.post('meta?action=dataload', { columnname: columnname, datatype: datatype, columnlength: columnlength }); $("#loadedtablecontainer");
has answer: http://stackoverflow.com/a/27717422
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: How to reload a div with jquery
type: Question
has answer: http://stackoverflow.com/a/27717657
tagged with: javascript
score: 0

http://stackoverflow.com/a/27657893
has body: This following code will fix your problem. $(document).ready(function(){ $(".btn1").click(function(){ $(this).parents(".news-item").find(".esl").hide(); }); $(".btn2").click(function(){ $(this).parents(".news-item").find("p.esl").show(); }); }); this code will not hide all the p tags which only hide belongs to news item cheers
accepted answer of: http://stackoverflow.com/q/27657497
answers question: http://stackoverflow.com/q/27657497
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/43773249
type: Comment
type: QuestionComment
has text: Instead of `id="MyDIV"` & `id="read_more_btn"` use class and bind event to class. You should find many example on the web
comment on: http://stackoverflow.com/q/27678881
score: 0

http://stackoverflow.com/q/27783169
has answer: http://stackoverflow.com/a/27783270
possible better answer: http://stackoverflow.com/a/27783235
favorite count: 0
has comment: http://stackoverflow.com/comment/43976345
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27783228
answer count: 4
downvote count: 0
has answer: http://stackoverflow.com/a/27783235
accepted answer: http://stackoverflow.com/a/27783227
has body: I have made a object called Circle and have two instances of this object called circle1 and circle2 Im trying to get them to swap positions, But only one of them is moving at the moment. Javascript: var gap = 6, size= 60; var Circle = function(t,l, color){ var elem = document.createElement('div'); t = t, l = l; elem.setAttribute("class", "circle"); elem.style.backgroundColor = color; // init positions elem.style.top = gap+t*(size+2*gap) + "px"; elem.style.left = gap+l*(size+2*gap) + "px"; document.body.appendChild(elem); this.getPosition = function(){ return [t,l]; }; this.setPosition = function(arr){ t = arr[0]; l = arr[1]; elem.style.top = gap+t*(size+2*gap) + "px"; elem.style.left = gap+l*(size+2*gap) + "px"; }; } // make two new circle objects var circle1 = new Circle(0, 0, "blue"); var circle2 = new Circle(0, 1, "red"); // we need the circles to swap positions setTimeout(function(){ circle1.setPosition(circle2.getPosition()); circle2.setPosition(circle1.getPosition()); // this is not working }, 1000); I have put this code on jsFiddle to make it easier: http://jsfiddle.net/rhL7671p/
type: Question
type: AnsweredQuestion
has title: How can I move multiple DOM elements using javascript?
score: 3
has answer: http://stackoverflow.com/a/27783227
tagged with: javascript

http://stackoverflow.com/comment/43829039
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27708525
has text: just a pro tip, a `for` loop is faster and much easier to read.
score: 0

http://stackoverflow.com/comment/43896565
comment on: http://stackoverflow.com/a/27742838
type: Comment
score: 0
type: AnswerComment
has text: Is this proper way of creating assingToScope function? Shouldn't I create factory or something like that with angular pattern?

http://stackoverflow.com/q/27646927
type: UnansweredQuestion
tagged with: android
has body: So here's my code: webView = (WebView) findViewById(R.id.layout_webview); WebSettings webSettings = webView.getSettings(); webSettings.setJavaScriptEnabled(true); String js = " " + " " + " " + " " + " " + " "; webView.loadDataWithBaseURL("", js, "text/html", "UTF-8", ""); Even though I set the fontsize to 100 the equation doesn't change in size at all no matter what number I set in the font size. Is there a way to increase the font size of the equation?
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/27647488
tagged with: javascript
linked to: http://stackoverflow.com/q/12106035
has title: How to increase font size of jqMath equation for Android app
upvote count: 1
answer count: 1
favorite count: 0
tagged with: jqmath

http://stackoverflow.com/a/27757634
has body: The following will find all p tags which have preceding siblings .abc and following siblings .lmn: $('.abc + p + .lmn').prevUntil('.abc','p') If you just want ANY p tag between two divs, then do $('div + p + div').prevUntil('div','p')
answers question: http://stackoverflow.com/q/27756603
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/62323197
has text: really helped me too.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29350475
type: AnswerComment

http://stackoverflow.com/q/27711108
favorite count: 0
answer count: 4
upvote count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/41255407
has comment: http://stackoverflow.com/comment/56459075
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/43834565
score: 3
has body: I'm trying to edit objects with a modal Bootstrap. I've got that if you click over an event in Fullcalendar a form comes up with the info of that event (level,day,period) so I can edit the level and the day of that event(object). The problem is that when I click in the bottom save a new object is created instead of editing that event. Can't I get the params of the event clicked and change them?? This is my javascript where I set the eventClick function. var y = "y"; function drawControl(controls) { $('#calendar').fullCalendar({ editable: true, aspectRatio: 1, contentHeight: 500, scrollTime: '24:00:00', minTime: '01:00:00', maxTime: '24:00:00', defaultView: 'agendaWeek', header:{left:"prev,next,today", center:"title", right:"month, agendaWeek, agendaDay"}, events: allControls(controls), eventRender: function(event, element) { var bloodLevel=event.title if(bloodLevel >= 180) { element.css('background-color', 'red'); } else if(bloodLevel < 70) { element.css('background-color', 'yellow'); } }, eventClick: function(calEvent, jsEvent, view) { x=calEvent.id; $('#modalTitle').html(calEvent.title); $('#control_day_edit').val(calEvent.start); $('#control_level').val(calEvent.title.toString()); console.log(calEvent.title) console.log(calEvent.start._i) console.log(calEvent.id) $('#eventUrl').attr('href',"/users/:user_id/controls/calEvent.id/edit"); $('#fullCalModal').modal(); y=calEvent; } }) } }); document.getElementById('button_edit').addEventListener("click", editControl); function editControl(event) { event.preventDefault(); console.log(x); var controlEdited = { "level": document.getElementById('control_level').value, "day": document.getElementById('control_day_edit').value, "period": document.getElementById('control_period').value, "id": x } $('#calendar').fullCalendar('updateEvent', y); $.post("/editControls", JSON.stringify(controlEdited)); console.log(controlEdited) }; This is the code of my controller def editControls if request.xhr? @control = JSON.parse!(request.bod…
has title: Editing events in Fullcalendar with modal Bootstrap
has answer: http://stackoverflow.com/a/36582792
tagged with: javascript
tagged with: fullcalendar
type: Question
has answer: http://stackoverflow.com/a/70623004
has comment: http://stackoverflow.com/comment/43981306
has answer: http://stackoverflow.com/a/27711806
downvote count: 0

http://stackoverflow.com/comment/43898191
comment on: http://stackoverflow.com/a/27733693
score: 0
type: Comment
type: AnswerComment
has text: @ArtOfCode Wasn't returning false, console works fine now, thanks

http://stackoverflow.com/comment/44042572
has text: sorted. big thanks for that, once I figured out I was drawing the markers with one id I was able to give them seperate ID's and then colour them individually :) appreciate the help
comment on: http://stackoverflow.com/a/27803193
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27775469
tagged with: cordova
tagged with: angularjs
has answer: http://stackoverflow.com/a/27775622
type: AnsweredQuestion
has body: I want to transfer data from my html to JS file... It's works with AngularJS+Onsen+PhoneGap This is my HTML file Share This is my JS file $scope.openSocialSharing = function(qqrq){ console.log('DATA- '+qqrq); window.plugins.socialsharing.share(qqrq); } And console result 01-05 13:43:41.760: I/chromium(17719): [INFO:CONSOLE(197)] "DATA - qqqq wwwww", source: file:///android_asset/www/js/controllers.js (197)
score: 0
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27775622
tagged with: onsen-ui
has title: how to transfer data from html in Angular.js?
answer count: 1

http://stackoverflow.com/q/27729642
upvote count: 1
tagged with: browser-extension
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43880473
downvote count: 0
answer count: 0
score: 1
tagged with: iframe
has title: How do I insert an iframe with dynamic HTTPS source from a Firefox extension?
has body: We develop browser extensions for Google Chrome, Firefox and Safari. We need to insert an iframe in Gmail (https://mail.google.com/) in our Firefox extension. I created a JavaScript code that inserts the iframe to the page with jQuery. Here is the code: JavaScript code: var $container = jQuery(' '); $container.append(' '); jQuery("body").append($container); Utils.getUrl = function(filename, preferSecure) { return WS.getURL(filename, preferSecure); }; /* Function to retrieve the relative URL/URI of a file in the platform's file system. */ WS.getURL = function(filename, preferSecure) { if (typeof filename !== "string") { filename = ""; } else if (filename.substr(0, 1) === "/") { /* Remove forward slash if it's the first character, so it matches with the base URLs of the APIs below. */ filename = filename.substr(1); } switch (Sys.platform) { case 'mozilla': if (typeof exports === 'undefined') { // Means we're in a content script. return self.options.extensionURL + filename; } return require("sdk/self").data.url("../lib/" + filename); } }; login_iframe.html: login_iframe.js: // Get URL parameter. function GetURLParameter(sParam) { var sPageURL = window.location.search.substring(1); var sURLVariables = sPageURL.split('&'); for (var i = 0; i < sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if ((sParameterName.length >= 2) && (sParameterName[0] === sParam)) { return decodeURIComponent(sParameterName[1]); } } return null; } document.getElementById("iframe").src = GetURLParameter("url"); I checked and (typeof exports === 'undefined') is true, but the problem is that the iframe is empty in Firefox, it's HTML is and the src attribute is invalid. How do I fix the src attribute to show the correct iframe?
type: Question
tagged with: content-security-policy
tagged with: javascript
tagged with: firefox-addon

http://stackoverflow.com/comment/43910282
type: QuestionComment
score: 0
has text: Thanks peterjb, after I saw the solution, I was curious why it worked, and mine did not, and your comment helped resolve my confusion.
comment on: http://stackoverflow.com/q/27749128
type: Comment

http://stackoverflow.com/a/27666560
answers question: http://stackoverflow.com/q/27666511
downvote count: 0
has body: With nth-last-child: alert($(".table").find("tr:nth-last-child(2)").find("td").html()); You could also make it a single selector: alert($(".table tr:nth-last-child(2) td").html());
score: 6
type: Answer
upvote count: 6

http://stackoverflow.com/a/27832005
answers question: http://stackoverflow.com/q/27713660
has body: This question is actually extremely hard if you want to do it to perfection... or it can be relatively easy if you can live with solutions that work only some of the time. First of all, realize that getTextContent is intended for searchable text extraction and that's all it's intended to do. It's been suggested in the comments above that you use page.getOperatorList(), but that's basically re-implementing the whole PDF drawing model in your code... which is basically silly because the largest chunk of PDFJS does exactly that... except not for the purpose of text extraction but for the purpose of rendering to canvas. So what you want to do is to hack canvas.js so that instead of just setting its internal knobs it also does some callbacks to your code. Alas, if you go this way, you won't be able to use stock PDFJS, and I rather doubt that your goal of color extraction will be seen as very useful for PDFJS' main purpose, so your changes are likely not going to get accepted upstream, so you'll likely have to maintain your own fork of PDFJS. After this dire warning, what you'd need to minimally change are the functions where PDFJS has parsed the PDF color operators and sets its own canvas painting color. That happens around line 1566 (of canvas.js) in function setFillColorN. You'll also need to hook the text render... which is rather a character renderer at canvas.js level, namely CanvasGraphics_paintChar around line 1270. With these two hooked, you'll get a stream of callbacks for color changes interspersed between character drawing sequences. So you can reconstruct the color of character sequences reasonably easy from this.. in the simple color cases. And now I'm getting to the really ugly part: the fact that PDF has an extremely complex color model. First there are two colors for drawing anything, including text: a fill color and stroke (outline) color. So far not too scary, but the color is an index in a ColorSpace... of which there are several, RGB being only one po…
downvote count: 0
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/44129161
score: 6

http://stackoverflow.com/comment/43920436
type: Comment
type: QuestionComment
has text: @PeterAshwell sorry, didn't see that comment! Unfortunately it doesn't fix it.
score: 0
comment on: http://stackoverflow.com/q/27750497

http://stackoverflow.com/comment/43853622
type: Comment
comment on: http://stackoverflow.com/q/27719945
has text: Thx for your support @MiroslavMocek. I resolved the issue by switching to ` `, rathern than using the `0.9` version.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/48657740
comment on: http://stackoverflow.com/q/27694570
score: 0
type: Comment
has text: @DmitriZaitsev totally agree and it makes perfect sense. Thanks.
type: QuestionComment

http://stackoverflow.com/comment/44015967
has text: your question is not clear
type: QuestionComment
comment on: http://stackoverflow.com/q/27803210
score: 0
type: Comment

http://stackoverflow.com/a/27755900
answers question: http://stackoverflow.com/q/27755846
type: Answer
has body: You have to use socket.broadcast.emit to broadcast.. socket.on('new user', function(username) { socket.broadcast.emit('new connection', { nickname: username }); console.log('new connection ' + username); }); However this will not send the message to your own connection but to all other connections. If you want to send the message to all connections including yourself, socket.on('new user', function(username) { socket.emit('new connection', { nickname: username }); socket.broadcast.emit('new connection', { nickname: username }); console.log('new connection ' + username); });
score: 0

http://stackoverflow.com/comment/43781094
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27672093
has text: Sure, the socket.io homepage actually has an example that's almost exactly like you want, except that instead of listening to a tweet stream and emitting a tweet, you're listening to a pusher notification and emitting whatever custom event you want to have represent that. http://socket.io/

http://stackoverflow.com/a/27754906
answers question: http://stackoverflow.com/q/27740620
type: Answer
has body: This error say that your $auth service send request to the other URL. Therefore at first you need check and test what do your $auth service when you call its 'login' method. The better way in order to test is to have separate suites for $auth service (where you will test how it interact with backend) and for LoginCtrl controller (where you will mock $auth service and test only behavior of the controller). You can use this plunker http://tinyurl.com/lv3gskf as example. (I use tinyurl.com because stackoverflow not allow to post links to plunker without code)
score: 0

http://stackoverflow.com/comment/43865926
comment on: http://stackoverflow.com/a/27726837
type: Comment
type: AnswerComment
has text: Would you do this for multiple changes? $(this).css("background-color", "green", "border-color", "black", "border-width", "30px");
score: 0

http://stackoverflow.com/a/27772748
has comment: http://stackoverflow.com/comment/43960840
has body: You can use observeChanges and makes this reactive. On the added, you can add fields. I'm using this amazing package: meteor-publish-composite, It saves you time. Use pagination, otherwise you won't enjoy the performance.
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27771318
downvote count: 0
has comment: http://stackoverflow.com/comment/43963116
type: Answer

http://stackoverflow.com/q/27725822
has comment: http://stackoverflow.com/comment/43863785
answer count: 1
tagged with: arrays
has title: How do I make a numerical array's increase amount smaller in each step?
has comment: http://stackoverflow.com/comment/43863740
tagged with: javascript
has comment: http://stackoverflow.com/comment/43863867
favorite count: 0
has comment: http://stackoverflow.com/comment/43863887
has comment: http://stackoverflow.com/comment/43863773
has body: I would like to make a numeric array which increases in every step. [1,200,400,600,800,1000, .... , 10000] But I need to make the amount by which it increases progressively smaller in every step. For example, [1, 200, 300, 350, 325, 312.5, ....., 10000] If anybody knows the solution, please give me some ideas. Thank you.
has comment: http://stackoverflow.com/comment/43864585
downvote count: 6
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27725919
upvote count: 1
has comment: http://stackoverflow.com/comment/43864486
type: Question
score: -5
tagged with: math
has comment: http://stackoverflow.com/comment/43864607
has comment: http://stackoverflow.com/comment/43864698
has comment: http://stackoverflow.com/comment/43863771
accepted answer: http://stackoverflow.com/a/27725919
has comment: http://stackoverflow.com/comment/43863878

http://stackoverflow.com/comment/43885289
type: QuestionComment
has text: Now I get an error that says Uncaught ReferenceError: a is not definedhii.html:27 onclick Do you know what might cause that?
comment on: http://stackoverflow.com/q/27736898
score: 0
type: Comment

http://stackoverflow.com/q/27755644
upvote count: 0
tagged with: forms
type: Question
has body: I have troubles with JS form validation. I use regular expressions. If all fields user fill correct, then submit button in form is active (onmouseover), but when one of fields is incorrect, submit button is disabled. When user filled all fields correct - submit button stand still disabled, can you help me fix this problem? As the result, user fix all fields and submit button must be enabled.
possible better answer: http://stackoverflow.com/a/27758634
score: -2
tagged with: javascript
answer count: 2
downvote count: 2
tagged with: validation
linked to: http://stackoverflow.com/q/18113937
favorite count: 0
has answer: http://stackoverflow.com/a/27758634
has title: JS form validation, activate submit button if all field correct
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27755725
accepted answer: http://stackoverflow.com/a/27755725
type: AnsweredQuestion

http://stackoverflow.com/q/27736747
linked to: http://stackoverflow.com/q/27736883
score: 0
has body: I need to scrape some content from Google search results that only shows in browsers (I suspect it's when Javascript is enabled) – specifically, their Knowledge Graph "People also search for" content. I use a combination of request and cheerio to scrape and has already managed to force-load results from .com domain, however, the knowledgebase box does not show up in the body of my results, probably because it's javascript-generated content. Anybody knows if there's a setting I could add or another library I could use? Here's my code below. Thank you! var request = require('request'); var cheerio = require("cheerio"); request = request.defaults({jar: true}); var options = { url: 'http://www.google.com/ncr', headers: { 'User-Agent': 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16' } }; request(options, function () { request('https://www.google.com/search?gws_rd=ssl&amp;site=&amp;source=hp&amp;q=google&amp;oq=google', function (error, response, body) { var $ = cheerio.load(body); $("li").each(function() { var link = $(this); var text = link.text(); console.log(text); }); }); });
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: node.js
duplicate of: http://stackoverflow.com/q/28739098
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/28739098
tagged with: node-request
type: Question
has answer: http://stackoverflow.com/a/27736836
has title: Scraping javascript generated content using request in Node.Js

http://stackoverflow.com/comment/43855185
comment on: http://stackoverflow.com/q/27721735
has text: http://www.livesport.cz/x/js/core_1_943000000.js - search for '1s'
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43729454
type: QuestionComment
comment on: http://stackoverflow.com/q/27656202
has text: Related (sort of) question: http://stackoverflow.com/questions/2345132/reversing-z-index-based-from-page-render-order
score: 0
type: Comment

http://stackoverflow.com/a/27704605
type: Answer
accepted answer of: http://stackoverflow.com/q/27704029
answers question: http://stackoverflow.com/q/27704029
score: 0
type: AcceptedAnswer
has body: If you are returning a 400 status code it will be considered as a failed request. check this link About your console showing the error it is the normal behavior. If you don't want it to show an error you shouldn't return an error code: check this link

http://stackoverflow.com/q/27747631
has body: I have a regular expression in PHP but when I ported it to Node.js, the output I'm getting is not the same as the one I get from PHP, but I think it is because I don't really know how to make PREG_SET_ORDER work in Node.js. Example text: INPUT - Each line represents a line inside a text file. ------------------------------------------------------------------------------------- "!?Text" (1234) 1234-4321 "#1 Text" (1234) 1234-???? #2 Text (1234) {Some text (#1.1)} 1234 Text (1234) 1234 Some Other Text: More Text here 1234-4321 (1234) (V) 1234 PHP: preg_match_all("/^((.*?) *\((\d+)\))(?: *\{((.*?) *\((.+?)\)) *\})?/m",$data,$r, PREG_SET_ORDER); $i = 0; foreach($r as $a) { array_splice($a, 0, 2); if(count($a) &gt; 2) { array_splice($a, 2, 1); } print_r($a); } Node.js: var regex = /^((.*?) *\((\d+)\))(?: *\{((.*?) *\((.+?)\)) *\})?/mg var result = data.toString().match(regex); console.log(result); PHP (Output): Array ( [0] =&gt; "!?Text" [1] =&gt; 1234 ) Array ( [0] =&gt; "#1 Text" [1] =&gt; 1234 ) Array ( [0] =&gt; #2 Text [1] =&gt; 1234 [2] =&gt; Some text [3] =&gt; #1.1 ) Array ( [0] =&gt; Text [1] =&gt; 1234 ) Array ( [0] =&gt; Some Other Text: More Text here 1234-4321 [1] =&gt; 1234 ) Node.js (Output): [ '"!?Text" (1234)', '"#1 Text" (1234)', '#2 Text (1234) {Some text (#1.1)}', 'Text (1234)', 'Some Other Text: More Text here 1234-4321 (1234)' ]
tagged with: php
tagged with: regex
tagged with: node.js
score: 2
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27749563
accepted answer: http://stackoverflow.com/a/27749563
type: Question
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/43909231
tagged with: preg-match-all
answer count: 1
has comment: http://stackoverflow.com/comment/43906481
favorite count: 0
has title: How to use my PHP regular expression in Node.js?
has comment: http://stackoverflow.com/comment/43907171

http://stackoverflow.com/a/27741953
has comment: http://stackoverflow.com/comment/43896216
has comment: http://stackoverflow.com/comment/43895737
type: Answer
has comment: http://stackoverflow.com/comment/43895642
score: 2
has comment: http://stackoverflow.com/comment/43896568
downvote count: 0
has body: Don't call the function with a parameter. Instead try to let the function itself search for the latest already posted comment id (in a db or elsewhere) and increment that value.
upvote count: 2
has comment: http://stackoverflow.com/comment/43895925
answers question: http://stackoverflow.com/q/27741840

http://stackoverflow.com/q/27752593
favorite count: 0
has answer: http://stackoverflow.com/a/27752675
upvote count: 2
accepted answer: http://stackoverflow.com/a/27752675
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27752638
has answer: http://stackoverflow.com/a/27752638
type: Question
answer count: 2
tagged with: javascript
has title: multiple file validation using javascript
has body: I am trying to upload multiple files via &lt;input type="file" id="uploadFiles" multiple onchange="checkFileUploadExt(this);"/&gt; using javascript function checkFileUploadExt(fieldObj) { var control = document.getElementById("uploadFiles"); var filelength = control.files.length; var FileName = fieldObj.value; var FileExt = FileName.substr(FileName.lastIndexOf('.') + 1); if ((FileExt.toUpperCase() != "PDF")) if ((FileExt !== "pdf") || (FileExt !== "PDF")) { var error = "File type : " + FileExt + "\n\n"; error += "Please make sure your file is in pdf format .\n\n"; alert(error); fieldObj.value = ''; return false; } return true; } but here multiple pdf files->success single other files(.txt,.doc etc)->success pdf+(txt or doc)-> fail my need is only pdf files can accept when multiple selection. and also it shows errors in files.length on Interner Explorer how to do this
downvote count: 0

facebook-php-webdriver
tag name: facebook-php-webdriver
type: Tag
tags question: http://stackoverflow.com/q/27785721

http://stackoverflow.com/a/27789177
has body: The following function seems to do what you want: function filter(obj, schema, out) { var i, schemaItems, schemaItem, isItemLevel; if (!obj || !schema) return; out = out || {values: []}; isItemLevel = Array.isArray(schema); schemaItems = isItemLevel ? schema : Object.keys(schema); for (i = 0; i &lt; schemaItems.length; i++) { schemaItem = schemaItems[i]; if (isItemLevel &amp;&amp; typeof schemaItem === "string") { out.values.push(obj[schemaItem]); } else if (typeof schemaItem === "object") { filter(obj, schemaItem, out); } else if (typeof schemaItem === "string") { filter(obj[schemaItem], schema[schemaItem], out); } } return out.values; } called as var obj = { "prop1": { "prop1A": "A", "prop1B": { "prop1BA": "BA" }, "prop1C": "C" } }; var filterSchema = { "prop1":["prop1A", {"prop1B":["prop1BA"]}] }; filter(obj, filterSchema); returns: ["A", "BA"] Take it with a grain of salt, it is by far not tested well-enough and I certainly don't claim it's the most elegant way of solving this. It works like this: traverse the items of the schema (which is either an array or an object) for each schemaItem if we are in an array and the schemaItem is a string, output the respective property value of obj else if the schemaItem is itself an object, recurse, but stay at the same level in obj else if the schemaItem is a string, recurse, drilling into both obj and schema
has comment: http://stackoverflow.com/comment/43989309
score: 0
has comment: http://stackoverflow.com/comment/43996128
type: Answer
has comment: http://stackoverflow.com/comment/43989245
has comment: http://stackoverflow.com/comment/43997383
answers question: http://stackoverflow.com/q/27787453
has comment: http://stackoverflow.com/comment/43989185
has comment: http://stackoverflow.com/comment/43990164

http://stackoverflow.com/comment/72947588
score: 0
type: AnswerComment
type: Comment
has text: Same here @MartinKlasson - as these are STILL undocumented features I'm not sure if they even still exist. But the example above doesn't work.
comment on: http://stackoverflow.com/a/27799147

http://stackoverflow.com/a/27759712
has comment: http://stackoverflow.com/comment/43930507
type: Answer
has comment: http://stackoverflow.com/comment/43930541
has comment: http://stackoverflow.com/comment/43930624
has comment: http://stackoverflow.com/comment/43931279
answers question: http://stackoverflow.com/q/27759280
score: 0
has comment: http://stackoverflow.com/comment/43931947
has body: What you need to do is listen for the select change event. You could try something like this $('select[name="action"]').on('change', function (e) { var $form = $(this).closest('form'); var checked = $( "input:checked" ).length; e.preventDefault(); if($(this).val()==="delete" &amp;&amp; checked) { $('#confirm').modal({ backdrop: 'static', keyboard: false }) .one('click', '#delete', function (e) { $form.trigger('submit'); }); } }); Here is a link to a jsfiddle http://jsfiddle.net/dh0g6cge/
accepted answer of: http://stackoverflow.com/q/27759280
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43931456
has comment: http://stackoverflow.com/comment/43931225

http://stackoverflow.com/comment/43976533
type: QuestionComment
has text: I have seen it done like this before but I would advise against it for a couple of reasons. The best approach is to set the current page in the backend and not use JavaScript for this at all. If you are going to stick with this approach, you should consider using a string match instead and you should consider upper/lower case as `WWW.GOOGLE.COM` and `www.google.com` are not the same when using `==`. Also, `www.google.com` and `www.google.com/` will go to the same place but one will be `true`, the other will be `false` using your current function.
score: 0
comment on: http://stackoverflow.com/q/27783060
type: Comment

http://stackoverflow.com/a/27732574
has comment: http://stackoverflow.com/comment/43876735
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43877410
has comment: http://stackoverflow.com/comment/43877981
accepted answer of: http://stackoverflow.com/q/27732480
type: Answer
answers question: http://stackoverflow.com/q/27732480
score: 2
upvote count: 2
has body: http://jsfiddle.net/72ene5ob/ Hey, it looks like you want to check the lenght of the last input field only. so just add .last() to your selector: var $itemNum = $('#tbody tr').last(); $('body').on('keyup','.elm',function(e){ //Check Key Press is Enter console.log(e.keyCode); if (e.keyCode != 13) { console.log('Enter detected'); var sum = 0; $('.elm').each(function() { if($(this).val() != '' && !isNaN($(this).val())){ sum += parseInt($(this).val()); } }); $('#total').text(sum); } else{ var $itemNum = $('#tbody tr').last(); if($itemNum.find('input').val().length > 0) { console.log('should add new input'); var itemNum = $('#tbody tr').length + 1; var newRow = ' '+ ' Item'+itemNum+' '+ ' '+ ' '+ ' '+ ' '; $('#tbody').append(newRow); } } });
has comment: http://stackoverflow.com/comment/43877370

http://stackoverflow.com/a/27681493
upvote count: 2
has comment: http://stackoverflow.com/comment/43777759
has comment: http://stackoverflow.com/comment/43777704
has comment: http://stackoverflow.com/comment/43777852
answers question: http://stackoverflow.com/q/27681284
has body: Are you using controller-as syntax? To reference vm inside the HTML, you should use the controller-as syntax. if you are using ngRoute be sure to add the controllerAs property on the route configuration object. If you are using the ngController directive, do this: ng-controller="CreateController as vm" Also in my testing it only worked when I added the var keyword before the vm variable declaration, like this: var vm = this; Here is the code I used to test it stack overflow Register name Operation Cost member Submit
accepted answer of: http://stackoverflow.com/q/27681284
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43777876
type: Answer
score: 2

http://stackoverflow.com/q/27718983
tagged with: forms
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43850141
has body: I have several forms in my code, and I want to assign a Confirmation Box to show before it is submitted. Hence, I use Boxy Jquery, however after the user confirms, $(this).submit() does not work. Is this because there are more than 1 form? Here is my JS: $("form").submit(function(ev) { Boxy.confirm("Are you sure?", function() { $(this).submit(); }, {title: 'Confirm'}); return false; });
has answer: http://stackoverflow.com/a/27719669
has title: Boxy this submit does not work
tagged with: jquery
type: UnansweredQuestion
tagged with: boxy
has answer: http://stackoverflow.com/a/27719350
type: Question
tagged with: javascript

http://stackoverflow.com/comment/44125384
type: QuestionComment
has text: It's not the deletion of prior charts, it's that the script also filters the data, and occasionally parts of the chart's data were getting moved around during the filtering, and if all the data got moved, the graph would throw an error. A rare error, but still a potential bug.
score: 0
comment on: http://stackoverflow.com/q/27726914
type: Comment

http://stackoverflow.com/comment/44011335
has text: I see. Thank you, this has been very interesting and informative. Time for me to do some background reading!
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27800698
type: Comment

http://stackoverflow.com/q/27756069
type: UnansweredQuestion
has body: I have an ngRepeat with a limitTo in my HTML. This will show the first x number of users - essentially paginating the table. I now need to be able to show the next batch of x users. I've added a couple of anchors to go to previous or next page (with functions attached to the click) I'm now not sure how to manipulate the ngRepeat through these functions to actually show the correct batch of users. HTML {{user.name}} {{user.email}} left right JS $scope.users = //full users object here $scope.paginate = {}; $scope.paginate.size = 10; $scope.prevPage = function(){ //load the previous 10 users } $scope.nextPage = function(){ //load the next 10 users }
has answer: http://stackoverflow.com/a/27756242
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43923262
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: angularjs-ng-repeat
has title: Navigate limitTo batches in Angular ngRepeat
tagged with: angularjs

http://stackoverflow.com/comment/43702597
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27641875
has text: No there is no error showing in the browser or at the console I set dataType but i did not help.

http://stackoverflow.com/comment/44616480
has text: It offers me only to install it but not to add to console for filtered output. Altho I auto-install my .xpi with your Auto-Installer (which works great, thanks!) then use console.error("@@@ msg").
comment on: http://stackoverflow.com/a/27918925
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27789535
has body: I've read this article: Callbacks are imperative, promises are functional: Node’s biggest missed opportunity There's a code: var p1 = new Promise(); p1.then(console.log); p1.resolve(42); var p2 = new Promise(); p2.resolve(2013); p2.then(console.log); // prints: // 42 // 2013 This makes sense to me. Very declarative code. However, once I really use promise in node.js doing npm bluebird Here is the actuall code that does work: var Promise = require('bluebird'); var r1; var p1 = new Promise(function(resolve){ r1 = resolve; }); p1.then(console.log); r1(42); var r2; var p2 = new Promise(function(resolve){ r2 = resolve; }); r2(2013); p2.then(console.log); To me the former code looks more reasonable. What is going on? Any idea? Thanks.
has answer: http://stackoverflow.com/a/27791252
tagged with: node.js
has title: The implementation for `promise` in JavaScript
tagged with: promise
duplicate of: http://stackoverflow.com/q/22684643
has comment: http://stackoverflow.com/comment/43989317
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27789748
accepted answer: http://stackoverflow.com/a/27789748
answer count: 2
linked to: http://stackoverflow.com/q/22684643
upvote count: 1
possible better answer: http://stackoverflow.com/a/27791252
downvote count: 1
tagged with: javascript
favorite count: 0
score: 0

http://stackoverflow.com/q/27735831
tagged with: javascript
tagged with: event-handling
has answer: http://stackoverflow.com/a/27736037
accepted answer: http://stackoverflow.com/a/27736037
has answer: http://stackoverflow.com/a/27736031
upvote count: 1
has title: How to call removeEventLisener when addEventListener in a method and removeEventListener in a global function in JavaScript
has body: There are plenty of questions and answers on a similar topic, but I feel that this is a slightly different question that the other question's answers did not quite answer this. I have a constructor, and its prototype has an addEventListener, is called with a global function, once. Once needs to be global, but the addEventListener needs to be in the prototype's method. How would I remove the event listener, would I put once.bind(that) in or once for the function in removeEventListener? var once = function(event) { removeEventListener("keydown", /*something*/); } Chomp.prototype.playerMove = function() { var that = this; addEventListener("keydown", once.bind(that)); } Thanks ahead of time! :)
favorite count: 0
possible better answer: http://stackoverflow.com/a/27736031
type: AnsweredQuestion
score: 1
tagged with: methods
type: Question
answer count: 2
downvote count: 0

http://stackoverflow.com/q/27800816
tagged with: javascript
has body: I have jqplot line charts and some pie charts. I have been able to change everything except the text color of the legend labels. It would be nice if I could make the label color match the swatch color but if I can just specify one color across the board that would be ok. Additional info: This link does what I need to unfortunately I don't think it will work for me, I have to do it in the chart options: Legend text color in accordance with line color in jqplot Here is exactly what I am trying to achieve in chart options but it doesn't appear to have a satisfactory answer: jqplot donut chart label/legend color and line In the code below, in the legend definition, I set the background color and it works. However, setting textColor does not. Any help is greatly appreciated. Please let me know if I can provide any more detail. Thanks!! grid:{ background: '#2A2A2A', gridLineColor: '#FF9900' }, seriesDefaults: { rendererOptions: { showDataLabels: true } }, axes:{ yaxis: { tickOptions: { textColor: '#FF9900' } }, xaxis: { tickOptions: { textColor: '#FF9900' }, renderer: $.jqplot.CategoryAxisRenderer, ticks: dates, drawMajorGridlines: false } }, series: [ { label: 'Data1'}, { label: 'Data2' }, { label: 'Data3' }, { label: 'Data4' } ], legend: { show: true, location: 'e', background:'#FF9900' }
score: 0
answer count: 1
type: UnansweredQuestion
has title: jqplot - Is it possible to set legend label text color in the chart's settings?
has comment: http://stackoverflow.com/comment/44271204
tagged with: jqplot
has answer: http://stackoverflow.com/a/27899195
type: Question
linked to: http://stackoverflow.com/q/26466989
tagged with: charts
linked to: http://stackoverflow.com/q/10424471
tagged with: textcolor

http://stackoverflow.com/a/30405925
type: Answer
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/55124968
upvote count: 3
has body: Not following why the above answer is marked accepted. The question asks how to accomplish using templateUrl while @PeterAshwell's answer provides a solution with inline HTML that does not work when using templateUrl. To gain access to the isolate scope when using templateUrl, you must wrap the isolateScope call in a $timeout to allow the $http call (made by templateUrl) to complete. Code would look something like: element = $compile("&lt;myHTML /&gt;")($scope) $timeout(function() { expect(element.isolateScope().myProp).toEqual(12); }), 0 , false); $timeout.flush();
answers question: http://stackoverflow.com/q/27697747

file
type: Tag
tag name: file
tags question: http://stackoverflow.com/q/27640350

http://stackoverflow.com/comment/43790230
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27688350
has text: Yes, this is all good, but it still seems like componentDidMount is too early in the life cycle for the plugin to work. I tested putting $.bootstrapSortable() inside a timeout clause of 100 ms, and then it worked. Without the timeout it did not work.

three.js
tags question: http://stackoverflow.com/q/27712241
tags question: http://stackoverflow.com/q/27642270
tags question: http://stackoverflow.com/q/27753101
tag name: three.js
tags question: http://stackoverflow.com/q/27771701
tags question: http://stackoverflow.com/q/27750642
tags question: http://stackoverflow.com/q/27715947
tags question: http://stackoverflow.com/q/27664026
tags question: http://stackoverflow.com/q/27722441
tags question: http://stackoverflow.com/q/27800052
tags question: http://stackoverflow.com/q/27676923
tags question: http://stackoverflow.com/q/27690441
tags question: http://stackoverflow.com/q/27792909
tags question: http://stackoverflow.com/q/27747154
tags question: http://stackoverflow.com/q/27716404
tags question: http://stackoverflow.com/q/27694167
tags question: http://stackoverflow.com/q/27724428
tags question: http://stackoverflow.com/q/27665321
tags question: http://stackoverflow.com/q/27653572
tags question: http://stackoverflow.com/q/27793743
type: Tag
tags question: http://stackoverflow.com/q/27796045
tags question: http://stackoverflow.com/q/27689557
tags question: http://stackoverflow.com/q/27784471
tags question: http://stackoverflow.com/q/27645041
tags question: http://stackoverflow.com/q/27648541
tags question: http://stackoverflow.com/q/27723190
tags question: http://stackoverflow.com/q/27788587
tags question: http://stackoverflow.com/q/27702292
tags question: http://stackoverflow.com/q/27713963

http://stackoverflow.com/comment/43823725
score: 0
has text: I put the code within the switchChange and it works and removed the .val() Thanks for heading me to the right direction.
type: Comment
comment on: http://stackoverflow.com/a/27693766
type: AnswerComment

http://stackoverflow.com/q/27796505
tagged with: youtube
tagged with: video
downvote count: 3
has answer: http://stackoverflow.com/a/39923277
type: Question
has title: Is there anything like youtube-dl, but in pure jquery or js?
score: 10
tagged with: javascript
upvote count: 13
has body: Is there anything like http://rg3.github.io/youtube-dl/ which will allow to get json of youtube movie, get direct links to various format of videos, even with username and password, to private yt movies?
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/43927169
type: QuestionComment
comment on: http://stackoverflow.com/q/27757172
has text: @KimGysen, basically what I'm trying to do resumes to this [simple example](http://jsfiddle.net/dennislaymi/dnvacLaw/2/) . Now, Im pretty sure I should not try to get the value into the variable when the code runs because the value from the _.map is not yet populated (as it is asynchronous). And thats where I'm stucked in the example above. So I need guidance on how to deal with such a situation. Please let me know. Cheers
score: 0
type: Comment

text
tags question: http://stackoverflow.com/q/27772890
tags question: http://stackoverflow.com/q/27770443
type: Tag
tags question: http://stackoverflow.com/q/27748472
tags question: http://stackoverflow.com/q/27781286
tags question: http://stackoverflow.com/q/27759278
tags question: http://stackoverflow.com/q/27653850
tag name: text

http://stackoverflow.com/comment/43811509
type: Comment
has text: Hi Roamer, it works perfectly now. Thank you again for your time and effort, it is greatly appreciated. Regards, IQ
score: 1
comment on: http://stackoverflow.com/a/27685396
type: AnswerComment

http://stackoverflow.com/comment/43797442
has text: Thanks. I got the idea of using ajax. http://cybak.7pz.me/contact_book/pages/index.php
score: 0
comment on: http://stackoverflow.com/a/27691886
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27776847
answer count: 1
tagged with: websocket
has title: On ajax error, cache and try later
tagged with: javascript
tagged with: jquery
score: 0
tagged with: local-storage
type: Question
has answer: http://stackoverflow.com/a/27777039
accepted answer: http://stackoverflow.com/a/27777039
type: AnsweredQuestion
tagged with: caching
has body: I have a mobile project where I have to send ajax-requests one after the other. The project is using a mobile internet connection (egde, 3G), so it can happen that I lost the connection and I have to cache the failed request (in the localStorage), check at intervals for a valid connection and try again the request. At the same time other requests come in (from the Browser), so I have to cache the requests in a queue and send them whole in a row. Sorry for my bad Englisch, I hope you can understand my problem. Any suggestions? Are there any libraries for my problem?

http://stackoverflow.com/q/27709995
answer count: 2
has answer: http://stackoverflow.com/a/27710057
downvote count: 0
tagged with: javascript
has title: Load a javascript method from Android Webview
favorite count: 0
linked to: http://stackoverflow.com/q/827368
possible better answer: http://stackoverflow.com/a/27710057
tagged with: android
score: 2
type: AnsweredQuestion
tagged with: android-webview
has answer: http://stackoverflow.com/a/27710406
upvote count: 2
accepted answer: http://stackoverflow.com/a/27710406
type: Question
has body: I am trying to render a chart in an Android WebView using HighCharts. What my app does should be simple : - Load the HTML page and external (but local) css and js files - Load data from the Java part of the app - Call a javascript function with the previously-loaded data as a parameter I setup my webview by activating Javascript : mWebView.getSettings().setJavaScriptEnabled(true); And also by setting a WebClient to catch javascript's console messages : mWebView.setWebChromeClient(new WebChromeClient() { public boolean onConsoleMessage(ConsoleMessage cm) { Log.d(TAG, cm.message() + " -- From line " + cm.lineNumber() + " of " + cm.sourceId() ); return true; } }); This is my HTML page : Chart I load this page from the app's assets by calling mWebView.loadUrl("file:///android_asset/page.html"); My external CSS file seems to be read and I suppose the external JS files are also correctly loaded I read everywhere that I can call my javascript method anytime by calling mWebView.loadUrl("javascript:plot()"); However, I always get the error Uncaught ReferenceError: plot is not defined -- From line 1 of null Is there anything I might have forgotten ? Note that I load my page and call the javascript method right after the loadUrl call. Thanks !
linked to: http://stackoverflow.com/q/979975

http://stackoverflow.com/a/27711451
score: 1
has body: Examine the object passed to your .fail handler. It will have a property called "entityErrors" when a server-side validation error occurs during saveChanges. Example: entityManager.saveChanges() .then(... do something ...) .fail(function(reason) { console.log(reason.entityErrors); }); If things are wired up correctly breeze will automatically stuff these errors in your object's validationErrors collection. You can access them like this: var errors = entity.entityAspect.getValidationErrors();
answers question: http://stackoverflow.com/q/27711084
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27711084
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/q/27659427
has answer: http://stackoverflow.com/a/27659724
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27659504
has title: How to validate a drag and drop html 5 form?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27659504
score: 3
possible better answer: http://stackoverflow.com/a/27659724
has body: I'm trying to build a form which is based on drag and drop(html5). The form is working properly but I have a issue with the validation, I need to make sure all the form input fields are not empty and to only allow input from the drag and drop option (and not from keyboard). I tried to do that using the required and readonly options but apparently they can't work together. so this is what I got so far, link to fiddle CSS: .div_swap { width:150px; height:30px; padding:10px; border:1px solid #aaaaaa; } .sch { } HTML: fixed drag from here </3> drag me 4 | 1 drag me 5 | 1 drag me 6 | 1 JAVASCRIPT: function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("src", ev.target.id); } function drop(ev) { ev.preventDefault(); var src = document.getElementById(ev.dataTransfer.getData("src")); var srcParent = src.parentNode; var tgt = ev.currentTarget.firstElementChild; ev.currentTarget.replaceChild(src, tgt); srcParent.appendChild(tgt); } function submitNewRoles() { var x = document.getElementsByClassName("sch"); var str =""; for (var i = 0; i < x.length; i++) { str += x[i].innerHTML; if (i< x.length -1) str +=", "; } var y = document.getElementById("GrantRoles"); y.innerHTML = str; } function submitNewRoles2() { var x = $( "#second" ).find(".sch"); var str =""; for (var i = 0; i < x.length; i++) { str += x[i].innerHTML; if (i< x.length -1) str +=", "; } var y = document.getElementById("GrantRoles"); y.innerHTML = str; } function myFunction() { var y = document.getElementById("GrantRoles"); } I would really appreciate your help! thanks!
type: Question
answer count: 2
tagged with: validation
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
upvote count: 3

http://stackoverflow.com/a/27700619
downvote count: 0
has comment: http://stackoverflow.com/comment/43835919
type: Answer
upvote count: 13
has comment: http://stackoverflow.com/comment/43825234
has body: Well. I'll just throw this out there. var add = function(a,b) { return a + b; }; var addThree = function(a) { return add(a,3); }; add(1,2); addThree(4); Maybe it will be ok for some.
has comment: http://stackoverflow.com/comment/43835834
score: 13
answers question: http://stackoverflow.com/q/27699493

http://stackoverflow.com/a/27652364
score: -1
has body: yes, you can, because document.getElementById will return an Object, you can enhance this object if it is not freeze. Please refer to my DEMO
type: Answer
has comment: http://stackoverflow.com/comment/43723722
downvote count: 1
answers question: http://stackoverflow.com/q/27652263
upvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27652263

http://stackoverflow.com/q/27670829
type: UnansweredQuestion
score: 2
downvote count: 0
has title: Adjust screen size based off user's browser
has answer: http://stackoverflow.com/a/27670866
type: Question
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/27673934
tagged with: javascript
has body: Is there any way I can adjust a users screen size once they've visited my website? Basically, If I zoom out of my webpage, my containers and box are off alignment. So I was wondering there was any way to have like a css or javascript feature to where I'd do something like: if screen size is x, then adjust screen size to x
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/43771386
score: 0
comment on: http://stackoverflow.com/q/27674798
type: Comment
has text: or a normal button and onChange
type: QuestionComment

http://stackoverflow.com/q/27697104
type: AnsweredQuestion
has body: I have some images and when I click to a specific image the url changes to that id. But the problem is that I can only go back once (than the same url is repeated everytime I press the back button) and forward button does not work at all. Any idea what I'm doing wrong? &lt;img id="1" src=""&gt; &lt;img id="2" src=""&gt; &lt;img id="3" src=""&gt; $('img').click( function() { update($(this).attr('id')); }); function update(photo_id) { var state = { photo_id: photo_id}, title = "", path = "/mysite/" + photo_id; window.history.pushState(state, title, path); } window.onpopstate = function(event) { var photo_id= document.location.href.split('/').slice(-1)[0]; update(photo_id); }
type: Question
has answer: http://stackoverflow.com/a/27697850
score: 0
has title: On pop state not working properly
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43808366
accepted answer: http://stackoverflow.com/a/27697850

http://stackoverflow.com/comment/43908805
has text: Yes and set the parent with `ClientIDMode="Static"`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27744625

http://stackoverflow.com/a/27693437
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27693372
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27693372
has body: Try changing your link to use an onclick: &lt;a href="javascript:void(0);" onclick="startOnderzoek(); return false;"&gt; Also you need to change your setTimeout to this: setTimeout(volgendePagina, 6000); Having the parenthesis after volgendePagina will cause it to execute immediately and not when the 6 seconds are up. Also in reference to what Paul said about the weghalen function. The parameter is named the same as the variable that you're creating. You might want to consider refactoring the function like so: function weghalen(child) { var element = document.getElementById('starter'); element.parentNode.removeChild(child); } I am also not sure that the logic of weghalen will work as you expect.
type: Answer

http://stackoverflow.com/a/27728627
has comment: http://stackoverflow.com/comment/43869138
downvote count: 0
score: 7
has body: The radio button is unlike a check box because only one element can be selected at a time. But, in order for this to work, the radio buttons must be 'grouped' together. This is done by specifying input elements with the same name. In your example, this can be achieved by changing the following in your HTML: &lt;input type="radio" name="car_type" id="BMW" /&gt; &lt;input type="radio" name="car_type" id="Mercedes" /&gt; No additional Javascript would be necessary to get the desired behavior. Hope this helps offer some additional explanation! Edit: Not sure what you are trying to do, but you can extract the value by simply iterating over the radio elements in Javascript: var r = document.getElementsByName('car_type'); for (var i = 0, i &lt; r.length; i++) { if (r[i].checked) { // insert code to use the checked value alert(r[i].value); break; } }
upvote count: 7
type: Answer
answers question: http://stackoverflow.com/q/27728598
has comment: http://stackoverflow.com/comment/43869179

http://stackoverflow.com/comment/66877566
type: QuestionComment
comment on: http://stackoverflow.com/q/27746982
has text: I just used a CORS proxy . " http://www.corsproxy.com/mangacow.co/wp-content/manga/29/172/0002.jpg" .. instead of the direct url i appended it to the free CORS proxy URL, and that solved the problem.
score: 0
type: Comment

http://stackoverflow.com/comment/43725464
has text: It was not me who downvoted, but let me guess: because you provide the wrong answer.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27654473

http://stackoverflow.com/comment/43960309
type: QuestionComment
has text: @thanapat saeliu You should accept answer, If you got answer to your question. It is the correct way to behave and this way you will give appreciation back to people that put down effort into helping you.
comment on: http://stackoverflow.com/q/27774549
score: 0
type: Comment

http://stackoverflow.com/comment/43821942
comment on: http://stackoverflow.com/a/27678113
score: 1
type: AnswerComment
has text: Thank you everyone who contributed. While all the responses do work, I chose this one for its simplicity. Also, it does not require you to link to the jquery library. Once again, thank you very much.
type: Comment

http://stackoverflow.com/q/27770661
score: 1
tagged with: gruntjs
has comment: http://stackoverflow.com/comment/44033849
tagged with: jshint
type: Question
has comment: http://stackoverflow.com/comment/43971205
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27771002
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43952995
has title: How to tell JSHint to look for definitions in another JS file
linked to: http://stackoverflow.com/q/17709657
tagged with: grunt-contrib-jshint
has body: Here's the problem: I'm using JSHint in Grunt. I have a couple JS files and they'll be merged into one file in the end. But before merging, I would like to run JSHint. However, JSHint complaints some undefined variables. Here's an example: 1. JavaScript/file_one.js defines a variable: var Foo = (function (){}()); 2. JavaScript/file_two.js uses that module. new Foo(). jshint: { files: ['Gruntfile.js', 'javascript/**/*.js', ], options: { // some options. } } JSHint complaints that Foo isn't defined in file_two.js. Here are my goals (if possible): 1. I want to have codes in separate files. So it's possible that some variable is defined in a different file. 2. I want JSHint to check the origin JS files. I don't want to merge all JS files to one and have JSHint to check the merged one. 3. JSHint can check across all files in &lt;%= jshint.files %> (javascript/**/*.js for example) and look for definition. I know one work around that to put Foo as a global in options, as in this post How to tell JSLint / JSHint what global variables are already defined. But I don't want to put the variable I defined there, since every such variable is in my source files. So my question is whether there's a way to achieve my goal 3 to tell JSHint to look for the definition in other files.
has answer: http://stackoverflow.com/a/33549428
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/67627926

http://stackoverflow.com/a/77159571
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27736186
has body: I investigated this error a little further and came to the conclusion that the error comes from here: jQuery.ajaxTransport( function( options ) { ... xhr.open( options.type, options.url, options.async, // This one options.username, options.password ); ... If you set it to true the error dissappears even if you set back to options.async. So maybe a good solve to this problem is using a downloaded version of the jquery file and modify this line (in the 3.2.1 file is on 9400~)

http://stackoverflow.com/q/27687927
upvote count: 2
linked to: http://stackoverflow.com/q/15825562
has comment: http://stackoverflow.com/comment/43790929
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43789326
has body: I'm trying to create a form without a real submit button, but with a styled a href and javascript, but I'm unable to POST the form itself. If I do var_dump($_POST); then I get an array of 4 items (3 inputs and 1 text area). The form itself is not there, so if (isset($_POST['submit'])) valuates to false. I also tried if (isset($_POST['ContactForm'])) but its not working either form code: <input type="text" class="col-md-6 col-xs-12 name" id="naam" name='naam' placeholder='Naam *' value="<? echo $_SESSION['naam']; ?>" required/> <input type="email" class="col-md-6 col-xs-12 Email" id="email" name='email' placeholder='Email *' value="<? echo $_SESSION['email']; ?>" required/> <? echo $_SESSION['vraag']; ?> ledig vakjes Verstuur bericht javascript: function submitForm(e) { if (validateForm()) { document.getElementById("ContactForm").submit(); } e.preventDefault(); } php: session_start(); //Validatie serverside => bescherming inbouwen voor als iemand zijn javascript uitschakelt. Javascript echter wel nodig om de server en netwerktraffic te ontlasten. if (isset($_POST['submit'])) { $naam = $_POST['naam']; //$bedrijf = $_POST['bedrijf']; $subject = $_POST['Subject']; $email = $_POST['email']; $vraag = $_POST['vraag']; //In session steken zodat we bij een eventuele terugkeer naar de form de reeds ingevulde gegevens kunnen terug zetten. $_SESSION['naam'] = $_POST['naam']; //$_SESSION['bedrijf'] = $_POST['bedrijf']; $_SESSION['Subject'] = $_POST['Subject']; $_SESSION['email'] = $_POST['email']; $_SESSION['vraag'] = $_POST['vraag']; $isOK = true; $error = '0'; $atpos = strrpos($email,"@"); $dotpos = strrpos($email,"."); if(is_null($naam) || $naam == '') { $isOK = false; echo('NAAM NIET OK '); $error .= ',1'; } if(is_null($email) || $email == '') { $isOK = false; echo('EMAIL NIET OK '.$email); $error .= ',2'; } else { //checken geldig e-mailadres if ($atpos === false || $dotpos === false || $dotpos < $atpos+2 || $dotpos+2 >= strlen($email)) //=== moet => http://php.net/manual/e…
tagged with: javascript
tagged with: forms
has title: Javascript Submit is not Sending SUBMIT POST to php file
accepted answer: http://stackoverflow.com/a/27688871
tagged with: post
type: Question
has comment: http://stackoverflow.com/comment/43791755
possible better answer: http://stackoverflow.com/a/27688117
has answer: http://stackoverflow.com/a/27688117
has comment: http://stackoverflow.com/comment/43790543
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43789338
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/43789556
has comment: http://stackoverflow.com/comment/43790046
answer count: 4
has answer: http://stackoverflow.com/a/27688254
has answer: http://stackoverflow.com/a/27688499
has comment: http://stackoverflow.com/comment/43790668
score: 2
has answer: http://stackoverflow.com/a/27688871

http://stackoverflow.com/q/27656976
type: Question
has answer: http://stackoverflow.com/a/27657207
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27657246
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: angularjs-ng-repeat
accepted answer: http://stackoverflow.com/a/27657207
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/27665817
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27665817
has body: So my problem is that i use ng-repeat in Angular and every item need to have a certain style. I repeat and create different list items from a JSON which contains name and value. The name and value and shown but every element also has a progress bar. The value (width) of the bar should depend on the value for each element. Here is a fiddle which demonstrates: http://jsfiddle.net/15yb42tj/ As you can see in the fiddle, the width of the bar is 50% (as default in the CSS). However, for example the second element Karl which have the value 4, I want the bar to have a width of 40%. Basically what I want to do for each element is: $scope.bar_style = { 'width' : "(parts.value)*10" } I've been trying different strategies but honestly I have just been shooting in the dark, does anyone here know how to style a certain element in a ngRepeat?
has title: Angular ngRepeat - Unique style for every element

http://stackoverflow.com/comment/129235237
score: 0
type: Comment
has text: @Siniša this is true if you need to support extremely outdated browsers, but the question should also be asked of the business why you're still supporting these old browsers and how might you migrate users to more secure and modern browsers. https://caniuse.com/css-variables
comment on: http://stackoverflow.com/a/70557483
type: AnswerComment

http://stackoverflow.com/a/27650144
answers question: http://stackoverflow.com/q/27649693
type: Answer
upvote count: 1
score: 1
has body: @Guffa is correct. But, there are at least two situations where you can have the appearance of a race condition. Maybe there is an error during the ajax request that isn't handled. Consider some typical XMLHttpRequest code: var request = new XMLHttpRequest(); request.onreadystatechange = function() { if (request.readyState === 4) { if (request.status === 200) { call_success_handler(); } else { call_error_handler(); } } }; request.open("GET", url , true); request.send(null); If the readyState is never '4', then no handlers will be called and no errors will be reported. Your success handler is never triggered, so you assume that the event fired too fast and you didn't notice. It's less common now, but there are also cases where browsers may make you think you have a race condition. The specification says what is supposed to happen in error conditions, but it wasn't always that way. Old / non-conforming XMLHttpRequest implementations behave poorly with oddball network conditions. The initial (ca. 2006) versions of the spec didn't even address network level errors. Hopefully most browsers have conforming implementations now, and hopefully most frameworks should handle error conditions properly. There's a great article by Pearl Chen on asynchronous debugging that's worth a read if you want to dig into it deeper. Also, there's more information on ajax problems here: jQuery $.ajax, error handler doesn&#39;t work.
downvote count: 0

http://stackoverflow.com/comment/43806419
comment on: http://stackoverflow.com/a/27696497
type: AnswerComment
score: 0
type: Comment
has text: Yes, thats it. The effect itself, does it have a name?

http://stackoverflow.com/q/27652827
tagged with: javascript
has title: Pass array from URL to javascript
linked to: http://stackoverflow.com/q/1763508
possible better answer: http://stackoverflow.com/a/27652876
has answer: http://stackoverflow.com/a/27652876
has answer: http://stackoverflow.com/a/27652888
tagged with: php
has comment: http://stackoverflow.com/comment/43722689
has comment: http://stackoverflow.com/comment/43722761
type: AnsweredQuestion
type: Question
score: 0
accepted answer: http://stackoverflow.com/a/27652888
answer count: 2
has comment: http://stackoverflow.com/comment/43722630
tagged with: arrays
has body: How can i pass an array from a GET request like this: [x, y], [x, y]... Into the second part of this google visualization API call. var data = google.visualization.arrayToDataTable([ ['Initial', 'Second'], [8, 37], [4, 19.5], [11, 52], [4, 22], [3, 16.5], [6.5, 32.8], [14, 72]]); Currently i have the values pre-set, but i would like to pass them from a GET request. I have tried using PHP for this however failed using methods like this passing arrays as url parameter as i am not quite sure how to set the x value properly. Below is the script i use to generate the chart: &lt;script&gt; google.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Initial', 'Second'], [8, 37], [4, 19.5], [11, 52], [4, 22], [3, 16.5], [6.5, 32.8], [14, 72]]); var options = { width: 420, height: 420, legend: 'none', trendlines: { 0: {} }, colors: ['#FE2E2E'], hAxis: { textPosition: 'none', gridlines: { color: "#CCCCCC" }, baselineColor: '#CCCCCC' }, vAxis: { textPosition: 'none', gridlines: { color: "#CCCCCC" }, baselineColor: '#CCCCCC' }, enableInteractivity: false }; var chart = new google.visualization.ScatterChart(document.getElementById('chart_div')); chart.draw(data, options); } &lt;/script&gt;

http://stackoverflow.com/q/27724345
has comment: http://stackoverflow.com/comment/43860909
has title: get value of javascript variable and pass it to modal from view to get the list
type: Question
upvote count: 2
answer count: 1
tagged with: javascript
tagged with: drop-down-menu
tagged with: model
has answer: http://stackoverflow.com/a/27724670
favorite count: 0
tagged with: playframework-2.2
score: 2
downvote count: 0
type: UnansweredQuestion
tagged with: parameter-passing
has body: I have 3 select dropdown fields Country,State,City.Onload of the page only country field is enabled (city and state fields are disabled)then if user select country then state field is enabled(with all the states mapped on that country stored in my database) then if user select state then city field is enabled(with all the city mapped on the on that state stored in my database).My dropdowns code are Select country @for(country <- countryList) { @country.getName } Select country @for(state<- Country.findStateByCountryId(get value of cid from setDropdownState function)) { @state.getName } Select country @for(city<- State.findCityByStateId(get value of sid from setDropdownCity function)) { @state.getName } scripts $(document).ready(function() { $("#state_id").attr("disabled", true); $("#city_id").attr("disabled", true); }); function setDropdownState() { var cid = $("#country_id").val(); if (cid != "select") { //pass value to state dropdown $("#state_id").attr("disabled", false); } else { $("#state_id").attr("disabled", true); $("#city_id").attr("disabled", true); } } function setDropdownCity() { var sid = $("#state_id").val(); if (sid != "select") { //pass value to citydropdown $("#city_id").attr("disabled", false); } else { $("#city_id").attr("disabled", true); } } So I have to pass country_id value onchange of country select box to get state field for loop value Country.findStateByCountryId(get value of cid from setDropdownState function) and in the same way pass state_id on change of state field to city field for loop to get the desired city on that particular state State.findCityByStateId(get value of sid from setDropdownCity function). So how can I pass javascript value to model?? Is It possible?? Or is there any other way to do this?? Thanks

http://stackoverflow.com/q/27695829
has answer: http://stackoverflow.com/a/27695887
tagged with: javascript
tagged with: special-characters
possible better answer: http://stackoverflow.com/a/27695910
accepted answer: http://stackoverflow.com/a/27695857
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27695910
upvote count: 0
has body: I've been trying to find a way to do this for about an hour now, but maybe I'm not phrasing it right. I want to match all special characters EXCEPT -_+#&amp;! example set: !@#$%^&amp;µ*&amp;+=_-()}{~`¡€$* regex should select: @$%^µ*=()}{~`¡€$*
favorite count: 0
type: Question
tagged with: regex
score: -1
tagged with: escaping
has title: Javascript regular expression: match any not-word except allowed special characters
has answer: http://stackoverflow.com/a/27695857
answer count: 3
tagged with: regex-negation
downvote count: 1

http://stackoverflow.com/a/27750512
answers question: http://stackoverflow.com/q/27750016
upvote count: 1
score: 1
downvote count: 0
type: Answer
has body: I'm not sure if this is what you want: please comment below "My Very Long Board".split(' ').map(function(word){ return word[0]; }).join('').slice(0, 3)

http://stackoverflow.com/comment/43788321
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27687111
score: 0
has text: Stick to the site rules and you'll be OK.

http://stackoverflow.com/comment/43997316
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27793962
has text: should it not be a <= for 8 ?
score: 0

http://stackoverflow.com/a/27677120
score: 1
accepted answer of: http://stackoverflow.com/q/27676527
answers question: http://stackoverflow.com/q/27676527
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43768684
has body: First of all you should replace mytabs with mytabs2 in your jquery code because you dont have a mytabs class. After that change shown.bs.tab to click because you want to redraw the donut when a tab is clicked. And at last, move your click function into the $(function () because the variables donut1,donut2, etc are not accessible outside function(): $(function () { $('ul.mytabs2 a').on('click', function (e) { var types = $(this).attr("data-identifier"); var typesArray = types.split(","); $.each(typesArray, function (key, value) { eval(value + ".redraw()"); }) }); }); Here's the working example: DEMO
type: Answer
downvote count: 0

http://stackoverflow.com/q/27748368
upvote count: 5
has comment: http://stackoverflow.com/comment/43907974
tagged with: parse-platform
downvote count: 0
has answer: http://stackoverflow.com/a/27748786
accepted answer: http://stackoverflow.com/a/27748786
has comment: http://stackoverflow.com/comment/43908160
has comment: http://stackoverflow.com/comment/43908032
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/15100020
type: Question
score: 5
has comment: http://stackoverflow.com/comment/43908475
tagged with: angularjs-service
answer count: 1
has body: My service needs to retrieve a value asynchronously, but once I have it, I'd like to used a cached version of the value. When two controllers call this service, I'd expect the first one to cache the retrieved value and the second one to use the cached value, but according to the log, I never find a cached value. When this runs, I see a log message that shows the value being cached, then, when I follow an angular route to a different controller, I do not see that the service finds the cached value. Why does it not run according to my expectation**?** angular.module('myApp.services').factory('Config', function() { var Config = { }; Config.currentYear = function() { if (Config._currentYear) { // sadly, we never execute here console.log("returning cached year"); return Parse.Promise.as(Config._currentYear); } return Parse.Config.get().then(function(config) { console.log("caching year"); Config._currentYear = config.get("currentYear"); return Config._currentYear; }); }; return Config; }); A couple notes: (1) I named the cached attribute _currentYear, adding the underscore to avoid colliding with the function name. Not sure if I need to do that. (2) I return a fulfilled promise when the value is cached, so the function always returns a promise...also not sure if that's needed, but figure it can't hurt.
has title: Angular service cache a value
tagged with: javascript
favorite count: 0
tagged with: promise
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43908379
has comment: http://stackoverflow.com/comment/43908195

http://stackoverflow.com/comment/43813783
type: Comment
type: QuestionComment
has text: I don't know how to view the console on the iphone...
comment on: http://stackoverflow.com/q/27700435
score: 0

http://stackoverflow.com/comment/43730779
type: QuestionComment
has text: Use any transversal method to target specific element regarding specific clicked element using `this` in click handler. Now you have to post relevant HTML markup in question itself. This is completly useless for futur readers to only post link to any thirs party website. What if your HTML markup site changes???
score: 0
comment on: http://stackoverflow.com/q/27657497
type: Comment

http://stackoverflow.com/q/27739776
has comment: http://stackoverflow.com/comment/43890298
has answer: http://stackoverflow.com/a/27739790
favorite count: 0
downvote count: 8
has comment: http://stackoverflow.com/comment/43890371
tagged with: http://stackoverflow.com/tag/html
has body: I want to block user to open new tab, close tab or browser window for 30 sec when user is on my home page in jquery, javascript. Kindly suggest.
type: UnansweredQuestion
score: -8
has title: Do not open new tab, close tab or close browser window
tagged with: php
has comment: http://stackoverflow.com/comment/43890646
type: Question
linked to: http://stackoverflow.com/q/1565304
has comment: http://stackoverflow.com/comment/43890359
upvote count: 0
has comment: http://stackoverflow.com/comment/43890397
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43890355

http://stackoverflow.com/a/27646568
score: 13
has body: That sounds fine, but there are some rules you need to follow (and you can only use plugins that follow these rules): don't remove/replace/move any nodes React creates don't create siblings to React nodes, especially between or before react nodes do create nodes, add event listeners, modify dom in componentDidMount and/or componentDidUpdate do remove nodes, remove event listeners, in componentWillUnmount do create and append nodes manually in componentDidMount to pass to jQuery plugins don't modify DOM outside of react components do pass a callback to setState (argument 2) to do something after react updates it (but prefer componentDidUpdate) For manually mounted React components (via React.render) don't mount a react component as a child of a plugin controlled element with no lifecycle hooks do use React.unmountComponentAtNode to clean up React components before removing their parent from the DOM do pass a callback to React.render (argument 3) if you must do something after the component is mounted Please edit the question if I missed anything, or included a rule you feel is invalid.
has comment: http://stackoverflow.com/comment/43717339
upvote count: 13
accepted answer of: http://stackoverflow.com/q/27646347
has comment: http://stackoverflow.com/comment/43717476
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27646347
has comment: http://stackoverflow.com/comment/43723424
type: Answer

http://stackoverflow.com/q/27797392
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/44004469
tagged with: http://stackoverflow.com/tag/html
has title: cannot initialise jQuery knob in jquery moble page
has comment: http://stackoverflow.com/comment/44004625
favorite count: 0
has comment: http://stackoverflow.com/comment/44004699
has answer: http://stackoverflow.com/a/27798623
has answer: http://stackoverflow.com/a/27798711
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27798623
has body: I am trying to use jquery knob plugin to display a circle through which the user can post a rating. But I cannot get it to display. I'm posting my code here, please tell me whats wrong. PS : I'm using JQuery Mobile. So the page is being loaded via Ajax. Please keep that in mind. Rate and Review Rate & Review Your Rating : write a review :
upvote count: 1
possible better answer: http://stackoverflow.com/a/27798711
has comment: http://stackoverflow.com/comment/44004995
downvote count: 1
type: Question
answer count: 2
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44003993

http://stackoverflow.com/comment/43719871
comment on: http://stackoverflow.com/q/27649815
score: 0
type: Comment
type: QuestionComment
has text: Can you put 'Alert' in your js function and see if it pops before postback?

http://stackoverflow.com/q/27677744
tagged with: bison
has answer: http://stackoverflow.com/a/27678039
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27678039
answer count: 1
tagged with: javascript
has body: I am authoring a parser using Jison which allows me to parse a fairly complex expression language. In this language, it supports grammar like: stats_expression : stats_function '(' eval_expression ')' | other_stats_aggregation ; stats_function : SUM | AVERAGE | ... ; Here the eval_expression is very complex (with features like nested eval, logic expression, etc), and I don't care the contents of eval_expression and don't want to spend too much effort parsing it. I would like to only obtain other information such as stats_function name in the above grammar. My question is if there is any way in Jison that allows me to do some wildcard matching to match the entire eval_expression easily without writing full lexer/grammar specification for the eval_expression? NOTE: Solution like using regular expression instead of Jison to do this job does not work for me because I need to parse other_stats_aggregation part above in the language too which I write the entire grammar/parser for it. Any help is appreciated.
tagged with: flex-lexer
score: 0
tagged with: jison
has title: Ask Jison to ignore some unnecessary details
tagged with: parsing

http://stackoverflow.com/comment/43868343
score: 0
comment on: http://stackoverflow.com/q/27727909
type: QuestionComment
has text: Why are you counting the number of times your `convert` function is called? It won't be called once per line. Streams typically operate on streams of bytes - they don't even care whether its ASCII, so newlines don't mean anything special. Also, `nextTick` is almost certainly not the answer here. It sounds like you're suffering from http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem - please try to describe the problem you're trying to solve.
type: Comment

http://stackoverflow.com/comment/43906279
has text: Still no luck using "*://*.youtube.com/watch?v=*" either :( Thanks for the suggestions, I really do appreciate it.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27747290

http://stackoverflow.com/comment/43883372
has text: Assigning to `.innerHTML` doesn't run scripts in the HTML.
comment on: http://stackoverflow.com/q/27735858
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43789113
type: QuestionComment
comment on: http://stackoverflow.com/q/27687579
has text: A short answer would be to have a single `audio` element on the page and work out some `Javascript` to change its `src` attribute according to the clicked part on the image.
score: 0
type: Comment

http://stackoverflow.com/a/35598353
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27668037
type: Answer
upvote count: 1
has body: This one should work:

http://stackoverflow.com/comment/43700903
has text: Place a log statelement like `console.log('Loading controller')` statement at the top of your `phoneController.js`. Check if you see that before or after the angular error in the console. If it comes second that's your problem. Fixing it could be tricky, you could try manually bootstrapping from the success callback of `$.load`, but I don't know if that waits for *all* the script tags to run.
comment on: http://stackoverflow.com/q/27640947
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27731827
type: Answer
has body: Your parseXml function will return null if neither window.ActiveXObject nor window.DOMParse exists function parseXml(str){ if (window.ActiveXObject){ var doc = new ActiveXObject('MicrosoftXMLDOM'); doc.loadXML(str); return doc; }else if (window.DOMParse){ return (new DOMParser).parseFromString(str,'text/xml'); } }; You have a typo DOMParse should be DOMParser (like it is in the tutorial you reference) function parseXml(str){ if (window.ActiveXObject){ var doc = new ActiveXObject('MicrosoftXMLDOM'); doc.loadXML(str); return doc; }else if (window.DOMParser){ return (new DOMParser).parseFromString(str,'text/xml'); } };
answers question: http://stackoverflow.com/q/27731258
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27731258

http://stackoverflow.com/a/27793202
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27789017
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27789017
type: Answer
has body: Rough solution, but a start - http://jsfiddle.net/bkseqsu4/ Javascript: // Variables var windowHeight = $(window).height(); var headerHeight = $('.siteHeader').outerHeight(); var paneHeight = windowHeight - (headerHeight / 2); var scrollLock = 0; var paneIndex = 0; var lastScroll = 0; var panes = ['.pane.bgBlue', '.pane.bgGreen', '.pane.bgRed']; /** * Lock scroll position for each pane * as the user scrolls down. */ $.fn.scrollView = function() { this.each(function() { $('html, body').animate({ scrollTop: $(this).offset().top }, 1000, "swing", function() { setTimeout(function() { scrollLock = 0; var currentPosition = $(this).scrollTop(); lastScroll = currentPosition; }, 100); }); }); } // `.scroll()` function $(window).scroll(function() { if (scrollLock == 0) { var currentPosition = $(this).scrollTop(); if (currentPosition &gt; lastScroll) { paneIndex = paneIndex + 1; } else { paneIndex = paneIndex - 1; } scrollLock = 1; $(panes[paneIndex]).scrollView(); } });
has comment: http://stackoverflow.com/comment/44018196

http://stackoverflow.com/q/27757888
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43926655
has comment: http://stackoverflow.com/comment/43928432
has comment: http://stackoverflow.com/comment/43926905
has answer: http://stackoverflow.com/a/27757950
type: UnansweredQuestion
has body: i am working on my mobile site there is a jquerymobile script, is conflict with other libraries. all function working without this script. here is my site : http://bit.ly/1ETOzRf ... please guide me,
has comment: http://stackoverflow.com/comment/43926899
type: Question
has title: Jquery Mobile conflict with other javascript
has comment: http://stackoverflow.com/comment/43928270
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27791383
has title: closing issue with modal in modal - bootstrap
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27791994
accepted answer: http://stackoverflow.com/a/27791994
type: Question
tagged with: modal-dialog
has comment: http://stackoverflow.com/comment/43993429
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43992661
score: 0
answer count: 1
tagged with: css
tagged with: twitter-bootstrap
has body: I have a customer visits list page, in which add visit invokes a bootstrap popup ("#Pop1") to record visit details. In the modal, I have provision to add new customer (on the fly), which in turn opens another popup ("#Pop2") to capture new customer details. On successful save of the new customer (via AJAX) I show an alert (browser alert) and close new customer popup using $("#Pop2").hide();. On successful save of visit, I show an alert and close the add visit popup using $("#Pop1").hide();. I have a couple of issues in this context. (critical) Pop1 -> Pop2 -> Save -> Save. In this scenario, it returns to the listing page, but the page is not accessible. a transparent layer (that came with Pop1) was still overlay on the page. I need to refresh entire page to add another visit. When I close the Pop2 using close button, it closes both the popups. Is there a piece of JS or CSS I need to apply to get this work properly?

http://stackoverflow.com/comment/44065200
type: Comment
has text: I try it but not want to work.. I not understand why
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27789078

http://stackoverflow.com/comment/43707668
has text: Thank you for solving my problem and not just giving me the easiest solution. I didn't know there was a trim method. I'll look into that some more.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27644496
score: 1

http://stackoverflow.com/comment/44010381
score: 0
type: AnswerComment
type: Comment
has text: Actualy, I believe that there is no need to inject $state into another service and bound it to another property if you don't want to change or extend its properties. Just inject it anywhere you need it.
comment on: http://stackoverflow.com/a/27799035

http://stackoverflow.com/a/27803989
has body: You can intercept and adjust the scale inside the redraw function: function redraw() //-redraw network { var trans=d3.event.translate; var scale=d3.event.scale; var newScale = scale / 2; zoom.scale(newScale); svg.attr("transform","translate(" + trans + ")" + " scale(" + newScale + ")"); //-translates and scales } Or if you want more specific interpolation, you can add an interpolator like d3.linear.scale() into the redraw function: function redraw() //-redraw network { scaleInterpolator = d3.linear.scale().domain([1,10,100,1000]).range9([1,3,9,99]); var trans=d3.event.translate; var scale=d3.event.scale; svg.attr("transform","translate(" + trans + ")" + " scale(" + scaleInterpolator(scale) + ")"); //-translates and scales }
has comment: http://stackoverflow.com/comment/44042233
score: 0
has comment: http://stackoverflow.com/comment/49923326
answers question: http://stackoverflow.com/q/27798222
type: Answer
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/43959937
comment on: http://stackoverflow.com/q/27774464
score: 1
has text: `id's` should be unique, you could use `pref_subject_1` and so on. Then use the `name` part in the `selector` instead of the `id`(without []).
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27783507
type: Answer
answers question: http://stackoverflow.com/q/27783379
score: 0
has body: After the page load, there's no major difference between "adding an script node" or "executing a piece of script". If you do want to add the &lt;script&gt;node in &lt;head&gt;, you could use the DOM API.

http://stackoverflow.com/comment/43956479
type: AnswerComment
comment on: http://stackoverflow.com/a/27772699
score: 0
type: Comment
has text: In your solution, the weather report widget is not shown. And the map controls are enabled...right?

http://stackoverflow.com/q/27698250
has title: Array w/ all elements (except the first) undefined returns wrong length
has answer: http://stackoverflow.com/a/27698394
has comment: http://stackoverflow.com/comment/43809736
duplicate of: http://stackoverflow.com/q/7246618
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/7246618
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/43809685
accepted answer: http://stackoverflow.com/a/27698394
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/43809716
tagged with: javascript
score: 4
has body: var arr = ["string", , ] console.log(arr.length) Why is the length of arr 2 and not 3?
has comment: http://stackoverflow.com/comment/43809668
answer count: 1
favorite count: 0

http://stackoverflow.com/a/75422836
has body: The backtick character (`) in JavaScript is used to define template literals. A template literal is a special type of string that allows you to embed expressions, which are evaluated and included in the final string. They are denoted by being surrounded by the backtick (`) character instead of single quotes (') or double quotes (&quot;). Here's an example of using a template literal to embed an expression in a string: const name = "Akila"; const message = `Hello, ${name}!`; console.log(message); // Output: Hello, Akila! In the example above, the expression ${name} is evaluated and included in the final string, which is assigned to the message variable. Template literals also provide several convenient features, such as multi-line strings and string interpolation. Multi-line strings allow you to include line breaks in your strings, which is especially useful for creating formatted text. Here's an example of using a multi-line string with a template literal: const message = `This is a multi-line string.`; console.log(message); output This is a multi-line string. In conclusion, the backtick character (`) in JavaScript is used to define template literals, which are a convenient way to include expressions and multi-line strings in your JavaScript code.
upvote count: 4
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/133170043
has comment: http://stackoverflow.com/comment/133147252
answers question: http://stackoverflow.com/q/27678052
type: Answer

http://stackoverflow.com/a/27770346
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27770266
type: Answer
upvote count: 2
has body: Instead of "Calpol Plus 200MG".split('\\s+(?=\\d+M[LG])') You must use one of these: RegExp constructor to convert your string to a regular expression: "Calpol Plus 200MG".split(RegExp('\\s+(?=\\d+M[LG])')) Directly use a regular expression literal: "Calpol Plus 200MG".split(/\s+(?=\d+M[LG])/) Note in this case you don't need to scape the \ characters with another \.
score: 2
answers question: http://stackoverflow.com/q/27770266

http://stackoverflow.com/q/27760868
tagged with: css
type: UnansweredQuestion
type: Question
has body: I have been trying to use this fading slideshow code that I have found from this website.. http://blog.crondesign.com/2012/01/free-javascript-for-rotating-website.html My main problem is that my divs will not stack on top of each other and I have researched of different ways like z-indexing and position:absolute and none of them seem to work. Can someone please have a look at my code to see what isn't working! HTML: CSS #slideshow_container { height:486px; width: 806px; margin-top: 0%; margin:auto; background-color:green; display:block; } .banner { z-index:1; height:486px; width:806px; top:0px; background:#FFF; border:solid 1px #CCC position: absolute; } #banner1 { background:green; z-index: 5; } #banner2 { background: blue; z-index:6; } #banner3 { background:#F90; } #banner4 { background:#FFC; } #banner5 { background:#99CCFF; } #slideshow_container { height:486px; width: 806px; margin-top: 0%; margin:auto; background-color:green; display:block; } .banner { z-index:1; height:486px; width:806px; top:0px; background:#FFF; border:solid 1px #CCC position: absolute; } #banner1 { background:green; z-index: 5; } #banner2 { background: blue; z-index:6; } #banner3 { background:#F90; } #banner4 { background:#FFC; } #banner5 { background:#99CCFF; } Javascript var imageCount = 5; //how many images in total? var changeSpeed = 3; //how many seconds between fades? var fadeSpeed = 0.5; //how many seconds should the fade take? var fps = 25; //animation frames per second //BANNER FUNCTIONS: var topImgID var changeInterval function $(id) { return(document.getElementById(id)); } function changeOpac(obj, opacity) { obj = obj.style; obj.opacity = (opacity / 100); obj.MozOpacity = (opacity / 100); obj.KhtmlOpacity = (opacity / 100); obj.filter = "alpha(opacity=" + opacity + ")"; } function changeImage() { var nextImgID = ( topImgID+1 <= imageCount ? topImgID+1 : 1 ); //get id number of next image in list var nextImg = $('banner'+nextImgID); var lastImg = $('banner'+topImgID); var opac = 0…
answer count: 1
tagged with: slideshow
tagged with: javascript
has answer: http://stackoverflow.com/a/27760900
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Slideshow function, stacked divs

http://stackoverflow.com/q/27650640
type: AnsweredQuestion
type: Question
has body: I have just started my backbone tutorials, and on first assignment i have to display a lit of ul on the page. i have write the following code, the browser didn't show any errors but also didn't display the list on the screen. Can somebody inspect my code , where i am doing wrong. Pass Data to Views <!-- =============== //
has title: Passing Data to Views in Backbone Js does not see in the browser
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: backbone.js
has answer: http://stackoverflow.com/a/27650743
upvote count: 2
score: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/27650743

http://stackoverflow.com/comment/43758856
type: QuestionComment
has text: Hey, you're in Cambridge? You ever get to see John Lennox speak? Man, I totally envy you - would love to study math with that guy. I will update the question to address your points - much appreciated.
comment on: http://stackoverflow.com/q/27670009
score: 0
type: Comment

http://stackoverflow.com/comment/43837008
score: 0
type: Comment
type: QuestionComment
has text: Questions about efficiency are usually tough for SO because it's hard to answer conclusively. That said, my primary reaction is that I'd consider `happyGreet(...)` in general to be a mistake. If a function is on an instance, you probably shouldn't go assigning it to a variable, if if you do, you should `.bind` it there at the assignment location, or do `happyGreet.call(happy, "Denny")`
comment on: http://stackoverflow.com/q/27712385

yammer
type: Tag
tags question: http://stackoverflow.com/q/27717130
tag name: yammer

http://stackoverflow.com/comment/43987432
comment on: http://stackoverflow.com/q/27788570
score: 0
has text: This is not keyboard accessible. Put ` `s in the ` `s and attach the click handler to the buttons instead.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43963659
has text: `option` elements don't have an `href` attribute. If you want to put arbitrary information on elements, use [`data-*` attributes](http://www.w3.org/TR/html5/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes).
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/27776520
type: Comment

http://stackoverflow.com/comment/43833073
type: Comment
type: QuestionComment
has text: From a browser perspective I believe it does cache since load() is a shorthand for ajax() which defaults the cache option to true. The actual behaviour of this will vary by browser and web server.
score: 0
comment on: http://stackoverflow.com/q/27709880

http://stackoverflow.com/comment/43722780
has text: what problem u face. please mention. It will help to solve your problem.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27652929

http://stackoverflow.com/comment/43855268
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27721735
has text: for exmpale: if(1s sM==\'1u\')
score: 0

http://stackoverflow.com/q/27782022
has body: I need to check the data returned is sorted by date. This is how I'm writing it: it('should be sorted by date', function() { element.all(by.repeater('users in group.users')).then( function(users) { var lastUser = users[0].element(by.id('birth-date')).getText(); for (var i = 1; i &lt; users.length; ++i) { var currentUser = users[i].element(by.id('birth-date')).getText(); expect(moment(currentApplication).format('MMM d, YYYY HH:mm')).toBeGreaterThan(moment(lastApplication).format('MMM d, YYYY HH:mm')); lastUser = currentUser; } } ) }) This returns: Expected 'Jan 1, 2015 00:00' to be greater than 'Jan 1, 2015 00:00'. What am I doing wrong? currentUser and lastUser seem to be objects instead of text...but I'm not sure why.
upvote count: 6
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/31610966
accepted answer: http://stackoverflow.com/a/27782516
has answer: http://stackoverflow.com/a/31610966
type: Question
tagged with: testing
tagged with: protractor
has answer: http://stackoverflow.com/a/50796610
downvote count: 0
tagged with: javascript
tagged with: end-to-end
answer count: 3
has answer: http://stackoverflow.com/a/27782516
has title: Protractor: Checking data is sorted by date
favorite count: 0
tagged with: angularjs
score: 6

http://stackoverflow.com/q/27771893
downvote count: 0
answer count: 0
tagged with: javascript
type: UnansweredQuestion
score: 1
favorite count: 0
type: Question
tagged with: d3.js
upvote count: 1
tagged with: parallel-coordinates
has comment: http://stackoverflow.com/comment/43974982
has body: I have a 3 axes in the parallel coordinates Name, Frequency Range and Band..I am trying to do two things here: { "kind": "t3", "data": { "name": "Band2", "frequencyRange": "20-52", "Band": "FM" } }, { "kind": "t3", "data": { "name": "Band3", "frequencyRange": "1-11", "Band": "AM" } }, { "kind": "t3", "data": { "name": "Band4", "frequencyRange": "1.5-4.25", "Band": "AM" } } Draw two lines to show the range (Eg : For Band 2 : A line connecting Band2,20,FM and another line connecting Band2,52,FM Shade the region between the two lines. Sample : http://lalithkaushik.com/d3/ I tried to paste the script part here, but stack overflow would not let me do it. http://lalithkaushik.com/d3/code.html Any suggestions would really help and appreciated.. Many thanks
has title: D3 Parallel Coordinates : Drawing two lines to show a range and shading the region between them

http://stackoverflow.com/comment/44008447
has text: attr disabled is just for type buttons doesn't work on div ... you will need to use off()
score: 1
comment on: http://stackoverflow.com/q/27799915
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43704481
has text: Rather than setting the property directly and looping, much simpler to add and remove a class, e.g. remove the class from `'input.selectedClass'` and then `this.addClass('selectedClass')`. The OP may need add/remove class functions.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27642802
type: Comment

http://stackoverflow.com/a/27757399
upvote count: 2
has comment: http://stackoverflow.com/comment/43969521
has comment: http://stackoverflow.com/comment/43973737
answers question: http://stackoverflow.com/q/27719767
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27719767
has body: You are looking for toLocalPoint, which does most of the work for you : http://fabricjs.com/docs/fabric.Object.html#toLocalPoint As you can see in the source of the function, it does not take into account scaling, but it does the rotation and translation of the object. var p = canvas.getPointer(event); var loc = target.toLocalPoint(new fabric.Point(p.x,p.y), "left", "top"); var pos_in_target = { x : loc.x / target.getScaleX(), y : loc.y / target.getScaleY() };
type: Answer
score: 2

http://stackoverflow.com/comment/43867137
type: QuestionComment
has text: Your “goal” is more or less your main problem here IMHO. Get used to the idea, that a website does not look the same on all possible screen sizes – and it does not have to. “Insisting” on having the layout in your example even on really small screens would be rather stupid. The user does not benefit from you trying to force your fixed layout onto their tiny screen no matter what. Your time would be better invested in trying to find a different layout for smaller screens, that _does_ work, and does not need ridiculous measures like calculating all measurements via JS.
score: 0
comment on: http://stackoverflow.com/q/27727583
type: Comment

http://stackoverflow.com/comment/43788787
type: QuestionComment
has text: True, this only works with a get of course.
comment on: http://stackoverflow.com/q/27687458
score: 0
type: Comment

http://stackoverflow.com/comment/43894772
has text: It shouldn't in modern browsers. Assignment without units should be ignored.
comment on: http://stackoverflow.com/a/27741901
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43997336
type: QuestionComment
score: 1
has text: The `scan` method appears inside the object definition, which ends only at the line containing `};`.
comment on: http://stackoverflow.com/q/27794074
type: Comment

http://stackoverflow.com/a/27899195
answers question: http://stackoverflow.com/q/27800816
has body: before all add this seriesColors: [ "#F90E2A", "#10C40D", "#3886BB", "#F90E2A", "#ffffff", "#ffffff", "#ffffff", "#ffffff", "#ffffff", "#CDD6E0", "#ffffff"],
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44292985
has comment: http://stackoverflow.com/comment/44308064
has comment: http://stackoverflow.com/comment/44241604

http://stackoverflow.com/q/27734278
accepted answer: http://stackoverflow.com/a/27734443
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: toggleMe Issue on html
tagged with: css
has body: I need some help with toggleMe function ,, After i click button two the other that is open to hide not open all one by one ,,, *sorry for my bad english * my js my html 111111111111 22222222222222 3333333333333 444444444444 "
favorite count: 0
has answer: http://stackoverflow.com/a/27734443
score: -3
tagged with: php
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/43880226
type: Question
tagged with: javascript
tagged with: jquery
downvote count: 3

http://stackoverflow.com/comment/44004961
has text: @dystroy gave you the answer, just use the chrome console and copy paste the string (not the array) and evaluate it.
score: 1
comment on: http://stackoverflow.com/q/27797971
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27650932
score: 0
has body: How to transfer data from the html-forms in the body of the e-mail template in meteor.js? The documentation is an example: Meteor.call('sendEmail', 'alice@example.com', 'bob@example.com', 'Hello from Meteor!', 'This is a test of Email.send.'); But it does convey only advance by string values. How to transfer data from the form?
tagged with: email
tagged with: meteor
has answer: http://stackoverflow.com/a/27651451
type: UnansweredQuestion
type: Question
tagged with: forms
has title: Transfer data from html-forms by mail in meteor.js
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/43754991
has text: Hmh, so In My case I write if(isset($_POST['add'])){ $add= $_POST['add']; } But then where do I place the Code Before the } :?
type: Comment
comment on: http://stackoverflow.com/a/27670079
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43749240
has text: Oh, still does not work, first asks do you want to run/open/save, when I click open comes up with error message - Publisher could not be verified
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27666998
type: Comment

http://stackoverflow.com/comment/43830053
comment on: http://stackoverflow.com/q/27709126
score: 0
type: Comment
type: QuestionComment
has text: What's your try and can you provide the data as is, I don't know what you're having, an array of objects or array of arrays?

http://stackoverflow.com/comment/43811634
type: Comment
type: QuestionComment
has text: Hmm, the problem isn't immediately obvious to me then. I was thinking the problem is that you're logging an object that has properties on its prototype which wouldn't show up in the log, but would work fine in actuality.
score: 0
comment on: http://stackoverflow.com/q/27699261

http://stackoverflow.com/a/27671984
type: Answer
has comment: http://stackoverflow.com/comment/43775946
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/27669482
answers question: http://stackoverflow.com/q/27669482
has comment: http://stackoverflow.com/comment/43787984
has body: The key to get this working is to change the assortment variable to a reactive data source. When a reactive data source is reset in Meteor, the functions depending on it are rerun. When a plain vanilla variable is reset, functions are not rerun. Your two options here are to make assortment a Session key, or to make it a ReactiveVar. You should take a look at the documentation for each and choose the one that fits best for you: http://docs.meteor.com/#/full/session http://docs.meteor.com/#/full/reactivevar There are some noteworthy differences between the two, e.g., ReactiveVar requires a package to be installed and will not rerun when the value is reset to the same value as existed previously. But to demonstrate the pattern with Session, you will want to set it initially: Session.setDefault('assortment', true); In your template helpers, get the value: doTasks: function() { return Tasks.find({section: "do", done: Session.get('assortment')}, {sort: {createdAt: -1}}); } And set it in your template event: "change select": function(event) { var assortment = (event.target.value) ? event.target.value : true; Session.set('assortment', assortment); }

http://stackoverflow.com/q/27754634
tagged with: directive
has title: Pass External Function into Angular Directive
tagged with: javascript
type: Question
score: 0
tagged with: function
answer count: 1
tagged with: angularjs
has body: I'm struggling to find an elegant way of passing an external/out-of-scope/non angular function into a directive. So far the only way I could see to do this was by passing the function name as a string into angular and then using eval which does not seem so nice. Here is an example of that on Plunker http://plnkr.co/edit/L9GGDkxwh4IGNufXB8yg?p=preview Using extFunc:'&amp;' in the scope only work for functions in the scope so that does not work for me. Is there a better way of doing this? I realise in my example one would just include the function inside the directive or controller but this is not always practical. &lt;script&gt; function nonAngularFunction( someText ) { alert( someText ); } &lt;script&gt; &lt;my-directive ext-func="nonAngularFunction('Hi there')" &gt;&lt;/my-directive&gt; Sorry if this question has already been asked but I could not find a solution anywhere.
has answer: http://stackoverflow.com/a/27754714
type: UnansweredQuestion

http://stackoverflow.com/q/27797823
favorite count: 0
has comment: http://stackoverflow.com/comment/44101064
has answer: http://stackoverflow.com/a/27798168
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44023488
has title: Monkey-patching a named function that's called immediately
type: Question
score: 3
accepted answer: http://stackoverflow.com/a/27798908
tagged with: javascript
tagged with: monkeypatching
has comment: http://stackoverflow.com/comment/44057056
has body: A script I'm loading is misbehaving. It's got a structure like this: function bad_function() { ... } /* randomly generated stuff */ bad_function(); How do I modify the behavior of bad_function if it's called immediately at the end of the script? I thought of creating a silently read-only property on window before loading the script, but this throws a TypeError: Identifier 'bad_function' has already been declared exception when the above script is executed: Object.defineProperty(window, 'bad_function', { value: function() { /* my monkey-patched code */ } }); How do I monkey-patch this function?
upvote count: 3
answer count: 2
has answer: http://stackoverflow.com/a/27798908
downvote count: 0
possible better answer: http://stackoverflow.com/a/27798168
has comment: http://stackoverflow.com/comment/44015132

http://stackoverflow.com/q/27701655
linked to: http://stackoverflow.com/q/20863288
has title: Responsive Bootstrap Push Menu
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: css
has body: i m trying to create Responsive Bootstrap Push Menu , i have created this templete and this for computer and for mobile it look like this so when we click dropdown it should push to the left side and show the dropdown menu list this is code i have tried <div class="container Toggle navigation submit Link Link Dropdown Action Another action Something else here Another action Something else here Another action Something else here Another action Something else here but i m not able to push to left side.
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27701872
has comment: http://stackoverflow.com/comment/43817003
score: 0
has answer: http://stackoverflow.com/a/27701798
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43997902
has text: the script src is to link to an external javascript file, you cant put inline javascript in it
comment on: http://stackoverflow.com/a/27783529
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27778252
answers question: http://stackoverflow.com/q/27778128
has comment: http://stackoverflow.com/comment/43967780
has body: You are very close - you are already in scope of participant, so you just need to navigate down to participant_name: &lt;xsl:for-each select="participants/participant"&gt; &lt;td&gt; &lt;xsl:value-of select="participant_name" /&gt; &lt;/td&gt; &lt;/xsl:for-each&gt; Edit I've just re-read your question and I believe I missed the part about sending to your javascript function? If so, you can build up the participants in another &lt;xsl:variable&gt; &lt;xsl:variable name="participants"&gt; &lt;xsl:for-each select="participants/participant"&gt; &lt;xsl:value-of select="participant_name" /&gt; &lt;xsl:if test="not(position() = last())"&gt; &lt;xsl:text&gt;,&lt;/xsl:text&gt; &lt;/xsl:if&gt; &lt;/xsl:for-each&gt; &lt;/xsl:variable&gt; &lt;button type="button" onClick="myFunc('{$date} {$eventType} {$participants}')" /&gt; Last Comma removal courtesy of here
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/43967614
has comment: http://stackoverflow.com/comment/43966880
has comment: http://stackoverflow.com/comment/43967904

http://stackoverflow.com/a/27653853
score: 1
answers question: http://stackoverflow.com/q/27652626
type: Answer
has comment: http://stackoverflow.com/comment/43724523
upvote count: 2
has comment: http://stackoverflow.com/comment/43724472
downvote count: 1
has body: A component should depend only on the input that are passed to it. If component has some internal dependency (AJAX / Other data) for input it is an anti pattern. Ember way will be 1) Create a Route : (Get data to you application) Sometime you dont have a route for such data (like in your case). Here you can use application route or any other parent route if have. Use the setupController to inject this data to relevant controller 2) Pass down data to component Now your data should be a controller. Pass this data like any other to required component {{my-comp-here data="here" ajaxData=fromRoute }}
has comment: http://stackoverflow.com/comment/43743662

http://stackoverflow.com/comment/43927226
type: QuestionComment
has text: Sorry, this is just a side note, but it hurts to see people are still using the whole `XMLHttpRequest` cross browser BS, especially when you seem to be using jQuery already in the first place...
comment on: http://stackoverflow.com/q/27758274
score: 0
type: Comment

http://stackoverflow.com/q/27774929
score: -1
answer count: 1
downvote count: 1
has body: Three issues restrict the date like this user choosing end date base on the start date onwards only (sample:1/1/2015-12/31/2014 which is wrong) the user unable to manually type in a date have the calendar start at today's date HTML &lt;div class="row-fluid"&gt; &lt;div class="span2"&gt; Date&lt;/div&gt; &lt;div class="span7 input-append input-prepend"&gt; &lt;input type="text" id="sdate" name="sdate" value="&lt;?=$sdate?&gt;" class="input-small" &gt;&lt;span class="add-on"&gt;&lt;i class="icon-calendar"&gt;&lt;/i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;to&lt;/span&gt; &lt;input type="text" id="edate" name="edate" value="&lt;?=$edate?&gt;" class="input-small" &gt;&lt;span class="add-on"&gt;&lt;i class="icon-calendar"&gt;&lt;/i&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; JAVASCRIPT $('#sdate, #edate').datepicker(); //$.loadData(); $('a.btn').unbind('click').bind('click',function(e){ e.preventDefault(); $.loadData(); });
has comment: http://stackoverflow.com/comment/43961112
has comment: http://stackoverflow.com/comment/43960523
has answer: http://stackoverflow.com/a/27853663
tagged with: javascript
type: UnansweredQuestion
upvote count: 0
tagged with: jquery
has title: date range date picker restriction
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/27694452
has body: The only time I've done something like this was when I wanted to see if I could. I had this jquery code: $(document).ready(function(){ alert("before"); $.ajax({ url: "something.cfc?method=abc&returnFormat=JSON", global: false, type: "POST", //data: {username:name,password:pass}, dataType: "json", async:false, success: function(msg){ alert(msg); } }); alert("after"); }); And this CF Code <cfreturn "hello"> The code executes successfully. It is meant as a starting point for your situation, not a final answer. Note that the function has its access attribute set to remote. That makes it available to javascript, among other things.
score: 4
has comment: http://stackoverflow.com/comment/43839506
has comment: http://stackoverflow.com/comment/43877781
upvote count: 4
has comment: http://stackoverflow.com/comment/43805371
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27694070
answers question: http://stackoverflow.com/q/27694070
type: Answer

http://stackoverflow.com/comment/43838591
score: 1
type: AnswerComment
has text: Makes sense. Just throwing ideas in here... You could make it work without jQuery, and bind it to the `click`, `focus`, and maybe the `scroll` events. I can't think of any other events where you would want this to work.
type: Comment
comment on: http://stackoverflow.com/a/27713116

http://stackoverflow.com/comment/43978612
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27783406
has text: Yes @maurycy is right. You don't need to disable the cache, you can achieve the same in different way.

http://stackoverflow.com/a/27698727
answers question: http://stackoverflow.com/q/27698584
has body: You can find many responses to know the country in this post: PHP - Detect country For example you can use the api hostip $country = ''; $IP = $_SERVER['REMOTE_ADDR']; if (!empty($IP)) { $country = file_get_contents('http://api.hostip.info/country.php?ip='.$IP); } After you can test the country : if($country== "england") { // your code }
score: 0
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/43867066
accepted answer of: http://stackoverflow.com/q/27698584

http://stackoverflow.com/a/27770397
score: 1
answers question: http://stackoverflow.com/q/27769964
upvote count: 1
has body: In the first case, you are dealing with objects and in the 2nd case with direct primitive values on the scope. a) each controller creates it own scope; b) angular goes up the scope hierarchy until it finds the OBJECT its looking for, but c) if instead of being an object its a value, it creates the PRIMITIVE value in the current controller's scope, overwriting and value it previously inherited from a parent scope. To avoid this confusion, use objects all the time. Instead of $scope.A and $scope.B, create something like $scope.data = {} and then assign $scope.data.A and $scope.data.B Then in your view, you refer to data.A and data.B The nested controller will go up the hierarchy until it finds the data object instead of creating a new one.
downvote count: 0
type: Answer

http://stackoverflow.com/comment/63411014
has text: @MörreNoseshine Well, the original version of my answer, `Promise.resolve(obj) == obj`, appears to since have been [solidified in the spec](http://www.ecma-international.org/ecma-262/6.0/#sec-promise.resolve) and now finally works in Safari as well, so perhaps I should change it back?
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28133130

http://stackoverflow.com/a/68451120
has body: I extracted the code from the react-facebook-login and updated it to use hooks. import {useEffect, useState} from 'react' const _extends = Object.assign || function (target) { for (let i = 1; i < arguments.length; i++) { const source = arguments[i] for (const key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target } const useFacebook = function () { const appId = process.env.NEXT_PUBLIC_FACEBOOK_APP_ID const [isReady, setIsReady] = useState(false) const facebook = { login: async () => { const {authResponse, status} = await new Promise(resolve => window.FB.login(resolve, {scope: 'public_profile,email'})) if (!authResponse) return {status} return new Promise(resolve => window.FB.api('/me', {locale: 'en_US', fields: 'name,email,picture'}, me => { _extends(me, authResponse) resolve(me) })) } } useEffect(() => { window.fbAsyncInit = function () { FB.init({ appId, autoLogAppEvents: true, xfbml: true, version: 'v8.0' }) setIsReady(true) }; (function (d, s, id) { if (d.getElementById(id)) { setIsReady(true) return } const fjs = d.getElementsByTagName(s)[0] const js = d.createElement(s) js.id = id js.src = `https://connect.facebook.net/en-US/sdk.js` js.async = true js.defer = true fjs.parentNode.insertBefore(js, fjs) })(document, 'script', 'facebook-jssdk') }, []) return [facebook, isReady] } export default useFacebook How to use: const [facebook, isFacebookReady] = useFacebook() const handleFacebookLogin = async () => { const response = await facebook.login() console.log(response) } Login with Facebook
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/27717555
type: Answer

http://stackoverflow.com/q/27790372
tagged with: javascript
linked to: http://stackoverflow.com/q/9290000
score: 0
answer count: 1
has title: Error Line in console.error
type: AnsweredQuestion
has body: I am trying to throw an error to the Javascript console using console.error(), and I would like to set the line number so people can see where they went wrong. Is this at all possible? Thanks in advance, Awesomeness01
duplicate of: http://stackoverflow.com/q/9290000
has comment: http://stackoverflow.com/comment/43990586
type: Question
has answer: http://stackoverflow.com/a/27790401
accepted answer: http://stackoverflow.com/a/27790401

http://stackoverflow.com/q/27674352
downvote count: 2
accepted answer: http://stackoverflow.com/a/27674402
type: Question
tagged with: javascript
has title: Document is not defined error for 'document.getElementById()'
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/27674419
tagged with: http://stackoverflow.com/tag/html
tagged with: getelementbyid
possible better answer: http://stackoverflow.com/a/27674417
has comment: http://stackoverflow.com/comment/43763684
has answer: http://stackoverflow.com/a/27674402
has answer: http://stackoverflow.com/a/27674417
favorite count: 0
has body: Essentially, I keep getting the message "document is not defined" when I run my .js doc on command line. I'm trying to create a super basic game where the user helps the squirrel get to the chestnuts by using arrow keys. So far I can't move the squirrel yet, and I suspect it has to do with the document is not defined error that I'm getting (lines 1-3 and maybe also 52 in the link). You can find my code (html, css and js) in the following jsfiddle link (http://jsfiddle.net/8Lbkcsq2/) var squirrelImg = document.getElementById("squirrelImg"); var forest = document.getElementById("forest"); var chestnutImg = document.getElementById("chestnutsImg"); var squirrel = { name: "Mr. Squirrel", has_chestnuts: false, hungry: true }; var chestnuts = { name: "chestnuts" }; var positionLeft = 0; var positionTop = 0; function move(e) { // 39 for right arrow if (e.keyCode === 39) { if (positionLeft < 850) { positionLeft += 50; squirrelImg.style.left = positionLeft + "px"; } } // 40 for down arrow if (e.keyCode === 40) { if (positionTop < 600) { positionTop += 50; squirrelImg.style.top = positionTop + "px"; } } // 37 for left arrow if (e.keyCode === 37) { positionLeft -= 50; if (positionLeft < 0) { positionLeft += 50; // CHANGE TO +=50 LATER } squirrelImg.style.left = positionLeft + "px"; } // 38 for up arrow if (e.keyCode === 38) { positionTop -= 100; if (positionTop < 0) { positionTop += 50; // CHANGE TO +=50 LATER } squirrelImg.style.top = positionTop + "px"; } foundChestnuts(); } document.onKeyDown = move(); function foundChestnuts() { if ((squirrelImg.style.top == "300px") && (squirrelImg.style.left == "750px")) { squirrel.has_chestnuts = true; alert("Thank you for helping Mr. Squirrel find his chestnuts!"); var eat = confirm("Should Mr.Squirrel eat his chestnuts?"); if (eat === true) { alert("Time to eat!"); alert("Yum! Mr. Squirrel isn't hungry anymore!"); } else { alert("I guess Mr. Squirrel can wait a little longer..."); } } else { squirrel.has_chestnuts = false; } } body { b…
has comment: http://stackoverflow.com/comment/43763798
upvote count: 2
has comment: http://stackoverflow.com/comment/43763788
has comment: http://stackoverflow.com/comment/43763717
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/comment/43789043
has text: remove `href = "#"` and use `cursor:pointer` in css to show a hand cursor: ``
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27687714
score: 0

http://stackoverflow.com/comment/43956197
comment on: http://stackoverflow.com/q/27772323
type: Comment
type: QuestionComment
has text: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions#Calling_functions
score: 0

http://stackoverflow.com/comment/43859680
comment on: http://stackoverflow.com/a/27723730
type: Comment
score: 0
has text: adding `20vh` to the ` `s seems to resolve the height issues... But It needs to be supported on iOS 6/7 so I'm not sure about this.
type: AnswerComment

http://stackoverflow.com/a/27746324
downvote count: 10
type: AcceptedAnswer
upvote count: 520
has comment: http://stackoverflow.com/comment/126715859
accepted answer of: http://stackoverflow.com/q/27746304
type: Answer
has comment: http://stackoverflow.com/comment/116449205
score: 510
has comment: http://stackoverflow.com/comment/116438480
has comment: http://stackoverflow.com/comment/130070603
has comment: http://stackoverflow.com/comment/126715711
has body: How a promise library decides If it has a .then function - that's the only standard promise libraries use. The Promises/A+ specification has a notion called thenable which is basically "an object with a then method". Promises will and should assimilate anything with a then method. All of the promise implementation you've mentioned do this. If we look at the specification: 2.3.3.3 if then is a function, call it with x as this, first argument resolvePromise, and second argument rejectPromise It also explains the rationale for this design decision: This treatment of thenables allows promise implementations to interoperate, as long as they expose a Promises/A+-compliant then method. It also allows Promises/A+ implementations to “assimilate” nonconformant implementations with reasonable then methods. How you should decide You shouldn't - instead call Promise.resolve(x) (Q(x) in Q) that will always convert any value or external thenable into a trusted promise. It is safer and easier than performing these checks yourself. really need to be sure? You can always run it through the test suite :D
answers question: http://stackoverflow.com/q/27746304
has comment: http://stackoverflow.com/comment/130013747

http://stackoverflow.com/comment/43997920
type: Comment
score: 1
has text: `controller: [$scope, 'radiant', function($scope, radiant)` becomes `controller: ['$scope', 'radiant', function($scope, radiant)`.
comment on: http://stackoverflow.com/a/27792928
type: AnswerComment

http://stackoverflow.com/a/27798074
has comment: http://stackoverflow.com/comment/44016776
has comment: http://stackoverflow.com/comment/44015241
has comment: http://stackoverflow.com/comment/44016414
has body: To modify values passed to classSet property React has special addon: React.addons.classSet. It is very handy when you are changing multiple different classes but in your case it can be usefull, too: var SearchResult = React.createClass({ getInitialState: function () { return { site: '', address: '', checked: false, data: [], }; }, onSiteChanged: function (selected) { this.setState({ site: selected.SITE_NAME, checked: selected.id, }); }, render: function () { var resultRows = this.props.data.map(function (result) { var cx = React.addons.classSet({ success: (this.state.checked === result.id) }); return ( {result.SITE_NAME} {result.ADDRESS} ); }, this); return ( Name Address {resultRows} {this.state.site} {this.state.address} ); } });
has comment: http://stackoverflow.com/comment/44004860
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44016650
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/44014613
has comment: http://stackoverflow.com/comment/44016324
score: 2
answers question: http://stackoverflow.com/q/27797529
has comment: http://stackoverflow.com/comment/44004787
accepted answer of: http://stackoverflow.com/q/27797529

http://stackoverflow.com/comment/43744470
comment on: http://stackoverflow.com/a/27664404
score: 0
type: AnswerComment
has text: extending native API works fine in theory but should also be concerned that future specifications in HTMLElement could add similar methods that open the app up to potential collisions
type: Comment

http://stackoverflow.com/a/27784103
downvote count: 0
has body: because it thinks the / in // is the end of the reg exp. If you look at the coloring in your code above you can see the brown color ends at the first slash. You need to escape it. /.*:\/\/.*waw\d.omegle.com/;
type: Answer
answers question: http://stackoverflow.com/q/27784081
score: 1
upvote count: 1

http://stackoverflow.com/a/44540075
answers question: http://stackoverflow.com/q/27786048
has body: Just add a new line char (\n) before closing the contenteditable tag. For example in JavaScript: var html = ' ' + content + "\n" + ' '
type: Answer
score: 0

http://stackoverflow.com/comment/43722826
has text: You should see lines like: "127.0.0.1 - - [26/Dec/2014 05:43:25] "GET /foo HTTP/1.1" 200 -" "127.0.0.1 - - [26/Dec/2014 05:43:39] "GET /bar HTTP/1.1" 200 -" - do you see that message "Running on http …"? after you launch Flask?
type: AnswerComment
comment on: http://stackoverflow.com/a/27652614
score: 0
type: Comment

http://stackoverflow.com/comment/43732732
comment on: http://stackoverflow.com/q/27658487
score: 0
type: Comment
has text: @charlietfl If i have 3 rows in table i want to get 3 rows
type: QuestionComment

http://stackoverflow.com/q/27712235
linked to: http://stackoverflow.com/q/7538715
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I am using "CLEditor WYSIWYG HTML Editor v1.4.5" When I open the window containing the TextArea element I'm using with clEditor, the Editor comes up disabled and it appears that the TextArea element is invisible. I have text in the TextArea element but the text is invisible. If I right click on the body of the TextArea and select "Inspect Element", the debugger window opens and the Editor becomes enabled and the TextArea becomes visible. Then I close the debugger window and everything appears to be functioning correctly. HTML: This is the test data... is this editable? Javascript $("#woEditor").cleditor( {height: "400"}); No CSS If I comment out the Javascript .cleditor() call, then the TextArea element appears and functions correctly. So there is definately some setting in the editor initialization that is setting this state. You can access this page at: http://test.nds.link then click on the "Props" Tab in the left column Does anyone know what would cause the clEditor to come up in a disabled state, making the TextArea element invisible?
tagged with: cleditor
type: Question
has title: cleditor comes up disabled
has answer: http://stackoverflow.com/a/36700389
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/28902602

http://stackoverflow.com/q/27703302
tagged with: mobile
has body: I open a new window using javascript. Once loaded and the user has done what I need them to do, the opened window then calls a function from the main window, which closes the opened window, taking the user back to the main, original window. This works fine on desktop - but not on mobile. I can see the opened window runs the function successfully by alerting some info, but the standard .close() function doesn't seem to work. My code looks like: Main window: var auth_window; auth_window = window.open(dropbox_auth_url , 'Dropbox Authorization', auth_window_options); function open_dropbox_picker(access_token){ alert('back to main window?') if(auth_window){ alert('closing') auth_window.close(); } dropbox_access_token = access_token; get_dropbox_list_json(); }; Opened window: var url = window.location.href; var dropbox_access_token = url.split('#access_token=').pop().split('&amp;').shift(); window.opener.open_dropbox_picker(dropbox_access_token); both of the alerts on the main menu show, and if I manually close the opened window, I can see by the data on he main window that get_dropbox_list_json() has also worked successfully. So, how can I close the opened/popup window on mobile?!
tagged with: javascript
downvote count: 0
tagged with: jquery
has title: close a window opened by javascript on mobile
favorite count: 0
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/43710708
comment on: http://stackoverflow.com/q/27646426
score: 0
type: QuestionComment
has text: Possible duplicate: http://stackoverflow.com/questions/9151729/how-to-get-children-array-of-an-element-in-jquery
type: Comment

templates
tags question: http://stackoverflow.com/q/27784463
tags question: http://stackoverflow.com/q/27762385
tags question: http://stackoverflow.com/q/27758312
tag name: templates
type: Tag
tags question: http://stackoverflow.com/q/27785564
tags question: http://stackoverflow.com/q/27787914

http://stackoverflow.com/q/27716569
has comment: http://stackoverflow.com/comment/43955823
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28607822
has title: "index.html" is not served by grunt-contrib-connect
has comment: http://stackoverflow.com/comment/43855422
tagged with: grunt-contrib-connect
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28606465
tagged with: javascript
tagged with: gruntjs
score: 0
has body: My code is pretty simple, and the grunt file is, module.exports = function(grunt) { var proxySnippet = require('grunt-connect-proxy/lib/utils').proxyRequest; grunt.initConfig({ connect: { server: { options: { hostname: "localhost", keepalive: true, base:['../web/'], port: 8080, middleware: function(connect, options) { return [proxySnippet]; }, debug: true } } } }); // grunt.loadNpmTasks('grunt-connect-proxy'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.registerTask('default', [ 'connect:server' ]); }; there's an index.html, and the path is "../web/index.html". When I open "http://localhost:8080" it gives "Cannot GET /". Any idea why this is happening?

http://stackoverflow.com/q/27720211
has title: What happens under the hood to prevent calling a bound method changing the this object?
possible better answer: http://stackoverflow.com/a/27720499
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/43852347
has comment: http://stackoverflow.com/comment/43851962
upvote count: 1
downvote count: 0
favorite count: 0
has body: Consider the following code: var o1 = { name: 'o1' }; var o2 = { name: 'o2', foo: function() { console.log(this.name); }.bind(o1) } o2.foo(); // o1 because of the 'bind' o2.foo.call(o2); // o1 - why? Is this a specific feature of bound methods that the this object on their context can never be overridden by call or apply?
has answer: http://stackoverflow.com/a/27720499
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43854652
type: Question
has answer: http://stackoverflow.com/a/27721511
accepted answer: http://stackoverflow.com/a/27721511

http://stackoverflow.com/q/27799900
has body: When I click on the black button, the red div fades out and the blue div fades in. However, when I click the black button a second time to switch it back, there is no fade out/in. How can I make it so that the blue div fades out and the red div fades back in? Fiddle: http://jsfiddle.net/ddac5391/1/ HTML Get in touch CSS #contact-button { background: #000; background-size: 24px; color: #fff; text-decoration: none; text-transform: uppercase; font-weight: bold; padding: 10px 20px; position: absolute; right: 0; top: 0; z-index: 1; } #primary { background: red; height: 200px; position: absolute; width: 200px; } #contact-keebs { background: blue; display: none; height: 200px; position: absolute; width: 200px; } JS var c = 0; $('#contact-button').click(function (e) { e.preventDefault(); if (c++ % 2 == 0) { $(this).addClass('work-button').text('Work'); $('body').addClass('contact-content'); $('#contact-keebs').stop().fadeIn(500).show(); } else { $(this).removeClass('work-button').text('Get in touch'); $('body').removeClass('contact-content'); $('#contact-keebs').stop().fadeOut(500).hide(); } });
tagged with: javascript
tagged with: jquery
has title: jQuery toggle fade: Can't get div to fade out/in on toggle
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/27799991
possible better answer: http://stackoverflow.com/a/27800001
has answer: http://stackoverflow.com/a/27800001
accepted answer: http://stackoverflow.com/a/27799991
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27799978
type: Question

http://stackoverflow.com/comment/43716042
has text: Note : its not a duplicate because the question don't match my case
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27649382
score: 0

http://stackoverflow.com/comment/43848168
has text: "does not work" is not a very useful problem statement. What are you trying to accomplish, and what steps have you taken to solve this on your own? If you haven't done so already, please take some time to review the Help Center: http://stackoverflow.com/help/how-to-ask
type: Comment
comment on: http://stackoverflow.com/q/27718200
score: 0
type: QuestionComment

iframe
tags question: http://stackoverflow.com/q/27729642
tags question: http://stackoverflow.com/q/27778987
tags question: http://stackoverflow.com/q/27738645
tags question: http://stackoverflow.com/q/27747723
tags question: http://stackoverflow.com/q/27761233
tags question: http://stackoverflow.com/q/27728167
tag name: iframe
tags question: http://stackoverflow.com/q/27794933
tags question: http://stackoverflow.com/q/27666196
tags question: http://stackoverflow.com/q/27767243
tags question: http://stackoverflow.com/q/27748329
tags question: http://stackoverflow.com/q/27762776
tags question: http://stackoverflow.com/q/27728570
tags question: http://stackoverflow.com/q/27802146
tags question: http://stackoverflow.com/q/27698584
tags question: http://stackoverflow.com/q/27716081
tags question: http://stackoverflow.com/q/27656458
tags question: http://stackoverflow.com/q/27652100
tags question: http://stackoverflow.com/q/27789189
tags question: http://stackoverflow.com/q/27775003
tags question: http://stackoverflow.com/q/27789029
tags question: http://stackoverflow.com/q/27680665
tags question: http://stackoverflow.com/q/27767782
tags question: http://stackoverflow.com/q/27681949
tags question: http://stackoverflow.com/q/27712313
tags question: http://stackoverflow.com/q/27773816
tags question: http://stackoverflow.com/q/27671139
tags question: http://stackoverflow.com/q/27803087
tags question: http://stackoverflow.com/q/27733772
tags question: http://stackoverflow.com/q/27713045
tags question: http://stackoverflow.com/q/27726702
tags question: http://stackoverflow.com/q/27660408
tags question: http://stackoverflow.com/q/27682320
tags question: http://stackoverflow.com/q/27671932
tags question: http://stackoverflow.com/q/27734136
tags question: http://stackoverflow.com/q/27795879
tags question: http://stackoverflow.com/q/27654892
tags question: http://stackoverflow.com/q/27798122
tags question: http://stackoverflow.com/q/27653930
tags question: http://stackoverflow.com/q/27705460
tags question: http://stackoverflow.com/q/27682536
tags question: http://stackoverflow.com/q/27703855
type: Tag
tags question: http://stackoverflow.com/q/27722596
tags question: http://stackoverflow.com/q/27786510
tags question: http://stackoverflow.com/q/27704446
tags question: http://stackoverflow.com/q/27697037
tags question: http://stackoverflow.com/q/27788319
tags question: http://stackoverflow.com/q/27698705
tags question: http://stackoverflow.com/q/27712910
tags question: http://stackoverflow.com/q/27758671
tags question: http://stackoverflow.com/q/27749218
tags question: http://stackoverflow.com/q/27701968
tags question: http://stackoverflow.com/q/27740714
tags question: http://stackoverflow.com/q/27654757
tags question: http://stackoverflow.com/q/27778608

http://stackoverflow.com/q/27710799
tagged with: digest
favorite count: 0
score: 4
tagged with: loops
has title: Angular app not updating (dirty-checking) after async call to firebase
tagged with: firebase
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/21922470
has answer: http://stackoverflow.com/a/27710899
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/43902216
accepted answer: http://stackoverflow.com/a/27710899
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: angularjs
has body: I am using a single page angular app for my blog. On load, the controller makes a call to my firebase for all blog posts and pushes them into a $scope.posts array. The HTML employs ng-repeat to display a snippet of each blog post. However, no snippets appear at all unless the user activates any other random function on the page to force the digest loop. How can I make it dirty check or force the digest loop without user interaction? angular.module('evancodes.main', []) .controller('MainController', function(Main, $http, $scope) { $scope.posts = []; $scope.getAllPosts = function() { var ref = new Firebase("https://MYFIREBASENAME.firebaseio.com/"); ref.on("value", function(snapshot) { var posts = snapshot.val(); for (var post in posts) { $scope.posts.push(posts[post]); } }, function (errorObject) { console.log("The read failed: " + errorObject.code); }); } $scope.getAllPosts(); }) HTML: {{post.title}}

http://stackoverflow.com/q/27683259
upvote count: 5
has comment: http://stackoverflow.com/comment/43781355
has answer: http://stackoverflow.com/a/27683389
accepted answer: http://stackoverflow.com/a/27683490
answer count: 10
has answer: http://stackoverflow.com/a/27683326
has body: I found that there is a difference between for loop and for-in loop in javascript. When I define a new array: var a=new Array(); Then I put some value into in but not contiguously for example: a[0]=0;a[1]=1;a[4]=4; When I use for(i=0;i&lt;5;i++) to get the value and use alert to show it, it's different from using for(i in a). The previous one will show elements in index 2,3 which shows "undefined" while for-in will show only index 0,1,and 4. Can anybody tell me why?
tagged with: for-loop
tagged with: arrays
linked to: http://stackoverflow.com/q/242841
tagged with: javascript
tagged with: for-in-loop
possible better answer: http://stackoverflow.com/a/27683333
has answer: http://stackoverflow.com/a/27683333
type: Question
has answer: http://stackoverflow.com/a/27750726
has comment: http://stackoverflow.com/comment/43781103
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27683679
favorite count: 0
score: 4
has answer: http://stackoverflow.com/a/27683456
has comment: http://stackoverflow.com/comment/43781138
downvote count: 1
has answer: http://stackoverflow.com/a/27683490
has answer: http://stackoverflow.com/a/27880482
has answer: http://stackoverflow.com/a/27683446
has title: difference between for loop and for-in loop in javascript
has answer: http://stackoverflow.com/a/27683307

http://stackoverflow.com/comment/43941469
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27762105
has text: Thanks! The same svg code without the svg-pan-zoom library [link](http://jard.es/demo012/) apparently fits well and has no padding. That's why I think it is caused by the library itself.
type: AnswerComment

http://stackoverflow.com/a/27761247
has comment: http://stackoverflow.com/comment/43945144
has comment: http://stackoverflow.com/comment/43956909
type: Answer
upvote count: 1
has body: Testing javascript is not a totally mature thing, so there isn't a great diversity of good tools for doing so. Jasmine and Karma are the current best ways of doing that. Those tools are best managed using bower, which is a nodejs package. So you'll have to install, in this order: nodejs npm (node package manager) bower (using npm) jasmine and karma using bower phantomjs, and whatever other dependencies your javascript needs (presumably angular) Then you can run the tests. I found this package for maven with some brief googling, but god knows how to set it up: http://searls.github.io/jasmine-maven-plugin/ There are many tutorials on going through this process. You have to accept that these are currently the best tools for doing this and give it your best shot. If you post more specific issues regarding the 'installation that never goes as described' of jasmine and karma you will get assistance.
score: 1
has comment: http://stackoverflow.com/comment/43952453
downvote count: 0
answers question: http://stackoverflow.com/q/27761168
has comment: http://stackoverflow.com/comment/43956287

http://stackoverflow.com/comment/52701660
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27714089
has text: I had this problem when i used ./**/*.ts as 'scr' for my grunt-typescript task. I guess it enumerated the whole folder structure and included the .ts files from inside the grunt-typescript module as well. Changing the value of 'scr' to be more specific solved my problem. I leaving this here because this was the first answer that came up when i searched for the problem. Thanks!
score: 0

http://stackoverflow.com/a/27716928
has comment: http://stackoverflow.com/comment/43846082
upvote count: 3
has comment: http://stackoverflow.com/comment/43846022
has comment: http://stackoverflow.com/comment/43845913
has body: You have an . in .sendReply while appending the HTML You just need to remove . from .sendReply Use my button " As you are using Event delegation your jQuery will work. As you are adding textarea with same ID multiple times? $("#myTextarea").val() will always show value of first textarea with id myTextarea. You can use a common class and then use prev() to select the textarea See example $(document).ready(function() { $(document).on('click', '.sendReply', function() { var myNewText = $(this).prev(".myTextarea").val(); alert(myNewText); }); for (var i = 0; i < 5; i++) { $(".mydiv").append(" some text my button "); } });
has comment: http://stackoverflow.com/comment/43846035
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27716892
answers question: http://stackoverflow.com/q/27716892
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/43845764

http://stackoverflow.com/a/27779900
has body: I suggest you to create an index on employee.eid. Another thing you can try is to change the batch size in the first find adding batchSize(500) after setting the no timeout option: http://docs.mongodb.org/manual/reference/method/cursor.batchSize/
answers question: http://stackoverflow.com/q/27779188
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43973551
has comment: http://stackoverflow.com/comment/43984144

http://stackoverflow.com/comment/43700853
has text: Yes, u can transform object to json string and then revert it, what's the problem?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27640638

http://stackoverflow.com/comment/43823340
comment on: http://stackoverflow.com/q/27705738
has text: Post the full code. What is the HTML element #ff_elem576?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44281879
has text: did you finally find an answer for your question? If you did, please close the question accepting one of the answers.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27792000

http://stackoverflow.com/comment/43856215
type: QuestionComment
has text: Your code is fine. The only thing you need to remember is that `getElementsByClassName` and `getElementsByTagName` return you an array of nodes. Either iterate through them, or in your case since you only have one level, just add a `[0]`. `x[0].getElementsByTagName("P")[0].innerHTML`.
comment on: http://stackoverflow.com/q/27722216
score: 1
type: Comment

http://stackoverflow.com/a/27664919
type: Answer
answers question: http://stackoverflow.com/q/27662103
type: AcceptedAnswer
score: 0
has body: Javascript in the browser generally doesn't allow you to access files located on the file system, if it could, it would be a security vulnerability. The browser environment is contained in a sandbox. However, you may want to look into using the File API provided by HTML5 to interact with local files. Refer to this article for examples and explanation on the HTML5 File API.
accepted answer of: http://stackoverflow.com/q/27662103

http://stackoverflow.com/a/27757876
has comment: http://stackoverflow.com/comment/44088560
downvote count: 0
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27720384
score: 1
has body: The socket.io docs, in Migrating from 0.9, do a great job of showing how to authenticate sockets in 1.0. An example for you would be: You should create an authentication middleware to handle this. Create a controller called authorization.js: /** * Socket.io middleware that that authorizes clients * @param {object} socket * @param {function} next */ module.exports = function(socket, next) { // do some custom auth here var handshakeData = socket.request; // make sure the handshake data looks good with some // custom logic // if doesn't you can do this: // next(new Error('not authorized'); // else just call next next(); } In index.js simply attach the middleware with io.use: var authorizeSockets = require('./controllers/authorization'); io.use(authorizeSockets); Using io.set has been depreciated for io.use() since socket.io 1.0. You can then let the client know that they have successfully authorized and connected by emitting auth_suceed on the connection event because with the new middleware in place, a socket will not be able to connect unless they successfully authorize. io.on('connection', function(socket){ socket.emit('auth_succeed', yourPayloadHere); });

http://stackoverflow.com/comment/44024430
comment on: http://stackoverflow.com/a/27776925
type: AnswerComment
score: 0
has text: Your question asked about comparing values in an ng-repeat. This answers that question. If you have another question then post another question. SO is for answering questions, not fulfilling 'your requirements'
type: Comment

http://stackoverflow.com/q/27718013
has title: Element in Internet Explorer jumps while scrolling
score: 2
has comment: http://stackoverflow.com/comment/43847876
has answer: http://stackoverflow.com/a/27718338
type: Question
tagged with: internet-explorer
tagged with: javascript
has comment: http://stackoverflow.com/comment/43848284
upvote count: 2
linked to: http://stackoverflow.com/q/19377810
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has body: Everything is working smoothly on Chrome, but on IE 9 the green element is jumping on scroll, why? Here is a JSFiddle link. body{ height:1000px; } .block{ width:50px; height:20px; background: green; }
type: UnansweredQuestion
tagged with: css

chrome-app-developer-tool
tag name: chrome-app-developer-tool
type: Tag
tags question: http://stackoverflow.com/q/27770393

http://stackoverflow.com/a/27750748
type: Answer
has comment: http://stackoverflow.com/comment/43913001
score: 0
has comment: http://stackoverflow.com/comment/43913127
has body: You could try manually submitting your form in Javascript, change the input type from submit to button and then you could have something like: function onSubmit() { document.getElementById("bulletinForm").submit(); document.getElementById("bulletinForm").reset(); return false; //stop page refresh } Source: Clearing my form inputs after submission
answers question: http://stackoverflow.com/q/27750690

http://stackoverflow.com/comment/43903121
comment on: http://stackoverflow.com/a/27745348
score: 0
type: Comment
has text: I am geting TypeError: a is undefined... :( on queries.push(query.find()); Don't know why?
type: AnswerComment

http://stackoverflow.com/q/27704307
has answer: http://stackoverflow.com/a/27769221
has body: I'm trying to use destructuring assignment in Cloud Code on Parse.com, but when I run the code, the compiler gives me this error: Result: ReferenceError: Invalid left-hand side in assignment My code is this: [a, b] = foo(); And for example foo is implemented as follows: function foo() { return [2, 3]; } In a lot of browsers this code works fine but... in Parse Cloud Code I still have this error. How can I use destructuring assignment here? PS: I would prefer to use only an istruction to make this.
type: AnsweredQuestion
tagged with: parse-platform
score: 0
tagged with: destructuring
type: Question
accepted answer: http://stackoverflow.com/a/27769221
tagged with: ecmascript-6
answer count: 1
tagged with: javascript
has title: Destructuring assignment in Parse.com CloudCode
tagged with: variable-assignment

http://stackoverflow.com/comment/43984626
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27786659
has text: @NikolayTalanov I have just put '1.gif' as a filler but what would you recommend? IF I had a collection of 100 gifs or 1000 gifs, would it be bad practice to write them out in an array like that and pull it? Would there be a faster way to pull the images? I started this as a small project but now I am just trying to increase it in size as I learn so any direction is appreciated :)
score: 0

http://stackoverflow.com/q/27733702
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27733756
type: Question
tagged with: function
has body: I'm trying something out in html and I want to use the Metric prefixes like k, m, b and such... I found the code below which works splendidly but I don't know how to reference it in html. I want to make it apply to this html code, instead of displaying: Ape cost: 1000000 I want it to display 1M. The function works as intended just that I don't know how to use it while in HTML. thx :) Ape Cost: 10 Apes: 0 function nFormatter(num) { if (num >= 1000000000) { return (num / 1000000000).toFixed(1) + 'G'; } if (num >= 1000000) { return (num / 1000000).toFixed(1) + 'M'; } if (num >= 1000) { return (num / 1000).toFixed(1) + 'k'; } return num; }
tagged with: javascript
score: 0
answer count: 2
has title: address function from HTML
has answer: http://stackoverflow.com/a/27733730
type: UnansweredQuestion

http://stackoverflow.com/a/27795523
upvote count: 1
type: Answer
has body: try JSON.stringify(a) which will convert it to something like this "[{"start":"2015-01-12T00:00:00.000Z","allDay":false,"promotion_option":"banner"},{"start":"2015-01-13T00:00:00.000Z","allDay":false,"promotion_option":"banner"}]" Note that it converts it into a string in your backend whereever you recieve the httprequest you just have to keep that in mind.Hope it helps
downvote count: 0
answers question: http://stackoverflow.com/q/27795256
score: 1

http://stackoverflow.com/comment/97954038
has text: this works, according to [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await): "if the [awaited] value is not a promise, [the await expression] converts the value to a resolved Promise, and waits for it"
type: Comment
comment on: http://stackoverflow.com/a/51562795
score: 1
type: AnswerComment

http://stackoverflow.com/q/27799529
tagged with: javascript
has comment: http://stackoverflow.com/comment/44007911
has comment: http://stackoverflow.com/comment/44007683
answer count: 1
score: -1
favorite count: 0
has comment: http://stackoverflow.com/comment/44009382
tagged with: angularjs
has answer: http://stackoverflow.com/a/27799793
has body: Hi i'm having some issues with AngularJs, whenever i try to load more than one factory file in my index file (Where i initialize angular JS). Everything loads well but my Places factory refuses to initialize and i get this error at my console. https://docs.angularjs.org/error/$injector/unpr?p0=PlacesProvider This is my app.js file (function(){ 'use strict'; angular.module('app', ['oc.lazyLoad', 'ui.utils', 'app.configs', 'app.factories', 'app.ctrls']); })(); I have loaded the JavaScript files for these dependencies in my index file like so &lt;!-- Angular --&gt; {{ HTML::script('assets/js/frontend/src/vendor/angular/angular.min.js') }} {{ HTML::script('assets/js/frontend/src/vendor/angular/angular-route.min.js') }} {{ HTML::script('assets/js/frontend/src/vendor/bower_components/angular-ui-utils/ui-utils.min.js') }} {{ HTML::script('assets/js/frontend/src/vendor/angular/ocLazyLoad.js') }} &lt;!-- App --&gt; {{ HTML::script('assets/js/frontend/src/app.js') }} &lt;!-- Angular Configurations --&gt; {{ HTML::script('assets/js/frontend/src/configs/routes.js') }} &lt;!-- Angular services --&gt; {{ HTML::script('assets/js/frontend/src/services/Users.js') }} {{ HTML::script('assets/js/frontend/src/services/Places.js') }} &lt;!-- Angular directives --&gt; {{ HTML::script('assets/js/frontend/src/directives/foundation.js') }} &lt;!-- Angular controllers --&gt; {{ HTML::script('assets/js/frontend/src/controllers/mainCtrl.js') }} &lt;!-- End call for javascript files --&gt; This are my factory files: Users Factory (function(){ // Initialize angular module var app = angular.module("app.factories, []"); // Initialize user factory app.factory('Users', ["$http", function ($http) { // Define variables return { // My functions }; }]); })(); Places Factory (function(){ // Initialize angular module var app = angular.module("app.factories", []); // Initialize places factory app.factory('Places', ["$http", function ($http) { // Define variables return { // My functions }; }]); })();
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44007541
has comment: http://stackoverflow.com/comment/44009648
has comment: http://stackoverflow.com/comment/44007942
has comment: http://stackoverflow.com/comment/44009954
has comment: http://stackoverflow.com/comment/44007973
has comment: http://stackoverflow.com/comment/44007718
has title: AngularJs Modules Dependency Injection Error
downvote count: 1
has comment: http://stackoverflow.com/comment/44008017
type: Question
has comment: http://stackoverflow.com/comment/44008648
has comment: http://stackoverflow.com/comment/44008691
has comment: http://stackoverflow.com/comment/44009057
upvote count: 0

http://stackoverflow.com/comment/43746338
comment on: http://stackoverflow.com/q/27665598
score: 0
type: QuestionComment
type: Comment
has text: $(option) is from bootstrap multiselect and everything working fine just a alert is not working..and if i remove the placeholderclick("+$(option).val()+") its strat showing alert

http://stackoverflow.com/comment/43724352
has text: that error has already been replicated and mentioned in question
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27653713

http://stackoverflow.com/comment/43821870
score: 0
has text: i have added to my controller but it not working now
comment on: http://stackoverflow.com/a/27704334
type: Comment
type: AnswerComment

http://stackoverflow.com/a/27779450
type: Answer
answers question: http://stackoverflow.com/q/27779021
has body: Try adding position: fixed to your header. header { position: fixed; } Updated JSFiddle. You can read more about css positioning here.
has comment: http://stackoverflow.com/comment/43968798
score: 0

http://stackoverflow.com/q/27700844
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43831547
tagged with: dictionary
has comment: http://stackoverflow.com/comment/43817249
has comment: http://stackoverflow.com/comment/44032429
has comment: http://stackoverflow.com/comment/44033564
has comment: http://stackoverflow.com/comment/43816814
has comment: http://stackoverflow.com/comment/44033466
upvote count: 3
has comment: http://stackoverflow.com/comment/44032389
has comment: http://stackoverflow.com/comment/43830206
type: Question
has comment: http://stackoverflow.com/comment/43816999
has comment: http://stackoverflow.com/comment/43816939
tagged with: google-maps
has comment: http://stackoverflow.com/comment/44032336
has comment: http://stackoverflow.com/comment/43816848
has title: How To get all latitude and longitude from source to destination place on selection of suggested routes
tagged with: javascript
score: -1
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/43995756
has comment: http://stackoverflow.com/comment/44032413
has body: i want to fetch all the latitude and longitude between origin place to destination place. For that i have written following script but it will not give me the latitude and longitude between those two place. Below is the body: Points //...all the other input and button //.... From above script i can get all the route from origin place to destination place but i didnt get the all latitude and longitude between those place. you can see that i can get suggested route between two place. But now i want to print all latitude and longitude between those route which i am selecting. Suppose here 3 routes are there . now suppose i am selecting 1st then it will fetch all the latitude and longitude between those places only for that route Now suppose i am slecting 2nd suggested route then it will display all latitude and longitude between that route so now , how can i get all the latitude and longitude between those places for selected route from suggested routes?
downvote count: 4
has answer: http://stackoverflow.com/a/27803979
has comment: http://stackoverflow.com/comment/43821571
has comment: http://stackoverflow.com/comment/43967727
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44004391
has comment: http://stackoverflow.com/comment/43967554
has comment: http://stackoverflow.com/comment/43816903
has comment: http://stackoverflow.com/comment/43817471
favorite count: 0
has comment: http://stackoverflow.com/comment/44012593

http://stackoverflow.com/a/27643119
score: 0
answers question: http://stackoverflow.com/q/27642035
has body: I think I've read a way to get a text string of a webview's content. Then, you could use jsoup to parse it. [neh, don't even need jsoup; just indexOf string check] I'll suggest that you do consider handling the login with an HTTP client. It gives you flexibility, and seems the more proper way to go. I've been using the loopj library for HTTP get and post requests. It allows for simpler code. For me, anyway, a relative Android newbie. Here's some code from my project, to get you thinking. I've left out stuff like progress bar, and cookie management. private void loginFool() { String urlString = "http://www.example.com/login/"; // username &amp; password RequestParams params = new RequestParams(); params.put("username", username.getText().toString()); params.put("password", password.getText().toString()); // send the request loopjClient.post(urlString, params, new TextHttpResponseHandler() { @Override public void onStart() { // called before request is started //System.err.println("Starting..."); } @Override public void onSuccess(int statusCode, Header[] headers, String responseString) { // called when response HTTP status is "200 OK" // see if 'success' was a failed login... int idx = responseString.indexOf("Please try again!"); if(idx &gt; -1) { makeMyToast("Sorry, login failed!"); } // or actual success-ful login else { // manage cookies here // put extractData in separate thread final String responseStr = responseString; new Thread(new Runnable() { public void run(){ extractData(responseStr); selectData(defaultPrefs.getInt("xyz_display_section", 0)); // start the next activity Intent intent = new Intent(MainActivity.this, PageViewActivity.class); startActivity(intent); finish(); } }).start(); } } @Override public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) { // called when response HTTP status is "4XX" (eg. 401, 403, 404) makeMyToast("Whoops, network error!"); } @Override public void onFinish() { // done } }); } You…
type: Answer

http://stackoverflow.com/q/27785564
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43981265
tagged with: jquery
score: 1
linked to: http://stackoverflow.com/q/12197880
has comment: http://stackoverflow.com/comment/43982031
favorite count: 0
tagged with: angularjs-ng-include
tagged with: angularjs
has answer: http://stackoverflow.com/a/27786168
has comment: http://stackoverflow.com/comment/68008345
has body: How can run a line of jQuery once all the partials in the page loaded. No luck with $(document).ready and $(document).load is there any other ways? app.controller('PageCtrl', function () { $(document).ready( function() { $(".left-nav").height( $('.content-area').height()); }); });
tagged with: templates
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43982343
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27786046
has title: Run a function after all partials (ng-includes) loaded
has comment: http://stackoverflow.com/comment/43981104
answer count: 2
has comment: http://stackoverflow.com/comment/43981331

http://stackoverflow.com/q/27678371
score: 0
tagged with: windows-phone-8.1
has comment: http://stackoverflow.com/comment/43771376
type: Question
has title: How to terminate the module runned with require.run() in Windows Phone 8.1 app?
tagged with: javascript
has comment: http://stackoverflow.com/comment/43771200
has body: I'm working on a game for WP8.1. I use gameJS library which uses some kind of require.js. The html page with the game canvas contains the following code: WinJS.UI.Pages.define("/pages/game/game.html", { ready: function (element, options) { require.setModuleRoot('/js/'); require.run('main'); } }); The main.js file contains the main game loop and all other game stuff. So, when I first navigate to game.html, then everything works fine. But if I go away from game.html and then go to this page again (for example using back button) I can see only white screen. I can see in debugger that the main.js runs again and seems like it causes this trouble. Two game loops just collide each other. How to completely terminate and unload main.js when user goes away from game.html?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43771319
answer count: 0

http://stackoverflow.com/q/27659675
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/72340991
score: 11
type: Question
has answer: http://stackoverflow.com/a/27661477
linked to: http://stackoverflow.com/q/155378
has answer: http://stackoverflow.com/a/53365343
has answer: http://stackoverflow.com/a/27659779
tagged with: math
upvote count: 11
has answer: http://stackoverflow.com/a/62293045
has title: Get next smallest nearest number to a decimal
tagged with: javascript
possible better answer: http://stackoverflow.com/a/72340991
favorite count: 0
has body: Introduction For some calculations I need to find the smallest possible number I can add/subtract from a specified number without JavaScript getting in trouble with the internal used data type. Goal I tried to write a function which is able to return the next nearest number to VALUE in the direction of value DIR. function nextNearest(value, direction) { // Special cases for value==0 or value==direction removed if (direction &lt; value) { return value - Number.MIN_VALUE; } else { return value + Number.MIN_VALUE; } } The problem with this is, that JavaScript uses a 64-bit float type (I think) which has different minimum step sizes depending on its current exponent. Problem in detail The problem is the step size depending on its current exponent: var a = Number.MIN_VALUE; console.log(a); // 5e-324 console.log(a + Number.MIN_VALUE); // 1e-323 (changed, as expected) var a = Number.MAX_VALUE; console.log(a); // 1.7976931348623157e+308 console.log(a - Number.MIN_VALUE); // 1.7976931348623157e+308 (that's wrong) console.log(a - Number.MIN_VALUE == a); // true (which also is wrong) Summary So how can I find the smallest possible number I can add/subtract from a value specified in a parameter in any direction? In C++ this would be easily possible by accessing the numbers binary values.
answer count: 5
has comment: http://stackoverflow.com/comment/43735267
accepted answer: http://stackoverflow.com/a/27661477

http://stackoverflow.com/comment/43797327
type: QuestionComment
has text: The problem was you were overwriting the onload event, but there was no way to guess that without a [Minimal, Complete, Tested and Readable example](http://stackoverflow.com/help/mcve), which you didn't provide.
comment on: http://stackoverflow.com/q/27691601
score: 0
type: Comment

http://stackoverflow.com/comment/43917887
score: 0
has text: @Richlewis Yes, you can check with `!=-1`
type: Comment
comment on: http://stackoverflow.com/a/27753402
type: AnswerComment

http://stackoverflow.com/comment/44223112
comment on: http://stackoverflow.com/q/27748042
type: Comment
has text: @MrMins, there is no paginator? Sorry I was unclear, but on each webpage, there is many "pages" that belong to a book. But everything is all on one webpage.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43900872
type: QuestionComment
has text: How many is multiple? I would just do it by hand, I trust my hand more than I trust regex
score: 1
comment on: http://stackoverflow.com/q/27744947
type: Comment

http://stackoverflow.com/a/27644725
has body: On part was how to detect users browser you can this info from navigator.userAgent it will also let you know about the os the user is using. Second part of your question was answered above . If you are using chrome do a right click on anywhere n your site you will see a Devtoolbox opens up after that click on the network tab and in there you have to check disable cache screen shot attached . you can use console to check the value of navigator.userAgent ' '
answers question: http://stackoverflow.com/q/27644560
score: 0
type: Answer

http://stackoverflow.com/comment/43870301
type: Comment
score: 2
type: AnswerComment
has text: @user567797 `data` here is just whatever the name of your variable that holds the json is. Make sure you use the right varriable name.
comment on: http://stackoverflow.com/a/27729379

http://stackoverflow.com/q/27696612
score: 71
upvote count: 71
tagged with: angularjs-scope
type: Question
tagged with: angular-ui-router
linked to: http://stackoverflow.com/q/34690439
has answer: http://stackoverflow.com/a/27699798
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27699798
has comment: http://stackoverflow.com/comment/106827348
downvote count: 0
linked to: http://stackoverflow.com/q/58126482
has comment: http://stackoverflow.com/comment/52871763
favorite count: 0
possible better answer: http://stackoverflow.com/a/29468376
has answer: http://stackoverflow.com/a/27696670
tagged with: angularjs
has answer: http://stackoverflow.com/a/29468376
has body: Without using a service or constructing watchers in the parent controller, how would one give children states access to the main controller's $scope. .state("main", { controller:'mainController', url:"/main", templateUrl: "main_init.html" }) .state("main.1", { controller:'mainController', parent: 'main', url:"/1", templateUrl: 'form_1.html' }) .state("main.2", { controller:'mainController', parent: 'main', url: "/2", templateUrl: 'form_2.html' }) I'm not able to access the mainController scope in child state--or rather I'm getting another instance of that scope--not what I want. I feel I'm missing something simple. There is a shared data config option in the state object but I'm not sure if this should be used for something like this.
has title: How do I share $scope data between states in angularjs ui-router?
answer count: 5
has answer: http://stackoverflow.com/a/32852181
has comment: http://stackoverflow.com/comment/43806478
has answer: http://stackoverflow.com/a/29745031
type: AnsweredQuestion

http://stackoverflow.com/comment/43885147
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27736773
has text: Roger that, this is just example code, my actual (messy) implementation includes the verification stuff but thats non-essential to the question. I think I see the performance benefit of keeping an index of tree nodes to check against, as well as the decrease in cognitive overhead as well, so thanks for that suggestion.

variables
tag name: variables
tags question: http://stackoverflow.com/q/27695719
tags question: http://stackoverflow.com/q/27721749
tags question: http://stackoverflow.com/q/27644901
tags question: http://stackoverflow.com/q/27716028
tags question: http://stackoverflow.com/q/27795779
tags question: http://stackoverflow.com/q/27704123
tags question: http://stackoverflow.com/q/27760706
tags question: http://stackoverflow.com/q/27784370
tags question: http://stackoverflow.com/q/27765666
tags question: http://stackoverflow.com/q/27672294
tags question: http://stackoverflow.com/q/27774030
type: Tag
tags question: http://stackoverflow.com/q/27701779
tags question: http://stackoverflow.com/q/27792575
tags question: http://stackoverflow.com/q/27692945
tags question: http://stackoverflow.com/q/27797601
tags question: http://stackoverflow.com/q/27743246
tags question: http://stackoverflow.com/q/27783330
tags question: http://stackoverflow.com/q/27672901
tags question: http://stackoverflow.com/q/27652762
tags question: http://stackoverflow.com/q/27735483
tags question: http://stackoverflow.com/q/27743047
tags question: http://stackoverflow.com/q/27758469

http://stackoverflow.com/comment/43709361
comment on: http://stackoverflow.com/q/27645619
has text: are you using JQuery ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27657538
score: 3
tagged with: promise
upvote count: 3
answer count: 1
tagged with: node.js
accepted answer: http://stackoverflow.com/a/27657920
tagged with: bacon.js
has comment: http://stackoverflow.com/comment/43731528
has comment: http://stackoverflow.com/comment/43731568
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
has title: map a stream to lazy promise stream
favorite count: 0
has body: I have a I have a stream of numbers, I have to turn them into a stream of posts using a promise. And I want to do this lazily. So if I do .take(1) from the post stream, it will turn only one number to a post. This is the promise that gets a post from a number: var getPost = function(author) { console.log('get post' + author); return new RSVP.Promise(function(resolve, reject) { setTimeout(function() { var result = "Post by " + author; resolve(result); }, 1000); }); }; I am only interested in first post, thus take(1), and It should call getPost once. If I use map, the stream works lazy, calls getPost once. If I use flatmap, it calls getPost for all the numbers. var lazyStream = Bacon.fromArray([1, 2, 3, 4]).map(function(value) { return Bacon.fromPromise(getPost(value)); }); var nonLazyStream = Bacon.fromArray([1, 2, 3, 4]).flatMap(function(value) { return Bacon.fromPromise(getPost(value)); }); lazyStream.take(2).log(); //nonLazyStream.take(2).log(); However map returns a promise, while flatMap returns the post itself. How do I have a lazy stream that returns the value of promise?
type: Question
has answer: http://stackoverflow.com/a/27657920

http://stackoverflow.com/comment/43971644
comment on: http://stackoverflow.com/a/27780679
type: AnswerComment
score: 0
type: Comment
has text: so you have to parse the csv before the preload function, then start your game and load all the images in the preload

http://stackoverflow.com/a/27723971
upvote count: 1
answers question: http://stackoverflow.com/q/27723939
downvote count: 0
type: Answer
has body: You should add width and float it left e.g Points: 1422 Level: 17
score: 1

http://stackoverflow.com/a/66564212
score: 1
has body: Your browser tries to preload the audio for each audio tag. So the answer is to set the attribute preload in the audio tag to value none use can use:
answers question: http://stackoverflow.com/q/27687579
has comment: http://stackoverflow.com/comment/117824405
has comment: http://stackoverflow.com/comment/125091842
type: Answer
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/117673659

http://stackoverflow.com/q/27748265
linked to: http://stackoverflow.com/q/22326473
linked to: http://stackoverflow.com/q/14227363
downvote count: 0
has title: link_to method causes jquery to not load in js.erb
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43908844
tagged with: ruby-on-rails
score: 3
has body: I am trying to to use a jquery .insertafter method to dynamically insert a row in a table. I have my code in 'create.js.erb' as below: $(" <%= @work.id %> <%= @work.user.lname %>, <%=@work.user.fname %> <%= link_to(@work.project.name, @work.project, 'data-no-turbolink' => true) %> <%=@work.datetimeperformed%> <%=@work.hours %> ").insertAfter("tr#headerrow"); The code works perfectly fine as long as I don't use the 'link_to' method. The moment I use 'link_to', it stops working. I tired adding an alert before the 'insertafter' method. Adding link_to doesn't even fire the alert. The page seems to be rendering fine without javascript errors. rails console log looks fine: User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 "id", 281110143 Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 "id", 730774123 Rendered works/create.js.erb (3.0ms) This is my controller code where I am calling create.js.erb. The format.js {} calls create.js.erb. def create @work = Work.create(work_params) respond_to do |format| if @work.save format.html {redirect_to @work, notice: 'Work Created'} format.js { render content_type: 'text/javascript'} else format.html {render 'new'} format.js {} end end end I tired this solutions from Stack overflow regarding turbolinks and that didn't help either. Rails, javascript not loading after clicking through link_to helper Rails 4: disable Turbolinks in a specific page Using turbolinks in a Rails link_to Appreciate your help in this. Thanks! Mike G
has answer: http://stackoverflow.com/a/28507037
has comment: http://stackoverflow.com/comment/43909272
type: Question
tagged with: ruby-on-rails-4
has comment: http://stackoverflow.com/comment/43908292
answer count: 1
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/17600093
favorite count: 0
upvote count: 3

http://stackoverflow.com/comment/43872175
has text: There aren't any error messages. The out coming html looks like this: http://pastebin.com/hm1Ty7Lu.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27730080
score: 0

http://stackoverflow.com/comment/43754776
has text: Sounds like a duplicate of http://stackoverflow.com/q/25760079/54680. Which version(s) of Internet Explorer are you experiencing this issue with?
comment on: http://stackoverflow.com/q/27655374
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27654068
has comment: http://stackoverflow.com/comment/43724780
type: Answer
has comment: http://stackoverflow.com/comment/93467368
has body: you can't add I-frame with local file src All modern browsers prevent display of "local" files using the file protocol in iframes for security reasons. check your browser console... if you get message like it means your browser prevent load local resource to Iframe Not allowed to load local resource
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27653930
upvote count: 3
answers question: http://stackoverflow.com/q/27653930
type: AcceptedAnswer

http://stackoverflow.com/comment/43797416
has text: dataitems it's a json object : dataitems.d.results and yes its a table format
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27691823
score: 0

http://stackoverflow.com/a/27669020
has body: this line: $(this).parent().find(".icon myicons-down").removeClass("myicons-down").addClass("myicons-up"); would be looking for a class of .myicons-down (it doesnt have a . so right now it's not looking for anything) inside of .icon but it looks like your HTML set up should be trying to find .icon WITH a class of .myicons-down. Change it to be: $(this).parent().find(".icon.myicons-down").removeClass("myicons-down").addClass("myicons-up"); Also what is $(this) referring to? Where is .collapse in your HTML?
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27668973

http://stackoverflow.com/q/27672094
accepted answer: http://stackoverflow.com/a/27672186
tagged with: casperjs
has body: I have this piece of code: var casper = require('casper').create(); var startID = 21; var endID = 13533; while (startID &lt;= endID) { scrapPages(startID); startID++; } function scrapPages(i) { var str = "Starting to get the HTML for the problem" + i; console.log(str); var url = 'http://community.topcoder.com/stat?c=problem_statement&amp;pm=' + i; casper.start(url, function() { this.echo(startID); var result = this.getHTML('td.problemText'); casper.then(function() { var fileName = 'problem' + i + ".html"; require('fs').write(fileName, result, 'w'); this.echo("writing it to filename: " + fileName) }); }); } casper.run(); All I'm doing is trying to parse Topcoder for all it's problems. I believe this question is not a duplicate of questions on Javascript Closures. The problem is, the function scrapPages is running only once, the last iteration of while loop. Can someone help me out why this is happening?
score: 0
type: Question
has title: Only the last iteration is executed when iterating through parametrized URLs with CasperJS
tagged with: javascript
has answer: http://stackoverflow.com/a/27672186
answer count: 1
tagged with: callback
type: AnsweredQuestion

http://stackoverflow.com/comment/44005936
comment on: http://stackoverflow.com/a/27780268
has text: Hi thanks. I somehow manage to make it work. Though can I ask what should I put in the success and error callbacks. Still new with ajax.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44036824
has text: Yes, works the same way. Or as Mark pointed out there is a framework specific short-cut.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27805224
type: Comment

http://stackoverflow.com/q/27784136
has answer: http://stackoverflow.com/a/27784218
tagged with: javascript
tagged with: date
upvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27849744
type: UnansweredQuestion
has title: how to find difference in days between day and month irrespective of years
answer count: 4
tagged with: momentjs
has answer: http://stackoverflow.com/a/27784613
downvote count: 0
has comment: http://stackoverflow.com/comment/43982679
score: 1
has answer: http://stackoverflow.com/a/27784345
type: Question
has body: I want to know the difference between to two dates irrespective of year.. For Example : format date/month/year For example difference of today date to some date lets take 01/06 The expected answer for this will be around 185 days.. I tried below example..Let me know whats wrong with this var a = moment('06/01','M/D'); console.log(a); var b = moment(); console.log(b); var diffDays = b.diff(a, 'days'); alert(diffDays); I dont want to use momet.js atmost. If it can be done with javascript its so good for me.
has comment: http://stackoverflow.com/comment/43978272

http://stackoverflow.com/a/27735870
answers question: http://stackoverflow.com/q/27735713
score: 0
type: Answer
has body: akinuri, this was my first answer, but I deleted it (I thought you wanted to play the whole sound), so I undeleted it, it could help you (it will fix the delay bug of keydown). You should use a gameLoop (common pattern in game development), with requestAnimationFrame. Don't trigger events directly from player's input, set states that will be processed inside the gameLoop (which should be in charge of updating positions, rendering ...) var playing = false; var keyStatePressed = false;//set state at false at init var weapons = { aug : { audio : "weapons/aug-1.wav", icon : "e", key : "A" } }; function playAudio(file) { if (!playing) { var audio = new Audio(file); audio.play(); playing = true; setTimeout(function() { playing = false; }, 100); } } //flag at true on keydown document.onkeydown = function(e) { switch(e.keyCode) { case 65: keyStatePressed = true; break; } } //run a game loop function gameLoop(){ if(keyStatePressed === true){ playAudio(weapons.aug.audio); keyStatePressed = false;//reset state } //run this in 16ms (see more on game loops and requestAnimationFrame) requestAnimationFrame(gameLoop); } //launch the gameLoop gameLoop();

http://stackoverflow.com/a/61593847
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/133960712
answers question: http://stackoverflow.com/q/27749522
has comment: http://stackoverflow.com/comment/133959641
has body: The http.createServer method creates a server object. The server object has a listen method. If you invoke the listen method, for example: createServer(requestListener).listen({ port:80 }); the server object will be listening on port 80, and when a Http request is received on that port, the server object will invoke the function requestListener, passing it two objects, of type request and response. So you can write your requestListener like, for example: function requestListener(req, res) { res.write("Hello world"); res.end(); } and it will push out the string Hello world to every url that is hitting your this simple web server. write is one of the many methods of the response object. You can run the above few lines of code on your PC, and point your browser to http://localhost. If you have other applications listening on port 80, then use a different port number in your listen method. Using an anonymous function for requestListener is merely a different coding pattern, for better or for worse. My code above can be re-written as: createServer((req, res) =&gt; { res.write("Hello world"); res.end(); }).listen({ port:80 }); The above code is very rudimentary and will send the same response to every Http request that hits it. The code does not differentiate between localhost/page1 or localhost/page2, etc. So to do anything more, the requestListener have to be expanded significantly to parse different paths in the url and to decide on what content to send for each. But to do anything useful as a real web server without writing too much code, you will need a package. Express is an excellent one that drives many real life web servers.

http://stackoverflow.com/a/27645046
answers question: http://stackoverflow.com/q/27644754
has body: Why are you complicating things for yourself... Don't use javascript validation until and unless you are validating the data of fields. if the concern is only that the fields must be made compulsory.. you can user the required = "required" attribute of the tags. All browsers support it...
score: 0
has comment: http://stackoverflow.com/comment/43708655
type: Answer

http://stackoverflow.com/comment/43717426
comment on: http://stackoverflow.com/a/27650007
type: AnswerComment
has text: Its the syntax. You should have used something like. document.getElementById('hdfTotal').value to set that
score: 0
type: Comment

http://stackoverflow.com/a/27714705
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/43841534
score: -1
answers question: http://stackoverflow.com/q/27714600
downvote count: 2
has body: You're forgetting to return a value from isUpdated

http://stackoverflow.com/a/27724903
has comment: http://stackoverflow.com/comment/43862031
answers question: http://stackoverflow.com/q/27724872
score: 0
type: Answer
has body: You can use the array index to hop directly into a specific item. function myFunction(arr) { console.log(arr[0].itemid); console.log(arr[0].itemname); console.log(arr[0].currentprice); console.log(arr[1].itemid); console.log(arr[1].itemname); console.log(arr[1].currentprice); }
has comment: http://stackoverflow.com/comment/43862125

http://stackoverflow.com/comment/43947094
comment on: http://stackoverflow.com/a/27767356
type: AnswerComment
score: 0
type: Comment
has text: can u share link to your repository ?? i will run and check it on my local rails server. Maybe i can help.

http://stackoverflow.com/q/27641812
tagged with: javascript
has answer: http://stackoverflow.com/a/27641835
answer count: 3
downvote count: 0
upvote count: 16
has comment: http://stackoverflow.com/comment/43702416
favorite count: 0
tagged with: binary
has comment: http://stackoverflow.com/comment/43702453
possible better answer: http://stackoverflow.com/a/27641856
has title: Way to add leading zeroes to binary string in JavaScript
has answer: http://stackoverflow.com/a/27641833
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/1267283
score: 16
accepted answer: http://stackoverflow.com/a/27641835
type: Question
has body: I've used .toString(2) to convert an integer to a binary, but it returns a binary only as long as it needs to be (i.e. first bit is a 1). So where: num = 2; num.toString(2) // yields 10. How do I yield the octet 00000010?
linked to: http://stackoverflow.com/q/1267283
linked to: http://stackoverflow.com/q/24337260
has answer: http://stackoverflow.com/a/27641856

http://stackoverflow.com/a/27768009
has comment: http://stackoverflow.com/comment/43961543
has comment: http://stackoverflow.com/comment/43947990
downvote count: 0
score: 1
has body: Simply modify the bill objects directly. (You're doing that anyway) bills.forEach(function (bill) { bill.transactions = transactions.filter(function (transaction) { return transaction.billId === bill._id; }); }); With your edit (and without being able to test it), I think it should look like this: app.get('/getbills', function (req, res) { var allBills = Bills.find().exec(); var allTransactions = Transactions.find().exec(); promise.all([allBills, allTransactions]).then(function (results) { var bills = results[0]; var transactions = results[1]; bills.forEach(function (bill) { bill.transactions = transactions.filter(function (transaction) { return transaction.billId === bill._id; }); }); res.send(bills); }); });
has comment: http://stackoverflow.com/comment/43949792
upvote count: 1
has comment: http://stackoverflow.com/comment/43954924
has comment: http://stackoverflow.com/comment/43948290
type: Answer
answers question: http://stackoverflow.com/q/27767822
has comment: http://stackoverflow.com/comment/43950905
has comment: http://stackoverflow.com/comment/43961772

http://stackoverflow.com/a/27758612
has comment: http://stackoverflow.com/comment/43982385
answers question: http://stackoverflow.com/q/27758483
has comment: http://stackoverflow.com/comment/43929099
type: Answer
has comment: http://stackoverflow.com/comment/43928637
has comment: http://stackoverflow.com/comment/43930017
upvote count: 11
has comment: http://stackoverflow.com/comment/43930041
score: 11
has body: If you are interested in just the first part, then use var a = fulltext.match(/^.{47}\w*/) See demo (fiddle) here. If you want to split the entire string to multiple substrings, then use var a = fulltext.match(/.{47}\w*|.*/g); See demo (fiddle) here. ...and if you wish substrings do not start with the word separator (such as space or comma) and prefer to include it with the previous match, then use var a = fulltext.match(/.{47}\w*\W*|.*/g); See demo (fiddle) here.
accepted answer of: http://stackoverflow.com/q/27758483
has comment: http://stackoverflow.com/comment/89712093
has comment: http://stackoverflow.com/comment/43928855
has comment: http://stackoverflow.com/comment/43930068
has comment: http://stackoverflow.com/comment/43929770
has comment: http://stackoverflow.com/comment/43928509
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27678636
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43771975
has comment: http://stackoverflow.com/comment/43772168
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/507138
has comment: http://stackoverflow.com/comment/43771836
type: Question
possible better answer: http://stackoverflow.com/a/27678878
has title: How to use CSS with JS
tagged with: javascript
has answer: http://stackoverflow.com/a/27678830
accepted answer: http://stackoverflow.com/a/27678830
score: 0
answer count: 2
duplicate of: http://stackoverflow.com/q/507138
has comment: http://stackoverflow.com/comment/43771766
has body: I want to activate CSS using JS. Let's say I have this code, and I want to enlarge a picture at first click and then send it to the right after at the second click, but it's not working. Is the function correct? How can I use JavaScript to control the CSS of an element? &lt;script&gt; function function(){ var house = document.getElementById("house"); if(this.className == "mystyle") this.className = "mystyle2"; else this.className = "mystyle"; } &lt;/script&gt; &lt;a href="#" style="text-decoration: none"&gt;&lt;img src="casa1.jpg" id="house" width="200" height="150" onclick="function()"&gt; I want it to activate this CSS: .mystyle { position: absolute; left: 50%; margin-left: -100px; } .mystyle2{ float: right; }
has comment: http://stackoverflow.com/comment/43771923
has answer: http://stackoverflow.com/a/27678878

http://stackoverflow.com/q/27764095
has title: Printing X amount of Items in a Row in Javascript
has answer: http://stackoverflow.com/a/27764253
has answer: http://stackoverflow.com/a/27764355
has answer: http://stackoverflow.com/a/27764174
has answer: http://stackoverflow.com/a/27764158
type: AnsweredQuestion
tagged with: row
has answer: http://stackoverflow.com/a/27764222
tagged with: loops
type: Question
possible better answer: http://stackoverflow.com/a/27764174
has answer: http://stackoverflow.com/a/27764173
tagged with: javascript
tagged with: sorting
answer count: 6
has body: I want to print 4 items in a row, I'm using the code below, it works except there's a flaw and I don't know how to fix. for (i=0; i &lt; items.length; i++) { if (items.length-1 == i) { document.getElementById("items").innerHTML += "&lt;div style='display: inline-block;'&gt;" + items[i] + "&lt;/div&gt;" } else { if (i % 4 == 0) { document.getElementById("items").innerHTML += "&lt;div style='display: inline-block;'&gt;" + items[i] + "&lt;/div&gt;, &lt;br&gt;" } else { document.getElementById("items").innerHTML += "&lt;div style='display: inline-block;'&gt;" + items[i] + "&lt;/div&gt;, " } It always prints like this: #, #,#,#,#, #,#,#,#, #,#,# Which I want it to print like: #,#,#,#, #,#,#,#, #,#,#,#
score: 0
accepted answer: http://stackoverflow.com/a/27764355
tagged with: printing

http://stackoverflow.com/comment/44023483
score: 0
type: Comment
has text: Thanks for looking into this. I don't think I was specific enough in my question. I want the list of players to be in play order relative to the user. Say the user is Player 2, the divs should be "Player 3, Player 4, Player 1"
type: AnswerComment
comment on: http://stackoverflow.com/a/27773549

http://stackoverflow.com/q/27713801
tagged with: handlebars.js
accepted answer: http://stackoverflow.com/a/27824903
score: 2
type: AnsweredQuestion
has body: I’m utilizing crossroadsJS and hasherJS on an SPA powered by handlebarsJS. In retrospect I probably should have built the whole thing on Ember, but this late in it’s not wise to start over. I have hash routes set up that switch my handlebars templates in and out based on whatever was clicked. I’m able to move backwards and forwards between the routes with no problem. However, if I refresh the page, I’m always brought back to my #/home view. I’ve done some research into window.onhashchange and window.onbeforeunload, but none of these seem to be solving the issue. I have a very specific way of how I’m handling my views. I have a global views object constructed like so: views.procedures = function (template) { this.initialize = function () { this.el = $('&lt;div/&gt;'); this.el.attr('id', 'procedures'); this.el.on('click', '.returned-list li a', this.toResults); // list of API objects by name }; this.render = function () { var parts = { title: 'Procedures View', }; this.el.html(template(parts)); return this; }; this.toResults = function () { cache.justClicked = $(this).attr('data-id'); crossroads.addRoute('procedures/{name}', function () { api.endpoints.procedure(cache.justClicked); // constructed elsewhere }); }; this.initialize(); }; I mention this because I can’t simply add in JQuery listeners for any type of hash changes in a $(document).ready() or $(window).onhashchange I’ve read through both the hasherJS and crossroadsJS documentations multiple times, but I’m not able to think of anything to solve the refresh issue. Thanks in advance for any help.
upvote count: 2
type: Question
tagged with: crossroadsjs
tagged with: javascript
has answer: http://stackoverflow.com/a/27824903
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has title: Refresh hasherJS/crossroadsJS routes

http://stackoverflow.com/q/27758908
has comment: http://stackoverflow.com/comment/43929729
has title: How to call a non-jquery object method inside an angularjs directive?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43932422
has comment: http://stackoverflow.com/comment/43930186
accepted answer: http://stackoverflow.com/a/27764557
type: Question
tagged with: angularjs-directive
tagged with: polymer
tagged with: javascript
tagged with: jquery
has body: I'm using Polymer and AngularJS together, and I want the page to show a toast after a successful form submitting. Here's my HTML: &lt;div ng-view&gt;&lt;/div&gt; &lt;paper-toast id="toast" text="{{$rootScope.message}}" show-toast&gt;&lt;/paper-toast&gt; My $routeProvider has indicated different templates and controllers for different routes, so I put the toast element outside. Since the submitting causes a page jump, I need to put the message where the toast element can access, i.e. $rootScope. And JS: app.directive('showToast', ['$rootScope', function($rootScope) { restrict: 'A', link: function($scope, element, attrs) { var toast = document.querySelector('#toast'); if ($rootScope.message != '') { toast.show(); toast.addEventListener('core-overlay-close-completed', function() { $rootScope.message = ''; }) } } }]) But an error occurs saying that undefined is not a function at link, pointing to toast.show(). But if I put the content of link function into that page controller, it can work. What's wrong with directive? And as you can see, the link function has a parameter element, but since the show() method is not a jQuery method, I don't know how to call it through element.
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27758975
has answer: http://stackoverflow.com/a/27758975
has answer: http://stackoverflow.com/a/27764557
tagged with: angularjs

http://stackoverflow.com/comment/127403660
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27787768
score: 1
has text: @adeneo Your example of unbind/rebind executes first then ignores. Debounce ignores first then executes. There is significantly more functionality in a debounce than your example, most importantly that the most recent user input is always respected.

http://stackoverflow.com/q/27749460
linked to: http://stackoverflow.com/q/881515
has answer: http://stackoverflow.com/a/27759667
type: Question
accepted answer: http://stackoverflow.com/a/27759667
tagged with: polymer
has body: I have been having some scope issues when developing a Polymer app. Essentially I am attempting to use custom elements as classes containing pertinent logic. Say I have a listener that is listening for a click event on a custom-elem element, and I want to access a function in another element, in this case the elements parent, parent: &lt;polymer-element name="custom-elem"&gt; &lt;template&gt; &lt;/template&gt; &lt;script&gt; Polymer({ attached: function(){ this.addEventListener('mousedown', function(e) { if (e.which === 1){ this.parentNode.parentNode.testFunc(e); //or this.parentNode.querySelector.... etc } else if (e.which === 3){ } }.bind(this)); } &lt;/script&gt; &lt;/polymer-element&gt; I find I have to traverse the DOM to find the element I am looking for, or create a reference in a newly created element. I realize I could create an object in an external script that contains logic above, but that seems to invalidate the purpose of defining custom elements / web components. Is there anyway to easily access members of Polymer registered elements without navigating the DOM and without creating external scripts?
tagged with: dom
tagged with: prototype
score: 0
tagged with: web-component
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/23945085
type: AnsweredQuestion
has title: Polymer, accessing custom elements / namespace issues
has comment: http://stackoverflow.com/comment/43915366

http://stackoverflow.com/a/66360783
type: Answer
score: 0
has body: Just want to mention that if you are using a different Chrome release channel such as Canary, which is common during development, you will have to adjust the path accordingly. ~/Library/Application Support/Google/Chrome Canary/NativeMessagingHosts/
answers question: http://stackoverflow.com/q/27726799

http://stackoverflow.com/a/27770176
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27769964
upvote count: 1
type: Answer
has body: In angular scope inheritance is implemented using standard Javascript prototype inheritance. The difference between two examples is that in the second one you deal with primitive values which can't be inherited the way you think. When you do $scope.first = "Yes"; in the second controller it simply creates new scope property which "shadows" parent scope property. However in the first example first.greeted is a object reference to parent scope object first, and since it's not primitive, it preserves object reference. To illustrate the issue with pure Javascript objects (the same happens in your Angular code), consider this little example. var obj1 = { profile: { // object id: 1 }, name: 'Obj1' // primitive }; // create obj2 with obj1 set as its prototype var obj2 = Object.create(obj1); // Change promitive and object referenced property obj2.name = 'Obj2'; obj2.profile.id = 2; document.body.innerHTML = obj1.name + ', ' + obj2.name; document.body.innerHTML += '&lt;br&gt;' + obj1.profile.id + ', ' + obj2.profile.id; To avoid confusion it's often recommended to use object references, which is known as "dot-rule".

http://stackoverflow.com/a/27738998
has comment: http://stackoverflow.com/comment/43909130
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43909762
type: Answer
has comment: http://stackoverflow.com/comment/43909970
has comment: http://stackoverflow.com/comment/43910118
answers question: http://stackoverflow.com/q/27737776
has body: It jumps because: You have a rectangular image--350px X 325px. So this means width === 350px and height === 325px. You are checking whether width &gt; height and height &gt; width in these two lines: imgWidth = width &gt; height ? 350/325 * height : width; imgHeight = height &gt; width ? 325/350 * width : height; i.e. You are checking whether the width (which starts out at 350px) is greater than height (325), and whether height (325) is greater than width (350). Taking the second example: The height will not be greater than the width until after you've shrunk the window horizontally 25px (350 - 325) beyond the point where the image starts to shrink. And so, for those first 25px, the height isn't recalculated because height &gt; width is still false. The easiest remedy for this is simply to check against the offset--check whether width - 25 &gt; height and whether height + 25 &gt; width: imgWidth = width - 25 &gt; height ? 350/325 * height : width; imgHeight = height + 25 &gt; width ? 325/350 * width : height; JSFiddle Here Also, for what I think is cleaner code, though a more complex fix, check out this fiddle Here
accepted answer of: http://stackoverflow.com/q/27737776
upvote count: 1

http://stackoverflow.com/comment/44427093
type: QuestionComment
comment on: http://stackoverflow.com/q/27705505
score: 1
has text: `$(document).ready(function() { $("#list").change(function() { $("#field").val($('option:selected', this).text()); }); }); `
type: Comment

http://stackoverflow.com/q/27779161
tagged with: phaser-framework
type: AnsweredQuestion
has body: Okay, I am building a game and after implementing a level selection I nearly got my project working. However, there is a error(probably easy to fix) that has caught my eye. In my create function I create the variable "pages", but when I want to use it in an other function I get the ReferenceError: Uncaught ReferenceError: pages is not defined. I am fairly new to javascript and I also tried to pass the variable in the paramater, the error will go away, but the code won't work as I want to. I define the pages in the create function and I want to use it in the arrowClicked function UshanGame.Selection = function(game){}; var thumbRows = 2; var thumbCols = 3; var thumbWidth = 128; var thumbHeight = 128; var thumbSpacing = 3; var levelThumbsGroup; var currentPage = 0; var leftArrow; var rightArrow; UshanGame.Selection.prototype = { create: function(){ console.log("%c ✔✔ Level Selection Ready! ✔✔", "color:red;"); // array with finished levels and stars collected. var starsArray = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]; // how many pages are needed to show all levels? var pages = starsArray.length /(thumbRows * thumbCols); leftArrow = this.add.button(50, 420, "level_arrows", this.arrowClicked); leftArrow.anchor.setTo(0.5); leftArrow.frame = 0; leftArrow.alpha = 0.3; rightArrow = this.add.button(270, 420, "level_arrows", this.arrowClicked); rightArrow.anchor.setTo(0.5); rightArrow.frame = 1; // creation of the thumbails group levelThumbsGroup = this.add.group(); // determining level thumbnails width and height for each page var levelLength = thumbWidth * thumbCols + thumbSpacing * (thumbCols - 1); var levelHeight = thumbWidth * thumbRows + thumbSpacing * (thumbRows - 1); // looping through each page for(var l = 0; l &lt; pages; l++){ // horizontal offset to have level thumbnails horizontally centered in the page var offsetX = (this.width-levelLength)/ 2 + game.width * l; // I am not interested in having level thumbnails vertically centered in the page, but // if you are, sim…
score: 2
type: Question
has answer: http://stackoverflow.com/a/27779265
has title: Uncaught ReferenceError. Phaser.io
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/27779265

http://stackoverflow.com/comment/43757285
has text: With the code you provided you shouldn't be experiening any more issues, you are just doing reordering and thats what you want. Your method (from the comment above) is good.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27671093
type: AnswerComment

http://stackoverflow.com/comment/43998749
score: 0
type: AnswerComment
has text: Use [firebug](https://getfirebug.com/) to see the resultant in console. And my [working demo](http://jsfiddle.net/rohankumar1524/185rdnv3/) alerts too.
type: Comment
comment on: http://stackoverflow.com/a/27794066

http://stackoverflow.com/q/27790158
tagged with: electron
has answer: http://stackoverflow.com/a/65246600
upvote count: 8
possible better answer: http://stackoverflow.com/a/65246600
has body: 1) Is this javascript call not supported on Atom-shell? window.open('#/openpage','_self',false) 2) In NodeJS-Webkit, I could either reload the HTML with win.reload() without the toolbar and buttons. Is Atom-shell support this API as well? 3) In the app.js that is program to index.html into the Atom-shell var BrowserWindow = require('browser-window'); and index.html tried to execute a reload command and failed that BrowserWindow is not defined. BrowserWindow.reload()
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27792062
has title: How do run reload() and open() in Atom-Shell
type: Question
answer count: 2
score: 8
tagged with: javascript
has answer: http://stackoverflow.com/a/27792062
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/27708722
has body: See: http://jsfiddle.net/allisonc/am83wp4m/2/ var openings = document.createElement("Openings"); var opening1 = document.createElement("opening"); var imgsrc1 = document.createElement("imgsrc"); imgsrc1.appendChild(document.createTextNode("a0d3b6664b2fef68c279c5f58e6af5d6")); opening1.appendChild(imgsrc1); openings.appendChild(opening1); var opening2 = document.createElement("opening"); var imgsrc2 = document.createElement("imgsrc"); imgsrc2.appendChild(document.createTextNode("148d39e78620ed03dc6bf0fee199ec97")); opening2.appendChild(imgsrc2); openings.appendChild(opening2); var opening3 = document.createElement("opening"); var imgsrc3 = document.createElement("imgsrc"); imgsrc3.appendChild(document.createTextNode("971e9044a3f1fca2291d62d64470a1bd")); opening3.appendChild(imgsrc3); openings.appendChild(opening3); var new_openings = $(openings).find("opening"); mattes_create_openings(new_openings); function mattes_create_openings(openings) { $(openings).each(function(i, el) //loop through the openings xml { console.log(el); console.log(i); //more code... var photos_selected_fid = $(el).find("imgsrc").text(); console.log(photos_selected_fid); clipX = 0; clipY = 0; //photos_create_preview_image(document.getElementById("opening_" + i), clipX, clipY, photos_selected_fid); photos_create_preview_image(document.getElementById("opening_" + i), clipX, clipY, photos_selected_fid); }); } function photos_create_preview_image(element, clipX, clipY, photos_selected_fid) { var photos_selected_opening = element.id; //Sets the selected opening to the div that calls this function var photos_selected_opening_value = photos_selected_opening.replace("opening_", ""); var new_img = new Image(); new_img.onload = function() { $(element).empty(); //Empty the div element.appendChild(new_img); //Append the image to the div } new_img.src = "http://example.com" + "/system/photo/cf_preview/" + photos_selected_fid; //Set the source of the image }
answers question: http://stackoverflow.com/q/27707209
score: 0
type: Answer

http://stackoverflow.com/comment/43805812
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27693685
type: Comment
has text: Ok, made by myself: http://jsfiddle.net/aonj42xy/. Thank you for sketching the solution.

http://stackoverflow.com/comment/43930293
comment on: http://stackoverflow.com/a/27759614
type: AnswerComment
score: 0
type: Comment
has text: Or better: `return query.find();`.

http://stackoverflow.com/a/27688226
score: 35
accepted answer of: http://stackoverflow.com/q/27688120
upvote count: 35
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43790413
type: Answer
has body: Yes, as per ECMA262 15.5.4.14 String.prototype.split (separator, limit), if the separator is not in the string, it returns a one-element array with the original string in it. The outcome can be inferred from: Returns an Array object into which substrings of the result of converting this object to a String have been stored. The substrings are determined by searching from left to right for occurrences of separator; these occurrences are not part of any substring in the returned array, but serve to divide up the String value. If you're not happy inferring that, you can follow the rather voluminous steps at the bottom and you'll see that's what it does. Testing it, if you type in the code: alert('paxdiablo'.split('.')[0]); you'll see that it outputs paxdiablo, the first (and only) array element. Running: alert('pax.diablo'.split('.')[0]); alert('pax.diablo'.split('.')[1]); on the other hand will give you two alerts, one for pax and one for diablo.
has comment: http://stackoverflow.com/comment/43790155
answers question: http://stackoverflow.com/q/27688120

http://stackoverflow.com/comment/43897947
type: Comment
comment on: http://stackoverflow.com/a/27743296
score: 0
type: AnswerComment
has text: @RichardLundWinther the code is running before you include jQuery, so `$` is not defined then. Place your code after you include jQuery.

http://stackoverflow.com/comment/43813899
type: QuestionComment
comment on: http://stackoverflow.com/q/27700513
has text: In test.php you must return something and you can get return data to your data variable in ajax method
score: 0
type: Comment

http://stackoverflow.com/comment/43868371
score: 0
type: Comment
type: QuestionComment
has text: Can I make what clear?
comment on: http://stackoverflow.com/q/27728214

http://stackoverflow.com/a/27698063
answers question: http://stackoverflow.com/q/27697594
score: 0
type: Answer
has body: Similar to the other answer, something else to consider about your data structure is how you plan on using the data. Depending on what your insertion / retrieval / removal / etc needs are, you may decide that one data structure is easier for you to use. Because you're using objects or arrays, you'll have access to different methods for you to manipulate your data structure.

http://stackoverflow.com/comment/43887666
type: AnswerComment
comment on: http://stackoverflow.com/a/27737765
type: Comment
has text: it can be anything, jsut a flag/state holder for the function :) i don't understand what do you mean by `If its the document.getElementById("player").... how would i set that to isPlaying?` i updated the codes again above
score: 0

http://stackoverflow.com/a/27776784
downvote count: 0
has comment: http://stackoverflow.com/comment/43964336
score: 4
has comment: http://stackoverflow.com/comment/43964441
has body: getElementsByClassName includes the word "elements", which is a plural. It returns a NodeList (which is like an array) not an element. You need to call addEventListener on each value in the NodeList, not upon the NodeList itself (where it isn't defined).
answers question: http://stackoverflow.com/q/27776744
type: Answer
upvote count: 4

http://stackoverflow.com/comment/43776317
has text: Generally by just refreshing the page while working with a form, the browser with prompt the user. I asked a [question here](http://stackoverflow.com/questions/27658495/what-is-confirm-form-resubmission-and-how-is-it-triggered) and the user said that the form submit method needs to be POST.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27653133
type: Comment

http://stackoverflow.com/comment/43912008
type: QuestionComment
has text: Since you want different sounds to play, on fire you could attach a custom object when you fire the event with the correct sound then handle it the same way in the parent element. `var temp = { sound = 'path' }; this.fire('customEvent', temp);`
score: 1
comment on: http://stackoverflow.com/q/27747975
type: Comment

http://stackoverflow.com/a/27761932
has body: im sorry but i didn't see any flux's architecture in your code yet :) for a high level implementation explanation, assuming you have all 3 basic structure of flux, namely action, dispatcher, and store. in the _onSubmit in LoginForm component, you should trigger the action to perform the login, and then the event will go through the dispatcher and pass to store. from the store, it will perform the login (and here you save the [username] information), and then trigger an event (for example change). This event will be registered and listening by the Content component in the componentDidMount. Upon listened the change event, you should able to get the username information from the store. This is a good example for the flux
has comment: http://stackoverflow.com/comment/43952391
accepted answer of: http://stackoverflow.com/q/27761106
score: 0
answers question: http://stackoverflow.com/q/27761106
type: Answer
has comment: http://stackoverflow.com/comment/43938131
has comment: http://stackoverflow.com/comment/43938524
has comment: http://stackoverflow.com/comment/43955797
type: AcceptedAnswer

http://stackoverflow.com/a/27743435
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/27743383
has body: If your number is a javascript Number, then you can multiply it by 10 and then divide it: var num = 19.48; var result = Math.round(num * 10) / 10; // 19.5
has comment: http://stackoverflow.com/comment/43897856
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/43897902

http://stackoverflow.com/q/27769920
accepted answer: http://stackoverflow.com/a/27769987
possible better answer: http://stackoverflow.com/a/27770030
has answer: http://stackoverflow.com/a/27770030
type: AnsweredQuestion
tagged with: authentication
type: Question
answer count: 2
downvote count: 4
upvote count: 0
has comment: http://stackoverflow.com/comment/43950841
tagged with: javascript
has answer: http://stackoverflow.com/a/27769987
score: -4
has comment: http://stackoverflow.com/comment/43950710
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to make myself a login for my website, and I already tested that the links provided exist, and the redirect worked. I don't know why it isn't working! Here is the code: login2 Login I looked everywhere trying to figure out why it won't work. Please help me!
has comment: http://stackoverflow.com/comment/43950752
has comment: http://stackoverflow.com/comment/43950729
favorite count: 0
has title: HTML login not working

http://stackoverflow.com/a/27732326
has comment: http://stackoverflow.com/comment/43876169
has comment: http://stackoverflow.com/comment/43876062
score: 0
has comment: http://stackoverflow.com/comment/43876107
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43876135
has comment: http://stackoverflow.com/comment/43876091
type: Answer
has body: If you are using pure java and jsp create a jsp or servlet that gets an id of a news and shows it. For example your jsp is showSingleNews.jsp. Send id of News to this jsp/servlet. Your links will be something like these(the value of id is dynamic): Title of this news 1 Title of this news 2 Title of this news 3 In your showSingleNews.jsp page get parameter's value and fetch it from database and show it: <% request.getParameter("id"); // And fetch this news from database and show it %>
has comment: http://stackoverflow.com/comment/43876059
accepted answer of: http://stackoverflow.com/q/27732141
answers question: http://stackoverflow.com/q/27732141

http://stackoverflow.com/q/27739452
answer count: 1
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/27739603
tagged with: dygraphs
tagged with: routes
type: Question
has title: Loading Dygraph input inside a node app
tagged with: javascript
has body: I'm very new to node and am struggling to load the data for Dygraphs on a static page. I believe that my issue is to do with routing. My js for Dygraphs is: g2 = new Dygraph( document.getElementById("graphdiv2"), "../newDataFile.csv", etc.... I can see in the browser that newDataFile.csv is not being loaded, despite the file being in the root directory. My routing code looks like this: router.get('/Dygraphpage', function(req, res) { res.render('Dygraphpage'); }); I guess that I need to pass the csv file into this routing code, but I don't know how to. Any ideas?!
score: 0
tagged with: http://stackoverflow.com/tag/csv

http://stackoverflow.com/q/27641278
has comment: http://stackoverflow.com/comment/43701600
tagged with: javascript
score: 0
has body: I am writing a simple Chrome extension that uses HTML5 geolocation to show a map with your position on a map have got the geolocation to work but when I try to add it to maps it does not work. It says uncaught error google undefined. { "name": "gary ", "version": "0.0.3", "manifest_version": 2, "description": "geo extension", "icons": { "16": "icons/icon16.png", "48": "icons/icon48.png", "128": "icons/icon128.png" }, "browser_action": { "default_popup": "main1.html", "persistent": true }, "permissions": [ "geolocation", "https://maps.googleapis.com/*" ] } The JavaScript: x = navigator.geolocation; x.getCurrentPosition(success,failure); function success(position){ var mylat = position.coords.latitude; var mylong = position.coords.longitude; var coords = new google.maps.LatLng(mylat, mylong); var mapOptions ={ zoom:16, center: coords, maptypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map"), mapOptions); } function failure(){ $('#lat').html(" it does not work "); } And the HTML
tagged with: google-chrome-extension
has title: Cannot get Google maps to display in Chrome extension
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43701950
has comment: http://stackoverflow.com/comment/43702789
answer count: 0
has comment: http://stackoverflow.com/comment/43702836
type: Question
has comment: http://stackoverflow.com/comment/43759085

ember-data
tags question: http://stackoverflow.com/q/27711406
type: Tag
tags question: http://stackoverflow.com/q/27737162
tags question: http://stackoverflow.com/q/27698496
tags question: http://stackoverflow.com/q/27728982
tag name: ember-data
tags question: http://stackoverflow.com/q/27784930
tags question: http://stackoverflow.com/q/27652626
tags question: http://stackoverflow.com/q/27746481

http://stackoverflow.com/comment/43872622
type: QuestionComment
score: 0
has text: You should be able to determine why that is by using your browser dev tools. Is the script tag there? Is it giving a 404 because the url is wrong?
comment on: http://stackoverflow.com/q/27730277
type: Comment

http://stackoverflow.com/comment/43942005
type: QuestionComment
has text: Why do you want to split a string to do this? If the labels are really 100, 200 etc. you could make them in a loop. If they are more complicated you could store them in an array.
comment on: http://stackoverflow.com/q/27765023
score: 0
type: Comment

http://stackoverflow.com/comment/43760009
comment on: http://stackoverflow.com/q/27672624
score: 3
has text: Er, no, the marked `this` refers to the *current, individual `.codeContainer`*. Similarly, the other `this` refers to the *current, clicked-on `.toggle`*. `alert(this);` is a helpful hint.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43757543
has text: Yep, that seems entirely pointless!
score: 1
comment on: http://stackoverflow.com/q/27671390
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43965935
type: Comment
comment on: http://stackoverflow.com/q/27777564
type: QuestionComment
score: 1
has text: Where is defined and filled `dataBuffer` ?

http://stackoverflow.com/comment/43769339
has text: well as no one here will magically know what's on those lines, look at my answer below.
score: 0
comment on: http://stackoverflow.com/q/27677458
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27710554
type: Question
accepted answer: http://stackoverflow.com/a/27710716
has title: Find the element before the previous element - jQuery
possible better answer: http://stackoverflow.com/a/27710606
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/27710716
has body: I need to select the element 2 up from my current element. Normally you can use the .prev() to find the previous element but I need to find the one previous to this. Whats the simplest way to find this? var animation = $("div.services-block").prev(); I need to find the div before services-block and load that into a variable. My structure as an example Say my current element is services-block, I need to find and grab services-block-item-match. (but this class name can change)
answer count: 2
downvote count: 2
upvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27710606
type: AnsweredQuestion

http://stackoverflow.com/q/27706594
has body: I'm using Google reCAPTCHA and have been able to add the CAPTCHA component to my page inside a form. But when I submit the form there's no validation taking place to check if the CAPTCHA has been solved. How do I validate that the CAPTCHA component has been solved when submitting my form? Or, in other words, how do I make my CAPTCHA component required?
has answer: http://stackoverflow.com/a/29376982
has answer: http://stackoverflow.com/a/71695474
favorite count: 0
has answer: http://stackoverflow.com/a/40575687
has comment: http://stackoverflow.com/comment/43825494
has answer: http://stackoverflow.com/a/29993298
has comment: http://stackoverflow.com/comment/43864707
has answer: http://stackoverflow.com/a/32491825
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/55105459
type: Question
answer count: 8
linked to: http://stackoverflow.com/q/7168645
has answer: http://stackoverflow.com/a/37048027
accepted answer: http://stackoverflow.com/a/37048027
has answer: http://stackoverflow.com/a/55770062
score: 62
possible better answer: http://stackoverflow.com/a/29993298
has title: How can I make reCAPTCHA a required field?
tagged with: javascript
upvote count: 66
downvote count: 4
has comment: http://stackoverflow.com/comment/43864570
tagged with: http://stackoverflow.com/tag/html
tagged with: recaptcha

http://stackoverflow.com/a/27642947
answers question: http://stackoverflow.com/q/27642662
has body: You can label your countries in UI with id or class html properties. Then, you render your dropdown list with value populated with comma separated list of corresponding country labels. For example: English French ... Now, if user selects English language, you will take "value" attribute from "option" tag, split it by comma and then select by id/class attribute proper html elements and display them. That's the concept but specifics depend on your exact implementation.
has comment: http://stackoverflow.com/comment/43705020
has comment: http://stackoverflow.com/comment/43980326
score: 0
has comment: http://stackoverflow.com/comment/43709629
type: Answer

http://stackoverflow.com/comment/43712550
score: 1
has text: You should be using [**`select's ng-option`**](https://docs.angularjs.org/api/ng/directive/select).
comment on: http://stackoverflow.com/q/27647382
type: Comment
type: QuestionComment

http://stackoverflow.com/a/35344996
answers question: http://stackoverflow.com/q/27708614
type: Answer
downvote count: 0
score: 10
has body: This happens in recent versions of Opera browser too. For me it happens when I drag a file or folder over any part of the dev panel, even while it is behind other programs or folders. The prompt does not always stick, but when it does, dragging any file off my desktop back over the dev panel usually un-sticks it. It doesn't seem necessary to drop the file in the prompted area, but that works too. In addition to Alexandra's answer link, there're discussions on the GoogleChrome git pages discussing 'workspaces'.. personally I don't use it, I prefer a full editor.
upvote count: 10

http://stackoverflow.com/q/27788402
tagged with: javascript
has body: I have a JavaScript object, and I want to extend it. The problem is that it's variables mutate from one scope to another. First, I create a Mammal prototype, and he has a name, this name can be printed with the whoAmI function var Mammal = ( function () { var whoAmI = function () { console.log("I am " + this.name); }; return { name : "mammal", whoAmI : whoAmI }; })(); Then, I create a Dog, who has a name too. It's name can be printed, directly from whoAmI, or from the state function. var Dog = ( function (mammal) { mammal.name = "dog"; mammal.state = function () { mammal.whoAmI(); console.log("I am happy"); }; return mammal; })(Object.create(Mammal)); But when i want to create an instance of Dog, and set his name from the outside, there seem to be two name variable: one in Dog, and another in the new created variable shipo. var shipo = Object.create(Dog); shipo.name = "Shipo" shipo.state(); // it's name is dog shipo.whoAmI(); // it's name is Shipo // mutation? :( I can solve this, by implementing a getter and a setter function for the name variable, on the Mammal definition... but I hate using getters and setters, my code would be shorter if variables could be publicly setted and getted without this ugly functions... Are getters and setters the only way to prevent this kind of mutations?
accepted answer: http://stackoverflow.com/a/27788512
type: AnsweredQuestion
score: 3
downvote count: 0
favorite count: 0
type: Question
answer count: 1
upvote count: 3
has answer: http://stackoverflow.com/a/27788512
has title: Are getters and setters the only way to avoid prototype mutations?

http://stackoverflow.com/a/29135191
has body: The problem aren't in $watchCollection. ng-repeat creates scope for each child, so when you are typing in the input you change item property only in the ng-repeat child scope because item is primitive. If you had $scope.list=[{value:1}] you could change the value in parent scope changing value in child scope because list[0] and item share reference on the same object. But watchCollection still would not being fired because it detect only shallow changes.
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27802752
accepted answer of: http://stackoverflow.com/q/27802752

http://stackoverflow.com/comment/43895855
comment on: http://stackoverflow.com/q/27742496
score: 0
type: Comment
type: QuestionComment
has text: possible duplicate of [How to force a line break on a Javascript concatenated string?](http://stackoverflow.com/questions/15357846/how-to-force-a-line-break-on-a-javascript-concatenated-string)

http://stackoverflow.com/comment/43974023
type: QuestionComment
comment on: http://stackoverflow.com/q/27781936
has text: Use Mozila Its best browser for debugging purpose.
score: 0
type: Comment

http://stackoverflow.com/comment/43988670
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27789237
has text: did you place the tag in the index.html file?
type: AnswerComment

http://stackoverflow.com/a/40775373
answers question: http://stackoverflow.com/q/27688311
downvote count: 0
type: Answer
has body: Although there's no componentDidRender, you can make a method with the desired behavior and call it in both componentDidMount (which is only called after the first render) and componentDidUpdate (which is called after every render but the first). Also, this is the preferred way of getting a ref to a DOM node from within the component: https://facebook.github.io/react/docs/refs-and-the-dom.html
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/132601339

http://stackoverflow.com/comment/43995854
score: 1
comment on: http://stackoverflow.com/q/27793281
type: Comment
has text: why not use `onblur` event instead of keypress?
type: QuestionComment

http://stackoverflow.com/a/27776472
score: 1
accepted answer of: http://stackoverflow.com/q/27776268
answers question: http://stackoverflow.com/q/27776268
has comment: http://stackoverflow.com/comment/43975409
has body: you are right. variables will be only freed if it is no longer needed. In your case the variable a is still needed for the event callback so it is not deallocated. It still exists, As another answer for this post by elaijuh says,It is a copy of real variable, actually it is not the copy stored in the event callback function. You can see this fiddle http://jsfiddle.net/3y7qbjav/ , so still you can change the value of var a after binding the click event. So the variable is not freed. function foo() { var a = "This is my content"; $('#myElemId').on('click', function() { $(this).html(a); }); a="new content after the event binding"; }
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43964097
type: Answer
has comment: http://stackoverflow.com/comment/43978023
downvote count: 0

http://stackoverflow.com/a/27655232
upvote count: 1
has body: You may refer to the following example: Instead of using the on event, i changing it to add the event when new row is added Besides that, I change the input ID to class, as ID should be unique across the HTML Example JavaScript: function addRow() { var div = document.createElement('div'); div.className = 'filerow'; div.innerHTML = ' \ \ \ \ No Yes \ '; document.getElementById('added_files_box').appendChild(div); addEvent(div); } function removeRow(input) { document.getElementById('added_files_box').removeChild(input.parentNode); } function addEvent(div) { $(div).find('.uploadFile').change(function() { var files = !! this.files ? this.files : []; var image = new Image(); if (!files.length || !window.FileReader) return; // no file selected, or no FileReader support if (/^image/.test(files[0].type)) { // only image file var reader = new FileReader(); // instance of the FileReader reader.readAsDataURL(files[0]); // read the local file reader.onloadend = function (_file) { // set image data as background of div $("#imagePreview").css({ "background-image": "url(" + this.result + ")", "background-size": "contain", "background-repeat": "no-repeat" }); } } }); } Hope this help :D
downvote count: 0
answers question: http://stackoverflow.com/q/27654721
type: Answer
score: 1

http://stackoverflow.com/comment/43895014
type: AnswerComment
has text: Yes I have checked your DEMO, its working fine. but when I'm using it, It's not working. Please check the url: https://www.ezeerooms.in/m/booking.html?itemId=4244608&packId=0&packGuid=b180b844-ba28-4f4c-a654-047345b4598c&BtcHashCode=cvmsespdwychvvzq2ppay2te
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27741825

http://stackoverflow.com/comment/43801562
has text: Isn't `changeImage("<%= asset_path('How-to/step_to_remove.gif') %>");` enough?
comment on: http://stackoverflow.com/a/27694096
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27737162
tagged with: ember.js
answer count: 1
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43886191
has comment: http://stackoverflow.com/comment/43886117
has title: Why I'm getting an empty store of records?
has body: I have backend that serve this json { "bars": [ { "id": 1, "name": "one bar" }, { "id": 2, "name": "second bar" }, { "id": 3, "name": "third bar" } ] } at host: 'http://localhost:3000/bars' this is all what I have on the client side: ;(function(Ember, DS) { var App = Ember.Application.create({ LOG_TRANSITIONS: true }); window.App= App; App.ApplicationAdapter = DS.RESTAdapter.extend({ host: 'http://localhost:3000' }); App.ApplicationSerializer = DS.JSONSerializer.extend({ primaryKey: 'id' }); App.Bar = DS.Model.extend({ name: DS.attr('string') }); App.ApplicationRoute = Ember.Route.extend({ model: function() { var bars = this.store.find('bar'); bars.then(function(bars) { console.log(bars.content.length); // return 0 where the xhr request getting 3 items }); return bars; } }); }(Ember, DS)); I'm using Ember : 1.9.0 Ember Data : 1.0.0-beta.14.1 Handlebars : 2.0.0 jQuery : 2.1.1 PS: the jquery ajax request seems that it working normally: XHR finished loading: GET "http://localhost:3000/bars".
type: AnsweredQuestion
tagged with: ember-data
type: Question
has comment: http://stackoverflow.com/comment/43885973
has answer: http://stackoverflow.com/a/27737718
accepted answer: http://stackoverflow.com/a/27737718
tagged with: javascript
score: 0
upvote count: 1

http://stackoverflow.com/a/27681497
has comment: http://stackoverflow.com/comment/43777863
has comment: http://stackoverflow.com/comment/43777901
score: 0
type: AcceptedAnswer
has body: From MDN: When found, separator is removed from the string and the substrings are returned in an array. Explanation of error: Start searching with split, find first &amp; &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp // &amp; found and removed, resulting in ' ' // returnArrForSplit = [''] Find second &amp; nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp // &amp; found and removed, everything before pushed to returnArrForSplit, 'nbsp' // returnArrForSplit = ['', nbsp] Third &amp; nbsp&amp;nbsp&amp;nbsp&amp;nbsp // &amp; found and removed, resulting in 'nbsp' // returnArrForSplit = ['', nbsp, nbsp] Fourth &amp; nbsp&amp;nbsp&amp;nbsp // &amp; found and removed, resulting in 'nbsp' // returnArrForSplit = ['', nbsp, nbsp, nbsp] Final &amp; nbsp&amp;nbsp // &amp; found and removed, resulting in 'nbsp' // returnArrForSplit = ['', nbsp, nbsp, nbsp, nbsp] But there is still one nbsp left! nbsp // added as last substring // returnArrForSplit = ['', nbsp, nbsp, nbsp, nbsp, nbsp] returnArrForSplit.shift() // removes unwanted empty string. Fixed Code function spacing(num){ var a=[]; var aToStr=""; for(i=0;i&lt;num;i++) { a.push("&amp;nbsp") } for(i=0;i&lt;a.length;i++) { aToStr=a[i]+aToStr; } return aToStr; } var spaces = spacing(5); // "&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp" spaces = spaces.split('&amp;'); // ["", "nbsp", "nbsp", "nbsp", "nbsp", "nbsp"] spaces.shift() // returns '' // spaces is ["nbsp", "nbsp", "nbsp", "nbsp", "nbsp"]
type: Answer
accepted answer of: http://stackoverflow.com/q/27681332
answers question: http://stackoverflow.com/q/27681332
has comment: http://stackoverflow.com/comment/43777702

http://stackoverflow.com/a/27763972
has body: You can first calculate the difference in milliseconds and then show the millisecond difference in other difference format like this: Date.daysBetween = function( date1, date2 ) { //Get 1 day in milliseconds var one_day=1000*60*60*24; // Convert both dates to milliseconds var date1_ms = date1.getTime(); var date2_ms = date2.getTime(); // Calculate the difference in milliseconds var difference_ms = date2_ms - date1_ms; //take out milliseconds difference_ms = difference_ms/1000; var seconds = Math.floor(difference_ms % 60); difference_ms = difference_ms/60; var minutes = Math.floor(difference_ms % 60); difference_ms = difference_ms/60; var hours = Math.floor(difference_ms % 24); var days = Math.floor(difference_ms/24); return days + ' days, ' + hours + ' hours, ' + minutes + ' minutes, and ' + seconds + ' seconds'; } //Set the two dates var y2k = new Date(2000, 0, 1); var Jan1st2010 = new Date(y2k.getYear() + 10, y2k.getMonth(), y2k.getDate()); var today= new Date(); //displays "Days from Wed Jan 01 0110 00:00:00 GMT-0500 (Eastern Standard Time) to Tue Dec 27 2011 12:14:02 GMT-0500 (Eastern Standard Time): 694686 days, 12 hours, 14 minutes, and 2 seconds" console.log('Days from ' + Jan1st2010 + ' to ' + today + ': ' + Date.daysBetween(Jan1st2010, today));
answers question: http://stackoverflow.com/q/27763086
score: 0
type: Answer

http://stackoverflow.com/comment/43878723
type: Comment
has text: Well, it is the combination of a logical operation and an assignement
comment on: http://stackoverflow.com/a/27733534
score: 0
type: AnswerComment

http://stackoverflow.com/a/27777422
type: AcceptedAnswer
upvote count: 5
type: Answer
accepted answer of: http://stackoverflow.com/q/27777046
downvote count: 0
answers question: http://stackoverflow.com/q/27777046
score: 5
has body: I think you should notice in jasmine, 'it' 'describe' are functions. So when you need to test something inside $scope. You should make sure in any of your 'it' functions, it should access to your variable. Simply change your test case into this: describe('Check if VideoListCtrl', function() { //Add an initialize here: var $scope = null; beforeEach(module('videoApp')); beforeEach(inject(function (_$controller_) { $controller = _$controller_; })); beforeEach(inject(function ($rootScope) { //new a $scope $scope = $rootScope.$new(); controller = $controller('VideoCtrl', { $scope: $scope }); })); it('exists', function() { expect(controller).not.toBeNull(); }); it('set page size', function () { expect($scope.setPageSize(12)).toEqual(12); }); }); Or you can check this in angular document. Hope this will work. : )

http://stackoverflow.com/a/27762291
has comment: http://stackoverflow.com/comment/43935796
score: 0
has comment: http://stackoverflow.com/comment/43936005
type: Answer
has comment: http://stackoverflow.com/comment/43942574
has comment: http://stackoverflow.com/comment/43936340
has comment: http://stackoverflow.com/comment/43941569
has body: Your JSFiddle wasn't working because the function was not available when the DOM elements have loaded. I have created a JSFiddle fixing that issue (moved function definition to jquery ready) and also included code to toggle between two similar lists (bananas and bananas1). Below is how toggling is done, first time bananas div will be displayed, from the second time bananas and bananas1 will be displayed alternatively show_content = function () { var s = document.getElementById("bananas"); var s1 = document.getElementById("bananas1"); if (s.style.height != "290px") { s.style.height = "290px"; s1.style.height = "0px"; } else { s.style.height = "0px"; s1.style.height = "290px"; } }
has comment: http://stackoverflow.com/comment/43941719
accepted answer of: http://stackoverflow.com/q/27762142
has comment: http://stackoverflow.com/comment/43936043
answers question: http://stackoverflow.com/q/27762142
has comment: http://stackoverflow.com/comment/43936447
has comment: http://stackoverflow.com/comment/43935827
has comment: http://stackoverflow.com/comment/43935773
has comment: http://stackoverflow.com/comment/43943998
type: AcceptedAnswer

http://stackoverflow.com/a/27655478
accepted answer of: http://stackoverflow.com/q/27655119
answers question: http://stackoverflow.com/q/27655119
score: 0
type: Answer
has body: if you want validate only extension use this. demo jQuery("#upload").validate({ expression: "if (VAL.match(/\.(xls[mx]?)$/) &amp;&amp; VAL) return true; else return false;", message: "Please upload valid excel file" });
type: AcceptedAnswer

http://stackoverflow.com/comment/43946417
comment on: http://stackoverflow.com/a/27707396
type: Comment
has text: @Sam I updated the answer with a link. It looks like this is now possible as of v0.1.5 of Ember-CLI.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43755367
type: QuestionComment
has text: How should we know that without seeing the code?
type: Comment
score: 2
comment on: http://stackoverflow.com/q/27669943

http://stackoverflow.com/q/27744630
has comment: http://stackoverflow.com/comment/43900443
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43900234
type: Question
has title: Merge 2 HTML Pages into One
has body: I have a webpage with called page1.html with button A I would like to show page2.html on the same page when button A is clicked without creating a new file. Is there anyway to do this?
tagged with: javascript
has answer: http://stackoverflow.com/a/27744870
possible better answer: http://stackoverflow.com/a/27744707
has comment: http://stackoverflow.com/comment/43900380
answer count: 2
has answer: http://stackoverflow.com/a/27744707
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43900216
upvote count: 2
has comment: http://stackoverflow.com/comment/43900262
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27744870

http://stackoverflow.com/a/27693369
answers question: http://stackoverflow.com/q/27693332
has body: .hasClass('someClass') will help you to retrieve a boolean true/false api.jquery.com/hasclass: Determine whether any of the matched elements are assigned the given class. The .hasClass() method will return true if the class is assigned to an element $(document).ready(function () { $('[data-toggle="offcanvas"]').click(function () { $('.row-offcanvas').toggleClass('active'); var act = $('.row-offcanvas').hasClass("active"); if(act){ $('.btn').html("HIDE"); }else{ $('.btn').html("SHOW"); } }); }); a shorter way using a Conditional Operator (AKA Ternary operator) would be: $(function() { // DOM ready $('[data-toggle="offcanvas"]').on("click", function () { var $row = $('.row-offcanvas').toggleClass('active'); $('.btn').html($row.hasClass("active") ? "HIDE" : "SHOW"); }); }); Also I have to warn you that by selecting elements like $(".btn") will alter every single .btn element on the page. Make always sure to use the right selectors with the help of .find() (or similar Selector methods). for specificity sake.
accepted answer of: http://stackoverflow.com/q/27693332
upvote count: 18
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/43799910
has comment: http://stackoverflow.com/comment/43799951
type: AcceptedAnswer
score: 18

http://stackoverflow.com/comment/43834126
type: Comment
has text: I concur with @T.J.Crowder, there is the option of putting it all in the same file. However, the two separate downloads probably won't have a significant impact on page speed, and combining the queries forces all users to download all styles (instead of just the smaller screens). Both approaches are valid; read the article, consider both opinions, and decide which works for you.
type: AnswerComment
comment on: http://stackoverflow.com/a/27710974
score: 0

http://stackoverflow.com/comment/43862544
type: QuestionComment
score: 0
has text: Thanks Sparky. And thanks for the reference.
comment on: http://stackoverflow.com/q/27708007
type: Comment

http://stackoverflow.com/a/27774493
has body: $('#' + divId + ' .settings_class').find('.print_settings').remove();
has comment: http://stackoverflow.com/comment/43959888
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27774472
answers question: http://stackoverflow.com/q/27774472
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43959926

http://stackoverflow.com/a/27756723
upvote count: 1
answers question: http://stackoverflow.com/q/27756595
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43944960
type: Answer
downvote count: 0
has body: It's most likely to do with the browser prefetch I suspect. If there is a src on the image tag then it'll take load time regardless. Any of the js solutions I've seen for responsive images have empty/dummy src tags and then the appropriate img src gets swapped in. I quite like this uncomment technique too as a js option. If the original tag is commented then nothing will get loaded, then you only uncomment the one you need (based on your existing work) https://github.com/DSGNRSteve/Uncomment-Technique-for-RWD
score: 1
accepted answer of: http://stackoverflow.com/q/27756595

http://stackoverflow.com/q/27696967
upvote count: 1
tagged with: php
score: 1
has body: I'm creating a graph with d3 with data from the database, but don't get the date to show properly, instead it only shows 01/17/1970. I get the date from database in this format: YYYY-MM-DD and convert it to a timestamp with: strtotime($t) this results in timestamps like: 1417215600, 1417302000, 1417388400 But the chart does only show above mentioned unix second null. And this is how the x-Axis is formated: chart.xAxis .tickFormat(function(d) { return d3.time.format('%x')(new Date(d)) }); I live in Italy and the default timezone in my application is CET, so I tried to set date_default_timezone_set('UTC'); but with no success. Can someone advice?
type: Question
tagged with: javascript
downvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27697046
has title: Get d3 to show correct dates based on timestamp
tagged with: d3.js
type: UnansweredQuestion
tagged with: datetime

http://stackoverflow.com/a/27747474
downvote count: 0
score: 1
has body: One line is wrong. Here is the fixed line: fileInput.addEventListener('change', imageLoader, false);
upvote count: 1
answers question: http://stackoverflow.com/q/27747333
type: Answer

http://stackoverflow.com/comment/43727908
score: 1
type: AnswerComment
type: Comment
has text: I've voted for Roko's ansver, because its more correct way to do what you want. So you did the right thing! Good luck!
comment on: http://stackoverflow.com/a/27651294

http://stackoverflow.com/comment/43874607
type: QuestionComment
comment on: http://stackoverflow.com/q/27726914
score: 0
has text: Is the range and/or dimensions valid before any other charts are deleted? I don't know why deleting prior charts would affect that, but just trying to brainstorm a debugging idea.
type: Comment

http://stackoverflow.com/q/27745941
type: Question
upvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/27747175
has comment: http://stackoverflow.com/comment/43903038
favorite count: 0
has comment: http://stackoverflow.com/comment/43903202
linked to: http://stackoverflow.com/q/4338538
score: -2
downvote count: 2
has title: javascript IF statement errors
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43902957
duplicate of: http://stackoverflow.com/q/4338538
has comment: http://stackoverflow.com/comment/43903288
has comment: http://stackoverflow.com/comment/43902887
has body: I got a problem with some javascript code that I cant find a solution to and hope some of you can help me find a solution. The problem seems to be with the if statment in the code below that says if(a&gt;b). I get different errors depending on how I write the if statement end depending on where I look I get different errors. Chrome's developer tool says: Uncaught SyntaxError: Unexpected token ; IE's developer tool says: Uncaught SyntaxError: Unexpected token ) I get the same result if i write if(3&gt;1) so i don't Think its a or b that is the problem. If i try if(b&lt;a) then glassfish throws an exception saying the error below where line 39 is the if statement Error Traced[line: 39] The content of elements must consist of well-formed character data or markup. if(1&lt;3) produces the same result as if(b&lt;a) now if i write if(3===1) or if(3===3) it works fine and the code runs perfectly and produces the expected result for using "===" signs, but now I need to be able to use &lt; or &gt;. This code worked fine before upgrading glassfish to 4.1 and a lot of the packages to the latest version. I have recompiled it many times and restarted the server but so far no success. &lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;!DOCTYPE html&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:cc="http://java.sun.com/jsf/composite" xmlns:tp="http://java.sun.com/jsf/composite/components" xmlns:fn="http://java.sun.com/jsp/jstl/functions"&gt; &lt;cc:interface&gt; &lt;cc:attribute name="text" type="java.lang.String" required="true" /&gt; &lt;cc:attribute name="maxsize" type="java.lang.Integer" required="true" /&gt; &lt;cc:attribute name="style" type="java.lang.String" required="false" /&gt; &lt;/cc:interface&gt; &lt;cc:implementation&gt; &lt;p id="par#{component.clientId}" style="#{cc.attrs.style}"&gt; &lt;span id="span#{component.clientId}"&gt;&lt;h:outputText value="#{cc.attrs.text}" /&gt;&lt;/span&gt; &lt;/p&gt; &lt;script&gt; var spa…
tagged with: javascript
tagged with: jsf-2.2
has answer: http://stackoverflow.com/a/27747175

http://stackoverflow.com/a/27681637
has comment: http://stackoverflow.com/comment/43778174
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43778211
has comment: http://stackoverflow.com/comment/43778021
has comment: http://stackoverflow.com/comment/43778219
has comment: http://stackoverflow.com/comment/43778027
has body: With the javascript animation approach you are doing, you would need to get hold of the scope of the current element within the animation's done callback. Since it is outside of angular context after updating the variable you need to manually invoke the digest cycle by doing $scope.$apply() (or use $timeout, scope.$evalAsync and so on). And also since ng-repeat creates a child scope, element's scope would actually have the inherited property state from the parent controller scope, so in-order for the update to get reflected on the parent scope, use an object to wrap state property, so that both child scope and parent has the same object reference. angular.module('myApp', ['ngAnimate']) .controller("MyController", function($scope) { $scope.push = {state: "idle" }; $scope.id=3; $scope.list = [1,2]; $scope.add = function () { $scope.push.state="pushing"; $scope.list.push($scope.id++); }; }).animation('.repeat-animate', function () { return { enter: function (element, done) { element.hide().show(2000, function(){ var scope = element.scope(); //Get the scope scope.$evalAsync(function(){ //Push it to async queue scope.push.state="done pushing" }); }); } }; }); Demo
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27681546
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43779013
answers question: http://stackoverflow.com/q/27681546
has comment: http://stackoverflow.com/comment/43778196
has comment: http://stackoverflow.com/comment/43778157
has comment: http://stackoverflow.com/comment/43779040
has comment: http://stackoverflow.com/comment/43778126
has comment: http://stackoverflow.com/comment/43778082
type: Answer

http://stackoverflow.com/comment/43969951
score: 0
type: Comment
has text: 2) `Some constructs cannot be resolved at parse time` - actually your example is generator, and it can be resolve an parse time. Logic is simple - `yield` (or `yield*` exists) it generator. Otherwise - its function. After all, your nevertheless cannot create conditional function/generator function in current es6 realization.
comment on: http://stackoverflow.com/a/27779542
type: AnswerComment

http://stackoverflow.com/comment/43721054
comment on: http://stackoverflow.com/a/27651928
type: Comment
has text: I have while loop posting photographs, under every photo i have a link "comments" when i press it the popup appears and it contains this form. Now what i am trying to do is to add a comment to database to the particular photo connected with the link. I tried to do it in milion ways but this is not working. I am working on it like 20 hours a day and just nothing. Its 5 at night already and i am so tired already
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43815319
comment on: http://stackoverflow.com/a/27701237
score: 0
type: Comment
type: AnswerComment
has text: seamsto work in chrome 30+ but if not look at this http://stackoverflow.com/a/25367919/406659

http://stackoverflow.com/comment/44003796
comment on: http://stackoverflow.com/q/27797530
type: Comment
has text: @Alnitak - The JavaScript doesn't load or do what it is suppose to do i.e. center the the selection in the centre.
type: QuestionComment
score: 1

http://stackoverflow.com/tag/csv
type: Tag
tags question: http://stackoverflow.com/q/27708283
tags question: http://stackoverflow.com/q/27753696
tag name: csv
tags question: http://stackoverflow.com/q/27780594
tags question: http://stackoverflow.com/q/27776994
tags question: http://stackoverflow.com/q/27700519
tags question: http://stackoverflow.com/q/27796309
tags question: http://stackoverflow.com/q/27654916
tags question: http://stackoverflow.com/q/27802123
tags question: http://stackoverflow.com/q/27739452
tags question: http://stackoverflow.com/q/27656310
tags question: http://stackoverflow.com/q/27782140
tags question: http://stackoverflow.com/q/27768813
tags question: http://stackoverflow.com/q/27801261
tags question: http://stackoverflow.com/q/27782431
tags question: http://stackoverflow.com/q/27762982

http://stackoverflow.com/comment/43920889
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27755115
has text: If by "Pure JS" you mean "Without a library of JS written by someone else" - you cannot. The `$` function creates a jQuery (or Zepto) object. You can't use the jQuery (or Zepto) library without using a library.
score: 4

http://stackoverflow.com/q/27759186
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/71429616
answer count: 2
has comment: http://stackoverflow.com/comment/44202732
downvote count: 0
has comment: http://stackoverflow.com/comment/43929793
tagged with: javascript
has comment: http://stackoverflow.com/comment/43929333
has body: I'm not quite sure what's going on here. I'm using the latest Google Chrome, and recently any Alert Box popups don't show up. They're THERE, because I have to hit enter/esc to be able to use my browser again. This is for all alert boxes in the browser. I tried plugging an HDMI cable to see if it was really off screen and maybe I could see it if I extended my monitor, but to no avail. I saw that there was a bug in 2012 that was similar to this, but that's obviously been fixed and shouldn't be relevant here. EDIT: Version 39.0.2171.95
favorite count: 0
has comment: http://stackoverflow.com/comment/43929822
has answer: http://stackoverflow.com/a/27759598
type: AnsweredQuestion
tagged with: google-chrome
possible better answer: http://stackoverflow.com/a/42757561
has title: Alert Box "not showing" in Chrome - Off Screen?
type: Question
has answer: http://stackoverflow.com/a/42757561
accepted answer: http://stackoverflow.com/a/27759598

http://stackoverflow.com/comment/43960638
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27774885
has text: What values you are getting in `MunLANUser` and `LANUser` ?
score: 0

http://stackoverflow.com/comment/43807228
type: QuestionComment
type: Comment
has text: you need to display caption of image when hover
comment on: http://stackoverflow.com/q/27696917
score: 0

http://stackoverflow.com/a/27749695
has comment: http://stackoverflow.com/comment/43917992
type: Answer
answers question: http://stackoverflow.com/q/27749596
downvote count: 0
upvote count: 8
has comment: http://stackoverflow.com/comment/43917821
has comment: http://stackoverflow.com/comment/43917842
has comment: http://stackoverflow.com/comment/43917778
has body: compareSync method takes only 2 arguments and returns a boolean value true or false. You should perform the check like this: var result = bcrypt.compareSync(password, user.password); if (result) { console.log("Password correct"); } else { console.log("Password wrong"); }
score: 8

http://stackoverflow.com/comment/43945320
has text: hi, i tried it but it seem doesn't refresh the iframes.. If I may could I ask to make a fixed code of mine as shown on my question?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27767354

http://stackoverflow.com/q/27751325
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: partial-views
downvote count: 0
has answer: http://stackoverflow.com/a/27751382
accepted answer: http://stackoverflow.com/a/27751382
tagged with: laravel
type: AnsweredQuestion
score: 1
has title: jquery creating variable and using it to for load - laravel
tagged with: loadview
has body: I am a newbie in jQuery, obviously I don't really understand some basics, although I have read some tutorials. I Have two buttons: News 1 News 2 - - - I want to use them to load content of a div with id="dashcontent" My Route looks like this: Route::get('newcontent/latest_events/{mode}', 'ReportsController@newcontent_partials'); My controller method is this: public function newcontent_partials($mode) { if($mode == 'importance') { $rnd = rand(4, 5); // just for testing purpose $top5events = Event1:: ->orderBy('id', 'desc') ->take($rnd) ->get(); $test_type = 'ajax OK - OLDEST'; } else { $rnd = rand(5, 6); $top5events = Event1:: ->orderBy('id', 'asc') ->take($rnd) ->get(); $test_type = 'ajax OK - NEWEST'; } return View::make('partials._event_minibox', compact('test_type','top5events','rnd')); } My script looks like this: This works just as expected: function getbyText() { $("#dashcontent").toggleClass( "col_12" ); // just to see that the script is working $('#dashcontent').load('newcontent/latest_events/newest'); } This works only if load target is delivered as plain text: function getbyVar() { $('#test_output').text($('#test2').attr("displaymode")); // printing the value of attr var linkcode = $('#demo3').attr("displaymode"); // creating the variable $('#dashcontent').load(linkcode); // THIS WILL NOT LOAD $('#test_output').text(linkcode); // surprisingly, this one works!!! } if in the above code getbyVar function I use $('#dashcontent').load('newcontent/latest_events/newest'); then the thing is working as expected Please help me to solve these two problems: Make the loading div content work with the variable displaymode. Note: it can be a different solution than the one I am trying to implement. Make the function work extract the attr("displaymode") of the element which is clicked. not from an element with specified ID. I have tried this: var linkcode = $(this).attr("displaymode"); but contrary to examlpes I have found on-line, in case of my code doesn't work. Any hel…

http://stackoverflow.com/comment/81932164
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/35603217
has text: Man, you saved me lots of time struggling this:))) I changed Facebook to Component though and all the references from global to "this" but your logic worked as magic!. Thanks a lot!

http://stackoverflow.com/a/27694252
has comment: http://stackoverflow.com/comment/43806039
has comment: http://stackoverflow.com/comment/43804378
has comment: http://stackoverflow.com/comment/43805434
type: Answer
score: 1
has body: For each element in the iterated collection a DOM template will be rendered and a new scope will be created and associated with it. The leave function in your code is called when one of these templates is removed from the DOM (for example due to filter). When the template is removed its associated scope is destroyed. This means that when the following function executes the associated scope will already have been destroyed: return function (cancelled) { if (cancelled) { jQuery(element).stop(); } else { scope.$apply(function () { scope.step.Visible = false; }); } }; You can verify this by adding the following inside it: console.log(scope.$$destroyed); When a scope is destroyed one of the things that happens it that its $apply function is set to an empty function: function noop() {} This means that the anonymous function (the one that sets Visible to false) that you pass to scope.$apply will never be executed, since $apply is just an empty function and doesn't do anything with its passed arguments. To solve this you can inject $rootScope and use that instead: return function(cancelled) { if (cancelled) { jQuery(element).stop(); } else { $rootScope.$apply(function() { scope.step.Visible = false; }); } }; Demo: http://plnkr.co/edit/jdNtcOSzq9BC9vxjmmLy?p=preview Also note that the element will already be a jqLite element (or jQuery element if jQuery is loaded before AngularJS) so you can replace the following: var scope = angular.element(element).scope(); With: var scope = element.scope(); And all occurences of: jQuery(element) With just: element
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27671600
answers question: http://stackoverflow.com/q/27671600
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/55967638
comment on: http://stackoverflow.com/q/27661306
type: Comment
type: QuestionComment
has text: @vitaly-t: It's relevant as far as [arrow functions are not just a syntactic replacement for bound function expressions](http://stackoverflow.com/q/32535110/1048572), and that you cannot expect the same syntax to work for other functions.
score: 0

http://stackoverflow.com/comment/43773710
score: 0
comment on: http://stackoverflow.com/q/27679134
type: Comment
type: QuestionComment
has text: @U2744SNOWFLAKE I edited the whole thing, with much more simple fiddle could you possibly put it off hold now?

http://stackoverflow.com/a/27736383
has comment: http://stackoverflow.com/comment/56942101
has comment: http://stackoverflow.com/comment/82991092
has comment: http://stackoverflow.com/comment/56936434
has comment: http://stackoverflow.com/comment/112235596
has comment: http://stackoverflow.com/comment/82977567
has comment: http://stackoverflow.com/comment/100491067
accepted answer of: http://stackoverflow.com/q/27736186
has comment: http://stackoverflow.com/comment/56941442
has body: To avoid this warning, do not use: async: false in any of your $.ajax() calls. This is the only feature of XMLHttpRequest that's deprecated. The default is async: true, so if you never use this option at all, your code should be safe if the feature is ever really removed. However, it probably won't be -- it may be removed from the standards, but I'll bet browsers will continue to support it for many years. So if you really need synchronous AJAX for some reason, you can use async: false and just ignore the warnings. But there are good reasons why synchronous AJAX is considered poor style, so you should probably try to find a way to avoid it. And the people who wrote Flash applications probably never thought it would go away, either, but it's in the process of being phased out now. Notice that the Fetch API that's replacing XMLHttpRequest does not even offer a synchronous option.
has comment: http://stackoverflow.com/comment/65882502
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/100489706
has comment: http://stackoverflow.com/comment/56941690
answers question: http://stackoverflow.com/q/27736186
has comment: http://stackoverflow.com/comment/100489684
has comment: http://stackoverflow.com/comment/56951516
downvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/67754220
has comment: http://stackoverflow.com/comment/56942081
has comment: http://stackoverflow.com/comment/45577089
has comment: http://stackoverflow.com/comment/112395472
upvote count: 148
score: 146
has comment: http://stackoverflow.com/comment/45573665
has comment: http://stackoverflow.com/comment/77968873
has comment: http://stackoverflow.com/comment/93946064
has comment: http://stackoverflow.com/comment/56936289
has comment: http://stackoverflow.com/comment/95134012
has comment: http://stackoverflow.com/comment/100489690
has comment: http://stackoverflow.com/comment/112266436
has comment: http://stackoverflow.com/comment/77986510
has comment: http://stackoverflow.com/comment/95136794
has comment: http://stackoverflow.com/comment/100489662
has comment: http://stackoverflow.com/comment/93931431
has comment: http://stackoverflow.com/comment/112225344
has comment: http://stackoverflow.com/comment/112259626

http://stackoverflow.com/a/27758003
answers question: http://stackoverflow.com/q/27757860
has body: You could start by parsing the whole JSON: var jsonObject = JSON.parse(RAW_JSON_STING); var newJsonObject = []; // Loop through it for (var interator in jsonObject) { for (var it = 0; it &lt; iterator.length; it++) { newJsonObject.push(iterator[it] + ", " + iterator); } } No guarantee the code above will work as intended.
score: 0
type: Answer

http://stackoverflow.com/comment/43862463
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27725187
has text: possible duplicate of [Get reviews from google map api](http://stackoverflow.com/questions/16415827/get-reviews-from-google-map-api)

http://stackoverflow.com/comment/43925328
type: Comment
comment on: http://stackoverflow.com/q/27756579
score: 0
has text: I'm looking for it, but CryptoJS does not have a direct array to `WordArray` conversion. The answer is probably to convert to hexadecimals first, then create a `WordArray` out of it (which is pretty inefficient, but JavaScript generally is for byte array / crypto operations).
type: QuestionComment

http://stackoverflow.com/a/27655995
type: Answer
has comment: http://stackoverflow.com/comment/43729474
downvote count: 0
has comment: http://stackoverflow.com/comment/43729461
has comment: http://stackoverflow.com/comment/43728421
accepted answer of: http://stackoverflow.com/q/27655521
answers question: http://stackoverflow.com/q/27655521
score: 1
has comment: http://stackoverflow.com/comment/43728905
upvote count: 1
has body: Of course it does not work, look at your javascript, you are cloning the last row to add a new line, you have no last row because you have no partners in the list. There are several options, probably the simplest one for you is to add a hidden row at the top. In this way you will always have a last row. Remember to make the row visible when you clone it. Something like <?php $id = 0; ?> <?php $partner = new \app\models\Partners(); ?> <?= $form->field($partner, '[' . $id . ']' . 'name')->textInput(['maxlength' => 255]) ?> <?= $form->field($partner, '[' . $id . ']' . 'email')->textInput(['maxlength' => 255]) ?> <?= $form->field($partner, '[' . $id . ']' . 'mobile')->textInput(['maxlength' => 255]) ?> <div style="margin-top: 30px;" class="col-md-3 <?php echo ($id < 1) ? 'dnone' : 'dblock'; ?>" id="divDelete" class="row-fluid"> Remove <?php foreach ($partnerModels as $partner) { ?> <?= $form->field($partner, '[' . $id . ']' . 'name')->textInput(['maxlength' => 255]) ?> <?= $form->field($partner, '[' . $id . ']' . 'email')->textInput(['maxlength' => 255]) ?> <?= $form->field($partner, '[' . $id . ']' . 'mobile')->textInput(['maxlength' => 255]) ?> <div style="margin-top: 30px;" class="col-md-3 <?php echo ($id < 1) ? 'dnone' : 'dblock'; ?>" id="divDelete" class="row-fluid"> Remove <?php $id++; ?> <?php } ?> Then in your function addNewSection(divToAppend, modelName) { you can add a line to make the $cloneDiv attr display as block. There are more elegant ways but it would take a long time to explain how they work.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43728440
has comment: http://stackoverflow.com/comment/43728139

http://stackoverflow.com/q/27716558
has comment: http://stackoverflow.com/comment/43847530
has answer: http://stackoverflow.com/a/27748124
has answer: http://stackoverflow.com/a/27787089
accepted answer: http://stackoverflow.com/a/27787089
downvote count: 0
tagged with: javascript
favorite count: 0
has title: How do I properly split apart a Controller's model?
has answer: http://stackoverflow.com/a/27717074
answer count: 3
tagged with: ember.js
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27748124
upvote count: 1
type: Question
score: 1
has body: I'm working on a webapp to teach myself Ember, and I've walked into one large issue: The page halts while it is attempting to fetch json, and my IndexRoute and IndexController feel very bloated. Additionally, this.store.find('pokemon') uses the RESTAdapater, and can freeze the page from rendering anything (besides the loader) for up to 1.5 seconds. App.IndexRoute = Ember.Route.extend({ model: function() { var store = this.store; return Ember.RSVP.hash({ pokeballs: App.Pokeball.all(), pokemon: store.find('pokemon'), status: App.Status.all(), levels: App.Levels }); } }); Updated Question: As it is now, my IndexController is larger than I would like, and is acting as a mediator for the pokeballs and pokemon collections. I am thinking it would be a good idea to split up IndexController so that I have an IndexController, a PokemonListController, and a PokeballListController. The problems I have are: How should I populate the content of the PokemonListController and PokeballListController if I am on '/', which maps to the IndexRoute? Is this actually a good idea, am I treating controller's they way they are intended to be treated? Webapp Demo: http://theirondeveloper.github.io/pokemon-catch-rate Github: https://github.com/TheIronDeveloper/pokemon-catch-rate
has comment: http://stackoverflow.com/comment/43845941

http://stackoverflow.com/comment/43957710
comment on: http://stackoverflow.com/a/27749886
has text: Hey @Rob, after doing the optimization with `grunt-contrib-requirejs` and using the built file as my background script I have only one question left: Can I maintain the code that I provided in my question `as is`? Do I need to change anything? The onInstalled event handler is not executing. Notice that I have used the configuration in my entry-point file instead of providing a separate file (I used mainConfigFile option for this). I can see that all the necessary files have been concatenated in the build file, but no luck making it work as desired.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29192578
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/57277471
accepted answer of: http://stackoverflow.com/q/27643307
type: Answer
answers question: http://stackoverflow.com/q/27643307
upvote count: 2
has comment: http://stackoverflow.com/comment/57820975
has body: it seems that username &amp; email can not be altered in beforeSave trigger as they should be unique Right now, the email field cannot be modified on a beforeSave because this field should be unique. If you were to use a value that another user is already using, this would result in an error that your beforeSave method would not be able to handle. reference: https://www.parse.com/questions/why-cant-i-modify-the-email-field-in-a-before-save-trigger

http://stackoverflow.com/a/27711274
downvote count: 0
answers question: http://stackoverflow.com/q/27711227
has body: Your first example is a function statement, which declares a name in its containing scope. Your second example is a named function expression, which does not. For more information, see here.
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/43972286
has text: what you want the ``to do
type: QuestionComment
comment on: http://stackoverflow.com/q/27781195
score: 0
type: Comment

http://stackoverflow.com/a/27656813
answers question: http://stackoverflow.com/q/27656753
has comment: http://stackoverflow.com/comment/43729551
type: Answer
score: 0
has body: You are missing second Argument in function calling OnClientClick='&lt;%# "getSetContactID(\"" + Container.DataItemIndex + "\")" %&gt;' function getSetContactID(rowIndex, obj) {

http://stackoverflow.com/comment/43992617
type: QuestionComment
score: 2
has text: That *parent.child* doesn't exist yet. ;-) *parent* exists because it was declared. The assignment of the object to *parent* will only occur once the object is fully parsed and created, so until the closing `}` *parent* will keep its value prior to the assignment (i.e. undefined).
type: Comment
comment on: http://stackoverflow.com/q/27791429

http://stackoverflow.com/comment/44073407
type: Comment
comment on: http://stackoverflow.com/a/27815531
has text: @Dimitri M : Yes and Thanks for your help. First I tried to make them programmatically but its not worked for my scenario so I have created using above way. But from next time will try or insure to make it programmtically or declarative.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43892911
type: Comment
type: QuestionComment
score: 0
has text: Do you check the value of the `name` variable in your servlet?
comment on: http://stackoverflow.com/q/27740970

http://stackoverflow.com/comment/43878554
comment on: http://stackoverflow.com/q/27733264
score: 0
type: QuestionComment
type: Comment
has text: @Joe, yes, sorry; a typo on my part.

http://stackoverflow.com/comment/43931626
type: QuestionComment
comment on: http://stackoverflow.com/q/27758010
has text: Check out my answer. That's because \t is the escape code for a tab.
score: 0
type: Comment

http://stackoverflow.com/comment/43770538
type: Comment
comment on: http://stackoverflow.com/a/27677068
type: AnswerComment
has text: @CameronA yes that's true! In ES6 things are more flexible.
score: 0

http://stackoverflow.com/a/27666638
type: Answer
has comment: http://stackoverflow.com/comment/43748354
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43748183
answers question: http://stackoverflow.com/q/27666344
has comment: http://stackoverflow.com/comment/43748288
has comment: http://stackoverflow.com/comment/43748573
downvote count: 0
has body: You have several problems: you use remember before defining it your document.sqrl.login_username.value and document.sqrl.secretkey.value values depend on name and pw, name and pw depend on localStorage values, which in turn are set based on yourdocument.sqrlobjects. If you set document.sqrl.login_username.value and sqrl.secretkey.value somewhere else before the onsubmit is executed, then this is actually not a problem you try to directly access "name" and "pw" from localStorage, I believe you cannot do that. Use the getItem and setItem functions instead Suggested code: var remember = function() { var name = localStorage.getItem("name"); var pw = localStorage.getItem("pw"); if(pw != undefined &amp;&amp; name != undefined) { document.sqrl.login_username.value = name; document.sqrl.secretkey.value = pw; }; document.sqrl.onsubmit = function() { localStorage.setItem("name", document.sqrl.login_username.value); localStorage.setItem("pw", document.sqrl.secretkey.value); }; }; window.onload = remember; EDIT: I have read the comment of Xan and have tested the following code in my console: localStorage["foo"] = "bar"; After reloading the page I have checked the value of localStorage["foo"] and it was "bar" indeed. Therefore, Xan was right and my third point is invalid indeed.

http://stackoverflow.com/a/27731195
accepted answer of: http://stackoverflow.com/q/27731159
downvote count: 0
answers question: http://stackoverflow.com/q/27731159
has comment: http://stackoverflow.com/comment/43874171
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43873891
has comment: http://stackoverflow.com/comment/43874740
upvote count: 3
has comment: http://stackoverflow.com/comment/43874319
has comment: http://stackoverflow.com/comment/43874131
has comment: http://stackoverflow.com/comment/43873866
has comment: http://stackoverflow.com/comment/43874022
type: Answer
has body: From your question, I assume you've considered but rejected using composition: var Player = function (socket, x, y) { this.socket = socket; this.x = x; this.y = y; }; Usage: var player = new Player(socket, x, y); player.socket.on(/*...*/); player.socket.emit(/*...*/); FWIW, I would probably use composition. But if you don't want to, you have at least a couple of choices: Really inherit, using socket as the prototype of the new object: In this scenario, you probably wouldn't use new: var Player = function (socket, x, y) { var obj = Object.create(socket); obj.x = x; obj.y = y; return obj; }; Usage: var player = Player (socket, x, y); // No `new` here, although it's harmless player.on ('event1', function () {}); player.emit ('event2', function () {}); (Although if you did use new, it would be harmless&nbsp;&mdash; the object created by new would just be thrown away, because Player returns a non-null object reference, and so overrides the default result of new.) This won't work if you're relying on the objects inheriting Player.prototype, however. You could copy everything from Player.prototype onto the instance by adding this code to the above: var key; for (key in Player.prototype) { if (Player.prototype[key] !== Object.prototype[key]) { this[key] = Player.prototype[key]; } } That copies any properties from Player.prototype (and its prototypes, except for Object.prototype as the player will already have those) onto the player object. Less than ideal, but functional, it just means that you need to make sure that Player.prototype has everything on it before you create the first player. Also, instanceof won't work for players. Just wire up the bits you want, without actually using socket as the prototype, by adding bound functions to your Player instance that actually route to socket: var Player = function (socket, x, y) { this.on = socket.on.bind(socket); this.emit = socket.emit.bind(socket); this.x = x; this.y = y; }; Usage is then as in your question, using new. Or a …
score: 3

http://stackoverflow.com/comment/44011928
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27801542
type: QuestionComment
has text: what environment you run the js?(e.g. In browser or node.js, etc). Most environment support running code on other threads. For instance, node.js you can use cluster. Check the manual for detail.

http://stackoverflow.com/q/27776268
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/27776463
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/27776463
upvote count: 1
accepted answer: http://stackoverflow.com/a/27776472
favorite count: 0
tagged with: memory-management
has title: Declare vars inside javascript function and memory management
has body: For some time I've had a doubt about js potential memory leak in this type code: function foo() { var a = "This is my content"; $('#myElemId').on('click', function() { $(this).html(a); }); } My question is: When foo is called, I suppose it is created an execution object, allocates memory for var a and assigns an event listener to a dom element. Once foo returns it should free the execution object but I think it won't because there is still a reference to var a from the click listener, right?
tagged with: garbage-collection
has answer: http://stackoverflow.com/a/27776472
type: AnsweredQuestion

http://stackoverflow.com/a/27777224
upvote count: 1
type: Answer
has body: Using WebWorkers might be a solution. WebWorkers can process large amounts of data in the background process, while keeping application UI responsive: http://www.w3schools.com/html/html5_webworkers.asp
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27776994

http://stackoverflow.com/q/27643719
has answer: http://stackoverflow.com/a/27645203
has comment: http://stackoverflow.com/comment/43707250
score: 2
linked to: http://stackoverflow.com/q/22519784
upvote count: 2
tagged with: dom
has comment: http://stackoverflow.com/comment/43707556
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43707115
has comment: http://stackoverflow.com/comment/43710237
has comment: http://stackoverflow.com/comment/43707013
answer count: 1
downvote count: 0
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/43706770
linked to: http://stackoverflow.com/q/14220321
favorite count: 0
has comment: http://stackoverflow.com/comment/43707005
tagged with: promise
has comment: http://stackoverflow.com/comment/43708669
type: UnansweredQuestion
has body: The asynchronous function I am trying to call is defined by onClick property of DomOutline. For this example, domClickHandler is like callback that receives the selected element. var iWantThis; var myDomOutline = DomOutline({ onClick: domClickHandler, filter: false, stopOnClick: true, hideLabel: true }); var domClickHandler = function(element){ iWantThis = element console.log("I am the element you've selected: " + element); }; myDomOutline.start(); console.log("From the outside world: " + iWantThis); return iWantThis; DomOutline.start() returns right away and domClickHandler is asynchronous callback. So in this example, the last console.log will return undefined even before I select the element. I have tried trying $.when() on a function that wraps around DomOutline.start() to return promise(), but it didn't make the async call synchronous. What is the way to use promise here so that I could return the DOM object when it has been selected? I promisified the callback, but I am not sure how this will help me to achieve synchronous return of the array iWantThis var domClikcHandler= function(element){ var dfd = $.Deferred(); classifiedElements = __classifyChildrenElements(element); dfd.resolve(classifiedElements); dfd.then(function(e){ console.log(e); iWanThis = e; }); return dfd.promise() };
has title: Adding promise to DomOutline event handler

firefox-addon-sdk
tags question: http://stackoverflow.com/q/27754641
tags question: http://stackoverflow.com/q/27801029
type: Tag
tags question: http://stackoverflow.com/q/27689747
tag name: firefox-addon-sdk
tags question: http://stackoverflow.com/q/27693012
tags question: http://stackoverflow.com/q/27663868
tags question: http://stackoverflow.com/q/27692517

http://stackoverflow.com/q/27721486
has comment: http://stackoverflow.com/comment/43898085
possible better answer: http://stackoverflow.com/a/27721650
has comment: http://stackoverflow.com/comment/43854701
has answer: http://stackoverflow.com/a/27721650
accepted answer: http://stackoverflow.com/a/27721698
tagged with: javascript
has comment: http://stackoverflow.com/comment/43855457
score: 0
answer count: 3
tagged with: jquery
has comment: http://stackoverflow.com/comment/43855064
favorite count: 0
has body: How can we create the vertical bar / spiral / splash kind of page animation effect found as we scroll down the web page at http://grouek.com/ website? I guess it is CSS3 or something advanced than it like Canvas. But is there any way to do it in CSS3 or jQuery?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27721810
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43854696
upvote count: 1
has title: How to create Scrolling Effect like Grouek website
downvote count: 1
has answer: http://stackoverflow.com/a/27721698
tagged with: computer-science
type: Question

http://stackoverflow.com/a/27695326
accepted answer of: http://stackoverflow.com/q/27642627
has comment: http://stackoverflow.com/comment/43837445
score: 0
has comment: http://stackoverflow.com/comment/43837373
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/27642627
has body: Make sure to load all of your polyfills before any other scripts. It sounds as though you might be referencing these too late, and thus not properly benefiting from them.

http://stackoverflow.com/a/33932234
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27667806
has body: Please, check the third (accepted) answer to this: Angular bootstrapping after load of html (direct link: Loading an AngularJS controller dynamically) I think, you have to "compile" anything, which is added after a first 'bootstrap' call Also, I've made this fiddle yesterday to describe my trouble, I think it fits yours. http://jsfiddle.net/21neg0ox/ var app = angular.module('app', []); angular.element(document).ready(function () { angular.bootstrap(document, ['app']); }); //c1 app.controller('c1', ['$scope', '$compile', c1Fn]); app.controller('c2', ['$scope', '$compile', c1Fn]); function c1Fn($scope){ $scope.isAlive = 'is alive'; } setTimeout(wtf, 500); function wtf(){ var myLovelyHTML = ' c2 {{isAlive}} '; document.getElementById('c2-wrap').innerHTML = myLovelyHTML; }

http://stackoverflow.com/a/27648337
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27648030
has body: The unload event fires when the window closes, but also when user refreshes the page or navigates to a new page (even if new page is within your site). I recommend against using unload in this case. (unload is better used for things like prompting user to save or lose changes before leaving a form, for example.) Also, if you implement a javascript solution you either want to (1) require javascript to use the site (and show element to folks with JS disabled), or (2) code such that you are not relying solely on your window close / cleanup detection routine to release resources. The strategy I typically implement to do stuff like this is to use a ping process. Basically: the client sends regular pings to the server which resets the connection's/session's idle counter to 0 when it receives a ping. The pings occur every minute or so depending on need. A long-running looping thread (a Session manager, if you will) then checks for any clients that have idled beyond the idle threshhold (say 3 minutes, but up to you), and if exceeded releases the resources tied to that connection/session. Then every page (where appropriate) in your site adds this ping code so that the client starts pinging for as long as the page is open in the browser. Benefits keeps track of how long user is viewing your site (useful for metrics, especially when coupled with a metric for tracking number of requests) closes all connection-related resources when browser is closed, and also when user navigates away from your site if user navigates to different page [that has ping code] on your site their connection resources will not be cleared because the idle counter will reset on the next page Drawbacks requires javascript (setTimeout or setInterval and XMLHttpRequest, for example) unless you also have something like an "authentication timeout" on the server, the client could potentially keep your server (and resources) connected for a long time if user walks away from an open web browser for a while (you …
type: Answer
downvote count: 0

http://stackoverflow.com/a/27699290
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27699136
accepted answer of: http://stackoverflow.com/q/27699136
has comment: http://stackoverflow.com/comment/43812916
type: AcceptedAnswer
has body: Here's a shot. Instead of using `jQuery.animate' just use your CSS transitions. On keypress, add the 'hover' class to the element, then remove it when you trigger the new page. Also add the 'hover' rules to the css. $(document).bind("keydown", function(event){ event.preventDefault(); var k = event.which || event.keyCode; for(var i = 32; i < 91; i++){ if (i == k){ var obj = $("a.hotkey" + k); obj.addClass('hover') setTimeout(function(){ window.open(obj.attr("href")); obj.removeClass('hover') },500); } } return false; }); div.website a:link, div.website a:visited{ background-color:#ffffff; display:block; position:relative; text-align:center; vertical-align:middle; text-decoration:none; line-height:45px; height:45px; font-size:14px; border-radius:2px; color:#474a4d; transition-property:background-color, color, font-size; transition-duration:0.2s; transition-timing-function:ease; } div.website a.hover, div.website a:hover{ background-color:#2c3e50; color:#ffffff; font-size:24px; } facebook You'll notice that facebook doesn't start up from Stack, but that's because the sandboxed environment doesn't allow popups. I tried the same in Codepen and it seems to work just fine. Give it a shot and let me know if this is what you were looking for.

http://stackoverflow.com/q/27743032
tagged with: javascript
has comment: http://stackoverflow.com/comment/43897005
score: -1
has comment: http://stackoverflow.com/comment/43897001
answer count: 2
upvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/27743158
has answer: http://stackoverflow.com/a/27743235
has comment: http://stackoverflow.com/comment/43899611
has comment: http://stackoverflow.com/comment/43899561
has comment: http://stackoverflow.com/comment/43897087
has title: JQuery AJAX $.post failure to return data
tagged with: php
has comment: http://stackoverflow.com/comment/43897154
possible better answer: http://stackoverflow.com/a/27743235
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43896924
has comment: http://stackoverflow.com/comment/43897028
has comment: http://stackoverflow.com/comment/43896964
has comment: http://stackoverflow.com/comment/43897004
accepted answer: http://stackoverflow.com/a/27743158
downvote count: 1
type: Question
has body: I am having difficulty with a specific JQuery $.post call to a PHP-based processor. I created a test page with the code below located here: http://goo.gl/Bg7H2u Note this is located on a subdomain, but we are not doing cross-domain posting. Everything should be included on the subdomain. There do not seem to be any JS errors as reported in the error console. The processor /get-data.html is the general purpose PHP processor, and, if you load the processor page with the right value, it returns a dataset from the MySQL database in JSON format. We have this working on the main domain without issue, and other $.post calls seem to work OK from this subdomain (not to this /get-data.html processor, but other processors that process form content). See the actual processor output here: http://goo.gl/yOzrm2 I must be missing something obvious, but I am coming up empty. Thoughts? Here is the code: Thanks for any advice you can provide.

http://stackoverflow.com/q/27656315
has body: I use above script to show popup when visitors click anywhere in website. When I access link: http://yllix.com/popup.php?section=General&amp;pub=766137&amp;ga=g&amp;show=2, it showed: document.write(' Un-authorized access! Yllix media '); Can you explain me how it work, please ? Why I can't access link ? What method they use ?
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43731276
has title: I can't access .js but it work well in browser
has comment: http://stackoverflow.com/comment/43728891
type: Question
tagged with: javascript
tagged with: authorization
score: 0

http://stackoverflow.com/a/27720495
has body: already answerd here jQuery - Redirect with post data var redirect = 'Your Url here'; $.redirectPost(redirect, {x: 'example', y: 'abc'}); // your parametters // jquery extend function $.extend( { redirectPost: function(location, args) { var form = ''; $.each( args, function( key, value ) { form += '&lt;input type="hidden" name="'+key+'" value="'+value+'"&gt;'; }); $('&lt;form action="'+location+'" method="POST"&gt;'+form+'&lt;/form&gt;').appendTo('body').submit(); } });
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43852749
type: Answer
accepted answer of: http://stackoverflow.com/q/27720432
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27720432
has comment: http://stackoverflow.com/comment/43853636

http://stackoverflow.com/q/27712941
downvote count: 0
has body: I'm having some trouble finding an explanation for how to use grunt-browserify. Looking in their examples folder, I'm looking under the browserify node under their basic example and I see the following: module.exports = function (grunt) { grunt.initConfig({ browserify: { vendor: { src: [], dest: 'public/vendor.js', options: { require: ['jquery'], alias: [ './lib/moments.js:momentWrapper', //can alias file names 'events:evt' //can alias modules ] } }, client: { src: ['client/**/*.js'], dest: 'public/app.js', options: { external: ['jquery', 'momentWrapper'], } } }, concat: { 'public/main.js': ['public/vendor.js', 'public/app.js'] } }); grunt.loadTasks('../../tasks'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.registerTask('default', ['browserify', 'concat']); }; What are "vendor" and "client" and where are they documented? In the README file, they mention "preBundleCB", "dist" and I've seen quite a few others, and most have their own data structures. Are these options enumerated and explained anywhere?
type: Question
upvote count: 6
tagged with: javascript
tagged with: gruntjs
tagged with: browserify
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27715143
accepted answer: http://stackoverflow.com/a/27715143
score: 6
has title: using grunt-browserify in Gruntfile.js
tagged with: node.js
type: AnsweredQuestion

openlayers-3
type: Tag
tags question: http://stackoverflow.com/q/27670622
tag name: openlayers-3
tags question: http://stackoverflow.com/q/27767493
tags question: http://stackoverflow.com/q/27658280

http://stackoverflow.com/q/27662980
score: 1
type: Question
upvote count: 1
tagged with: arrays
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43799232
accepted answer: http://stackoverflow.com/a/27663304
has body: I am starting do some scripting using OS.File.DirectoryIterator from the OS.File module. I've gotten the following block of code working...sort of. What I'm trying to do is iterate through the given directory (which has 4 sub-directories) and place the names of the sub-directories into an array. The hang-up is that the array is populated as expected but is not available outside of the promise construct. Admittedly, I'm inexperienced with promises, so I'm sure the problem lies in how I've constructed this (which is lifted from the MDN page on OS.File.DirectoryIterator). So my question: why is the array accessible within the promise but not outside it? var iterator = new OS.File.DirectoryIterator(PathToDir); var subDirNames = []; var promise = iterator.forEach( function(entry) { subDirNames.push(entry.name); } ); promise.then( function(success) { iterator.close(); console.log("--&gt; "+subDirNames[1]); \\Array element 1 display in console fine. return subDirNames; }, function(failure) { console.log("--&gt; Error: "+failure); } ); console.log("--&gt; "+subDirNames[1]); \\Array element 1 displays as undefined.
tagged with: promise
has answer: http://stackoverflow.com/a/27663304
has title: Returning an array from the JavaScript OS.File.DirectoryIterator
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/43876504
type: Comment
has text: If it works for you then suggest correction and I will edit my answer.
comment on: http://stackoverflow.com/a/27725958
score: 0
type: AnswerComment

http://stackoverflow.com/q/27643384
score: 1
tagged with: google-chrome-devtools
has comment: http://stackoverflow.com/comment/43706633
has comment: http://stackoverflow.com/comment/49701063
type: Question
has title: Unable to set breakpoint in chrome app
upvote count: 1
tagged with: javascript
favorite count: 0
tagged with: google-chrome-app
has comment: http://stackoverflow.com/comment/43836184
has comment: http://stackoverflow.com/comment/60082383
has comment: http://stackoverflow.com/comment/43705928
answer count: 0
has comment: http://stackoverflow.com/comment/43833856
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43705534
linked to: http://stackoverflow.com/q/20385505
has body: I seemed to have lost the ability to set a breakpoint in a chrome app. I tested with a chrome-app-sample and my old app in both canary and stable chrome with both chrome versions open simultaneously on a mac as well as only one open at a time. Whether I try to set a breakpoint programmatically with debugger; or set the breakpoint in the sources tab of the Developer Tools app, I can not seem to stop on code that I am 100% confident is executed. Version 41.0.2258.2 canary (64-bit)
has comment: http://stackoverflow.com/comment/43836493
downvote count: 0

http://stackoverflow.com/comment/43915345
type: Comment
comment on: http://stackoverflow.com/a/27752154
has text: Am not able open the save dialog box.
type: AnswerComment
score: 0

http://stackoverflow.com/a/44917708
answers question: http://stackoverflow.com/q/27798218
type: Answer
has body: Here is a simple solution using jq. It assumes that $colors and $fruits contain the JSON values for 'colors' and 'fruits' respectively: $colors.COLORS | map( {(.[0]|tostring): .[1] } ) | add as $dict | $fruits | .FRUITS |= map( (.[2]) |= $dict[tostring] ) The example below shows how to set $coloars and $fruits. If your jq has INDEX/1, the first line above could be shortened to: $colors.COLORS | INDEX(.[0]) | map_values(.[1]) as $dict Explanation The first line produces a dictionary ($dict), which is then used to make the translation. Example Assuming colors.json and fruits.json hold valid JSON values corresponding to the example give in the question, and that program.jq holds the above jq program, the invocation: jq -n --argfile colors colors.json --argfile fruits fruits.json -f program.jq yields: {"FRUITS":[[1,"apple","red"],[2,"banana","yellow"],[3,"orange","orange"],[4,"grenade","red"],[5,"apple","yellow"]]}
score: 0

http://stackoverflow.com/comment/43843963
comment on: http://stackoverflow.com/a/27715951
score: 0
type: Comment
has text: I though the canvas was styled using CSS where the 2d context does not know about the actual render size, the 2d context only cares for the attributes.
type: AnswerComment

http://stackoverflow.com/comment/122687532
type: Comment
comment on: http://stackoverflow.com/a/28385715
score: 0
type: AnswerComment
has text: Worked for me, Thank you.

http://stackoverflow.com/q/27701792
tagged with: php
has body: Plot I save every visit to a count.dat file on my website. It just outputs 123450. So it displays pageviews till the second of website. Problem Firstly I was displaying it using file_get_contents but then I tried to display it every two seconds using ajax. But the resulting div is empty, always. What I have tried so far is.. JS: (function(d, s, id) { $(document).ready(function(){ refreshTable(); }); function refreshTable(){ $('#tth').load('count.dat', function(){ setTimeout(refreshTable, 2000); }); } count.dat 123456 HTML &lt;div id="tth"&gt;&lt;/div&gt; Additional info : Jquery version &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"&gt;&lt;/script&gt;
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27701896
has title: Get data from ajax every 2 seconds and display it
has comment: http://stackoverflow.com/comment/43816300
score: 1
has comment: http://stackoverflow.com/comment/43816327
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43817109
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43816225
has comment: http://stackoverflow.com/comment/43817392
tagged with: ajax
has answer: http://stackoverflow.com/a/27701896
favorite count: 0
possible better answer: http://stackoverflow.com/a/27701942
has answer: http://stackoverflow.com/a/27701942
upvote count: 1
has comment: http://stackoverflow.com/comment/43816259

http://stackoverflow.com/a/27674761
score: 1
upvote count: 1
has body: I think you have to do as below just add this script. $(function(){ $("#loansDue").addClass("ui-state-hover"); $("#loansDue a").addClass("ui-btn-active"); }); This is not a proper way but I have tested it and its just working fine. Feel free to ask anything. Thanks.
downvote count: 0
answers question: http://stackoverflow.com/q/27674483
type: Answer
has comment: http://stackoverflow.com/comment/43764412

http://stackoverflow.com/a/27750887
has body: Try using RegExp: var risk = document.getElementById("risk"); if (risk.src.match("assets/R0.png")){ risk.src = "assets/R1.png"; } else if(condition) { ... } else { ... }
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27750465
type: Answer
answers question: http://stackoverflow.com/q/27750465

http://stackoverflow.com/q/27686811
tagged with: google-maps
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43790652
has title: An issue while showing a path on Google Maps
upvote count: 2
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/27688683
tagged with: javascript
has body: I have multiple points of longitude and latitude. For example: 1 long lat, starting point 2 long lat 3 long lat 4 long lat . . . . My code is the following &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var markers = [ { "title": '1', "lat": '30.705911', "lng": '76.679656', "description": '1' } , { "title": '2', "lat": '30.701713', "lng": '76.684097', "description": '2' }, { "title": '2', "lat": '30.703291', "lng": ' 76.701022', "description": '2' },{ "title": '2', "lat": '30.691888', "lng": ' 76.710721', "description": '2' } ]; window.onload = function () { var mapOptions = { center: new google.maps.LatLng(markers[0].lat, markers[0].lng), zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions); var infoWindow = new google.maps.InfoWindow(); var lat_lng = new Array(); var latlngbounds = new google.maps.LatLngBounds(); for (i = 0; i &lt; markers.length; i++) { var data = markers[i] var myLatlng = new google.maps.LatLng(data.lat, data.lng); lat_lng.push(myLatlng); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: data.title }); latlngbounds.extend(marker.position); (function (marker, data) { google.maps.event.addListener(marker, "click", function (e) { infoWindow.setContent(data.description); infoWindow.open(map, marker); }); })(marker, data); } map.setCenter(latlngbounds.getCenter()); map.fitBounds(latlngbounds); //***********ROUTING****************// //Intialize the Path Array var path = new google.maps.MVCArray(); //Intialize the Direction Service var service = new google.maps.DirectionsService(); //Set the Path Stroke Color var poly = new google.maps.Polyline({ map: map, strokeColor: '#4986E7' }); //Loop and Draw Path Route between the Points on MAP for (var i = 0; i &lt; lat_lng.length; i++) { if ((i + 1) &lt; lat_lng.length) { var src = lat_lng[i]; var des = lat_ln…
type: Question
score: 0

http://stackoverflow.com/a/27794212
type: Answer
answers question: http://stackoverflow.com/q/27793127
has body: Here's a way that you can transform a page that has a DIV created with JavaScript such that the element is replaced by an anchor with an HREF attribute, as follows: function doit() { var mydiv = document.getElementById( 'mydiv' ); document.getElementById('bod').removeChild( mydiv ); var element = document.createElement('a'); var node = document.createTextNode('php.net'); element.href="http://www.php.net"; element.appendChild(node); document.getElementById('bod').appendChild( element ); } function query() { var ans = confirm("replace div with anchor?"); if ( ans == true ){ doit(); } } var element = document.createElement( 'div' ); element.id = 'mydiv'; element.innerText = 'please click here'; element.className = 'element'; element.style.backgroundColor = 'rgba(0,127,127,' + ( Math.random() * 0.5 + 0.25 ) + ')'; element.style.width='220px'; element.style.height='150px'; element.onclick = query; document.getElementById('bod').appendChild(element); If one should wonder why anyone would write code like this, well, I did myself some years back to present the user with a dynamic page and it was a cool effect. This solution runs with Google Chrome, Safari and Firefox. I tested the script on my local webserver.
score: 0

http://stackoverflow.com/q/27654149
favorite count: 0
has body: I got quite confused with Function.prototype.bind() method. function playsound(raw) { } function onfilechange(then, evt) { var reader = new FileReader(); reader.onload = function (e) { console.log(e); then(e.target.result); }; reader.onerror = function (e) { console.error(e); }; reader.readAsArrayBuffer(evt.target.files[0]); } document.getElementById('file') .addEventListener('change', onfilechange.bind(null, playsound), false); Can anyone explain to me what this code fragment does? The this is null and second argument is the playsound function. I am not quite understanding the usage behind the below line. onfilechange.bind(null, playsound)
has title: Function.prototype.bind with null as argument
has answer: http://stackoverflow.com/a/27654777
type: AnsweredQuestion
upvote count: 46
score: 46
type: Question
accepted answer: http://stackoverflow.com/a/27654777
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/43827189
score: 0
has text: I added the whole HTML code. You can check it now :)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27707467

http://stackoverflow.com/q/27708469
upvote count: 5
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27708857
tagged with: node.js
type: AnsweredQuestion
has title: How can i upload an image to a node js server without a form?
has answer: http://stackoverflow.com/a/44112511
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/44112511
score: 4
tagged with: forms
tagged with: express
answer count: 2
has body: I have an express server running and I want to upload an image (&lt;input type="file"&gt;) without the html &lt;form&gt; tag. Is this even possible? I use this function to get the file from the input when its value has changed: function readImage (input) { var _URL = window.URL || window.webkitURL; if (input.files &amp;&amp; input.files[0]) { var myImg = new Image(); myImg.onload = function () { var img = { image: myImg.src, file: input.files[0], w: this.width, h: this.height }; return img; }; myImg.src = _URL.createObjectURL(input.files[0]); } }
downvote count: 1
accepted answer: http://stackoverflow.com/a/27708857
favorite count: 0

http://stackoverflow.com/q/27653585
has title: JQuery function not working on initial trigger
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
has body: So I have a button that triggers a jquery function. In this function, an AJAX call is made (depending on certain factors) that appends div 'XYZ' somewhere in the doc. After this is done, I want div XYZ to popup with the leanModal bootstrap characteristics. Here is the triggered function: $(document).on("click", ".view_order", function(){ //…stuff... var filled = $(this).attr("data-filled"); if(filled == 0){ $.ajax({ type: 'post', data: {action: 'ABC123', var1: var1}, dataType: 'json', success: function(popup){ //div XYZ is created and appended. } }) } // Now I call a function that mimics the bootstrap leanModal function (tailored to work // without a selector) $.leanModalNoSelector({ top : 200, overlay : 0.6, closeButton : ".modal_close" }, $(this)); }); Here is a somewhat abbreviated area of code from leanModalNoSelector: var defaults={ . . . . . . . . etc. . . . . . }; // this creates the grey background overlay: var overlay=. . . . . ; $("body").append(overlay); options=$.extend(defaults,options); return this.each(function(){ var o=options; $(this).click(function(e){ // Getting the href attribute of the original, clicked element (which points to div XYZ) var modal_id=$(this).attr("href"); $("#lean_overlay").click(function(){ close_modal(modal_id) }); $(o.closeButton).click(function(){ close_modal(modal_id) }); // dimensions of the div XYZ set here . . . . .etc. . . . . . . $("#lean_overlay").css({ //dealing with the overlay some more…. }); $("#lean_overlay").fadeTo(200,o.overlay); $(modal_id).css({ "display":"block","position":"fixed",.. . . . . . .etc. . . . }); $(modal_id).fadeTo(200,1);e.preventDefault() }) }); function close_modal(modal_id){ … … … … … … … }) } } My problem is that this works perfectly--the second time it is clicked. The first time the trigger element is clicked, the new div is created, but the leanModal function does nothing at all. If I click it a second time, however, the leanModal function works fine. My question is why it doesn't work aft…
has answer: http://stackoverflow.com/a/27655485
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
tagged with: bootstrap-modal
favorite count: 0
has comment: http://stackoverflow.com/comment/47405037
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30053534
tagged with: css
has comment: http://stackoverflow.com/comment/43724868

http://stackoverflow.com/a/27740716
has body: Have you installed Bootstrap in your rails app? This addon is an extra addon for Bootstrap users. It seems that this gem supports only Bootstrap 2.x, if you're using Bootstrap 3, I recommend using this addon instead(I don't know if there's a gem of this, but you can always use the downloaded source): http://eonasdan.github.io/bootstrap-datetimepicker/
type: Answer
answers question: http://stackoverflow.com/q/27737872
score: 0

http://stackoverflow.com/a/27649300
score: 3
has body: That's how the post-increment operator works. It uses the variable in the expression, and then increments. If you want the increment to happen first, you would use the pre-increment operator like this: console.log(++i === k);
downvote count: 0
answers question: http://stackoverflow.com/q/27649290
type: Answer
upvote count: 3

http://stackoverflow.com/comment/43813218
comment on: http://stackoverflow.com/q/27700061
type: Comment
type: QuestionComment
has text: here http://jsfiddle.net/Lzw007t8/ now write some text and press ctrl+A and see what happens and also move between the text with the arrow keys
score: 0

http://stackoverflow.com/q/27798487
downvote count: 2
tagged with: scroll
upvote count: 1
tagged with: scrolltop
has answer: http://stackoverflow.com/a/27799381
accepted answer: http://stackoverflow.com/a/27799381
type: AnsweredQuestion
has body: My html code: value 1 value 2 value 3 value 4 value 5 value 6 and jquery code: var $s = $('.sss'); var optionTop = $s.find('[value="3"]').offset().top; var selectTop = $s.offset().top; $s.scrollTop($s.scrollTop() + (optionTop - selectTop)); it is possible for me in jquery . (DEMO) but I want to solve that in javascript. Is it possible?
score: -1
type: Question
answer count: 1
tagged with: javascript
has title: how to set scrolltop by javascript like jquery?
favorite count: 0

http://stackoverflow.com/comment/43984766
score: 0
has text: @PSL Yes, I've read the documentation many times and tried every possible way, however nothing seems to work.
type: Comment
comment on: http://stackoverflow.com/q/27787361
type: QuestionComment

http://stackoverflow.com/a/27687733
has comment: http://stackoverflow.com/comment/43804712
has comment: http://stackoverflow.com/comment/43789088
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43794243
type: Answer
has comment: http://stackoverflow.com/comment/43794336
has comment: http://stackoverflow.com/comment/43789827
has comment: http://stackoverflow.com/comment/43792981
has comment: http://stackoverflow.com/comment/43789033
accepted answer of: http://stackoverflow.com/q/27687714
has body: Remove href="#" &lt;a style="text-decoration: none"&gt;&lt;img src="house.jpg" id="house1" width="200" height="150" onclick="function1()"&gt;
answers question: http://stackoverflow.com/q/27687714

http://stackoverflow.com/comment/89128259
comment on: http://stackoverflow.com/a/40494681
type: Comment
score: 0
has text: Thank God You posted this answer, You made my day :P
type: AnswerComment

http://stackoverflow.com/q/27759278
has comment: http://stackoverflow.com/comment/43929683
type: Question
has title: jQuery filter JSON by variable
tagged with: javascript
has comment: http://stackoverflow.com/comment/43930158
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/43929544
has comment: http://stackoverflow.com/comment/43930475
answer count: 0
type: UnansweredQuestion
tagged with: text
has body: I'm building af custom store locator in WordPress. I'm trying to filter some JSON objects where the value of a property matches af variable. I've got a navigation bar generated by WordPress: Denmark Austria Germany The JSON is: var jsonStr = '[{'title': 'Jeans Store DK', 'country': 'Denmark'}, {'title': 'Footwear', 'country': 'Austria'}, {'title': 'Accessories', 'country': 'Australia'}]' When i click the link in the navigation I wan't to grab for instance "Denmark" and search for every store in the JSON where "country" is "Denmark". I then wan't to output this to a div with class .post-excerpt. So far I've got: $(document).ready(function(){ $('#store_list .cat-item').click(function(e){ e.preventDefault(); var loc = $(this).text(); var json = JSON.parse(jsonStr); var map_data = $.grep( json, function( n, i ) { return n.country === loc; }); $('.post-excerpt').text(JSON.stringify(map_data)); }); }); The problem is it only returns "[]" but if I set var loc = "Denmark" for instance, the code works. So I can't figure out to parse the loc variable to the grep function. Thanks.
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43929722
tagged with: wordpress

http://stackoverflow.com/a/27708848
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27680655
score: 1
accepted answer of: http://stackoverflow.com/q/27680655
has body: You should use Parsley's Events. Since you want to display or hide something based on a field validation, you should use parsley:field:success and parsley:field:error. Working example (with jsfiddle): Firstname: This message will be shown when the firstname is not valid Lastname: Fullname: And here's what I did: Added a div with ìd=checkmark after the firstname field (with a hidden class, since you're using Bootstrap). Added this block of javascript: $.listen('parsley:field:error', function(ParsleyField) { if(ParsleyField.$element.attr('name') === 'firstname') { $("div#checkmark").addClass('show').removeClass('hidden'); } }); $.listen('parsley:field:success', function(ParsleyField) { if(ParsleyField.$element.attr('name') === 'firstname') { $("div#checkmark").addClass('hidden').removeClass('show'); } }); This code will listen to the validation of every input validated by Parsley. This means that when the field lastname fails, the code inside $.listen('parsley:field:error', function(ParsleyField) { will be executed. This is why I used an if to check if the attr name is firstname. Then you show or hide the div based on the validation result. Added required to the field, so the message is displayed when you click on the button.

http://stackoverflow.com/a/27677422
accepted answer of: http://stackoverflow.com/q/27677351
score: 0
answers question: http://stackoverflow.com/q/27677351
type: AcceptedAnswer
has body: Thats probably because JavaScript is an asynchroneus language. What you are experiening is a synchronization issue: Your ajax is done, you are firing DOM manipulation (prepend()), and imidiately after you fire it you do the fadeIn() but the fadeIn is complete before your data is prepended, so probably you'are calling fadeIn() on an element that doesn't exist yet. Try this: ajax("login").done(function (data) { $("body").prepend(data); setTimeout(function(){ $("#login").fadeIn(500); },0); }); And read this to understand why using timeout 0 is sometimes helpful: Why is setTimeout(fn, 0) sometimes useful? By wrapping your action with setTimeout function you are basically telling: "wait until everything is done before doing this". Here's the fiddle: jsFiddle
type: Answer
has comment: http://stackoverflow.com/comment/43769343

http://stackoverflow.com/comment/43915462
comment on: http://stackoverflow.com/a/27750900
type: AnswerComment
score: 0
type: Comment
has text: Dependencies aren't shared from CDNs and so will not load from Jsfiddle. It looks like the problem is with the JS file you posted, in any case.

http://stackoverflow.com/comment/43921456
type: QuestionComment
has text: @JohnMueller No, I don't. I'm not scraping them. I'm just checking how it works in theory. No actual content was obtained. But can you point me to the TOS in question so I could see what happens?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27735919

http://stackoverflow.com/comment/43819827
type: Comment
type: QuestionComment
has text: Updated links.. sorry
comment on: http://stackoverflow.com/q/27703873
score: 0

http://stackoverflow.com/comment/43888355
comment on: http://stackoverflow.com/q/27738387
has text: Leave a space in `id=".$ef."(HERE)width="10"`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27684611
downvote count: 0
score: 1
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27684870
has answer: http://stackoverflow.com/a/27684843
upvote count: 1
has body: index.php TEST LOG IN WITH FACEBOOK CHANGE FACEBOOK ACCOUNT male female JavaScript my intention is when the user dont enter or enter wrong email , it will pop a text or a box in html div and telling them they didt entering the right email , how i going to make javasctrip print out a div your email is invalid ?? if return true submit post else not posted. and i dont wanted to use jquery. thank you
linked to: http://stackoverflow.com/q/19605773
has answer: http://stackoverflow.com/a/27684862
tagged with: javascript
answer count: 4
accepted answer: http://stackoverflow.com/a/27684843
has answer: http://stackoverflow.com/a/27685157
has title: print out div in JavaScript if return false
possible better answer: http://stackoverflow.com/a/27684862
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43783696

http://stackoverflow.com/a/27742569
has comment: http://stackoverflow.com/comment/43895988
upvote count: 5
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/43896486
has comment: http://stackoverflow.com/comment/43896361
answers question: http://stackoverflow.com/q/27742369
score: 5
accepted answer of: http://stackoverflow.com/q/27742369
has comment: http://stackoverflow.com/comment/43896274
type: AcceptedAnswer
has body: You are adding a new line segment in each iteration of the second for loop but you are also drawing the stroke for all previous segments, which results in the segments to be drawn multiple times. Call ctx.stroke() only once, after the loop. function DrawCurve() { var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); var Wave = []; for (var i = 0; i &lt; 6.28; i += 0.03) { Wave.push([(i * (350 / 6.28)), 130 - (Math.sin(i) * 80)]); } ctx.beginPath(); ctx.moveTo(50 + Wave[0][0], Wave[0][1]); for (var i = 0; i &lt; Wave.length; i++) { ctx.lineTo(50 + Wave[i][0], Wave[i][1]); ctx.strokeStyle = "red"; ctx.lineWidth = 1.5; ctx.lineJoin = 'round'; } ctx.stroke(); } DrawCurve(); &lt;canvas id="canvas" width="430" height="260"&gt;&lt;/canvas&gt;

http://stackoverflow.com/comment/43791947
type: AnswerComment
score: 0
type: Comment
has text: @shayk I have found this source: [link](http://red-team-design.com/removing-an-element-with-plain-javascript-remove-method/)
comment on: http://stackoverflow.com/a/27688131

http://stackoverflow.com/comment/43759162
type: Comment
score: 0
type: AnswerComment
has text: Thanks for the solution. I have been trying pick up writing my own RegExp in javascript. W3Schools has the fundamental parts broken down. Do you have any resources that you used to get a better grasp of RegExp?
comment on: http://stackoverflow.com/a/27672179

http://stackoverflow.com/a/27779265
accepted answer of: http://stackoverflow.com/q/27779161
answers question: http://stackoverflow.com/q/27779161
score: 1
has comment: http://stackoverflow.com/comment/43968417
type: AcceptedAnswer
has body: You're getting the error because pages is defined within your create function but isn't defined anywhere else. pages doesn't exist in your arrowClicked function. To fix this, make pages a global variable by adding it alongside your var declarations at the top: ... var leftArrow; var rightArrow; var pages; Then modify your create function to instead reference this variable (by dropping the var keyword): // array with finished levels and stars collected. var starsArray = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]; // how many pages are needed to show all levels? pages = starsArray.length /(thumbRows * thumbCols);
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/comment/44012501
type: Comment
comment on: http://stackoverflow.com/a/27801608
has text: @M.H. Is the HTML file in the same folder?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43785295
type: Comment
type: QuestionComment
has text: I am working won a co browsing app, so there is transfer of events among multiple users. I am able to manage all the events except scroll. It lets the system to infinite scroll. you can see the app by opening 182.71.103.93/screen2/client23122014.html and then 182.71.103.93/job_tree
score: 0
comment on: http://stackoverflow.com/q/27685115

http://stackoverflow.com/comment/43842208
comment on: http://stackoverflow.com/q/27714977
type: Comment
has text: So the options array should be overridden by the first object to the right that does not contain `null`
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43797622
score: 0
type: Comment
type: QuestionComment
has text: If you show the image out of the modal does it have height/width? If you place text in the modal does it show?
comment on: http://stackoverflow.com/q/27692049

http://stackoverflow.com/q/27742663
has comment: http://stackoverflow.com/comment/43897019
has title: Jquery Mobile not passing hiddenfield value?
has comment: http://stackoverflow.com/comment/43896894
downvote count: 0
has body: I am using jQuery Mobile script on my mobile website. I am not much familiar with JavaScript. There are two website have same code & files. http://m.suyes.co/ (with jQuery Mobile) http://www.suyes.co/ (without jQuery Mobile) I used this form to get value Search On my desktop website this working well, but it's only loading page in mobile site.
favorite count: 0
linked to: http://stackoverflow.com/q/16519546
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: mobile
has comment: http://stackoverflow.com/comment/43897047
tagged with: jquery-mobile
has comment: http://stackoverflow.com/comment/43896204
tagged with: javascript

http://stackoverflow.com/comment/43766556
type: Comment
comment on: http://stackoverflow.com/a/27674940
has text: In an attempt to solve the error, I change the line to trialStart = request.POST.get('time', False) . but now trialStart returns a false value and the time difference doesnt get calculated properly
type: AnswerComment
score: 0

http://stackoverflow.com/a/27695588
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27695246
has comment: http://stackoverflow.com/comment/43806702
downvote count: 0
has body: Since this is an exercise, You could just give a class to your cells where the price is contained. Then you can just grab all the cells with that class and loop over them So a cell containing a price would become e.g: 19.90 29.90 9.90 Then your script becomes: var priceCells = document.getElementsByClassName("priceCell"); //returns a list with all the elements that have class 'priceCell' var total=0; //loop over the cells array and add to total price for (var i = 0; i < priceCells.length; i++) { var thisPrice = parseFloat(priceCells[i].innerHTML); //get inner text of this cell in number format total = total + thisPrice; }; total = total.toFixed(2); //give 2 decimal points to total - prices are, e.g 59.80 not 59.8 alert(total); Just for the record: innerHTML returns the HTML as the name suggest of that cell - there's also innerText you could use, but it's not supported in all browsers so I used this instead. Calculating prices like this is plain wrong - There are myriads of reasons why this should not be done on the client-side and in the way I suggested, but I certainly won't go over them in this answer
type: Answer

http://stackoverflow.com/comment/43738008
has text: Using keypress, it is still possible to paste text in inputs
comment on: http://stackoverflow.com/a/27659724
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43775690
type: QuestionComment
comment on: http://stackoverflow.com/q/27680537
has text: You mixed the `id` and `style` attribute.
score: 0
type: Comment

http://stackoverflow.com/a/27698647
type: AcceptedAnswer
downvote count: 0
has body: Edit: Here is a plunkr demonstrating pretty close to what your code was doing. There are multiple issues with the code you have in your question that I have fixed: http://plnkr.co/edit/QXprEUof2Ps0Vivg4L34?p=preview In your test you call e.digest(), which will not work because you cannot digest an element... you should call $scope.$digest instead. e.html() will not contain that JSON blob. I interpreted this as wanting it to contain the name label... info='buttonInfo' binds info to the attribute buttonInfo in the outerscope, but you called it 'primaryButton'. Rename $scope.primaryButton to $scope.buttonInfo You used some underscores that weren't totally necessary, but that's not a big deal, when injecting compile, rootscope I used an inline template instead of loading it just for the plunkr, there is nothing wrong with loading it though Because your directive is an element I added 'replace', which replaces the element with a straight button. Consider making it an attribute instead. My plunkr has passing jasmine tests and a working demonstration of the button. Let me know if you need some more help with this. Good luck with AngularJS. (OLD ANSWER) ============== You will need to use something like nghtml2js to load your templates and make them available with template cache. using nghtml2js That's your first issue. Your second issue is getting the isolate scope is done by calling isolateScope() on the element after it is compiled. Log the result of calling that on elem and you'll find the attributes you're after. e.isolateScope()
accepted answer of: http://stackoverflow.com/q/27697747
has comment: http://stackoverflow.com/comment/43912883
answers question: http://stackoverflow.com/q/27697747
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/43834505
has comment: http://stackoverflow.com/comment/43915662
score: 6

http://stackoverflow.com/comment/43762254
type: AnswerComment
has text: got it! $("#myLink_33").attr("href", "javascript:toggleMe(0);");
type: Comment
comment on: http://stackoverflow.com/a/27673560
score: 0

http://stackoverflow.com/comment/43823946
comment on: http://stackoverflow.com/q/27705738
type: Comment
type: QuestionComment
has text: @Everton Lenger - thanks - I loaded the sticky function script from my own server instead of trying to access it remotely, then everything else works! Thanks... SunilHari - I'll go through the CSS and sort them out too! Thanks
score: 0

http://stackoverflow.com/a/39424638
upvote count: 1
downvote count: 0
type: Answer
has body: I had resolved same issue by removing jQuery include, that was included twice. There's note about that in the comments, but it's collapsed and I figured that out myself. Posting this as answer for people to notice it.
score: 1
answers question: http://stackoverflow.com/q/27757666

http://stackoverflow.com/comment/43823687
has text: You should correct the errors on your page. That's probably why it isn't working. Especially the one that used the sticky function.
score: 0
comment on: http://stackoverflow.com/q/27705738
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43724308
type: Comment
comment on: http://stackoverflow.com/a/27653713
has text: What is the difference between your answer and my question, both look similar
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43755285
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27670147
score: 1
has text: I don't understand what you mean. You can't have ` ` without ` `.

http://stackoverflow.com/a/27728098
type: Answer
score: 0
has body: Here's one way to do it: http://jsfiddle.net/4te4x93h/1/ var myApp = angular.module('myApp', ['ionic']); myApp.controller('DropCtrl', function($scope, $ionicLoading) { $ionicLoading.show({ template: 'Loading...', animation: 'fade-in', showBackdrop: true, showDelay: 10 }); $scope.order = {}; $scope.products = [ { label: 'Store 1', products: [{ label: 'Product 1' }, { label: 'Product 2' }] }, { label: 'Store 2', products: [{ label: 'Product 1' }, { label: 'Product 2' }] } ]; // Mock loading for 1.5 seconds. setTimeout(function() { $ionicLoading.hide(); }, 1500); }); Coffee House Product Where you have //problem// you just need to reference your order object's coffeehouse property. Until you make a selection in the first drop down there will be no options in the second. Once you bind a coffeehouse to the order the second drop down's options will populate.
answers question: http://stackoverflow.com/q/27728014

http://stackoverflow.com/a/27749435
answers question: http://stackoverflow.com/q/27749371
has comment: http://stackoverflow.com/comment/43910827
score: 5
upvote count: 5
has comment: http://stackoverflow.com/comment/43910522
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43910389
has body: A function in Javascript is an object, so you can add properties to a function. Example: function lib(x) { return x + 1; } lib.add = function(a, b){ return a + b; }; Now you can use it both as a function and as an object having functions: var n = lib(4); // n = 5 var m = lib.add(7, 8); // m = 15 jQuery does the same, just using $ as a name instead of lib as I used in the example. The $ name is normally an alias for the jQuery name, and jQuery.fn is a reference to the prototype for the jQuery function. So when jQuery.fn.init is called, it's the same as jQuery.prototype.init.
type: Answer
has comment: http://stackoverflow.com/comment/43910248
accepted answer of: http://stackoverflow.com/q/27749371
has comment: http://stackoverflow.com/comment/43910205

http://stackoverflow.com/comment/43837802
comment on: http://stackoverflow.com/a/27712650
score: 0
type: AnswerComment
has text: Not what I am aware of, although you're gonna start notice that you're going to need callbacks in almost every function you make either way so there's nothing wrong with adding a callback to your existing functions.
type: Comment

http://stackoverflow.com/comment/43767842
score: 0
type: Comment
has text: @Jivani Jaydeep thank you dude. i have vote up your answer. but second answer is well suits for my question. so i accept it. thanks dude. this will help me when i use js arrays.thank you again
comment on: http://stackoverflow.com/a/27675354
type: AnswerComment

http://stackoverflow.com/comment/43852274
score: 0
type: AnswerComment
type: Comment
has text: Sure: http://jsfiddle.net/Lpqc4xhy/. However, as I pointed out, my example does not handle the html inside the CKEDITOR. You need to parse it as well, since my code only checks the length and truncates it if too long.
comment on: http://stackoverflow.com/a/27720326

http://stackoverflow.com/a/27738040
type: Answer
answers question: http://stackoverflow.com/q/27737899
has body: You can use ng-repeat directive with JSON Data like this example: Looping with ng-repeat: {{ x }} Fiddle Demo With Array And You can even show your nested objects using ng-repeat directive like this: {{item.name}} has children: {{child.name}} has grant-children: {{gch.name}} Fiddle Demo With Nested Objets
score: 0

http://stackoverflow.com/comment/43950775
type: Comment
comment on: http://stackoverflow.com/q/27769929
has text: You tagged it with the language needed.
type: QuestionComment
score: 10

http://stackoverflow.com/comment/43975745
type: AnswerComment
comment on: http://stackoverflow.com/a/27772067
type: Comment
has text: @IsmaelMiguel, no. I would not use them in the same line as long lines are worse to read.
score: 0

handsontable
tags question: http://stackoverflow.com/q/27737288
tags question: http://stackoverflow.com/q/27722514
tags question: http://stackoverflow.com/q/27749824
type: Tag
tags question: http://stackoverflow.com/q/27787670
tags question: http://stackoverflow.com/q/27726034
tags question: http://stackoverflow.com/q/27724738
tag name: handsontable

http://stackoverflow.com/q/27712747
score: 0
has answer: http://stackoverflow.com/a/27712785
answer count: 1
has title: Toggle closest DIV in table
tagged with: jquery
has comment: http://stackoverflow.com/comment/43837785
has comment: http://stackoverflow.com/comment/43838324
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27712785
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43837720
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43838280
has body: I have a table with checkboxes that have a class of .toggle-extract and when clicked I'd like them to toggle the closest DIV with the class name .extract-years Now the code I have should work, but it is driving me nuts trying to figure out why it won't trigger. here is the JSFiddle example. $(document).ready(function() { $('.toggle-extract').on('click', function () { $(this).closest('div').find('.extract-years').toggle("fast"); }); }); and here is the HTML Toggle Box Toggle Box
has comment: http://stackoverflow.com/comment/43838148

http://stackoverflow.com/q/27641303
accepted answer: http://stackoverflow.com/a/27641743
possible better answer: http://stackoverflow.com/a/27641328
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: Onclick Remove/delete image
has body: I need to load an .swf file after we click on an image The .swf file loads successfully after we click on the image,but it loads the .swf below the image.I need to replace the img with .swf(in short,hide the img). I need to hide/remove the class/id "iii" (within which the img tag lies).However the code doesn't seem to work only with respect to hiding/removing of img. Any tips?
type: Question
tagged with: flash
tagged with: javascript
has answer: http://stackoverflow.com/a/27641743
has comment: http://stackoverflow.com/comment/44583313
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27641328

http://stackoverflow.com/a/27646087
type: Answer
has body: Here's an attempt. It assumes there is only one property in each object that is an array. It them composes an object with the remaining properties and makes a new clone with each value from the array property. * Works as required now * var resultArray = [], len = data.length, tempObj, newObj, targetVal, targetKey, composeObj, tempJson, key, i, k; for(i = 0; i &lt; len; i++) { tempObj = data[i]; // obj to build up composeObj = {}; // look at all key/vals in obj in data for(key in tempObj) { keyObj = tempObj[key]; // is it an array? if(Array.isArray(keyObj)) { // save key/val for array property targetVal = keyObj; targetKey = key; } else { // copy non-array properties to empty object composeObj[key] = keyObj; } } // json-ify the object for cloning tempJson = JSON.stringify(composeObj); // compose new object for each val in array property targetVal.map(function(val) { // clone object newObj = JSON.parse(tempJson); // add array values as object properties for(k in val) { newObj[k] = val[k]; } // add to results resultArray.push(newObj); }); }
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27645455
accepted answer of: http://stackoverflow.com/q/27645455
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27741252
upvote count: 1
answers question: http://stackoverflow.com/q/27741114
score: 1
has body: In you keep this data representation, you'll have to loop over your entire array, which is inefficient. I think you should (if you can) change your data representation and opt for an associative array, where keys are pairs id-name and values are nicknames. This way it becomes easy and efficient to find matches. Or, maybe even better because it reduces redundancy, two associative arrays: the first one for id/names; the second for nickname matches (keys are ids and values are ids as well).
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43912170
has text: can be shortened to: `~list.indexOf(text)` no need for `!== -1`
type: AnswerComment
comment on: http://stackoverflow.com/a/27750249
type: Comment
score: 1

http://stackoverflow.com/comment/43959946
has text: You would of course have to create an anchor with a download attribute, or use a serverside script with the right headers.
comment on: http://stackoverflow.com/q/27773674
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27734300
score: 1
has answer: http://stackoverflow.com/a/27734326
answer count: 2
downvote count: 0
tagged with: javascript
has title: Passing data in ajax JQUERY
tagged with: jquery
has answer: http://stackoverflow.com/a/27734342
favorite count: 0
tagged with: ajax
has body: I'm creating a Login page with ajax and JQuery. Here is my code for ajax: &lt;script&gt; $(document).ready(function() { $('#login').click(function(){ var username=$("#username").val(); var password=$("#password").val(); var url = 'username='+username+'&amp;password='+password; if($.trim(username).length&gt;0 &amp;&amp; $.trim(password).length&gt;0){ $.ajax({ type: "POST", url: "ajaxLogin.php", data: url, cache: false, success: function(responceText){ document.write(responceText); if(responceText==1){ document.write('____Welcome____'); } else if(responceText==0){ document.write('____Login Failed____'); } else if(responceText == -1){ document.write('____Some Thing went wrong____'); } } }); } return false; }); }); &lt;/script&gt; And here is the ajaxLogin class: &lt;?php include("db.php"); session_start(); if(isSet($_POST['username']) &amp;&amp; isSet($_POST['password'])){ $username=mysqli_real_escape_string($db,$_POST['username']); $password=md5(mysqli_real_escape_string($db,$_POST['password'])); $result=mysqli_query($db,"SELECT user_id FROM users WHERE user_name='$username' and user_pass='$password'"); $count=mysqli_num_rows($result); $row=mysqli_fetch_array($result,MYSQLI_ASSOC); if($count==1) echo 1; else echo 0; } else{ echo -1; } ?&gt; I've debugged the code and i thing the url which i'm passing to the ajax login is not working fine. The values for username and password are null when i load ajaxLogin.php. What is the problem with my url? var url = 'username='+username+'&amp;password='+password;
type: UnansweredQuestion
upvote count: 1
tagged with: php
type: Question

http://stackoverflow.com/q/27696957
has title: What is the max length of browser URL for Window.Open
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2659952
linked to: http://stackoverflow.com/q/417142
tagged with: java
downvote count: 1
duplicate of: http://stackoverflow.com/q/417142
type: Question
tagged with: gwt
has comment: http://stackoverflow.com/comment/43807203
accepted answer: http://stackoverflow.com/a/27697013
tagged with: javascript
tagged with: base64
possible better answer: http://stackoverflow.com/a/27697001
answer count: 2
has answer: http://stackoverflow.com/a/27697001
tagged with: url
score: 1
favorite count: 0
upvote count: 2
has body: I have this GWT code that opens a new browser window to show a text file. Window.open("data:text/plain;base64," + Base64.byteArrayToBase64(textBytes), "_blank", ""); My questions are: How long is the maximum URL part that a browser can handle? And what is the maximum bytes that this code will be able to handle properly?
has answer: http://stackoverflow.com/a/27697013

http://stackoverflow.com/q/27705572
score: 0
has comment: http://stackoverflow.com/comment/43823259
has comment: http://stackoverflow.com/comment/43822993
has comment: http://stackoverflow.com/comment/43823031
answer count: 2
has answer: http://stackoverflow.com/a/27705649
has comment: http://stackoverflow.com/comment/43823045
tagged with: jquery
has comment: http://stackoverflow.com/comment/43823159
favorite count: 0
has comment: http://stackoverflow.com/comment/43823082
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27705634
has comment: http://stackoverflow.com/comment/43823104
has title: javascript updating hidden value
upvote count: 1
downvote count: 1
type: Question
has body: I have a function: function add() { $.ajax({ type: "POST", url: "add.php", async: "false", // Tried both- async: "false/true" data: { name: 'Test', }, success: function(data) { document.getElementById('id').value = data; id = document.getElementById('id').value; alert(id); // alerts here proper value } }); } function testMyFunction() { add(); // 'id' was set in add function. id = document.getElementById('id').value; alert(id); // Here does not alert value but blank(no value) // This 'id' value is used at other place but here is issue. } Calling testMyFunction() function gives above mentioned issue. What could be a issue?
tagged with: javascript

http://stackoverflow.com/comment/43922745
type: Comment
type: QuestionComment
score: 2
has text: What did you try until now?
comment on: http://stackoverflow.com/q/27756024

http://stackoverflow.com/comment/43775483
comment on: http://stackoverflow.com/q/27680329
type: Comment
type: QuestionComment
has text: Check your `imgs` array actually contains what it should: I've never seen `[].slice.call(document.querySelectorAll('img'));` before, try using `document.getElementsByTagName("img")`.
score: 0

http://stackoverflow.com/comment/43807140
type: Comment
score: 0
has text: On change does not work either, verified by this post: http://codingforums.com/javascript-programming/328492-datalist-onclick-event-not-firing.html
type: QuestionComment
comment on: http://stackoverflow.com/q/27695191

http://stackoverflow.com/a/27713156
upvote count: 2
has comment: http://stackoverflow.com/comment/43840076
accepted answer of: http://stackoverflow.com/q/27713111
has comment: http://stackoverflow.com/comment/43839638
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43840122
has body: All the data to sort the items is present in the page. Just extract the data, and sort by the datePublished item property: &lt;meta itemprop="datePublished" content="2014-11-27" /&gt; The site even uses the Schema.org microdata Review type to mark up the reviews, making it extra easy for you to parse the items here. Either look for itemprop attributes with BeautifulSoup, or use a tool like rdflib-microdata to convert the information in the page to RDF, then use RDF tools to further process. Parsing Schema.org data using BeautifulSoup: reviews = [] for rating in soup.find_all(itemprop='review'): data = {} for item in rating.find_all(itemprop=True): data[item['itemprop']] = item.attrs.get('content') or item.get_text() reviews.append(data) after which you can sort them by date (newest first) with: reviews.sort(key=lambda i: i['datePublished'], reverse=True) Demo: &gt;&gt;&gt; from bs4 import BeautifulSoup &gt;&gt;&gt; from pprint import pprint &gt;&gt;&gt; import requests &gt;&gt;&gt; response = requests.get('http://www.homedepot.com/p/Husky-41-in-16-Drawer-Tool-Chest-and-Cabinet-Set-HOTC4016B1QES/205080371') &gt;&gt;&gt; soup = BeautifulSoup(response.content) &gt;&gt;&gt; reviews = [] &gt;&gt;&gt; for rating in soup.find_all(itemprop='review'): ... data = {} ... for item in rating.find_all(itemprop=True): ... data[item['itemprop']] = item.attrs.get('content') or item.get_text() ... reviews.append(data) ... &gt;&gt;&gt; reviews.sort(key=lambda i: i['datePublished'], reverse=True) &gt;&gt;&gt; pprint(reviews) [{u'author': u'RHS381', u'bestRating': u'5', u'datePublished': u'2014-12-15', u'description': u' I\'ve shopped all the home improvement centers evaluating the tool box brands they carry. Including specialty stores like Sears, Harbor Freight and Northern tool. Without a doubt, HomeDepots HUSKY tool boxes and tool storage systems were a land slide winner. These box\'s are SOLID, desent gauge steel, bullet proof hardware and casters you\'d expect to find on military g…
answers question: http://stackoverflow.com/q/27713111
type: Answer
has comment: http://stackoverflow.com/comment/43839932
has comment: http://stackoverflow.com/comment/43839962
has comment: http://stackoverflow.com/comment/43840133
score: 2

http://stackoverflow.com/q/27766362
answer count: 1
has title: Client not updating realtime with Socket.io and Node.js
has comment: http://stackoverflow.com/comment/43943766
tagged with: node.js
has comment: http://stackoverflow.com/comment/43943983
has body: Why isn't my client side updating automatically using socket.io and node.js? My backend accepts JSON POST requests from PHP, then it emits the data to all connected devices. My backend code app.post('/', function (req, res) { console.log(req.body); subdata = req.body; res.send('ok'); }); io.sockets.on('connection', function (socket) { socket.broadcast.emit('info', subdata); }); Client side &lt;script&gt; var socket = io.connect('http://127.0.0.1:3000/'); socket.on('info', function (data) { console.log(data); }); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/43943874
score: 2
has comment: http://stackoverflow.com/comment/43943861
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43943732
type: Question
has answer: http://stackoverflow.com/a/27766674
favorite count: 0
upvote count: 2
tagged with: sockets

http://stackoverflow.com/q/27791034
duplicate of: http://stackoverflow.com/q/986120
has comment: http://stackoverflow.com/comment/43991849
tagged with: hidden-field
type: UnansweredQuestion
has title: jQuery else clause not working
has comment: http://stackoverflow.com/comment/43991854
answer count: 0
has body: I have this simple if/else but I cannot figure out why the else code will not execute. I am sure it is something simple but I do not see it and firebug does not have any alerts or errors. HTML: &lt;input type="hidden" value="12" id="lastm"&gt; &lt;input type="hidden" value="2014" id="lasty"&gt; &lt;input type="hidden" value="1" id="thism"&gt; &lt;input type="hidden" value="2015" id="thisy"&gt; &lt;input type="hidden" value="12" id="ForMonth" name="ForMonth"&gt; &lt;input type="hidden" value="2014" id="ForYear" name="ForYear"&gt; &lt;input type="radio" checked="checked" value="0" id="last" name="last"&gt; December 2014 &lt;input type="radio" value="1" id="last" name="last"&gt; January 2015 Javascript: var last_month = 12; var this_month = 1; var last_year = 2014; var this_year = 2015; $('#last').change(function() { if($('#last').val() == 0) { //$('#ForMonth').val($('#lastm').val()); $('#ForMonth').val(last_month); //$('#ForYear').val($('#lasty').val()); $('#ForYear').val(last_year); } else { alert('here'); //$('#ForMonth').val($('#thism').val()); $('#ForMonth').val(this_month); //$('#ForYear').val($('#thisy').val()); $('#ForYear').val(this_year); }; });
has comment: http://stackoverflow.com/comment/43991915
has comment: http://stackoverflow.com/comment/43992112
type: Question
tagged with: if-statement
tagged with: javascript
has comment: http://stackoverflow.com/comment/43991873
tagged with: jquery
has comment: http://stackoverflow.com/comment/43991892
score: 0
tagged with: radio-button
linked to: http://stackoverflow.com/q/986120

http://stackoverflow.com/comment/43788638
has text: I don't see any way of doing this, but rewriting the code isn't *that* much trouble...
comment on: http://stackoverflow.com/q/27687502
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43834648
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27703614
score: 0
has text: There were some tweaks I had to do to that but, it's fully working. Aso added the smooth change on the left. Thanks!

http://stackoverflow.com/a/27757819
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43928037
has comment: http://stackoverflow.com/comment/43926332
has comment: http://stackoverflow.com/comment/43926403
has comment: http://stackoverflow.com/comment/43926266
has comment: http://stackoverflow.com/comment/43926371
has comment: http://stackoverflow.com/comment/43927365
answers question: http://stackoverflow.com/q/27757637
has comment: http://stackoverflow.com/comment/43928074
has body: See this fiddle You can use Download This Image eg: Download This Image
has comment: http://stackoverflow.com/comment/43928129
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43926558
type: Answer
has comment: http://stackoverflow.com/comment/43928223
has comment: http://stackoverflow.com/comment/43926405
has comment: http://stackoverflow.com/comment/43927336
accepted answer of: http://stackoverflow.com/q/27757637
has comment: http://stackoverflow.com/comment/43928146

http://stackoverflow.com/comment/43985738
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27787489
has text: Is there any way to put the second graph in the first graph's place? and delete the first one?

http://stackoverflow.com/q/27668332
favorite count: 0
answer count: 0
has title: Post a form with ajax to remote server
has body: I want to post a form to a remote server with ajax, the user shall not leave the website. ... send Is that possible, with no restrictions compared to self-hosted files in terms of getting the response, etc.?
type: UnansweredQuestion
upvote count: 1
tagged with: php
downvote count: 1
has comment: http://stackoverflow.com/comment/43751914
linked to: http://stackoverflow.com/q/18817863
linked to: http://stackoverflow.com/q/2866063
tagged with: forms
has comment: http://stackoverflow.com/comment/43751692
type: Question
has comment: http://stackoverflow.com/comment/43751298
tagged with: javascript
has comment: http://stackoverflow.com/comment/43752291
tagged with: ajax
score: 0
linked to: http://stackoverflow.com/q/3897641
has comment: http://stackoverflow.com/comment/43752557
linked to: http://stackoverflow.com/q/13824941

http://stackoverflow.com/comment/43805852
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27695842
score: 0
has text: Updated example with counter. Please modify as appropriate

http://stackoverflow.com/q/27711889
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/43835840
favorite count: 0
tagged with: angularjs
type: Question
has title: Creating filters dynamically with ng-click and ng-repeat
has body: Right now, I have a bunch of filters that use ng-click to filter some JSON data pulled in from a factory: All Apple Samsung HTC {{ phones.name }} Price: ${{ phones.price }} No term: ${{ phones.no-term }} It works well, but I'm wondering how I can programmatically generate the links and use ng-click to filter. My best attempt so far: All {{ phones.manufacturer }} {{ phones.name }} Price: ${{ phones.price }} No term: ${{ phones.no-term }} The links are generating properly and the data is showing up in the phonesContent div, but the filtering is not working. I keep getting a $parse:syntax error so something is wrong with my expression where brandFilter = { 'manufacturer' = phones.manufacturer } (I think).
tagged with: angularjs-ng-repeat
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/43835957
has comment: http://stackoverflow.com/comment/43835776
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27711975

http://stackoverflow.com/q/27754871
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43922239
possible better answer: http://stackoverflow.com/a/27756030
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43922357
has answer: http://stackoverflow.com/a/27756030
has body: I've seen plenty of posts tackling this issue but none seem to work for me and many solutions use deprecated methods. I have static file directory already set up: app.use(express.static(__dirname + "/public", {maxAge: 86400000*30 })); Then I have a custom 404.html page in that public directory. Now, any incorrect URLs should be routed to that 404.html page. I've tried the following: app.use(function(req, res, next){ res.render("404.html", { url: req.url }); }); But I get the response: Error: Cannot find module 'html' What am I doing wrong and why is such a simple thing so hard?
score: 1
has comment: http://stackoverflow.com/comment/43920688
upvote count: 1
has title: Route 404.html for Express app
type: Question
has answer: http://stackoverflow.com/a/27756812
linked to: http://stackoverflow.com/q/4529586
tagged with: javascript
tagged with: express
answer count: 2
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/27756812

http://stackoverflow.com/comment/58843619
has text: would be nice to have at least a way to specify background and text color,
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28619922

http://stackoverflow.com/comment/43932781
has text: It's pointless code. Not worth diagnosing what it does because it should never be left the way it is. Fix the code to do something useful and predictable for all expected inputs and something that follows decent coding practices. You can see exactly what it does by just stepping through it in the debugger and watching the `i` variable get trounced around.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27760640
type: QuestionComment

http://stackoverflow.com/comment/43780596
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27682899
has text: Good point. I updated my post, although I wouldn't exactly call iterating over 3 items "so excessive", but it's not necessary, I agree.
score: 0

http://stackoverflow.com/comment/47653494
comment on: http://stackoverflow.com/a/29732252
type: AnswerComment
type: Comment
has text: I am not behind a proxy server. The problem happens for a few dozen hosts we've identified, not for most.
score: 3

http://stackoverflow.com/q/27751010
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/27751254
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43913236
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has body: Hi I would like to create a website, similar to this http://hillsong.com/ in the sense that scrolling down the page results in the writing/information scrolling up but then reveals a new background image which is different from the previous and is fixed. How can I do that? At the moment I've been searching on the web however I am new to coding and programming and I need a lot of help. This is what I've done so far: (Can someone please help me thanks) how can I get the background affect?
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43913974
has title: Hillsong Website- Transitioning from one background image to the next smoothly whilst scrolling

http://stackoverflow.com/a/27802700
answers question: http://stackoverflow.com/q/27802577
has comment: http://stackoverflow.com/comment/44014762
type: Answer
score: 3
upvote count: 3
has body: You are binding the event listener on the first keydown/keyup, thats why it doesn't work on the first try. Check the fixed fiddle. Change: window.onkeydown = handleKeyDown; window.onkeyup = handleKeyUp; to: handleKeyDown(); handleKeyUp(); In other words, you are doing something like this: button.onclick = function () { button.onclick = function () { alert("you click!"); }; }; (see this fiddle as an example for the code above) The first click will bind the alert for the next click, but it doesn't do anything else. Thats why it works from the second time, and something similar was happening with your code.
has comment: http://stackoverflow.com/comment/44018500
downvote count: 0

http://stackoverflow.com/a/27787010
type: Answer
answers question: http://stackoverflow.com/q/27786730
has comment: http://stackoverflow.com/comment/43984173
score: 0
has body: Do you mean "onStartup" event? chrome.runtime.onStartup.addListener(function callback) See Google documentation here
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/43790010
comment on: http://stackoverflow.com/q/27688191
has text: How is this question related with java and JSP ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43973046
comment on: http://stackoverflow.com/a/27780871
has text: @Qantas94Heavy is it better this way?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43990356
has text: if you control the router you can do something like app.get(module.myroute) where myroute=function(req,res){} inside the module then anywhere you can do. unless your route handler uses module variables, you should be ok. for using this function you can build your req and response streams just like node would
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27789611
score: 1

http://stackoverflow.com/q/27647783
tagged with: php
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
upvote count: 0
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/43713238
has answer: http://stackoverflow.com/a/27647843
answer count: 1
has body: I am getting some information from database, this information is getting back into JSON format now I need to print this JSON information. But my code is not working getCountryDetails.php is php file for interacting with the database. Following code is the script, When I click the button It intersects with database.
has comment: http://stackoverflow.com/comment/43713167
favorite count: 0
accepted answer: http://stackoverflow.com/a/27647843
downvote count: 2
has title: How to print xmlhttp response?

http://stackoverflow.com/q/27737561
has title: Dreamweaver: Auto-Indent JavaScript code
favorite count: 0
has comment: http://stackoverflow.com/comment/43886529
tagged with: dreamweaver
has answer: http://stackoverflow.com/a/27737584
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27737638
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/27737584
type: Question
has comment: http://stackoverflow.com/comment/43886507
possible better answer: http://stackoverflow.com/a/27737638
tagged with: javascript
answer count: 2
has body: I am using a template website that I downloaded online. Everything works - problem is all of the JavaScript in my project is unreadable as it is all written as one line. My thought is that downloading it caused all of the spaces and indents in the .js document to go away and everything is left lookinglikethisfortheentirepage. That makes this very unreadable. Does anyone know of a way to auto-indent JS in Dreamweaver?
downvote count: 0

http://stackoverflow.com/comment/43982708
type: Comment
has text: @user222 - This whole thing is a lot easier if you're using jQuery. I'll post an update.
comment on: http://stackoverflow.com/a/27786284
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44247310
type: Comment
comment on: http://stackoverflow.com/a/27909703
type: AnswerComment
score: 0
has text: It is surprising how inefficiently Photoshop generates PDF's. I certainly don't suggest using it for PDF creation. However, when parsing arbitrary PDF's, you don't get to make that choice. In practice, it may very well be that Photoshop is rarely used for PDF creation, but I don't know.

http://stackoverflow.com/q/27677946
tagged with: javascript
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27678040
tagged with: regex
has answer: http://stackoverflow.com/a/27678602
favorite count: 0
type: UnansweredQuestion
has title: javascript lookback regex
has comment: http://stackoverflow.com/comment/43770252
downvote count: 0
has answer: http://stackoverflow.com/a/27678003
score: 1
has body: I want to replace all alphabets in the string which are not preceded by _ by numeric 1. So jj*_sin(jj)+_cos(hh) should be 1*_sin(1)+_cos(1) How to achieve it with regex lookbacks or any other method.
type: Question

http://stackoverflow.com/comment/79173550
has text: Actually `items` in `change` function is array of only widgets starting from the dragged widget and till the end, but `items` doesn't include widgets before the changed one.
type: Comment
comment on: http://stackoverflow.com/a/27691250
score: 0
type: AnswerComment

http://stackoverflow.com/q/27644473
has answer: http://stackoverflow.com/a/27644504
tagged with: javascript
linked to: http://stackoverflow.com/q/7635952
score: 0
answer count: 3
has title: whitespace before or after characters, symbols, or numbers; but, not in-between
accepted answer: http://stackoverflow.com/a/27644496
tagged with: jquery
tagged with: string
has comment: http://stackoverflow.com/comment/43707675
favorite count: 0
has answer: http://stackoverflow.com/a/27644675
has comment: http://stackoverflow.com/comment/43707570
possible better answer: http://stackoverflow.com/a/27644504
has comment: http://stackoverflow.com/comment/43707600
has answer: http://stackoverflow.com/a/27644496
tagged with: regex
type: AnsweredQuestion
has body: I'm trying to write a regexp that selects whitespace before or after any character( letters, symbols, or numbers ), but not in-between words composed of the characters. For example, in ' abc', the spaces before would match; but, in 'words words words' none of the whitespace in-between would be selected. So in ' hello world to everyone ', only the leading and trailing whitespace would be selected. Bonus: if there's a way to separately, in a second regexp, select the white-space in-between, that would help alot. What i'm trying to do is, in javascript, minimise the whitespace in a sentence so that leading and trailing whitespace is gone and the white-space in-between words is shrunk to 1 space.
upvote count: 1
downvote count: 1
type: Question

http://stackoverflow.com/q/27769919
tagged with: mongodb
has title: Save time of day as number in mongodb, but display in a human format (using meteor autoform)
accepted answer: http://stackoverflow.com/a/27770749
downvote count: 0
tagged with: javascript
score: 2
answer count: 1
tagged with: meteor
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/27770749
linked to: http://stackoverflow.com/q/15780415
type: AnsweredQuestion
has body: In a form, I'm asking for a start time &amp; end time, which I'll be using in a script later on. I figured in MongoDB, a time of day is best stored as the # of seconds since midnight (per How can I store time-of-day in MongoDB? As a string? Give arbitrary year/month/day?). My question is: how can I display a human-readable time in autoform (e.g. 7:30pm) yet still save it as a number in mongodb &amp; have proper client-side validation (make sure time is before 8:00pm)? I figure I could either use a datetime object &amp; subtract the seconds since 1970, or I could parse the time string &amp; do math on the hours, minutes, AM/PM. Thoughts on methods? &amp; where to put the math hooks in autoform? This seems like something folks a lot smarter than me have probably already figured out!
tagged with: meteor-autoform
type: Question

http://stackoverflow.com/comment/43823021
has text: Not an exact duplicate, but worth reading: [*Empty an array in JavaScript?*](http://stackoverflow.com/questions/1232040/empty-an-array-in-javascript/1234337#1234337).
score: 2
comment on: http://stackoverflow.com/q/27705332
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27797863
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27793997
has comment: http://stackoverflow.com/comment/44009013
has comment: http://stackoverflow.com/comment/44009179
downvote count: 0
has body: I'm presuming that you are using ExtJs 3.4 for this answer due to the format of the code above. I tried to run your code directly and got a number of errors. Such as _('Default') _() is undefined and from what I can see in the documentation a ComboBox doesn't have a function called bindStore ComboBox Documation. I have rewritten the code into the below code and it works fine for me. You need to make sure that you are applying the filter AFTER the store has loaded the data, in my example I wait for the load event to be fired. Ext.onReady(function() { Ext.BLANK_IMAGE_URL = '/js/ext-3.4.0/resources/images/default/s.gif'; var markerStore = new Ext.data.JsonStore({ autoLoad: true, url: 'data/data1.json', root: 'rows', sortInfo: {field: 'name', direction: 'ASC'}, fields: [ {name: 'id', type: 'integer'}, {name: 'name', type: 'string'}, {name: 'markerid', type: 'integer'} ], listeners: { 'load': function() { Ext.getCmp('createformTypeCombo').getStore().filter('markerid', 17); } } }); var form = new Ext.form.FormPanel({ renderTo: Ext.getBody(), items: [ new Ext.form.Label({ text: "form", margin: "25 10 25 5" }), new Ext.form.ComboBox({ fieldLabel: 'Marker', id: 'createformTypeCombo', displayField: 'name', valueField: 'id', mode:'local', lastQuery: '', store: markerStore }) ] }); });
type: Answer

http://stackoverflow.com/comment/134327935
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27760489
has text: Downvoted because I'd like to show a temporary "Loading ..." component precisely if the value is a promise.
score: 1

http://stackoverflow.com/q/27656777
score: 21
favorite count: 0
answer count: 5
tagged with: path
has answer: http://stackoverflow.com/a/27661950
has answer: http://stackoverflow.com/a/43122133
has answer: http://stackoverflow.com/a/27732830
type: AnsweredQuestion
has title: yii2 registering JS files to a View
has answer: http://stackoverflow.com/a/38278353
possible better answer: http://stackoverflow.com/a/28748063
upvote count: 21
has answer: http://stackoverflow.com/a/28748063
type: Question
has body: I have A.php view file in /views/A/ folder. And I have A.js js file in /views/A/ folder Please help me register js file in view file. As I understand I must write $this-&gt;registerJsFile('path/to/file.js'); in view file. But (Question A) I get method registerJsFile is not found in a class message from PHPStorm. Also (Question B) what should I write in path considering both files are in the same folder /views/A/ ?
tagged with: yii2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27732830
tagged with: class
downvote count: 0

http://stackoverflow.com/comment/43830358
type: Comment
has text: Agreed, placing a function call in the questioner's code at the appropriate places is cleaner. I just added the note since the OP was asking about using the eventing system. ;-)
type: AnswerComment
comment on: http://stackoverflow.com/a/27707206
score: 0

http://stackoverflow.com/comment/43838992
type: Comment
comment on: http://stackoverflow.com/q/27713015
type: QuestionComment
has text: You are right "TreePanel is making a POST request".I missed changing the file name in code. But it is same file name on both places. I will edit the question to avoid this confusion.
score: 0

http://stackoverflow.com/a/27793390
has body: If you do want to display an alert you can do this: function isvalidEmail(email) { var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; return regex.test(email); } $("#emailid").keyup(function (event) { var emailValue = $(this).val(); console.log(emailValue); if(!isvalidEmail(emailValue)){ alert('Please enter a valid email address'); } }); JS Fiddle link: http://jsfiddle.net/w0yoaqs5/
downvote count: 1
has comment: http://stackoverflow.com/comment/43996055
score: -1
answers question: http://stackoverflow.com/q/27793281
upvote count: 0
type: Answer

http://stackoverflow.com/a/27651050
type: Answer
has body: I think the problem is that the function doit is not available when you bind onsubmit. You can try to declare doit like a variable: doit = function(){ By the way, if you don't want to submit really the form you can bind onclick instead of onsubmit. Code snippet: var greeting = "hello " var div = document.getElementById('#item2'); doit = function() { $('#item2').append(document.name_form.fname.value + "U WOT"); return false; } // alert(greeting + document.name_form.fname.value) // // // $( " HEYTHERDUDE " + document.name_form.fname.value).appendTo($( " #item2 " )); // // div.innerHTML = div.innerHTML + 'LOOK AT ME' + document.name_form.fname.value; /***************************/ /*****CONTAINER STYLES******/ /***************************/ body { background-color: #212130; } #container { font-family: 'Exo 2', sans-serif; color: #c5c520; font-weight: 300; width: 100%; min-width: 225px; max-width: 325px; } /***************************/ /*******INPUT STYLES********/ /***************************/ .input { height: 25px; width: 100%; background-color: transparent; border-style: solid; border-width: 0px 0px 1px 0px; border-color: #c5c520; outline: 0; -webkit-transition: background-color 0.2s; -o-transition: background-color 0.2s; transition: background-color 0.2s; -webkit-transition: box-shadow 0.2s; -o-transition: box-shadow 0.2s; transition: box-shadow 0.2s; font-family: 'Exo 2', sans-serif; color: #c5c520; font-weight: 300; } .input:hover { box-shadow: inset 0 -10px 20px -10px #131322; -moz-box-shadow: inset 0 -10px 20px -10px #131322; -webkit-box-shadow: inset 0 -10px 20px border-right-width: 1px; border-left-color: #181825; border-right-color: #181825; } .input:focus { background-color: #191929; } .name_submit { color: #181825; background-color: #c5c520; border: none; } .submit_btn { display: none; } .question { display: block; bottom: 15px; } /***********************************/ /*******ITEM SPECIFIC STYLES********/ /***********************************/ #item1 { display…
answers question: http://stackoverflow.com/q/27650960
score: 0
has comment: http://stackoverflow.com/comment/43719205

http://stackoverflow.com/comment/43841289
has text: I know the methods are deprecated, the question is about if it´s possible to merge the functions in only one. Thanks again.
comment on: http://stackoverflow.com/q/27714028
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27659036
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43736170
score: 0
tagged with: browserify
has comment: http://stackoverflow.com/comment/43736682
has comment: http://stackoverflow.com/comment/43736997
tagged with: gulp
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43736516
has comment: http://stackoverflow.com/comment/43736534
has body: In essence I am getting Uncaught ReferenceError: require is not defined In the console it points to: var fooBarGold = require('../bower_components/scrollup/dist/lib/jquery-1.11.1.min.js'); So in the file (jquery.scrollUp.js) I am trying to leverage browserify, I have the above; and that file I am trying to import(in this case jquery-1.11.1.min.js) is wrapped like so: module.exports = function(){ //jquery }; This is my gulp task: gulp.task('browserify', ['scripts'], function() { return browserify('./builds/development/js/app.js') .bundle() .pipe(source('app.js')) .pipe(gulpif(env === 'production', gulp.dest(outputDir + 'js'))); }); and this is my script task, (Please note: As you can see by the length of my script task, I'd love to move to browserify so I can get rid of all the streamque) gulp.task('scripts', function() { return streamqueue({ objectMode: true }, gulp.src('builds/development/bower_components/jquery/jquery.js'), gulp.src('builds/development/bower_components/fastclick/lib/fastclick.js'), gulp.src('builds/development/bower_components/mixitup/src/jquery.mixitup.js'), gulp.src('builds/development/bower_components/flexslider/jquery.flexslider.js'), gulp.src('builds/development/bower_components/angular/angular.js'), gulp.src('builds/development/bower_components/angular-animate/angular-animate.js'), gulp.src('builds/development/bower_components/angular-route/angular-route.js'), gulp.src('builds/development/bower_components/angular-ui-router/release/angular-ui-router.js'), gulp.src('builds/development/bower_components/angular-flexslider/angular-flexslider.js'), gulp.src('builds/development/bower_components/angular-foundation/mm-foundation-tpls.js'), gulp.src('builds/development/bower_components/foundation/js/vendor/modernizr.js'), gulp.src('components/js/rustyApp.js'), gulp.src('components/js/share.js'), gulp.src('builds/development/bower_components/uikit/js/uikit.js'), // gulp.src('builds/development/bower_components/scrollup/dist/lib/jquery-1.11.1.min.js'), …
has comment: http://stackoverflow.com/comment/43735927
has comment: http://stackoverflow.com/comment/43737140
has comment: http://stackoverflow.com/comment/43737065
has title: I can't get 'browserify' to recognize file path, Uncaught ReferenceError: require is not defined
answer count: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/43734416
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43734449

http://stackoverflow.com/comment/43814034
type: Comment
has text: I tried this. It added comments like //# sourceMappingURL=../../../maps/access/controllers/HomeController.js.map to my files but there's no map file produced.
type: AnswerComment
score: 1
comment on: http://stackoverflow.com/a/27692770

http://stackoverflow.com/q/27765718
score: 1
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43942006
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27819880
has answer: http://stackoverflow.com/a/27765875
favorite count: 0
possible better answer: http://stackoverflow.com/a/27765875
has comment: http://stackoverflow.com/comment/43948304
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27819880
has title: Run JS on appended html with angular
has body: Hi I want to recreate the following using angularJS. This list was created with html Category1 Element1 Description of Category 1 Element 1 Element2 Description of Category 1 Element 2 Element1 Description of Category 1 Element 3 Element2 Description of element 2 Category2 Element1 Description of Category 2 Element 1 Element2 Description of Category 2 Element 2 Here is how I tried and what I have achieved till now. This is the html on which my controller is called. {{information.header}} {{item.name}} And this is the controller I am using. app.controller('UlController2', function($scope,$sce) { $scope.information = { header : "This list was created with angular!" }; $scope.items = [ {'name' : 'Category1', 'followUp' : ' '}, {'name' : 'Element2', 'followUp' : ' Description of element 2 '}, {'name' : 'Category2', 'followUp' : ' '} ]; $scope.elEments = [ {'name':'Element1','description':'Description of Category 1 Wlement 1'}, {'name':'Element2','description':'Description of Category 1 Wlement 2'}, {'name':'Element3','description':'Description of Category 1 Wlement 3'}, ]; $scope.element = function(input){ return $sce.trustAsHtml(input); } }); I want to make this without any JQuery or native JavaScript, only AngularJS native methods.
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/a/27685619
score: 0
has body: Remove the log_it function from the return this.each, else it will execute the log_it() function for EACH element. this.each(function(){ get_prop($(this)); }); return log_it();
type: Answer
answers question: http://stackoverflow.com/q/27685584
has comment: http://stackoverflow.com/comment/43785258

http://stackoverflow.com/comment/43859922
comment on: http://stackoverflow.com/a/27723535
type: Comment
has text: It's still unclear what you're trying to do when you say that you want to "use a checkbox to delete a row". Do you want the row to be deleted when the checkbox is checked? Do you want to delete only the rows that have checked checkboxes when, say, the user pushes a button? Can you edit your question to reflect the exact functionality you desire, and what you have tried in the way of achieving this functionality?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43803188
has text: I know how to handle asynchronous call (as outlined above, using promise). My issue is returning data alongside
type: QuestionComment
comment on: http://stackoverflow.com/q/27694844
score: 0
type: Comment

http://stackoverflow.com/comment/43808872
score: 0
type: Comment
type: QuestionComment
has text: Okay thanks Benjamin. I'll just use a standard jQuery Ajax call. That's honestly what I thought it just didn't jump out at me. If you want to put your comment in an answer format I'll accept it. I think it's a relevant question for React newbie's.
comment on: http://stackoverflow.com/q/27697808

http://stackoverflow.com/comment/43907835
comment on: http://stackoverflow.com/q/27748296
type: Comment
type: QuestionComment
has text: Please check the `var` line, it has two `=`s, then think about the executing order of that `var` and the next line ...
score: 3

http://stackoverflow.com/comment/44003243
has text: just wondering y everything starts with a `$`??
comment on: http://stackoverflow.com/q/27797301
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27798214
answer count: 2
possible better answer: http://stackoverflow.com/a/27800914
has comment: http://stackoverflow.com/comment/44005205
accepted answer: http://stackoverflow.com/a/27800263
has answer: http://stackoverflow.com/a/27800914
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27800263
has body: I need to dynamically display the accordance with the check box using bootstrap. When i click the parent check box , then my child boxes are not clicked. with static loading i can able to check it but when i keep the accordance code in JavaScript and run it when button is clicked I am unable to click the child check-boxes . code: Home Sample Area Submit
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44005153
has title: Unable to check the child checkbox when parent checkbox is clicked using bootstrap
tagged with: javascript
score: 0

http://stackoverflow.com/q/27748574
type: Question
has comment: http://stackoverflow.com/comment/43911138
tagged with: javascript
has body: I have a background slideshow that uses the jQuery 1.9.1 which is called here "jacksis.js" in body section and i have another submenu slider that uses jQuery 1.4.2 as in here is called "core.js" in head section. However, when i added the jQuery 1.9.1, the slider on 1.4.2 stopped working. I tried the noConflict() mode without success and the jQuery call innstead of the "$". Down below, the "ss1_wrapper" is using the 1.4.2 and the "cbp_bislideshow" the 1.9.1. What could be wrong in my ... ...... I am receiving only one error in firebug in line core.js (1.4.2) line 1993: TypeError: jQuery.browser is undefined and the error is in that function at line 4 (it's line 1993 in the original file) (function($) { $(document).ready( function() { // Fix background image caching problem if (jQuery.browser.msie) { try { document.execCommand("BackgroundImageCache", false, true); } catch(err) {} } What couldn't be wrong in my code if i tried all the possibilities of getting away with jQuery conflict? UPDATE: I introduced jQuery 1.7.1 and deleted both 1.4.2 and 1.9.1, then now i have both my Slider and Background slideshow working again together BUT my drop-down menu (which could be seen on my webpage www.es-processing.com) is not working anymore. On the online version it is working, but right now, on the version i'm working on it's not functioning at all. You can have an idea from my dropdown on my webpage to see which jQuery functions it follows and how to adapt them on the new 1.7.1 i put.
score: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/43908528
has comment: http://stackoverflow.com/comment/43908415
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43908556
has title: Conflict between jQuery 1.4.2 and 1.9.1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43908401
answer count: 0
has comment: http://stackoverflow.com/comment/43909294
has comment: http://stackoverflow.com/comment/43909239

http://stackoverflow.com/comment/43780382
type: AnswerComment
comment on: http://stackoverflow.com/a/27682843
type: Comment
has text: I get mple@email.com but not example@email.com
score: 1

http://stackoverflow.com/a/27732344
answers question: http://stackoverflow.com/q/27732055
has comment: http://stackoverflow.com/comment/43879610
has comment: http://stackoverflow.com/comment/43877990
has body: I'm not entirely sure if I understand it correctly, but I think the idea is to have an input field and then, ehn you click on a td the data in the input field goes there. To do that, you can use plain JS or Jquery. I used jquery as the code is faster to write. Your change code should look like this: $(document).ready(function(){ $('td').click(function(){ $(this).text($('#myIn').val()); $('#myIn').val(""); }); }); Check it working on: http://jsfiddle.net/lrojas94/sn0x6xat/ Basically, when you click a td element, you want it to take the value of the actual input. If what you want is to, also, submit that input, then you can feel free to do it using AJAX while showing the input to the user. Sorry if I did not answer your question. If I didn't please try to be a little more clear.
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43878753
has comment: http://stackoverflow.com/comment/43877869
has comment: http://stackoverflow.com/comment/43877741

http://stackoverflow.com/a/27763941
has comment: http://stackoverflow.com/comment/43940474
has comment: http://stackoverflow.com/comment/44019091
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43942800
has comment: http://stackoverflow.com/comment/43939591
has body: In order to make seats change in the UI on dropdownAValue change you need to declare empty observable array first: self.seats = ko.observableArray(); And update it in the subscribe function instead of creating new observableArray every time: self.seats([new PipCalculation(self.rates[0], self.rates[0].price, self.rates, self.newLot[0],currentlotvalue) ]); See updated fiddle
accepted answer of: http://stackoverflow.com/q/27761901
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43942874
has comment: http://stackoverflow.com/comment/43950944
answers question: http://stackoverflow.com/q/27761901

http://stackoverflow.com/comment/43828429
comment on: http://stackoverflow.com/q/27708013
has text: Correct, it isn't possible as of today. However, it is something they are looking into.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27714080
has title: $.parseJSON giving "Uncaught SyntaxError: Unexpected token"
type: Question
tagged with: http://stackoverflow.com/tag/json
score: 0
answer count: 3
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27721403
has answer: http://stackoverflow.com/a/27714291
tagged with: parsing
has body: I'm parsing a json string with JQuery parseJSON var jsontest = '[{"nombre":"Campaña de prueba","parcelas":"10","stampCreacion":"2014-12-30 18:18:26","estado":"1","id":"1","active":"1","camposControl":[{"nombre":"Repetición","tipo":"2","id":"2","active":"1"},{"nombre":"Comentarios","tipo":"1","id":"3","active":"1"}]},{"nombre":"Campaña2","parcelas":"10","stampCreacion":"2014-12-30 20:07:36","estado":"1","id":"2","active":"1","camposControl":[{"nombre":"Opciones","tipo":"3","id":"16","active":"1","opciones":[{"nombre":"muchas ","id":"12","active":"1"},{"nombre":"opciones ","id":"13","active":"1"},{"nombre":"para mi ","id":"14","active":"1"},{"nombre":"y para ti","id":"15","active":"1"}]},{"nombre":"numerito por aqui","tipo":"2","id":"17","active":"1"}]}]'; var obj = $.parseJSON(jsontest); It appears to be a valid json according to jsonlint, but as you may see in the fiddle it is giving the next error: Uncaught SyntaxError: Unexpected token -> jquery-1.11.2.min.js:4 http://jsfiddle.net/6a9qLtq2/ I'm using chrome BTW
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27714213

http://stackoverflow.com/comment/44020909
type: Comment
has text: Nice. I've glossed over the [Treeview documentation for databound](http://docs.telerik.com/kendo-ui/api/javascript/ui/treeview#events-dataBound) because it didn't mention styling the node at all. The Scheduler doc for databind does mention how to [modify element styling on databound](http://docs.telerik.com/kendo-ui/web/scheduler/how-to/modify-event-styling-on-databound).
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27798720

http://stackoverflow.com/comment/43841355
comment on: http://stackoverflow.com/q/27714619
has text: That's looks like expected behavior according to MDN. See the first code example there. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27659116
has answer: http://stackoverflow.com/a/27659244
type: AnsweredQuestion
downvote count: 0
has title: Node.js sync vs. async
tagged with: asynchronous
has answer: http://stackoverflow.com/a/27659245
tagged with: synchronization
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/27659281
tagged with: node.js
upvote count: 13
has answer: http://stackoverflow.com/a/27659267
has body: I'm currently learning node.js and I see 2 examples for sync and async program (same one). I do understand the concept of a callback, but i'm trying to understand the benefit for the second (async) example, as it seems that the two of them are doing the exact same thing even though this difference... Can you please detail the reason why would the second example be better? I'll be happy to get an ever wider explanation that would help me understand the concept.. Thank you!! 1st example: var fs = require('fs'); function calculateByteSize() { var totalBytes = 0, i, filenames, stats; filenames = fs.readdirSync(&quot;.&quot;); for (i = 0; i &lt; filenames.length; i ++) { stats = fs.statSync(&quot;./&quot; + filenames[i]); totalBytes += stats.size; } console.log(totalBytes); } calculateByteSize(); 2nd example: var fs = require('fs'); var count = 0, totalBytes = 0; function calculateByteSize() { fs.readdir(&quot;.&quot;, function (err, filenames) { var i; count = filenames.length; for (i = 0; i &lt; filenames.length; i++) { fs.stat(&quot;./&quot; + filenames[i], function (err, stats) { totalBytes += stats.size; count--; if (count === 0) { console.log(totalBytes); } }); } }); } calculateByteSize();
tagged with: javascript
answer count: 5
has answer: http://stackoverflow.com/a/27659256
score: 13
accepted answer: http://stackoverflow.com/a/27659267
possible better answer: http://stackoverflow.com/a/27659244

http://stackoverflow.com/comment/44312756
score: 0
comment on: http://stackoverflow.com/a/27912116
type: Comment
has text: Can you clarify using @import?
type: AnswerComment

http://stackoverflow.com/comment/44002842
type: QuestionComment
has text: @Teemu , no because i need to catch the url on the other page,(also the form methd has to be post) , so i have to use window.location to change the url as i need
comment on: http://stackoverflow.com/q/27796747
score: 0
type: Comment

http://stackoverflow.com/a/27652585
has body: I have never heard of changing the main part of the URL without a page reload, however you can easily change the path on modern browsers: https://stackoverflow.com/questions/20041302/how-to-change-url-without-page-refresh The down side to this is that if you save the path as a bookmark, you can't return to it later. However, there is a way around this: Use some PHP to decide which bit of content to load based on the URL path. Before you serve any content, get the url with $_SERVER['REQUEST_URI'] and then parse it with parse_url($url) . Then you can use the path to determine which position should be the starting position of your page. On the page, I would have all the positions saved in an array. Then you can make a variable that allows you to define the starting position. This variable can be written dynamically with the php from above. Each position in the array would have the scroll positions (most likely based on the positions of your content blocks). To make everything load smoothly, you might want to start out by loading the starting position's, and the next position's, content. So, if you start at position 2, the page loads 1, 2 and 3. When the event to scroll to 3 is triggered, the page loads 4, and so on. To get your scroll to snap in a similar way to that of the link you posted you are going to set up a "scroll event listener". This one seems to be nice: Scroll event listener javascript You can set the listener to snap to the next position (in your positions array) when it is triggered by a scroll event (you can animate it too so that it is smooth). This way it will go to the next position without the user having to scroll half way there, and then the listener will lock so that it can not be triggered again when a scroll is taking place. This scroll listener will then control position, loading, and the the rewriting of your URL. Then, the PHP will allow the user to return to the same page state that existed when a bookmark was made. I hope this makes sence …
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/43722103
answers question: http://stackoverflow.com/q/27652266

http://stackoverflow.com/q/27699493
downvote count: 0
has answer: http://stackoverflow.com/a/27699684
answer count: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/43811983
has answer: http://stackoverflow.com/a/27700619
linked to: http://stackoverflow.com/q/25674596
type: AnsweredQuestion
has body: Sorry if I'm missing something obvious, but I can't figure out how to bind a specific (nth) argument of a function in javascript. Most of my functional programming I've learned has been from Scala so I'm not sure this is even possible in JS. For example, I understand I can do the below to bind the 1st argument var add = function (a, b) { return a + b; }; add(1, 3); //returns 4 var addThree = add.bind(null, 3); //this = null. a = 3 addThree(4); //returns 7 But how can I bind the 2nd argument and leave the first as is. In other words how can I bind to 'b' only? From what i can tell from mozilla - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind , the arguments are actually nested which makes it look like it has to be in specific order? (I'm very possibly reading this wrong) Edit: I realize this is a sort of contrived example. I'm just trying to learn in case I eventually deal with something more complex than adding 2 numbers. I'm also trying to understand how the bind() arguments are actually working under the hood.
score: 49
has comment: http://stackoverflow.com/comment/43812003
favorite count: 0
has answer: http://stackoverflow.com/a/32168045
type: Question
accepted answer: http://stackoverflow.com/a/27699684
has answer: http://stackoverflow.com/a/75311841
possible better answer: http://stackoverflow.com/a/30657475
has title: JavaScript partially applied function - How to bind only the 2nd parameter?
has comment: http://stackoverflow.com/comment/43812348
has comment: http://stackoverflow.com/comment/43811989
upvote count: 49
has answer: http://stackoverflow.com/a/30657475

http://stackoverflow.com/q/27802771
has comment: http://stackoverflow.com/comment/44014420
has comment: http://stackoverflow.com/comment/44015080
answer count: 0
type: UnansweredQuestion
has body: My form already returns a value in the first element and loads to the second one, But how do i manually select the first element when i want to start over? Only a scanner will be connected so it would have to be a keypress or something. <?php $servername = "server"; $username = "user"; $password = "password"; $dbname = "JVSIntranet"; // Create connection $conn = mysqli_connect($servername, $username, $password, $dbname); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } $sql = "INSERT INTO MICROCHIP_TBL (chip_number,order_number) VALUES ('$_POST[chip_number]','$_POST[order_number]')"; IF (mysqli_query($conn, $sql)) { echo "Great Job! You've entered it correctly!"; } else { echo "Error: TRY AGAIN HUMAN!"; } $value = ""; if( isset( $_POST ["order_number"] )) $value = $_POST ["order_number"]; mysqli_close($conn); ?> Jeffers HomeAgain Microchip Entry <form name="chip_insert" id="chip_insert" action="<?php echo $PHP_SELF;?>" method="post" onsubmit="return validateForm()" > Order Number: <input tabindex="1" maxlength="12" type="text" name="order_number" id="order_number" value="<?php echo $value; ?>" required="required"onkeydown="return tabOnEnter(this,event)" /> Tag Number:
has title: How do i manually focus an element in my php form without clicking it?
tagged with: php
has comment: http://stackoverflow.com/comment/44014844
tagged with: forms
has comment: http://stackoverflow.com/comment/44014604
tagged with: post
type: Question
has comment: http://stackoverflow.com/comment/44014779
has comment: http://stackoverflow.com/comment/44014703
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/1484908
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44014522

http://stackoverflow.com/comment/43718689
type: Comment
has text: It's not at all clear to me what you mean. You just need to make sure that your PHP serves the appropriate Javascript as part of its HTML response... you *are* serving HTML from your PHP, right?
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27650759

http://stackoverflow.com/comment/44159881
score: 0
type: Comment
has text: Ok, i have edit my answer. If you have some question please aks me)
comment on: http://stackoverflow.com/a/27848326
type: AnswerComment

http://stackoverflow.com/a/27663422
score: 0
has body: Yes! So I figured out the problem with the help of Hector Ramos from the Parse Developers Google group. https://groups.google.com/forum/#!topic/parse-developers/2y-mI4TgpLc It was my client-side code. Instead of creating an event attached to my App.Views.Contact(); a.k.a. - an instance of Parse.View.extend({}), I went ahead and created a 'click' event using jquery within the sendMessage function that I recently defined. If you declare an event in the events object within the Parse view, it will recur over itself if the view wasn't re-initialized or destroyed and recreated properly. So what happened with me was the submit function that I declared in the events object kept recuring over itself and making duplicate calls to Parse.com. My view was static, it wasn't destroyed properly, re-initialized, or reloaded. You will see what I did below: Originally I had this: events: { 'click .submit' : 'submit', }, &amp; this submit : function (e) { e.preventDefault(); var message = new App.Models.Message({ name: $('.nameVal').val(), email: $('.emailVal').val(), subject: $('.subVal').val(), message:$('.messVal').val(), }); message.save(null, { success:function() { console.log("Success"); }, error:function(e) { alert('There was an error in sending the message'); } }); } /*end of submit*/ Now I have I completely removed the events object that I had and declared a sendMessage function: initialize : function () { this.render(); }, render : function () { this.$el.html(this.template); this.sendMessage(); }, sendMessage : function () { $('.submit').on('click', function(){ var message = new App.Models.Message({ name: $('.nameVal').val(), email: $('.emailVal').val(), subject: $('.subVal').val(), message:$('.messVal').val(), }); message.save(null, { success:function() { console.log("Success"); }, error:function() { alert('There was an error in sending the message'); } }); }); /*end of jquery submit*/ }/*end of send message function*/, And now it works perfectly fine. Credit is due Hector …
type: Answer
answers question: http://stackoverflow.com/q/27643612

http://stackoverflow.com/a/27645078
downvote count: 1
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27645043
has body: .green{ background-color:green !important; }
upvote count: 1

http://stackoverflow.com/comment/43897088
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27743034
has text: You already decided to use the XML data again? When the XML is already transformed into HTML, you could just use the HTML.

http://stackoverflow.com/comment/43884251
has text: well i only load the javascript file on the parent document so i guess thats it. Im only using iframes because i dont know ajax and i found it simpler than changing the page using pure DOM.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27736180
score: 0

http://stackoverflow.com/q/27748453
tagged with: geojson
type: Question
has title: Mouseover actions with geojson polygon
has answer: http://stackoverflow.com/a/27749229
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27752028
has answer: http://stackoverflow.com/a/27752028
answer count: 2
has body: First time using geojson polygons in Leaflet. I would like to add the following actions: 1. Mouseover change color 2. Onclick hyperlink to url Here is the code one polygon layer. /* Overlay Layers */ var boroughs = L.geoJson(null, { style: function (feature) { return { color: "blue", fill: false, opacity: 1, clickable: true }; }, $.getJSON("data/boroughs.geojson", function (data) { boroughs.addData(data); }); Current working map with toggle layers.
accepted answer: http://stackoverflow.com/a/27749229
downvote count: 0
favorite count: 0
score: 6
upvote count: 6
type: AnsweredQuestion
tagged with: leaflet

http://stackoverflow.com/q/27679893
downvote count: 0
favorite count: 0
has title: PHP won't load data on first page load at JavaScript HTTP request
type: Question
upvote count: 2
tagged with: php
has answer: http://stackoverflow.com/a/27680013
answer count: 1
tagged with: session
tagged with: javascript
type: UnansweredQuestion
has body: I'm sending data with a JavaScript HTTP request to PHP, I want the PHP to keep it in it's memory. Therefor, i'm using $_SESSIONS's. I'm doing this because i dont want to do any calculation or HTML deployment with JavaScript. Here's my method how i'm sending data to PHP: /** * The PHP file which receives the data * * @type {string} The php filename */ const INSTALL_FILE = "install.php"; /** * Passes roadTaxData to the php install file which could be getData with the $_POST operator */ function passToPHP (paramName, data) { var httpc = new XMLHttpRequest(); // simplified for clarity" httpc.open("POST", INSTALL_FILE, true); // sending as POST httpc.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); httpc.send(paramName + "=" + data); } I'm using the method like this: /** * @type {string} The data which is getting send to PHP */ var data = ""; /** * Parses the road tax data and stores it into the data string as JSON format */ function parseRoadTaxData () { var object = {}; /* Loop through all the road tax data */ for (var vehicleFormatType in roadTaxData) { /* Define all vehicle types which belong to that vehicle type format */ var vehicleTypes = roadTaxData[vehicleFormatType]; /* Loop through all the vehicle types */ for (var vehicleType in vehicleTypes) { /* Add the vehicle data to the JSON object */ object[vehicleType.toLowerCase()] = vehicleTypes[vehicleType]; } } /* Parse the javascript object (converted to JSON format) into the data string. */ data = JSON.stringify(object); } /** * Gets the data which is going to be send to PHP * * @returns {string} The JSON data string */ function getData () { return data; } /* Call the function to parse all data into the HTTP query string */ parseRoadTaxData(); /* Call the function to pass the whole HTTP query to PHP in seperate $_POST variables */ passToPHP('road-tax_data', getData()); The install.php file, which is receiving the data looks like this: It opens a session and stores the data in the RoadTaxData…
score: 2

http://stackoverflow.com/q/27726426
type: AnsweredQuestion
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
tagged with: parse-platform
has answer: http://stackoverflow.com/a/27728071
has body: I would like to store a URL as a string into parse. In particular, user select an item from Google drive using the Google Drive Picker, and then a URL is produced. I want to take that URL and store it into parse under a class named "Scan". Let me better elaborate in code: // A simple callback implementation. function pickerCallback(data) { var url = 'nothing'; if (data[google.picker.Response.ACTION] == google.picker.Action.PICKED) { var doc = data[google.picker.Response.DOCUMENTS][0]; url = doc[google.picker.Document.URL]; } var message = 'The following(s) were stored in Parse: ' + url; document.getElementById('result').innerHTML = message; I have generated the url through url = doc[google.picker.Document.URL]; and where the url is displayed as a string on the website through the following lines: var message = 'The following(s) were stored in Parse: ' + url; document.getElementById('result').innerHTML = message; All i want is to store that url into parse, however, not sure how to workout this code and inserted in the my google drive picker select code as shown below: eSnail Scan Upload Part 2 Any help would be greatly appreciated. Update 2: Below is a code that has tries to integrate parse with my initial code: eSnail Scan Upload Part 2 In particular this section, // A simple callback implementation. function pickerCallback(data) { var url = 'nothing'; if (data[google.picker.Response.ACTION] == google.picker.Action.PICKED) { var doc = data[google.picker.Response.DOCUMENTS][0]; url = doc[google.picker.Document.URL]; } var message = 'The following(s) were stored in Parse: ' + url; document.getElementById('result').innerHTML = message; Parse.initialize("ID", "ID"); var PDFUpload = new Parse.Object("Scan"); PDFUpload.set("Name", url); PDFUpload.save(null, { success: function(uploadResult) { // Execute any logic that should take place after the object is saved. }, error: function(uploadResult, error) { // Execute any logic that should take place if the save fails. // err…
accepted answer: http://stackoverflow.com/a/27728071
tagged with: google-drive-api
type: Question
has title: Storing string into Parse (Javascript)

http://stackoverflow.com/comment/43832037
type: Comment
comment on: http://stackoverflow.com/q/27709952
type: QuestionComment
score: 2
has text: Due respect, your `ToQueryString` is nothing remotely like a "to query string" function, there are ***lots*** of other things you need to do to correctly send user-entered text as a URI-encoded parameter, which is what you're doing above. Fortunately for you, there's already something that does it: `encodeURIComponent`: http://pastie.org/9805487

http://stackoverflow.com/a/27665854
has comment: http://stackoverflow.com/comment/43747107
has body: a &gt;= b &gt;= 5 is grouped as (a &gt;= b) &gt;= 5 a &gt;= b is true, which is converted to 1 when used in a numeric context. So this is equivalent to 1 &gt;= 5 which is false. If you want to do multiple comparisons, you should use: alert(a &gt;=b &amp;&amp; b &gt;= 5)
has comment: http://stackoverflow.com/comment/43747094
answers question: http://stackoverflow.com/q/27665838
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43747149
downvote count: 0
has comment: http://stackoverflow.com/comment/43747119
has comment: http://stackoverflow.com/comment/43747208
accepted answer of: http://stackoverflow.com/q/27665838
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/q/27707528
score: 0
type: UnansweredQuestion
tagged with: arraybuffer
has body: I'm trying to convert Uint8ClampedArray picked from webp images on canvas using the getImageData method. I've tried the method found in this thread: How can I create a canvas imageData array from an arrayBuffer representation of a JPG The output I get is only this part: AAAAAA== How to get the full data. Here's how I tried unsuccessful: function Uint8toBase64(idata) { this.idata = idata; var u = new Uint8ClampedArray(4); for (var i = 0; i &lt; idata.length; i += 4) { idata[0] = u[i]; idata[1] = u[i + 1]; idata[2] = u[i + 2]; idata[3] = u[i + 3]; } var str = String.fromCharCode.apply(null, u); var b64 = btoa(str); console.log(b64); } Thanks in advance,
type: Question
has comment: http://stackoverflow.com/comment/43827061
has comment: http://stackoverflow.com/comment/43830522
tagged with: canvas
linked to: http://stackoverflow.com/q/16194908
tagged with: javascript
has comment: http://stackoverflow.com/comment/43827200
has comment: http://stackoverflow.com/comment/43841179
has comment: http://stackoverflow.com/comment/43826925
has comment: http://stackoverflow.com/comment/43827125
has title: How to convert Uint8ClampedArray of webp image picked from canvas to base64
answer count: 0

http://stackoverflow.com/comment/51917263
comment on: http://stackoverflow.com/a/30602520
score: 0
type: AnswerComment
type: Comment
has text: Thanks for this Zach! I have tested it, and it works well. I have a small issue with the grid sorting. Sorting in the datatable works fine, but the black sort arrows (showing which column is being sorted and in which direction) that normally exist in datatables have disappeared in your implementation. Do you have any idea why this is the case?

http://stackoverflow.com/q/27772697
tagged with: onclick
has title: Trying to make an image move whenever clicked, however the .click even only fires the first time clicked
has body: I'm attempting to have an image (#goon) move and become resized whenever clicked. The code works great, however it only works the first time it is clicked. After the first time the image is clicked, clicking the image does noithing. Here is the Javascript code: var random = Math.floor(Math.random()* 750 + 1) var random2 = Math.floor(Math.random() * 200 + 10) $(document).ready(function() { $("#goon").click(function move() { $("#goon").animate({left: random},0) $("#goon").animate({top: random},0) $("#goon").animate({height: random2},0) $("#goon").animate({width: random2},0) }) }); Here is the HTML code: Goon My sincere apologies if this is a silly question, but I am still fairly new to web development.
type: Question
has answer: http://stackoverflow.com/a/27772723
has comment: http://stackoverflow.com/comment/43956328
tagged with: javascript
has answer: http://stackoverflow.com/a/27772807
tagged with: jquery
tagged with: click
accepted answer: http://stackoverflow.com/a/27772723
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27772807
has comment: http://stackoverflow.com/comment/43956309
type: AnsweredQuestion

http://stackoverflow.com/a/27642808
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27642408
answers question: http://stackoverflow.com/q/27642408
has body: I made a mistake with the module name i injected, it was supposed to be 'ui.router' instead of 'ui-router'.
type: Answer
upvote count: 1
downvote count: 1
score: 0

http://stackoverflow.com/q/27678028
answer count: 1
has title: Prevent 2 forms from being submitted?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27678088
score: 0
has comment: http://stackoverflow.com/comment/43770454
type: Question
has comment: http://stackoverflow.com/comment/43770424
tagged with: javascript
has body: I have two forms on the same page and I'm preventing each from being submitted multiple times with this: onclick="this.form.submit(); this.disabled=true;" Using javascript, can I similarly prevent form #2 from being submitted if form #1 has already been submitted, and vice-versa?

http://stackoverflow.com/a/37968617
answers question: http://stackoverflow.com/q/27791824
downvote count: 0
type: Answer
score: 17
has body: Just adding entity_encoding: 'raw' solved the problem.
upvote count: 17

http://stackoverflow.com/a/27650608
has comment: http://stackoverflow.com/comment/43718536
has comment: http://stackoverflow.com/comment/43718344
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43718426
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/43718547
has comment: http://stackoverflow.com/comment/43718465
accepted answer of: http://stackoverflow.com/q/27650602
has comment: http://stackoverflow.com/comment/43718374
has comment: http://stackoverflow.com/comment/43864691
type: Answer
answers question: http://stackoverflow.com/q/27650602
has body: Do as below Book.where(id: id). update_all(position: index+1) If you read the documentation, it says explicitly :- Parameters : updates - A string, array, or hash representing the SET part of an SQL statement.
has comment: http://stackoverflow.com/comment/43718409
has comment: http://stackoverflow.com/comment/43718363
has comment: http://stackoverflow.com/comment/43718514
has comment: http://stackoverflow.com/comment/43718408
upvote count: 4

http://stackoverflow.com/comment/43751169
type: Comment
type: QuestionComment
has text: It's actually off topic but jQuery's `$.Deferred()`, `$.Callbacks()` and `$()` itself all work that way. John Resig was kind enough to explain "new-tollerance" [here](http://www.ejohn.org/blog/simple-class-instantiation/). Since reading that a few years ago, I have written all my js constructors that way.
comment on: http://stackoverflow.com/q/27668060
score: 0

http://stackoverflow.com/a/27656452
upvote count: 14
score: 14
accepted answer of: http://stackoverflow.com/q/27656389
has body: You'll have to double escape it, as in "test\\"" var information = JSON.parse('[{"-1":"24","0":"","1":"","2":"","3":"0.0000","4":"","5":"0.00","6":"0.00","7":"1.00","8":"0","9":"false","10":"false","11":[""],"12":"","13":"","14":"test\\""}]'); document.body.innerHTML = '&lt;pre&gt;' + JSON.stringify(information, null, 4) + '&lt;/pre&gt;'; The first backslash escapes the second backslash in the javascript string literal. The second backslash escapes the quote in the JSON string literal. So it's parsed twice, and needs escaping twice. So even if it's valid JSON, you'll need one escape for javascript string literals that escapes the escape used in JSON.
answers question: http://stackoverflow.com/q/27656389
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43728880
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43815338
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27701311
has text: if(typeof variablename 'undefined') ????
score: 0

http://stackoverflow.com/comment/118729971
comment on: http://stackoverflow.com/a/67169669
type: AnswerComment
has text: Please explain what your code does and how it does it.
score: 0
type: Comment

http://stackoverflow.com/comment/43946806
comment on: http://stackoverflow.com/q/27767914
has text: Browsers might apply a gamma correction or any color correction scheme to the displayed images.
type: Comment
score: 3
type: QuestionComment

http://stackoverflow.com/comment/43905855
type: AnswerComment
comment on: http://stackoverflow.com/a/27746616
type: Comment
has text: Thank you for the answer. I get the protocol-independence idea (which is cool) and the superior performance of pubnub. All I needed for the answer though, was just "you can't force websockets connection for your app and xhr is our primary protocol atm". The project is experimental (not commercial), so I'm gonna compare pubnub against self-hosted websockets (or maybe even WebRTC technology) and choose the best performing option.
score: 3

http://stackoverflow.com/comment/43865217
comment on: http://stackoverflow.com/a/27726110
type: AnswerComment
score: 0
type: Comment
has text: Pretty sure he want's the result of the function call, not the function itself. P.S. Not many people here seem to know how to write good question titles.

http://stackoverflow.com/q/27664219
favorite count: 0
tagged with: exception
tagged with: xpath
has body: Slightly changed snippet from Mozilla's Introduction to using XPath in JavaScript is throwing exception. [Exception... "An attempt was made to use an object that is not, or is no longer, usable" code: "11" nsresult: "0x8053000b (InvalidStateError)" location: "debugger eval code Line: 6"] Code: var headings = document.evaluate('//h2', document, null, XPathResult.ANY_TYPE, null ); var thisHeading = headings.iterateNext(); while (thisHeading) { thisHeading.textContent = '\n'; thisHeading = headings.iterateNext(); } The difference from original piece of code is that I'm altering elements - not just reading them. Why do I see the exception and how to alter elements in iteration?
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27664220
tagged with: dom
accepted answer: http://stackoverflow.com/a/27664220
upvote count: 4
downvote count: 0
answer count: 1
tagged with: javascript
has title: XPath iteration Exception: "An attempt was made to use an object that is not, or is no longer, usable"
score: 4

http://stackoverflow.com/comment/43763137
score: 0
type: AnswerComment
has text: You can add a "currently selected" variable and do a while to make sure that the image does randomly change to something else than the current image.
comment on: http://stackoverflow.com/a/27673931
type: Comment

http://stackoverflow.com/comment/134437055
comment on: http://stackoverflow.com/a/29376982
score: 0
type: AnswerComment
type: Comment
has text: page not found. Please try to put answer instead of links

http://stackoverflow.com/q/27690342
answer count: 0
has title: CasperJS sessions weird behavior
type: Question
tagged with: session
tagged with: javascript
duplicate of: http://stackoverflow.com/q/18831098
score: 0
has body: Currently I have script that logs in to website and then tracks for requests that are emited in this process. However I see that between 2 different pages my requests are the same and does not send user related data to tracker which means that there are no sessions between these pages in PhantomJS. I listen to resource.requested and all of the requests are there, the problem is that there just isn't data in the last assertion, date that supposed to be injected between page 2 &amp; 3. Is this some phantomJS related weird behavior? Does anyone have any experience with it? Here is my code: var user, pass, url; casper.on("resource.requested",function(resource){ var match = resource.url.match("track_data"); if(match!=null) casper.echo(resource.url); }); casper.test.begin('Tracking test',3,function suite(test){ casper.start(url,function(page){ this.test.assertHttpStatus(200,'Page opened'); }); casper.then(function(){ this.evaluate(function(username, password){ document.querySelector('#email').value = username; document.querySelector('#password').value = password; document.querySelector('#submit').click(); },user,pass); this.waitForResource(function(req){ if(typeof document.sessionStorage !== "undefined") { casper.echo(JSON.stringify(document.sessionStorage,null," ")); } // all off the sessions are undefined var match = req.url.match("track_user"); if(match!=null) return true; },function(){ this.test.assert(true,"User is tracked") },function(){ this.test.assert(false,"Request not found"); }); }); casper.wait(3000); casper.then(function(){ this.mouseEvent('click','.next-page'); this.waitForResource(function(req){ if(typeof document.sessionStorage !== "undefined") { casper.echo(JSON.stringify(document.sessionStorage,null," ")); } // all off the sessions are undefined var match = req.url.match("id_user"); if(match!=null) return true; },function(){ this.test.assert(true,"ID is tracked") }, function(){ this.test.assert(false,"Request 2 not found"); }); }); casper.run(function()…
has comment: http://stackoverflow.com/comment/43822057
has comment: http://stackoverflow.com/comment/43803305
has comment: http://stackoverflow.com/comment/43799494
tagged with: casperjs
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/18831098
has comment: http://stackoverflow.com/comment/43794025
has comment: http://stackoverflow.com/comment/43817730
has comment: http://stackoverflow.com/comment/43815132
tagged with: phantomjs

http://stackoverflow.com/q/27754259
tagged with: javascript
has comment: http://stackoverflow.com/comment/43919776
has comment: http://stackoverflow.com/comment/43920652
has body: When making a javascript-variable you can do: var hest = hest++ || 0; I find this very useful. I'm looking for something similair when working with objects for example in this case: self.counted[grouping][conversion]++; if either grouping or conversion doesn't exist, I want it to be created. Is that possible? Also for pushing to an array that doesn't exist yet.
has comment: http://stackoverflow.com/comment/43919719
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43919927
answer count: 0
type: UnansweredQuestion
has title: create object-parent if undefined?
upvote count: 1
has comment: http://stackoverflow.com/comment/43919724
has comment: http://stackoverflow.com/comment/43919775
score: 1
has comment: http://stackoverflow.com/comment/43919757
has comment: http://stackoverflow.com/comment/43919383
type: Question
has comment: http://stackoverflow.com/comment/43924735

http://stackoverflow.com/a/27673931
answers question: http://stackoverflow.com/q/27673899
score: 1
has comment: http://stackoverflow.com/comment/43763137
downvote count: 0
has comment: http://stackoverflow.com/comment/43762995
type: Answer
has body: As per your jQuery reference at the top, below is the proposed solution: $(function() { $('a.click').click(function(e) { e.preventDefault(); var number = Math.floor(Math.random()*randomImage.length); $(this).html('&lt;img src="'+randomImage[number]+'" /&gt;'); }); });
upvote count: 1

http://stackoverflow.com/comment/43812677
has text: just allow space in regex
comment on: http://stackoverflow.com/a/27699785
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43762817
type: AnswerComment
has text: I don't think the original poster wants to reset the value on the service. He wants to display the value in the service on the view.
type: Comment
comment on: http://stackoverflow.com/a/27672161
score: 0

http://stackoverflow.com/comment/88766182
has text: The async function will still return a promise object if called without an await (or in non asynchronous code). Check the result of console.log(waitForPromise()) if you are uncertain. A check of console.log(result) within the async function _will_ print out what you expect, but the return from the async function happens immediately without blocking and returns a promise. Blocking in javascript is usually very bad since it's a single threaded application and blocking will starve any other pub/sub clients of notifications essentially bringing the entire app to it's knees.
type: Comment
comment on: http://stackoverflow.com/a/47940763
score: 15
type: AnswerComment

http://stackoverflow.com/q/27674150
has title: $.ajax succeeds with incorrect callback : reports failure
score: -2
has body: I have the following jquery. When I set a breakpoint in the callback functions, it calls the error callback although the status field is 200. I'm sure it's something stupid on my part, but I can't see it. Thanks. I modified the error function according to the jquery docs, and now I find the error identifies itself as a parse error (SyntaxError: Unexpected token &lt;). The response is html (it displays correctly), the error suggests that I need to modify data type information so this is accepted. How? $.ajax({ url: "../php/recordInteraction.php", type: 'GET', data : { 'rId' : 'image' }, dataType: 'json', success: function(response){ switch(response.status){ case 'saved': alert(response.message); // do what you want break; case 200 : $("#view1").html(arg.responseText); alert(response.message); // do what you want break; case 'empty': alert(response.message); break; default: alert("unknown response"); } }, error:function( jqXHR, textStatus, errorThrown){ // updated in edit. alert("failure" + textStatus); $("#view1").html(jqXHR.responseText); } });
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/43763280
has comment: http://stackoverflow.com/comment/43768242
has answer: http://stackoverflow.com/a/27677599
type: Question
has comment: http://stackoverflow.com/comment/43763307
upvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43763522
tagged with: jquery
favorite count: 0
tagged with: ajax

http://stackoverflow.com/q/27782339
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has title: Fileupload is not working with RequireJS
tagged with: file-upload
tagged with: asp.net
type: UnansweredQuestion
tagged with: requirejs
has body: I am having a problem when loading fileupload whilst using requirejs. The error that it gives me is: TypeError: this._on is not a function and I guess it is because fileupload requires jquery.ui.widget to be loaded too. So I tried importing the lib, but I can't seem to make this right. Can anyone help me how to load it properly? this is the code: require.config({ paths: { 'jQuery': 'lib/jquery-1.10.2.min', 'jQuery-ui': 'lib/jquery-ui-1.10.3', 'jQuery-ui-widget' : 'jquery.ui.widget', 'bootstrap': 'lib/bootstrap.min', 'jquery-iframe': 'jquery.iframe-transport', 'fileupload': 'jquery.fileupload', }, shim: { 'jQuery': { exports: '$' }, 'jQuery-ui': { deps: ['jQuery'], exports: '$' }, 'jQuery-ui-widget': { deps: ['jQuery', 'jQuery-ui-widget'] }, 'bootstrap': { deps: ['jQuery', 'jQuery-ui'] }, 'fileupload': { deps: ['jQuery', 'jQuery-ui', 'jquery-iframe'] } }, // only for development purporses: urlArgs: "bust=" + (new Date()).getTime() }); require(['jQuery', 'jQuery-ui', 'bootstrap', 'layout', 'menu', 'modal', 'table', 'form', 'fileupload'], function ($, jqueryUi, _bootstrap, layout, menu, modal, table, form, fileupload) { $(document).ready(function () {...
has answer: http://stackoverflow.com/a/27784585
type: Question

http://stackoverflow.com/comment/43720758
type: Comment
has text: What does the output array look like that contains names and counts?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27651708

http://stackoverflow.com/q/27760633
tagged with: javascript
has comment: http://stackoverflow.com/comment/43934839
has comment: http://stackoverflow.com/comment/43932415
answer count: 1
has comment: http://stackoverflow.com/comment/43934878
has comment: http://stackoverflow.com/comment/43932577
has comment: http://stackoverflow.com/comment/43932836
has comment: http://stackoverflow.com/comment/43932299
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43932479
has answer: http://stackoverflow.com/a/27760734
has title: Javascript doesn't generate email
has comment: http://stackoverflow.com/comment/43932328
score: 0
type: Question
has body: I've coded some js into an Articulate Storyline file for a workshop. I'm trying to get the system to compile a number of variables and email the data to the user. When I click on the icon to generate the email I get nothing. SET DATE CODE var d = new Date(); var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); var monthName = new Array("January","February","March","April","May","June","July","August","Septemeber","October","November","December"); var dateVal = d.getDate().toString(); var delimeter = ", "; var delimeter1 = " "; var txtPostdate = "" var lDigit = dateVal.charAt( dateVal.length-1); if (lDigit = = "1"){ txtPostdate = "st"; }else if(lDigit = = "2"){ txtPostdate = "nd"; }else if(lDigit = = "3"){ txtPostdate = "rd"; }else{ txtPostdate = "th"; } var dateString = weekday[d.getDay()]+delimeter+monthName[(d.getMonth())]+delimeter1+dateVal+txtPostdate+delimeter+d.getFullYear(); var player = GetPlayer(); player.SetVar("SystemDate",dateString); SEND EMAIL CODE var player = GetPlayer(); var useremail = player.GetVar("email"); var subject ="My Fact Sheet - Optimizing Your Online Job Applications"; var firstname = player.GetVar("firstname"); var lastname = player.GetVar("lastname"); var street = player.GetVar("street1"); var address2 = player.GetVar("street2"); var city = player.GetVar("city"); var state = player.GetVar("state"); var zip = player.GetVar("zip"); var phone = player.GetVar("phone"); var cell = player.GetVar("cell"); var mymail = player.GetVar("mymail"); var phone = player.GetVar("phone"); var cell = player.GetVar("cell"); var school1 = player.GetVar("school1"); var s1city = player.GetVar("s1city"); var s1degree = player.GetVar("s1degree"); var s1date = player.GetVar("s1date"); var s1start = player.GetVar("s1start"); var school2 = player.GetVar("school2"); var s2city = player.GetVar("s2city"); var s2degree = player.GetVar("s2degree"); var s2start = player.GetVar("s2start"); var s2date = player.GetVar("s2date"); v…
has comment: http://stackoverflow.com/comment/43932364

http://stackoverflow.com/a/27691832
has comment: http://stackoverflow.com/comment/43803892
has comment: http://stackoverflow.com/comment/43797150
has comment: http://stackoverflow.com/comment/43798004
type: Answer
answers question: http://stackoverflow.com/q/27691736
has comment: http://stackoverflow.com/comment/43797571
has comment: http://stackoverflow.com/comment/43797690
has comment: http://stackoverflow.com/comment/43799800
has comment: http://stackoverflow.com/comment/43801549
has body: You can send simple data from one activity to another using the Intent. You can pass the JSON data as String using something like this: intent.putExtra("OBJECT_DETAILS", myJSONString); And later you can read in the next activity like this: String myJsonData= i.getStringExtra("OBJECT_DETAILS");
has comment: http://stackoverflow.com/comment/43797326
score: 0
has comment: http://stackoverflow.com/comment/43797855

http://stackoverflow.com/a/27648876
score: 2
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27648703
answers question: http://stackoverflow.com/q/27648703
upvote count: 2
type: Answer
has body: It looks like a timing issue ... I commented out this line ... // $(".answers").html(" "); ... in deleteOlQuestion. Then, put it before the for-loop in changeQuestion and it works, sort of. This should give you enough direction to move forward. Working code snippet: var questionsOrder = []; var currentQuestion = 0; var allQuestions = [{ question: "1Who is Prime Minister of the United Kingdom?", choices: ["David Cameron", "Gordon Brown", "Winston Churchill", "Tony Blair"], correctAnswer: 0 }, { question: "1United Kingdom?", choices: ["David Camerfafaon", "Gordonfffa Brown", "Winstfafaon Churchill", "Tony fafaBlair"], correctAnswer: 0 }, { question: "2Who is Prime Ministerfsafasfa of the United Kingdom?", choices: ["David Cameron", "Gordon Brown", "Winston Churchill", "Tony Blair"], correctAnswer: 1 }, { question: "3Who ifafa Minister of the Unitedsafafgdom?", choices: ["David Caafameron", "Goasfarown", "Wiasfsfa Churchill", "TofasfaBlair"], correctAnswer: 2 }, { question: "4Who is Prime Minister oafsafaf the United Kingdom?", choices: ["David asfsafCameron", "Gordon asfasf", "Winston Churchill", "Tony Blfsafasfair"], correctAnswer: 3 }]; var deleteOlQuestion = function() { $(".question").children().slideUp(function() { $(this).remove(); }); $(".answers").children().slideUp(function() {}); console.log("apagadas"); }; var shuffle = function(array) { var currentIndex = array.length, temporaryValue, randomIndex; // While there remain elements to shuffle... while (0 !== currentIndex) { // Pick a remaining element... randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; // And swap it with the current element. temporaryValue = array[currentIndex]; array[currentIndex] = array[randomIndex]; array[randomIndex] = temporaryValue; } return array; }; var changeQuestion = function(question) { $(".question").slideDown(function() { $(".question").html(" " + allQuestions[questionsOrder[currentQuestion]].question); }); $(".answers").slideDown(function() { $(".answ…

http://stackoverflow.com/comment/43718468
comment on: http://stackoverflow.com/a/27650399
has text: either right after creating the button - which would result in a lot of event listeners - or right after the for loop ($('.yourbuttonclass').click..., for example). even better: don´t use jquery at all for those simple things. there is "addEventListener", native javascript stuff.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27697765
type: UnansweredQuestion
tagged with: css
tagged with: popup
type: Question
has body: Here is a FIDDLE of what I want my popup to look like... this works well: http://jsfiddle.net/mib92/x6yev5a0/ (both display are set to: block; ) and it shows perfectly. When I run it in my code, I use a JS script to do the popup. my HTML: Click to Open CSS Pop Up line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line line Click to Close CSS Pop Up MY CSS: (same as the FIDDLE without the display: block; because it is set to display:none; in the HTML) #blanket { background-color:#ff0024; opacity: 0.65; *background:none; position:fixed; z-index: 9001; top:0px; left:0px; width:100%; height:100%; } #popUpDiv { position:fixed; background-color:#ccc; width:400px; height:400px; border:5px solid #000; z-index: 9002; top:50%; left:50%; margin-left: -200px; margin-top: -200px; } And here is the JS CODE: function toggle(div_id) { var el = document.getElementById(div_id); if ( el.style.display == 'none' ) { el.style.display = 'block';} else {el.style.display = 'none';} } function blanket_size(popUpDivVar) { if (typeof window.innerWidth != 'undefined') { viewportheight = window.innerHeight; } else { viewportheight = document.documentElement.clientHeight; } if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) { blanket_height = viewportheight; } else { if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) { blanket_height = document.body.parentNode.clientHeight; } else { blanket_height = document.body.parentNode.scrollHeight; } } var blanket = docu…
answer count: 1
tagged with: javascript
has title: positioning a CSS popup with javascript script
score: 0
has answer: http://stackoverflow.com/a/27698274
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27788787
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/43988127
tagged with: scroll
has body: I have this problem: Google The page use this javascript: pastebin.com/DGN7CM9v I need that on click it scroll to top, how I can do? I already tried to read in this forum and in Google but nothing, I also use wordpress. What can I do? Online I find only how to scroll link without link. Regards
tagged with: href
has comment: http://stackoverflow.com/comment/55031315
has title: Scroll on top onclick href id?
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44013226
has answer: http://stackoverflow.com/a/36251526
type: Question
has answer: http://stackoverflow.com/a/27789078
has answer: http://stackoverflow.com/a/27802465

http://stackoverflow.com/q/27801510
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
upvote count: 1
accepted answer: http://stackoverflow.com/a/27809869
type: Question
score: 1
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/3642035
has title: Draw windBarbs with SVG and Javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I am a svg newbie.I need to draw wind arrows in svg with jquery. I found some code for drawing wind arrows with d3 here. I converted it into the jquery compatible form. Here is jsfiddle example. But it is not working. Can anyone help? Here is the jquery code: $(function () { var WindBarbArrowHandler = { WindArrow: function (speed, direction, container, arrowWidth) { 'use strict'; var index = 0, i; this.speed = speed; this.direction = direction; this.trigDirection = direction + 90; this.scale = arrowWidth / 8; this.ten = 0; this.five = 0; this.fifty = 0; // Create the canvas $(container).append( $(' ') .attr({ height: 2 * arrowWidth, width: 2 * arrowWidth }) ); $("svg", container).append(' '); $("defs", container).append($(' ').attr('id', 'clip')); $("clipPath", container).append($(' ') .attr({ height: 2 * arrowWidth, width: 2 * arrowWidth })); // Draw the widget area $("svg", container).append($('<g></g>').attr('class', 'wind-arrow')); this.widget = $("svg", container); if (this.speed > 0) { // Prepare the path this.path = ""; if (this.speed <= 7) { // Draw a single line this.longBar(); index = 1; } else { this.shortBar(); } // Find the number of lines in function of the speed this.five = Math.floor(this.speed / 5); if (this.speed % 5 >= 3) { this.five += 1; } // Add triangles (5 * 10) this.fifty = Math.floor(this.five / 10); this.five -= this.fifty * 10; // Add tenLines (5 * 2) this.ten = Math.floor(this.five / 2); this.five -= this.ten * 2; // Draw first the triangles for (i = 0; i < this.fifty; i++) { this.addFifty(index + 2 * i); } if (this.fifty > 0) { index += 2 * (this.fifty - 0.5); } // Draw the long segments for (i = 0; i < this.ten; i++) { this.addTen(index + i); } index += this.ten; // Draw the short segments for (i = 0; i < this.five; i++) { this.addFive(index + i); } this.path += "Z"; // Add to the widget this.widget.append($('<g></g>')); $("g", this.widget).append($(' ').attr({ 'd': this.path, 'vector-effect': 'non-scaling-stroke', 'transform': 'transl…
has answer: http://stackoverflow.com/a/27809869

http://stackoverflow.com/comment/118481047
comment on: http://stackoverflow.com/a/67026936
type: AnswerComment
has text: Isn't it in essence the same answer as @bubb?
type: Comment
score: 0

http://stackoverflow.com/comment/54686391
has text: Note that the two `if` statements are only the same if `a` is a number. `tempStr = "asdasdasd"; !(tempStr > 0) // true; tempStr <= 0 // false;`
score: 4
type: Comment
comment on: http://stackoverflow.com/a/27753521
type: AnswerComment

http://stackoverflow.com/q/27641768
type: UnansweredQuestion
downvote count: 2
has body: What I'm trying to do is a synchronization of json objects on the client side with help of the server. When the client is not able to connect to the server it should fall back to a locally stored backup of the most recent objects. I have tried ShareJS for this and so far I can't really connect to the server. All the examples kind of work server side as far as I understand. How do I connect to a remote ShareJS server with different clients (with authentication)? Or maybe are there better solutions than ShareJS?
tagged with: node.js
tagged with: share.js
type: Question
upvote count: 0
score: -2
has answer: http://stackoverflow.com/a/27641889
tagged with: javascript
tagged with: operational-transform
answer count: 1
tagged with: synchronization
favorite count: 0
has title: Client server synchronization with offline support

http://stackoverflow.com/comment/94111269
type: Comment
has text: Like Rick linked above, Netscape Navigator had the ability to check the digital signature on javascript, but it used jar files for that purpose instead of inline signing. Would love to have the ability to only run digitally authenticated jQuery, node, or any other js. https://superuser.com/questions/1263840/how-can-i-force-firefox-to-execute-only-ev-digitally-signed-javascript
type: AnswerComment
comment on: http://stackoverflow.com/a/27706791
score: 0

http://stackoverflow.com/comment/43737103
type: Comment
has text: I removed the "accepted answer". Thank you for your advice on this question, it helped me a lot to understand the problem.
comment on: http://stackoverflow.com/a/27658762
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43865854
type: QuestionComment
has text: Yes, that is correct.
score: 0
comment on: http://stackoverflow.com/q/27726869
type: Comment

http://stackoverflow.com/a/27774752
score: 0
has comment: http://stackoverflow.com/comment/43960327
has comment: http://stackoverflow.com/comment/43960401
type: Answer
answers question: http://stackoverflow.com/q/27774655
has body: You have to parse the JSON string to a JSON object before operating on it. var obj = eval ("(" + data + ")"); BTW, I see that item is not an array. If you want to make it an array, it has to be like this {item : [{"book" : "harry potter", "available" : true}, {..}]}

http://stackoverflow.com/comment/43716890
type: Comment
score: 1
has text: you need to sure that, SetTotal() function must run before postback.
comment on: http://stackoverflow.com/q/27649815
type: QuestionComment

http://stackoverflow.com/comment/43749340
comment on: http://stackoverflow.com/q/27667253
score: 4
type: QuestionComment
type: Comment
has text: need more clarification

http://stackoverflow.com/q/27749367
has comment: http://stackoverflow.com/comment/43910271
type: Question
has comment: http://stackoverflow.com/comment/43919476
score: 9
has answer: http://stackoverflow.com/a/50515729
has body: I've got this in my html (the SVG is about 500K): &lt;object type="image/svg+xml" data="/assets/images/test-diagram.svg" width="100%" height="100%" id="arm" class="svg-content"&gt;&lt;/object&gt; I'm using a script on GitHub to create a viewport for the SVG so that I can pan and zoom inside the viewport, but like GoogleMaps. https://github.com/ariutta/svg-pan-zoom So the load order needs to be: svg-pan-zoom.js finishes all 500k of the svg needs to finish loading the following code needs to run: var panZoomArm = svgPanZoom('#arm'); Unfortunately the code above runs when the SVG isn't completely loaded, resulting in errors. I've tried this but .load doesn't appear to be designed for &lt;object&gt; - in fact debugger never gets triggered $('#arm').load(function(){ debugger var panZoomArm = svgPanZoom('#arm'); }); Is these some way for me to tell the code to run only after the 500k svg has been completely downloaded? The only way for me to have this code fire off reliably is to make the SVG entirely inline... so that's like hundreds of lines of code with no ability to cache. EDIT---- Ok, I got it to work, but I'm confused. This does not work (debugger never triggers): $('#arm').load(function(){ debugger var panZoomArm = svgPanZoom('#arm'); }); This works: var arm = document.getElementById("arm"); arm.addEventListener('load', function(){ debugger var panZoomArm = svgPanZoom('#arm'); });
has comment: http://stackoverflow.com/comment/43910285
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/43910881
accepted answer: http://stackoverflow.com/a/27808044
answer count: 3
linked to: http://stackoverflow.com/q/27732140
has comment: http://stackoverflow.com/comment/43910310
possible better answer: http://stackoverflow.com/a/27752034
has answer: http://stackoverflow.com/a/27752034
upvote count: 9
has title: How to wait for an SVG inside to finish loading before some JS fires?
tagged with: javascript
linked to: http://stackoverflow.com/q/337293
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27808044
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/27716777
tagged with: asp.net
tagged with: ajax
type: UnansweredQuestion
has title: CORS request using jQuery - $.ajax()
has comment: http://stackoverflow.com/comment/43847143
has body: I am developing a web application where data is coming from different domain. I mean in my application almost 90% request are cross domain request. I am unable to get the data while deploy this application on IIS. Server is deployed on http://some.ip.add/crmservice client is deployed on http://diffent.ip.add/saascrm I am using jQuery 2.0 to get the data in async manner using $.ajax(); Note: data is coming in xml format Added some stuff to web.config file also. &lt;system.webServer&gt; &lt;httpProtocol&gt; &lt;customHeaders&gt; &lt;add name="Access-Control-Allow-Origin" value="*" /&gt; &lt;/customHeaders&gt; &lt;/httpProtocol&gt; &lt;/system.webServer&gt; This is my snippet. $.support.cors = true; $.ajax({ type: "GET", url: 'http://some.ip.add/crmservice/crmservice.asmx/HandShake', contentType: "application/json; charset=utf-8", dataType: "json", crossDomain: true, beforeSend: function (request) { // debugger; request.setRequestHeader("Access-Control-Allow-Origin", '*'); }, error: function (xhr, status, error) { try { // debugger; // debugger; //Here i am getting error : Access denied in IE 9.0 and and just "error" in firefox. var msg = JSON.parse(xhr.responseText); alert(msg.Message); } catch (e) { // debugger; alert(xhr.statusText); } return true; }, success: function (data) { debugger; xmlDoc1 = $.parseXML(data.d); $xml1 = $(xmlDoc1); if ($xml1.find('Result').text() == '0') { $(this).MessageBox('success', $xml1.find('Message').text()); $("#uxDBName").prop("disabled", false); $("#uxSUPassword").prop("disabled", false); $("#uxServiceURL").prop("disabled", true); GetListOfB1Databases(url); } } }); my server code is : Global.asax protected void Application_BeginRequest(object sender, EventArgs e) { HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache); HttpContext.Current.Response.Cache.SetNoStore(); EnableCrossDmainAjaxCall(); } private void EnableCrossDmainAjaxCall() { HttpContext.Current.Response.AppendHeader("Access-Control-Allow-Origin", "*…
has comment: http://stackoverflow.com/comment/43845507
has comment: http://stackoverflow.com/comment/43845610
type: Question
has answer: http://stackoverflow.com/a/27740325
has comment: http://stackoverflow.com/comment/43845555
has comment: http://stackoverflow.com/comment/43845560
tagged with: javascript
has comment: http://stackoverflow.com/comment/43845603
has comment: http://stackoverflow.com/comment/43871363
has comment: http://stackoverflow.com/comment/43847153
score: 0
tagged with: cors
has comment: http://stackoverflow.com/comment/43845547
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/43704691
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27643046
has text: numbers are fine as ID, at least in HTML5 http://www.w3.org/TR/html5/dom.html#the-id-attribute

http://stackoverflow.com/q/27705977
upvote count: 4
type: AnsweredQuestion
tagged with: html5-canvas
downvote count: 0
has title: HTML canvas making blurry shapes
has comment: http://stackoverflow.com/comment/43824848
linked to: http://stackoverflow.com/q/1664785
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/27706093
tagged with: http://stackoverflow.com/tag/html
score: 4
answer count: 1
tagged with: canvas
tagged with: javascript
has answer: http://stackoverflow.com/a/27706093
has body: I want to make simple shapes using HTML. But the shapes need to be big. And the canvas is in full screen Example: http://jsfiddle.net/xLgg43s9/1/embedded/result/ Code: Untitled Document Please fix it.

http://stackoverflow.com/a/27779897
score: -1
upvote count: 0
answers question: http://stackoverflow.com/q/27779673
has body: for (var country in data){ for(var i=0;i&lt;data[country].length;i++){ console.log (data[country][i]); } }
has comment: http://stackoverflow.com/comment/43971591
type: Answer
downvote count: 1

http://stackoverflow.com/q/27660367
type: UnansweredQuestion
has title: How to create a simple animation on ng-repeat?
answer count: 0
has comment: http://stackoverflow.com/comment/43738360
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/43738328
has body: I am using angularJS 1.2.28 Here is the source code: they are: {{performers.length}} performers {{ (performer.username | uppercase) + ', ' + performer.id }} 1) Animation NEVER occurs: how to add animation ? (Do I need to include angular-animate.min.js or is this module included in angularsjs lib ?) 2) this script works with angular 1.2 but gives an error with 1.3: why ? Error: [ng:areq] Any idea ?
score: 0
tagged with: javascript

http://stackoverflow.com/comment/43759095
has text: It seems to be a version problem. Check out this fork of your code: http://jsfiddle.net/jjcwzfu9/. Under external resources, remove the 1.2.28 version and use the 1.2.1 version (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.min.js) instead, hit the run button and and it will all work
type: Comment
comment on: http://stackoverflow.com/a/27663326
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43706989
type: Comment
score: 0
type: AnswerComment
has text: Uhmmm that's true, but actually my problem is something more tricky. I edit the post to show it.
comment on: http://stackoverflow.com/a/27644112

http://stackoverflow.com/comment/43976373
has text: Use the `:not()` selector
score: 1
comment on: http://stackoverflow.com/q/27783211
type: QuestionComment
type: Comment

http://stackoverflow.com/a/32592172
score: 3
has body: You can jQuery paste event to listen for the event and use prevenrDefault() to prevent the event. In this page , they used the below jQuery $('#pwd, #pwd2').bind('paste',function(e){ e.preventDefault(); alert('Please type your password.') }); Open Firebug, Go to Scripts Tab, then search the string Please type your password. (Firebug Search Bar , not browser search bar.) , you'll find above code. And Code is present logon.asp To Disable it , you simply use off method like this $('#id1').off(). this unbinds all events for the element that has id='id1'
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27704355
upvote count: 3

http://stackoverflow.com/a/27781253
accepted answer of: http://stackoverflow.com/q/27781172
has comment: http://stackoverflow.com/comment/43978264
answers question: http://stackoverflow.com/q/27781172
upvote count: 5
has comment: http://stackoverflow.com/comment/43972443
has comment: http://stackoverflow.com/comment/43972380
score: 5
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43972637
has body: This can't be possible since ng-controller creates isolated scope for the current element. So this is not possible. So there can't be two isolated scope on a same element. You need to change your code to: {{ c1.value }}, {{ c2.value }} Also its not valid to have same name attribute in any html tag.
type: Answer

http://stackoverflow.com/a/27797147
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27796965
has comment: http://stackoverflow.com/comment/44003101
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27796965
has body: You can simply use this.id, assuming your .template-builder-template-stream-slot element actually has an ID when this code is fired. If it doesn't have an ID, the result will be blank. $(document).on({ mouseenter: function(e) { console.log("mouseenter on #" + this.id); }, mouseleave: function(e) { console.log("mouseleave on #" + this.id); } }, '.example'); This has an ID of "one". This has an ID of "two". This has no ID at all. If we move our cursor over both of these from top to bottom, we'll get the following result in our JavaScript console (note how the last element, which has no ID, returns no value (an empty string)):

http://stackoverflow.com/a/27701929
answers question: http://stackoverflow.com/q/27701863
has body: You need to get the url string via AJAX-request. And then you can put returned string into src attribute of IMG tag Backbone.ajax({ url: "http://example.com/brand/21", success: function(returnedURL){ //code here } });
score: 0
has comment: http://stackoverflow.com/comment/43817153
type: Answer

http://stackoverflow.com/comment/43785773
score: 2
comment on: http://stackoverflow.com/q/27685953
has text: The second AJAX call is passing the same parameters as the first one. You said you need to get the next day's data, so you need to send different `data:` parameters.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43907394
comment on: http://stackoverflow.com/q/27747963
score: 0
type: Comment
type: QuestionComment
has text: typeof NaN .... what do you think?

http://stackoverflow.com/q/27667528
type: Question
has answer: http://stackoverflow.com/a/27667623
tagged with: javascript
score: 0
answer count: 1
has title: AngularJS directive scope seems to accept only one argument
accepted answer: http://stackoverflow.com/a/27667623
tagged with: yeoman-generator-angular
tagged with: angularjs
has body: i started learning AngularJS and i got stuck on creating my own costume directive. So, first of all, i'm using yeoman project to generate an AngularJS project and this is my starting point. Now, to the subject - I have the following code: app.js: myapp.directive('userinfo', function() { var directive = {}; directive.restrict = 'E'; directive.template = 'User: {{ user.firstName }} {{ user.lastName}}'; directive.scope = { user : '='/*, editing: false*/ }; return directive; }); index.html: ... ... main.js: angular.module('proj2App') .controller('MainCtrl', function ($scope) { $scope.users = [ { firstName : 'John', lastName: 'Doe'} ]; }); My problem as it seems, is found at app.js in the line where i'm defining directive.scope. Whenever it is like that: directive.scope = { user : '='/*, editing: false*/ }; There is no problem and everything works just fine.. But then, when i remove the comment block and it looks like that: directive.scope = { user : '=', editing: false }; It doesn't work - the page won't show the template and angular will throw the following error which to me absolutely says nothing: **TypeError**: undefined is not a function at http://localhost:9000/bower_components/angular/angular.js:6436:30 at forEach (http://localhost:9000/bower_components/angular/angular.js:331:20) at parseIsolateBindings (http://localhost:9000/bower_components/angular/angular.js:6435:5) at http://localhost:9000/bower_components/angular/angular.js:6494:49 at forEach (http://localhost:9000/bower_components/angular/angular.js:323:20) at Object.<anonymous> (http://localhost:9000/bower_components/angular/angular.js:6480:13) at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4182:17) at Object.enforcedReturnValue [as $get] (http://localhost:9000/bower_components/angular/angular.js:4035:37) at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4182:17) at http://localhost:9000/bower_components/angular/angular.js:4000:37 Does someone know wha…
tagged with: yeoman
type: AnsweredQuestion

http://stackoverflow.com/comment/49706842
type: QuestionComment
has text: it seem that you are missing more details: http://learn.ionicframework.com/formulas/navigation-and-routing-part-1/
type: Comment
comment on: http://stackoverflow.com/q/27738997
score: 0

http://stackoverflow.com/comment/46195836
score: 1
type: AnswerComment
has text: I hear what you are saying, but unless every single time a js file or css file is saved the version is updated also they too will cache. The version addition is great for production release, but less helpful in development with minor tweaks and changes like incrementally moving a DOM element. I'm not trying to combat your answer. It was thorough and well documented. I think it is the best answer aside from it being the only one.
type: Comment
comment on: http://stackoverflow.com/a/27782519

http://stackoverflow.com/a/27666633
downvote count: 0
answers question: http://stackoverflow.com/q/27665525
type: Answer
score: 1
upvote count: 1
has body: As Phill stated, I suggest you to create a list of notes and then iterate over them, something like the following: for (var i = 0, asset; asset = $scope.assets[i]; i++) { $scope.notes = $scope.notes || []; $scope.notes.concat(asset.notes); } Then in the view: &lt;div ng-repeat="note in notes"&gt; {{note}} &lt;/div&gt;

http://stackoverflow.com/a/27764962
has comment: http://stackoverflow.com/comment/43940544
score: 3
has comment: http://stackoverflow.com/comment/43940526
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27764942
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27764942
has body: Short answer: No, it's not possible. With jQuery it can go like this: Id:
type: Answer
downvote count: 0

web-services
type: Tag
tags question: http://stackoverflow.com/q/27792792
tags question: http://stackoverflow.com/q/27795597
tags question: http://stackoverflow.com/q/27718688
tags question: http://stackoverflow.com/q/27732463
tags question: http://stackoverflow.com/q/27668836
tags question: http://stackoverflow.com/q/27783786
tags question: http://stackoverflow.com/q/27717738
tags question: http://stackoverflow.com/q/27767996
tag name: web-services
tags question: http://stackoverflow.com/q/27761362

http://stackoverflow.com/comment/43798678
comment on: http://stackoverflow.com/q/27692790
score: 0
type: Comment
type: QuestionComment
has text: It is not setting to the right position when user toggles the content. it sets to position 0

http://stackoverflow.com/comment/43947563
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27768482
has text: Hiya, My CSS is not brilliant I'm afraid, would you be able to show me how I would wrap this in a parent?

http://stackoverflow.com/comment/135467106
type: AnswerComment
comment on: http://stackoverflow.com/a/32491825
has text: This works when you test manually. But will this work if the form will be submitted by a bot? :D It might not.
score: 0
type: Comment

http://stackoverflow.com/comment/43955964
score: 0
type: Comment
type: QuestionComment
has text: A bit late I know.... but.... Your developer should be probably using drupal functions to get the correct image url, not just grabbing it from the database.
comment on: http://stackoverflow.com/q/27653441

http://stackoverflow.com/comment/43943665
comment on: http://stackoverflow.com/q/27766440
has text: yeah and i want to print as it is
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43981273
has text: Why you don't go for server side bundling?
comment on: http://stackoverflow.com/q/27785622
score: 2
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44125015
has text: The answer I provided is not a complete working example. Instead it shows part of the logic. I'll see if I can make it more complete. I'm not testing it out, though, so I can't promise it'll work as-is
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27778488
score: 1

http://stackoverflow.com/a/27743800
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43899034
has comment: http://stackoverflow.com/comment/43899454
has comment: http://stackoverflow.com/comment/43899215
has comment: http://stackoverflow.com/comment/43900166
has comment: http://stackoverflow.com/comment/43899622
type: Answer
has comment: http://stackoverflow.com/comment/43900422
has comment: http://stackoverflow.com/comment/43899299
has comment: http://stackoverflow.com/comment/43899482
accepted answer of: http://stackoverflow.com/q/27741673
has body: To resolve this issue fully you would need to show the code for your stores and the form. It's a while since I've used ST2, But I don't beleive that you can bind a components data on child data of a store. you have to apply the logic for this yourself. I have created some sample code for you that should demonstrate how this can be approached, There are multiple ways of achieving this and mine may not be the best. But it does work. I have simplified the data for demo purposes and used local array data. Ext.application({ name : 'Fiddle', launch : function() { // create the models Ext.define('Country', { extend: 'Ext.data.Model', config: { fields: [ { name: 'id', type: 'string' }, { name: 'name', type: 'string' } ], associations: [{ type: 'hasMany', associatedModel: 'Region', ownerModel: 'Country', primaryKey: 'id', foreignKey: 'countryId', }] } }); Ext.define('Region', { extend: 'Ext.data.Model', config: { fields: [ { name: 'id', type: 'string' }, { name: 'name', type: 'string' }, { name: 'countryId', type: 'string' } ] } }); var countries = [ ["IT", "Italy"], ["SM", "San Marino"] ]; var regions = [ ["AG", "Agriento", "IT"], ["AL", "Alessandria", "IT"], ["AN", "Ancona", "IT"], ["AO", "Aosta", "IT"], ["AR", "Arezzo", "IT"], ["AP", "Ascoli Piceno", "IT"], ["AT", "Asti", "IT"], ["SM", "San Marino", "SM"], ["BA", "Bari", "IT"], ["BT", "BarlettaAndriaTrani", "IT"], ["BL", "Belluno", "IT"] ]; var countryStore = Ext.create('Ext.data.ArrayStore', { model: "Country", // store configs storeId: 'countryStore', data: countries }); var regionStore = Ext.create('Ext.data.ArrayStore', { model: "Region", // store configs storeId: 'regionStore', autoLoad: false, data: regions }); Ext.create('Ext.form.Panel', { fullscreen: true, items: [{ xtype: 'fieldset', title: 'Select', items: [{ xtype: 'selectfield', name: "countrySelect", id: "countrySelectField", displayField: "name", valueField: "id", label: 'Choose one', store: countryStore, autoSelect: false, listeners: { 'change': function( …
answers question: http://stackoverflow.com/q/27741673
has comment: http://stackoverflow.com/comment/43900507
has comment: http://stackoverflow.com/comment/43901324
score: 0

http://stackoverflow.com/comment/43787848
type: Comment
comment on: http://stackoverflow.com/a/27686916
score: 1
has text: According to the AngularJS API, this is a "buggy way to do it". The correct is to use mixing your answer with the question. ` `. Ref: [Angular API](https://docs.angularjs.org/api/ng/directive/ngSrc)
type: AnswerComment

http://stackoverflow.com/comment/43879813
type: QuestionComment
score: 0
has text: @Omar I don't recall.
comment on: http://stackoverflow.com/q/27733744
type: Comment

http://stackoverflow.com/q/27727017
tagged with: angularjs
upvote count: 8
type: Question
has answer: http://stackoverflow.com/a/53004809
tagged with: angularjs-controller
answer count: 3
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/27727086
score: 8
has answer: http://stackoverflow.com/a/27727034
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27727086
possible better answer: http://stackoverflow.com/a/27727034
type: AnsweredQuestion
has title: Angular minification with directive controller?
tagged with: minify
has body: If I have the following: myapp.directive('directivename', ... return { ... restrict: 'E', controller: MyController, ... } function MyController($scope, $somethingelse) { // Contents of controller here } ); How do I modify this such that MyController will not get destroyed when minified? I am getting the following error: Error: [$injector:unpr] Unknown provider: eProvider &lt;- e
favorite count: 0

http://stackoverflow.com/q/27796719
has title: Regex max length, ignore specific word combination
has comment: http://stackoverflow.com/comment/44002125
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44002282
tagged with: ember.js
tagged with: regex
has body: I've made this regex to check the max length of a string: /^[\[\]\/\w\s.,:;!?€¥£¢$-]{0,250}$/ The user needs to add [link] link text [/link] to the string to add a link. In my regex I want to ignore these [link][/link] for the max length of 250 characters. How should I do this?
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/44002345
tagged with: javascript
has comment: http://stackoverflow.com/comment/44002876
has comment: http://stackoverflow.com/comment/44004653
score: 0

http://stackoverflow.com/comment/43742276
type: QuestionComment
has text: What is the issue with this? Can you not parse it after it's been converted in order to get the output you want. It seems an odd request and I'm doubtful you'll find that out of the box.
type: Comment
comment on: http://stackoverflow.com/q/27663203
score: 0

http://stackoverflow.com/a/27646318
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/27645772
downvote count: 0
has body: You cannot. Opening a popup in response to the window being closed is forbidden by the specification: An algorithm is allowed to show a popup if any of the following conditions is true: The task in which the algorithm is running is currently processing an activation behavior whose click event was trusted. The task in which the algorithm is running is currently running the event listener for a trusted event whose type is in the following list: change click dblclick mouseup reset submit The task in which the algorithm is running was queued by an algorithm that was allowed to show a popup, and the chain of such algorithms started within a user-agent defined timeframe.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27645772

http://stackoverflow.com/q/27796754
has title: Node: Traversing directories in a recursion
upvote count: 1
type: AnsweredQuestion
tagged with: recursion
score: 1
tagged with: traversal
has comment: http://stackoverflow.com/comment/44004831
type: Question
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/27797065
tagged with: javascript
tagged with: callback
favorite count: 0
accepted answer: http://stackoverflow.com/a/27797065
has body: I'm pretty new to Node...I need to hammer Node's async behavior and callback structure into my mind. Here where I struggle right now: // REQUIRE -------------------------------------------------------------------- fs = require('fs'); path = require('path'); // FUNCTION readAllDirs ------------------------------------------------------- function readAllDirs(dir, result) { if (!result) { result = function() {}; }; fs.readdir(dir, function(err, list) { if(err) { return result(err) }; list.forEach(function(file) { var fullpath = path.resolve(dir, file); fs.stat(fullpath, function(err, stat) { if(err) { return result(err) }; if(stat &amp;&amp; stat.isDirectory()) { readAllDirs(fullpath); //console.log('In: ' + fullpath); result(null, fullpath); } }); }); }); } // MAIN ----------------------------------------------------------------------- readAllDirs('/somedir', function(err, dirs) { console.log(dirs); }); I try to traverse a tree of directories. In principle the function is working nice...as long I do not callback but print the directory names on the console. All folders and sub-folders come up as expected. BUT when I do callbacks the callback is not called for recursion deeper than first level. Pleeeaaassee help! Thanks guys!
tagged with: node.js

http://stackoverflow.com/comment/43999306
has text: glad that you went through this problem
type: AnswerComment
comment on: http://stackoverflow.com/a/27762464
score: 0
type: Comment

http://stackoverflow.com/q/27711906
has title: Get data from data-price using jquery
answer count: 2
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27711939
score: 0
has answer: http://stackoverflow.com/a/27711939
has comment: http://stackoverflow.com/comment/43835909
has answer: http://stackoverflow.com/a/27711957
has body: I have a working code where i output the price using value="" but i need a way to get data from data-price="" so that i can use value="" to store SKUs. Working demo here http://jsfiddle.net/pe2gpp01/21/ What does this code do? It returns fixed price for female for all products. Price changes for Male only. Product Product A Product B Product C Product D Gender Male Female Show Price: I need data from this Product A Product B Product C Product D
has comment: http://stackoverflow.com/comment/43836075
accepted answer: http://stackoverflow.com/a/27711957
tagged with: php
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/27664668
has title: show/hide multiple divs on clicking other divs
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27664701
has comment: http://stackoverflow.com/comment/43744840
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43744825
has comment: http://stackoverflow.com/comment/43744955
type: Question
has comment: http://stackoverflow.com/comment/43744898
has comment: http://stackoverflow.com/comment/43744831
has comment: http://stackoverflow.com/comment/43744872
tagged with: javascript
tagged with: jquery
has body: I am using a script for my webpage where I want to show and hide some divs by clicking on anchor tags as given on this link . This is exactly what i was looking for but its not working as i copy it on my web page. May be i have to add some jquery plugin for this or any other script source please . Everything is working on example but not on my page please tell me where am i missing something here is js fiddle: here here is script code $('.targetDiv').hide(); $('.targetDiv').first().show(); $('.showSingle').first().addClass('selected'); $('.showSingle').click(function () { $('.targetDiv').hide(); $('.showSingle').removeClass('selected'); $('#div' + $(this).attr('target')).show(); $(this).addClass('selected'); }); UPDATE Option 1 Option 2 Option 3 Option 4 Lorum Ipsum 1 Lorum Ipsum 2 Lorum Ipsum 3 Lorum Ipsum 4
has comment: http://stackoverflow.com/comment/43744846
score: 0
has comment: http://stackoverflow.com/comment/43744917
has comment: http://stackoverflow.com/comment/43744865
answer count: 1
has answer: http://stackoverflow.com/a/27664701
has comment: http://stackoverflow.com/comment/43745638

http://stackoverflow.com/q/27752880
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43919206
type: AnsweredQuestion
has title: AngularJS filter to compare day with ID - ng-show
accepted answer: http://stackoverflow.com/a/27752910
has comment: http://stackoverflow.com/comment/43919154
type: Question
has body: I am making a motivational quote of the day with Angular JS, PHP/MYSQL. I have 31 quotes in the DB, for each days of the month. How would I use ng-show or ng-hide and compare it with Today's day &amp; post ID to show the post that match? So for instance today we are the 3rd, so my script would call post ID 3. This is my app.js: var app = angular.module('myApp',[]); app.controller('quotesCtrl', function($scope, $http) { $http.post('ajax/getQuotes.php').success(function(data){ $scope.quotes = data; }); }); UPDATE! Thank you Peter, I'm almost sooo close to get this working! I did a var_dump($arr); Anyone who is really good at PHP, my apologies for the rough coding. Her is my getQuotes.php PHP file: &lt;?php include('../includes/config.php'); $query="select id,quote from quotes order by id desc"; $result = $mysqli-&gt;query($query) or die($mysqli-&gt;error.__LINE__); $arr = array(); if($result-&gt;num_rows &gt; 0) { while($row = $result-&gt;fetch_assoc()) { $arr[] = $row; } } unset($arr[0]); $numItems = count($arr); $i = 0; foreach($arr as $key =&gt; $value ){ if(++$i === $numItems) { echo "$key: '$value[quote]' "; }else{ echo "$key: '$value[quote]', "; } } echo "&lt;pre&gt;"; var_dump($arr); //var_dump($arr); # JSON-encode the response //$json_response = json_encode($arr); // # Return the response //echo $json_response; ?&gt; My app.js file is: var app = angular.module('app',[]); app.controller('TimeCtrl', function($scope, $filter, $http) { $http.post('ajax/getQuotes.php').success(function(data){ $scope.quotes = data; }); $scope.dayNumber = $filter('date')(new Date(), 'd'); console.log($http); }); And all I get is: 3 ' instead of getting: 3 its the third day of the month *** UPDATE 2 **** In app.js, the following function is erroring out: $timeout(function() { // Parse the JSON $scope.quotes = JSON.parse(data); }) error says: SyntaxError: Unexpected token o at Object.parse (native) When I change the function to stringify: $timeout(function() { var jsonString = JSON.str…
has comment: http://stackoverflow.com/comment/43918874
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43916759
has answer: http://stackoverflow.com/a/27752910

http://stackoverflow.com/q/27662807
has comment: http://stackoverflow.com/comment/43742173
type: Question
has comment: http://stackoverflow.com/comment/43742247
has comment: http://stackoverflow.com/comment/43742048
has comment: http://stackoverflow.com/comment/43742039
has answer: http://stackoverflow.com/a/27663233
tagged with: caching
upvote count: 4
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I have a script that uses $.get( ... ) to pull a piece of HTML from my server, and render it inside a &lt;div&gt; with $.html. Sometimes I have &lt;script&gt; tags in the pulled HTML, and I noticed that jQuery is putting a cache buster parameter in the request for these scripts and it's causing the browser to request again for scripts that have already been loaded. For example: Any idea how I can disable this behavior? The script tags don't have the _ param attached to them so it isn't my HTML that's the problem. Also, &lt;script&gt; tags that aren't rendered with $.html aren't exhibiting this behavior.
has comment: http://stackoverflow.com/comment/43742183
favorite count: 0
has title: jQuery keeps putting a cache buster in my CDN scripts?
accepted answer: http://stackoverflow.com/a/27663233
has comment: http://stackoverflow.com/comment/43742023
tagged with: http://stackoverflow.com/tag/html
score: 4
type: AnsweredQuestion

http://stackoverflow.com/comment/43975239
has text: Could you include the output of your `console.log(highlightMe);`?
comment on: http://stackoverflow.com/q/27782606
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27785258
has answer: http://stackoverflow.com/a/27785450
tagged with: angularjs
type: UnansweredQuestion
tagged with: angularjs-ng-resource
has answer: http://stackoverflow.com/a/27786436
has body: I had the following in my code: function store() { this.products = [ new product("sku001", "Apple", "Tasty stuff", 1.00, "local"), ... ]; This worked fine for displaying all the products: Products Display products: {{store.products}} {{product.description}} Products displayed: Now instead of hardcoding the values, I want to load them from a restful api: function store($resource) { var Resource = $resource('/api/products/'); this.products = Resource.query(); console.log(this.products) This also appears to work okay, but the formatting of the values is slightly different (Upper-case / differing key names): [{"SKU":"sku001","Name":"Apple","ProductType":"local","Description":"Tasty stuff","Allowance":1073741824,"Price":1}] I wanted to use the data I received from the API to create an array of objects which matches my current formatting but I am having some issues: function store($resource) { var Resource = $resource('/api/products/'); this.products = Resource.query(function (data) { var product = {}; var productsList = [] for (i = 0; i < data.length; i++) { product = { sku: data[i].SKU, name: data[i].Name, description: data[i].Description, price: data[i].Price, category: data[i].ProductType } productsList.push(product); } return productsList; }); When I run the code, this gets outputted: As you can see, the json displayed has not been modified and as a result, the description / price are not displayed. Does anybody know how I can modify data loaded using $resource and then display it? Edit controller.js function storeController($scope, $routeParams, DataService) { // get store and cart from service $scope.store = DataService.store; $scope.cart = DataService.cart; } app.js var storeApp = angular.module('AngularStore', ['ngRoute', 'ngResource']). //route stuff }]); storeApp.factory("DataService", function ($resource) { var myStore = new store($resource); var myCart = new shoppingCart("AngularStore"); // return data object with store and cart return { store: myStore, cart:…
tagged with: http://stackoverflow.com/tag/json
tagged with: ngresource
type: Question
tagged with: javascript
has title: Trouble modifying ngResource result
score: 0
answer count: 2

http://stackoverflow.com/comment/43758958
has text: @NewDev I have many "cards" in one page, and each card has it's own controller and cards are created in ng-repeater. So in card templates i want to reference correct controller. I guess I could use the same name for all, they are not nested YET, but still curious how to achieve that.
comment on: http://stackoverflow.com/a/27671809
type: Comment
score: 0
type: AnswerComment

alphabetical
tags question: http://stackoverflow.com/q/27761318
type: Tag
tag name: alphabetical

http://stackoverflow.com/comment/43953744
comment on: http://stackoverflow.com/a/27770883
score: 0
type: AnswerComment
has text: @DonTzapone That's a tall order. :P Canvas has to be my weakest point of knowledge when it comes to HTML5 but I'll give it a shot. Here's the first attempt using static text: http://jsfiddle.net/jmarikle/92xe77tu/.
type: Comment

http://stackoverflow.com/comment/43802897
comment on: http://stackoverflow.com/a/27694379
score: 0
type: AnswerComment
has text: You really should download fiddler and compose an HTTP Request using the full URL + '/api/server', and set the action to 'POST' to see if the problem is the javascript or your URL.
type: Comment

http://stackoverflow.com/comment/43855770
has text: so what if i just declared bar funciton before return it?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27722018

http://stackoverflow.com/comment/43959433
type: AnswerComment
score: 0
type: Comment
has text: This class is getting applied to the div when it gets created. The file containing the class error_message has already been added.
comment on: http://stackoverflow.com/a/27774186

http://stackoverflow.com/q/27756543
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27756647
type: Question
has body: Say I want to transform array with map function and each value is looked up in mongoDB with findOne, whose criteria in turn depends on current value from the array. To put it other way, simply transform array of ids to corresponding objects fetched from DB. Like: arr.map(function(v) { collection.findOne({_id: v}, function( ? }); return {newField: ?}; }); Question marks are the places that need to be filled, but I guess the whole structure needs to be changed. Hopefully I'm clear. I'm not used to such callback thinking and cannot wrap my head around it, am I missing something obvious?
tagged with: mongodb
has answer: http://stackoverflow.com/a/27756601
has title: Node.js: callback values depending on each other
tagged with: javascript
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27756601
accepted answer: http://stackoverflow.com/a/27756647
tagged with: node.js

http://stackoverflow.com/q/27764949
has body: I am creating an extension which has two tabs showing different values..I wrote the code for creating the tab and it worked in the browser also..but when i used the same code for my google extension it did not work. Can someone help me out with this.. Tab 1 Tab 2 Article 1 2012.01.01. Article 2 2012.01.02. Article 3 2012.01.03. Article 4 2012.01.04. Article 5 2012.01.05. Article 1 2012.01.01. Article 2 2012.01.02. Article 3 2012.01.03. so can someone help me out with this. thank you
has answer: http://stackoverflow.com/a/27769568
has comment: http://stackoverflow.com/comment/43943461
upvote count: 0
tagged with: javascript
type: UnansweredQuestion
type: Question
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43943502
favorite count: 0
score: -1
has title: How to create a Tab in my chrome extension
tagged with: tabs
has comment: http://stackoverflow.com/comment/43943020
has comment: http://stackoverflow.com/comment/43943508
tagged with: google-chrome
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43940783

http://stackoverflow.com/comment/43897019
comment on: http://stackoverflow.com/q/27742663
score: 0
type: Comment
type: QuestionComment
has text: because you've disabled Ajax. The result page will be loaded without jQM's Ajax navigation. Use `$.ajax()` methods to communicate with server if you want to keep jQM Ajax navigation enabled.

http://stackoverflow.com/q/27708445
has comment: http://stackoverflow.com/comment/43832050
tagged with: appendchild
has answer: http://stackoverflow.com/a/27710944
accepted answer: http://stackoverflow.com/a/27710944
type: Question
has body: Am using pure javascript prototype functions to create a list of checkbox and append them as we iterate over the data. Everything is created using javascript and css. When I run it so it can draw a list of checkboxes, it throws me an error : "Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'." for this line: results.push(this.list.appendChild(letter.draw)); Am sure there is nothing wrong with checkboxinput prototype since it works fine everywhere else. There is something wrong am doing in FormTicket.Can anyone help me what am doing wrong? The form page is FormTicket FormTicket.prototype.respond = function(data) { var letter, i, len; this.letters = []; for (i = 0, len = data.length; i &lt; len; i++) { letter = data[i]; this.letters.push(new ParaInfo({ InfoIndividual: letter })); } return this.drawList(); }; FormTicket.prototype.drawList = function() { var letter, i, len, ref, results; ref = this.letters; results = []; for (i = 0, len = ref.length; i &lt; len; i++) { letter = ref[i]; results.push(this.list.appendChild(letter.draw)); } return results; }; The draw function in the ParaInfo method is: ParaInfo.prototype.draw = function() { this.e = new CheckBoxInput({ title: this.InfoIndividual, float: 'left', }); return this.e; }; and just FYI, the checkboxinput is another prototype, part of it as below: CheckBoxInput.prototype.build = function(arg) { this.title = arg.title; this.float = arg.float; }; CheckBoxInput.prototype.draw = function() { var box, check; this.item = document.createElement('div').addClass('checkboxInput'); return this.item; };
tagged with: javascript
tagged with: prototype
score: 0
has comment: http://stackoverflow.com/comment/43833650
has comment: http://stackoverflow.com/comment/43831959
answer count: 1
has comment: http://stackoverflow.com/comment/43831247
has comment: http://stackoverflow.com/comment/43832211
has title: Getting the error: Failed to execute 'appendChild' on 'Node'
type: AnsweredQuestion

http://stackoverflow.com/q/27748684
has comment: http://stackoverflow.com/comment/43908777
has answer: http://stackoverflow.com/a/27748772
has comment: http://stackoverflow.com/comment/43908720
upvote count: 1
answer count: 4
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/27748882
type: Question
has title: Show text input value when click on a button
tagged with: function
tagged with: javascript
has answer: http://stackoverflow.com/a/27748803
tagged with: jquery
has body: I'm very new to JavaScript. Here is my html page. Document This is my site! My site content Submit name I want to type something in the textfield and click the submit button to change text in the . But It doesn't work the way I want. What am I doing wrong? Sorry for my bad English.
has comment: http://stackoverflow.com/comment/43908955
has answer: http://stackoverflow.com/a/27748730
has comment: http://stackoverflow.com/comment/43908847
linked to: http://stackoverflow.com/q/2105327
downvote count: 0
has answer: http://stackoverflow.com/a/27748882
possible better answer: http://stackoverflow.com/a/27748730
favorite count: 0

http://stackoverflow.com/q/27690609
has comment: http://stackoverflow.com/comment/43795438
accepted answer: http://stackoverflow.com/a/27690848
has body: I use this function to add images to a div element: function pasteImages(url,id) { jQuery("#photodiv").append(" ") jQuery("#photodiv").append(" "); jQuery("#photodiv").append(" Verwijderen "); jQuery("#photodiv").append(" "); } The url and id attribute are retrieved using an AJAX call. The button calls a function to delete the image (after the image was successfully deleted from the DB) After the image was successfully deleted the succes: function gets called: .......success: function(data) // A function to be called if request succeeds { var photoarray = JSON.parse(data); var photoid2remove = "#photoid" + photoarray[0].photoid; jQuery(photoid2remove).empty(); } All works fine, but nothing gets deleted. I've tried a static id OR class but it's not doing anything. When I check the source I can't find the appended div's anywhere. So how can I refer to the div's I've added with the first function? Any clue?
has title: How to reference elements added by jQuery .append()
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43794457
has comment: http://stackoverflow.com/comment/43794573
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/27690848
has comment: http://stackoverflow.com/comment/43795446
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43794446
type: Question
has comment: http://stackoverflow.com/comment/43795503

http://stackoverflow.com/comment/136875003
has text: An alternative is to use the `hour12` boolean instead of `hourCycle`.
comment on: http://stackoverflow.com/a/63736713
type: AnswerComment
score: 2
type: Comment

http://stackoverflow.com/comment/43801806
type: Comment
has text: Maybe this will help, i replaced my action =$php_self with just some random letters to see if it was actually trying to post. If i hit submit it says "cannot find the file" which is correct. But when i load the page it still puts the error and starts in the second field without a post error. So it's just loading like it was but not really trying to post. If that makes sense
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27660920

custom-fields
tag name: custom-fields
tags question: http://stackoverflow.com/q/27673406
type: Tag

http://stackoverflow.com/comment/43863579
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27724295
has text: @async5 what is the format for the error function? Is it like this? : PDFJS.getDocument(data).then(function(){}).error(function(data){}); That doesn't seem to work.

http://stackoverflow.com/comment/43927089
type: AnswerComment
has text: @216 added a fiddle too
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27758195

http://stackoverflow.com/comment/43810342
comment on: http://stackoverflow.com/a/27698638
score: 0
type: AnswerComment
has text: Ummm I want to remove from `html` did your code does that?
type: Comment

http://stackoverflow.com/a/27824903
upvote count: 1
answers question: http://stackoverflow.com/q/27713801
has body: I would need more information from you, but I'm assuming you're doing var DEFAULT_HASH = 'home'; if (! hasher.getHash()) { hasher.setHash(DEFAULT_HASH); } This is basically saying your default route is always going to be your home route, which is why you're seeing it when you refresh your current route. Try the following: var DEFAULT_HASH = 'home', url = hasher.getBaseURL(); if (hasher.getURL() === url) { hasher.setHash(DEFAULT_HASH); } This will check to see what your base URL is (the one that's loaded when you first visit the page) and append a #/home route to the base URL, allowing you to refresh your currently viewed route. Hope this helps.
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27713801
score: 1

http://stackoverflow.com/q/27764318
answer count: 1
downvote count: 0
has body: I have a google spreadsheet that stores data at my work and is constantly being updated via google drive so it is always online editing, what I want to do is to be able to extract the values in those cells and have them show up in a HTML5 table on my website, what would be the best solution for this? I did try one way which was to just embed the spreadsheet in a iFrame and have that refresh every 5 minutes, but the refresh loading is too slow and it causes issues with trying to get the spreadsheet to fit perfectly in the iframe everytime I refresh. these websites will be on display on TV screens so I dont want to be adjusting them regularly, they will auto refresh and be idle.
tagged with: javascript
favorite count: 0
has title: extracting data from google spreadsheet into a html table
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
type: Question
score: 3
has comment: http://stackoverflow.com/comment/44001458
upvote count: 3
has answer: http://stackoverflow.com/a/38648475
tagged with: google-sheets

http://stackoverflow.com/a/27728360
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43874351
has comment: http://stackoverflow.com/comment/44479889
answers question: http://stackoverflow.com/q/27728050
has body: Discovery of Cast devices is handled by the Cast Extension and the cast button that is made available by that extension. You can learn more about that in our docs. You can find a number of samples on our GitHub repo as well.
has comment: http://stackoverflow.com/comment/43878232
has comment: http://stackoverflow.com/comment/44481978

http://stackoverflow.com/q/27691137
score: 1
has answer: http://stackoverflow.com/a/45127591
type: Question
has body: I have an ajax app with velocity.js and animations (one global animation for a content wrapper to animate content off the screen, and animations inside the content that's being loaded). With every page call my script first animates the content wrapper off the screen with something like this: $('#main').velocity("transition.slideRightBigOut", { duration: 500 }); And then a new script FROM the content I load animates the content itself to screen: $('#main').velocity("transition.slideRightBigIn", { duration: 500 }); But the whole experience feels a bit weird. The animations feel like "stagger", especially when the content I load is rather big. What I tried to do is just to put the slideRightBigIn transition as a function inside the slideRightBigOut transition like that: $('#main').velocity("transition.slideRightBigOut", { duration: 500 }, function() { $('#main').velocity("transition.slideRightBigIn", { duration: 500 }); }); Of course in this case I control my animation from the content I load. But this doesn't work the way I want just because the content may load for 5 seconds and thus I will see the whole animation process only when the content loads. Thanks for your help. SOLUTION: Final solution of my case is wrapping the functions that build the ajax-loaded content in success call in setTimeout function with timeout equal to length of the slideRightBigOut animation which is called on beforeSend call. The "loading" animation slideRightBigIn is with no changes called from the loaded content. Thanks to the Clement for a tip.
has title: How to start new velocity.js effect only when the first ends?
tagged with: javascript
tagged with: jquery
answer count: 3
upvote count: 1
tagged with: animation
favorite count: 0
has answer: http://stackoverflow.com/a/45224421
downvote count: 0
has answer: http://stackoverflow.com/a/27691239
accepted answer: http://stackoverflow.com/a/27691239
possible better answer: http://stackoverflow.com/a/45127591
type: AnsweredQuestion

http://stackoverflow.com/q/27769413
has comment: http://stackoverflow.com/comment/43949842
answer count: 3
has body: Please see the code in jsfiddle - http://jsfiddle.net/gr7pa2yz/ var obj = { x: 4, y: 2, z: { z1: { z11: "who", z12: 44 } }, zx: [3, 4, "string"], zy: undefined } iterate(obj); function iterate(obj) { $.each(obj, function (i, e) { if (typeof e == "object") iterate(e); alert(e); }); } My question - You would see that the above code is alerting 3 things which am not able to understand how. It alerts - [Object object] twice and 3,4,string. how come?
has comment: http://stackoverflow.com/comment/43949704
favorite count: 0
has answer: http://stackoverflow.com/a/27769473
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27769483
downvote count: 2
upvote count: 1
has title: jQuery - Why does it alert unwanted things?
has answer: http://stackoverflow.com/a/27769479
has comment: http://stackoverflow.com/comment/43949669
has comment: http://stackoverflow.com/comment/43950112
type: Question
tagged with: javascript
tagged with: jquery
score: -1

http://stackoverflow.com/q/27646893
has title: jquery expand collapse div not working
score: 0
accepted answer: http://stackoverflow.com/a/27647705
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/43712001
type: AnsweredQuestion
type: Question
has body: This code that I have works if the "mer info" div is inside of the "exp_container ex_collapsed" div. What I want is to move the div that trigger the expand/collapse function to another div <<<<<<<<<<<<<<<<<<< --- want "mer info" div function here >>>>>>>>>>>>>> Mer info <%= image_tag(ads_item.logo_path) %>
has answer: http://stackoverflow.com/a/27647705
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27747367
upvote count: 1
has body: Our clients use RDP sessions created by clicking a button on our site which uses the old MSRDP.cab file called in a webpage. We also utilize Virtual channels using a custom dll. Both our dll and the MSRDP.ocx are loaded through the object tag and cab files using VBScript. As you might know, the orginal RDP connection script was written in VBScript. Apparently the ActiveX control will only work if called using VBScript. That has been working for over a decade. However the newer IE browsers and virtually all of the other browsers do not support VBScript. I realize that I can call the new RDP program mstsc.exe from Javascript for a straight connection. However, we also pass information to the old ocx like the plugin parameters in Advancedsettings which include our dll that uses virtual channels. In addition, we pass the domain and username. Maybe I'm searching in all the wrong places but I'm turning up no answers in trying to find how to run this ocx in javascript or another solution that would work. I'm thinking there has to be a replacement out there that I'm overlooking. We are able to force our clients to use IE so we are currently having our clients with IE versions over 10 to use compatibility mode. However I'm sure at some point this may no longer work. Has anyone out there had a similar problem that you have found a solution for? Any ideas or suggestions would be appreciated. Thanks!
answer count: 1
favorite count: 0
has title: IE dropping vbscript but the activex terminal services control msrdp.ocx only works with vbscript
type: UnansweredQuestion
downvote count: 0
score: 1
type: Question
tagged with: remote-desktop
linked to: http://stackoverflow.com/q/11341711
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/27748189
tagged with: javascript
tagged with: vbscript

http://stackoverflow.com/comment/44734378
comment on: http://stackoverflow.com/q/27694461
has text: Late to this (sorry) but if it's still relevant, any chance you could whip up a JSFiddle repro? I can't see any obvious reason why this shouldn't work (other than mismatch between `items` and `myItems`, but I assume that's a typo), and am curious to know if you've found a bug. Template fiddle to fork: http://jsfiddle.net/rich_harris/va6jU/. Thanks!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27746982
favorite count: 0
has comment: http://stackoverflow.com/comment/66771000
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/27750160
type: Question
score: 7
tagged with: javascript
has answer: http://stackoverflow.com/a/27750160
has body: I am trying to create a zip file using jsZip . The contents of the zip file are images from the web. I have created the following code. But when i run it all am getting is an empty zip file of 22kb. Click the button to generate a ZIP file (url1 , url2 and url3 replaced by image urls i want to download). Why am i getting these empty zip files?
upvote count: 7
answer count: 1
has comment: http://stackoverflow.com/comment/66877566
has title: Adding images from url to a zip file using jsZip
tagged with: jszip
linked to: http://stackoverflow.com/q/19325314

http://stackoverflow.com/comment/43724353
comment on: http://stackoverflow.com/a/27653663
has text: so u can use `callback`. Pass your function name as param and call it in your function after confirmation. Like this: `function click2(callback){if (confirm("Sure to call ClickBack"))callback();}` Now bind this function with your elements and pass the function name as `parameter` of your function.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43718904
has text: but why now by clicking on the shown div (`toShow`) it hide it too?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27650803

http://stackoverflow.com/comment/43732864
has text: The template is messed up. It should look like this ` `; does fixing it solve the problem?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27658177
score: 0

meteor-helper
tag name: meteor-helper
tags question: http://stackoverflow.com/q/27791742
type: Tag

foreach
tags question: http://stackoverflow.com/q/27742336
tags question: http://stackoverflow.com/q/27783698
type: Tag
tags question: http://stackoverflow.com/q/27772370
tag name: foreach
tags question: http://stackoverflow.com/q/27711981
tags question: http://stackoverflow.com/q/27778953
tags question: http://stackoverflow.com/q/27767822

http://stackoverflow.com/comment/43757646
has text: That might be part of the issue then. Without them, `research1Progress` is incremented by 5 each time researchStick is called, regardless of the condition. You really should apply indentation to your code. It helps tremendously when you need to read back your code when you want to make changes or find a bug. Also, try to press F12 in your browser. You will probably get developer tools, including a console that shows JavaScript errors. Very valuable to learn the various possibilities of this feature.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27671241
score: 1

http://stackoverflow.com/comment/43970561
type: Comment
has text: How do I handle the information that is being sent to the php then?
comment on: http://stackoverflow.com/a/27780268
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44014379
score: 0
comment on: http://stackoverflow.com/q/27802498
type: Comment
has text: Have you tried getting rid of `i`? You could use `index` instead: `$('.spin-block').each(function(index, el) { $(this).delay(index * 200 + 800).fadeIn(); })`
type: QuestionComment

http://stackoverflow.com/comment/43947103
comment on: http://stackoverflow.com/q/27768133
type: Comment
type: QuestionComment
has text: If you want to upload only one file, then don't make it multiple selectible.
score: 0

http://stackoverflow.com/a/27709956
accepted answer of: http://stackoverflow.com/q/27709470
score: 0
has comment: http://stackoverflow.com/comment/43848574
type: Answer
has comment: http://stackoverflow.com/comment/43856981
has body: Slovak Republic only has 2 data points: Slovak Republic,SK,Jan 2007,100 Slovak Republic,SK,Jan 2008,105.2 Instead of the hard-coded 6, just use: var position = d.values[d.values.length-1].credit; Example here.
answers question: http://stackoverflow.com/q/27709470
type: AcceptedAnswer

http://stackoverflow.com/a/27729041
has body: Problem code: &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;input type="submit" value="pesq" onclick="Redirect();"/&gt; &lt;/div&gt; &lt;/form&gt; HTML elements, specifically, forms, have default events that occur when user actions take place. In your context, the submit event is probably being invoked when you click on that input box. You need to prevent the default event from happening by either returning false from the event handler, or calling preventDefault &lt;form onsubmit="Redirect(); return false;" id="form1" runat="server"&gt; &lt;div&gt; &lt;input type="submit" value="pesq" onclick="Redirect(); return false;"/&gt; &lt;/div&gt; &lt;/form&gt; P.S. The onsubmit handler will allow yourself to press the enter key and still have the same effect as would have happened if you just clicked the input box.
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/27725127
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43907069
comment on: http://stackoverflow.com/q/27747525
has text: @Teemu This is how I see td.product-title-cell in the source code. Yellow Unicorn Award Trophy - 2014 / The Weird Animal Awards / Presented To: adsf / For: asdf2 / Additional Text: asdf3
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43916002
comment on: http://stackoverflow.com/q/27752441
type: Comment
type: QuestionComment
has text: When you use `input.setAttribute("class",value)`, it won't be a problem because here you are not accessing the javascript keyword. But when you try to access it as a property of an javascript object as in `children[k].class`, that becomes invalid.
score: 3

http://stackoverflow.com/comment/44016050
type: QuestionComment
score: 1
has text: An alternative to @JonasGrumann's good idea is to draw the outline of your shape with path commands and then use `context.isPointInPath` to hit-test whether the mouse is moving inside or outside your defined path.
type: Comment
comment on: http://stackoverflow.com/q/27801205

http://stackoverflow.com/comment/122368570
has text: @fregante Thanks for taking the time to do your "answers roundup", it's a gem. As is Benjamin's option
score: 1
comment on: http://stackoverflow.com/q/27745438
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27704593
has body: You have a typo at (Missing letter) heigh = 450; so, try the code below: var Height = &lt;%= Height %&gt;, _height; console.log(Height); // in my test, I got 800 if(Height &gt; 800){ _height = 450; } else { _height = 330; } console.log(_height);
score: 1
answers question: http://stackoverflow.com/q/27704549
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/a/27748421
has comment: http://stackoverflow.com/comment/43908104
has comment: http://stackoverflow.com/comment/43908224
type: Answer
has comment: http://stackoverflow.com/comment/43908079
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/27748301
has comment: http://stackoverflow.com/comment/43908132
accepted answer of: http://stackoverflow.com/q/27748301
has body: It is not a bug. The behavior you are seeing is because of the child scope created by ng-if. In your case the value set at the scope property disable is only available inside the child scope created by the second ng-if="!element" and disable inside the other block is in its own child scope. You can resolve it by setting it on an object reference where the object is initialized before any of these child scopes (ex ng-init="action ={}"), in this case both the child scopes refer to the same object reference action (as they get prototypically inherited) and modification on the property action.disabled gets reflected in both the places. This can happen not just for ng-if any directive that creates a child scope like ng-repeat, ng-switch etc. Read this well explained answer. Try: Hide Element Disable Bad Code Alert: I have used ng-init only for this demo purpose, you should not use ng-init for initializing. Always use a controller to initialize values on the scope. Demo angular.module('app', []).controller('Controller1', function() { }).controller('dummy', function() {}).controller('Controller2', function($scope) { $scope.action = {}; }); With ng-init Hide Element Disable With Controller As Hide Element Disable With Controller and dot in the binding Hide Element Disable
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/43776149
type: Comment
type: AnswerComment
has text: This example is simple and not what I want, try using my streams, see my edit please.
score: 0
comment on: http://stackoverflow.com/a/27679554

http://stackoverflow.com/a/27726274
answers question: http://stackoverflow.com/q/27725769
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
has body: I found this to be the solution: Add this to the CSS: html { height:100%; } body { height:100%; overflow:hidden; margin:0; padding:0; } Here's the full HTML if you need a 100% width and height html solution for android and ios
score: 1
accepted answer of: http://stackoverflow.com/q/27725769

http://stackoverflow.com/comment/43762891
comment on: http://stackoverflow.com/a/27665698
has text: Downvoting this because it is not a suitable answer. This is just hack around the actual problem which i can only assume has to do with server side code (routing and/or controller) or web server configuration. The problem should be fixed there or, if it cant be fixed in another fashion, it should at least be explianed as to why an encoded space at the end of the content is causing issues and why this was the only resolution you could implement.
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/q/27769465
has body: TL;DR - Storing user's login password for web app in memory in JS for use in client-side encryption of user's data: yea or nay? I'm working on a web application where users can store notes in the cloud. Users have a password to login. In addition, users can elect to encrypt notes using a password. The notes are stored encrypted in the cloud, meaning only the user can decrypt them (and notes are lost if their password is lost). For user convenience it would be better to use the same password for account login and for note encryption, and, upon login, to store that password in memory in a JS variable so they don't have to re-enter their password every time the application needs to encrypt or decrypt anything (for instance if they update a note). Is this insecure? Yes, an attacker with access to the user's machine could do a memory dump, or insert breakpoints into (uglified) JS, etc., and obtain the password. But an attacker with access to the user's machine could do this anyway: in order to log in at all there is necessarily a point where the user's password is accessible in plain text in my application's JS. So it seems okay to me - no more insecure than not storing it. Thoughts?
answer count: 3
has answer: http://stackoverflow.com/a/27769614
favorite count: 0
possible better answer: http://stackoverflow.com/a/27770638
has answer: http://stackoverflow.com/a/27770638
has answer: http://stackoverflow.com/a/27780391
tagged with: encryption
has title: Storing user's password for web application in client-side JavaScript - is this secure?
tagged with: passwords
type: AnsweredQuestion
score: 3
upvote count: 3
tagged with: web-applications
type: Question
accepted answer: http://stackoverflow.com/a/27780391
downvote count: 0
tagged with: javascript
tagged with: security

http://stackoverflow.com/comment/43799691
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27692635
has text: I'm not 100% sure what's going on, but it's probably due to the difference between Chrome and IE's JavaScript engines (IE's is slower).
score: 0

http://stackoverflow.com/a/27712736
accepted answer of: http://stackoverflow.com/q/27700990
type: Answer
answers question: http://stackoverflow.com/q/27700990
downvote count: 0
score: 1
has body: Ok, I found the problem. The _Create.cshtml class had some unnecessary javascript and css files being referenced/loaded up. It seems that one (or more) of these was causing a conflict, which (naturally) disappeared once I commented/removed these unnecessary references. Thanks all for your time and efforts. Issue is now resolved!
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/27724738
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27724812
score: 0
has body: I am trying to use http://jsfiddle.net/kc11/y66uc1cq/ to load some data which I have included into a handsontable view. Although the JS is valid: $(document).ready(function () { function getCarData() { return [ ["Nissan", 2009, "black", "black"], ["Nissan", 2006, "blue", "blue"], ["Chrysler", 2004, "yellow", "black"], ["Volvo", 2012, "white", "gray"]]; } var data = [ ["", "Kia", "Nissan", "Toyota", "Honda"], ["2008", 10, 11, 12, 13], ["2009", 20, 11, 14, 13], ["2010", 30, 15, 12, 13] ]; $("#example1").handsontable({ data: data, minRows: 5, minCols: 6, minSpareRows: 1, currentRowClassName: 'currentRow', currentColClassName: 'currentCol', autoWrapRow: true, rowHeaders: true, colHeaders: true }); $("#example1").handsontable('selectCell', 3, 3); }); The load is not occurring. Why and how can I fix this?
has title: Loading handsontable with local data fails
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43861597
tagged with: handsontable

http://stackoverflow.com/comment/43815839
type: QuestionComment
comment on: http://stackoverflow.com/q/27701607
has text: Is flag returning an array of your paths?
score: 0
type: Comment

http://stackoverflow.com/a/27646357
answers question: http://stackoverflow.com/q/27646203
has comment: http://stackoverflow.com/comment/43710763
type: Answer
has comment: http://stackoverflow.com/comment/43710636
accepted answer of: http://stackoverflow.com/q/27646203
has body: I think the problem is that you didn't define prestige variable. var penguins = 0.0; var igloos = 0; var snowballs = 0.0; var prestige = 'prestige' function save(){ var save = { snowballs: snowballs, penguins: penguins, igloos: igloos, prestige: prestige } localStorage.setItem("save",JSON.stringify(save)); }; See this link, it will work: jsfiddle
has comment: http://stackoverflow.com/comment/43710679
score: 0
has comment: http://stackoverflow.com/comment/43710613
type: AcceptedAnswer

http://stackoverflow.com/a/27663884
downvote count: 0
score: 1
type: Answer
has body: You're animating the scroll position on the scroll event. Animating the scroll position triggers scroll events, thus creating the infinite loop. You need to make sure you don't create another scroll animation while the current one is running. You can use a variable and the animation callback to set it. Here's a less-than-perfect example that demonstrated the basic concepts. var currDiv = 1; var scrolling = false; $(window).scroll(function(event) { if (!scrolling) { if (currDiv == 1) { $('html, body').animate({ scrollTop:$('.one').offset().top }, 'slow', function() { setTimeout(function() { scrolling = false; }, 1000); }); scrolling = true; currDiv = 2; } else if (currDiv == 2) { $('html, body').animate({ scrollTop:$('.two').offset().top }, 'slow', function() { setTimeout(function() { scrolling = false; }, 1000); }); scrolling = true; currDiv = 1; } } });
upvote count: 1
answers question: http://stackoverflow.com/q/27663731
accepted answer of: http://stackoverflow.com/q/27663731
type: AcceptedAnswer

http://stackoverflow.com/comment/43728749
type: Comment
comment on: http://stackoverflow.com/q/27656184
type: QuestionComment
has text: Better yet, Do you have a short example of how you would do so? Thanks, Blood
score: 0

http://stackoverflow.com/comment/43721637
type: AnswerComment
has text: Oh, my fault. I've just updated the answer. Please have a look. You have to add `ng-show` attribute also.
score: 0
comment on: http://stackoverflow.com/a/27652181
type: Comment

http://stackoverflow.com/comment/44384699
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27771671
has text: Спасибо! This helped! YAY!
score: 0

http://stackoverflow.com/comment/43918562
comment on: http://stackoverflow.com/q/27753849
score: 0
type: Comment
type: QuestionComment
has text: If you want it to attach to the top oft the page when you scroll down you need to use js, otherwise you could use `position: fixed;`

http://stackoverflow.com/q/27724244
tagged with: javascript
tagged with: jquery
tagged with: get
has answer: http://stackoverflow.com/a/27724288
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43860499
has comment: http://stackoverflow.com/comment/43860496
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43860490
type: Question
has title: Jquery - $.GET Place In Closest Div
has body: So this is probably very easy but for some reason I can't get it to work. I have a $.get function that runs properly. I want the data/results to load into the closest div. When I identify the div specifically, everything works fine: $.get( lk, function(data) { $("div.tcontainer").html(data); }); But when I try to look for the closest div, it does not work. I have a few divs on the page (dynamically) and they have the same attributes so i need to find the closest div and load the data into that div like: $.get( lk, function(data) { $(this).closest("div.tcontainer").html(data); }); But this does not work. Can someone help me find the closest div using the code above. Thank you.

http://stackoverflow.com/comment/43741335
type: Comment
comment on: http://stackoverflow.com/a/27662714
score: 0
type: AnswerComment
has text: Your solution works, but it is *not* the scope if the if statement but the event handler functions scope that is the culprit.

http://stackoverflow.com/q/27658422
type: Question
has answer: http://stackoverflow.com/a/27658459
has comment: http://stackoverflow.com/comment/43732596
has comment: http://stackoverflow.com/comment/43732679
tagged with: javascript
has comment: http://stackoverflow.com/comment/43732836
score: -4
downvote count: 4
answer count: 2
upvote count: 0
tagged with: jquery
has body: I have a client requirement to set line space to 1 1/2 (1.5). It's for setting line-height while creating PDF through PHP, and the PDF is a court document (US). I am not a designer guy, and I am unable to understand the requirement. If some could help me to understand the requirement it will be really helpful for me.
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27658440
tagged with: php
tagged with: css
has title: Line spacing 1 1/2 means how much in web development?

http://stackoverflow.com/a/27677395
has body: You can use setInterval This is an example with jQuery : Html change text dynamicly Javascript $(function(){ $('#textarea').data('old',$('#textarea').val()) $('#link').on('click',function(){ $('#textarea').val('text changed dynamicly'); return false; }) setInterval(function() { if($('#textarea').val() != $('#textarea').data('old')){ $('#status').html('text of textarea is changed to : ' + $('#textarea').val()) } $('#textarea').data('old',$('#textarea').val()) }, 100); }) this is a demo in jsfiddle
has comment: http://stackoverflow.com/comment/43769201
has comment: http://stackoverflow.com/comment/43769272
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27677183

http://stackoverflow.com/comment/43825806
score: 0
comment on: http://stackoverflow.com/q/27706840
type: Comment
type: QuestionComment
has text: Try definining your model first in your controller: `$scope.definition = {}`

http://stackoverflow.com/q/27790897
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Div Positioning is calculated fine but need explanation how it is working
has answer: http://stackoverflow.com/a/27790964
tagged with: http://stackoverflow.com/tag/html
score: 0
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27790964
has body: Can someone explain how this is working. I am creating sidepanel ad and to place the panels i want the position of the width. When i upload the script on my server then i get a small script which we place on the publisher website and where our script runs inside the iframe. Here is the screen shot. My script is highlighted in yellow which is getting the position of the div which is in red box class='content'. Here is the code i have used. function getPosition(element) { var xPosition = 0; var yPosition = 0; var left = 0; var top = 0; var i = 0; while (element) { xPosition = (element.offsetLeft); yPosition = (element.offsetTop); console.log("TOP Pos: "+yPosition+"Left Pos: "+xPosition); if (i == 1) { left = xPosition; top = yPosition; } element = element.offsetParent; i++; } return { x: left, y: top }; } This is how i am calling the getPosition method function ReadDivPos(selector) { var _divPos = ""; var parentDoc = window; while (parentDoc !== parentDoc.parent) { parentDoc = parentDoc.parent; } parentDoc = parentDoc.document; var parentDiv = parentDoc.getElementsByTagName('div'); var divs = []; for (var i = 0; i &lt; parentDiv.length; i++) { if (parentDiv[i].className == "content") { var pos = getPosition(parentDiv[i]); var x = pos["x"]; var y = pos["y"]; console.log("Values+ Top: " + y + " Left: " + x); var w = parentDiv[i].offsetWidth; _divPos += x + "," + w + "," + y + "," + (x + w) + ","+window.screen.availWidth+"\\n"; } } console.log("Values+ x: " + _divPos); return _divPos; } This is the values i am getting . I got the correct values in the second attempt ,i.e, TOP Pos: 185Left Pos: 197 Top:185 and Left 197 which is correct but why i got Top 2 and Left 0 for the first time and second time i got correct values. Since i am getting the values in the second attempt so i have fixed this using i==1 if (i == 1) { left = xPosition; top = yPosition; } i dont think this is the best approach but thats how i am getting the correct values. can anyone explain me this why it…
type: Question
has comment: http://stackoverflow.com/comment/43993174

http://stackoverflow.com/comment/43903027
type: AnswerComment
comment on: http://stackoverflow.com/a/27743363
has text: http://gitlab.learningtechasia.com:8901/rohan0793/angulairapi.git You can look at the repository of the API if you like. It is public.
type: Comment
score: 0

http://stackoverflow.com/q/27792243
tagged with: javascript
has body: I am using dhtmlgoodies drag and drop script.i have to addsource for dynamically created elements using element id..if i pass id value its taking as a string.. var dragDropObj = new DHTMLgoodies_dragDrop(); dragDropObj.addSource('box320',true,true,true,false,'onDragFunction'); dragDropObj.addSource('box314',true,true,true,false,'onDragFunction'); box320,box314 are element id's..i have to pass element id dynamically.i have used &lt;div class="dragableBox" ondrag="add1(this.id)" id="&lt;%=rs_list_task.getString("task_id")%&gt;" &gt; function add1(id) { var dragDropObj = new DHTMLgoodies_dragDrop(); dragDropObj.addSource(id,true,true,true,false,'onDragFunction'); } but its not working...it showing error element with id not found.
score: 0
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43995055
has title: object creation for javascript function
has comment: http://stackoverflow.com/comment/43994140
type: Question

http://stackoverflow.com/comment/43762790
type: Comment
type: QuestionComment
has text: @PSL At some point in time the service needs to notify subscribers that a value has changed. It would presumably do this via `$rootScope.publish()`, but in order to do that, you need to inject `$rootScope` into your service. The other option you mention is to create a service for doing pub/sub. In that case, you would do `myPubSubService.publish()` from your service, which is fine, but the declaration for `MyPubSubService` would have to deal with scopes (in order to auto unsubscribe when a scope is destroyed). I don't see any safe way to avoid having a reference to a scope in some service.
score: 0
comment on: http://stackoverflow.com/q/27670824

http://stackoverflow.com/q/27648357
type: Question
has comment: http://stackoverflow.com/comment/43714913
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/27648561
answer count: 1
type: AnsweredQuestion
has title: Using event trigger how to pass the value to function on input change
has answer: http://stackoverflow.com/a/27648561
has body: I would like to check the input value, in case the value is null, then i would like to set the value as 1. and whenever the input element value changes, i require a event trigger... i tried here, but it's not working. what is wrong with my code or what is the correct way to do this? here is my code : var page = function () { return { init : function () { var input = $("#pNo"); $(document).on("pageChange", this.onPageChange.bind(this)); $.event.trigger({type: "pageChange", element:input}); $(this.pageInput).bind("change paste keyup", $.event.trigger({type: "pageChange"})); }, onPageChange : function (e) { // from the e i would like to select input value... } } }(); page.init(); Live Demo Update : //This is works on page load.. var page = function () { return { init : function () { var input = $("#pNo"); $(input).val(1).trigger('pageChange'); $(document).on("pageChange", this.onPageChange.bind(this)); $(this.pageInput).bind("change paste keyup", $.event.trigger({type: "pageChange"})); }, onPageChange : function (e) { console.log(e) } } }(); page.init();

http://stackoverflow.com/q/27779801
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/27779946
upvote count: 1
answer count: 1
has body: I'm newbie in Angularjs,The following Spring controller get object from database by id I want to get This id by @RequestParam using AngularJs ,I try the following code but get this error "Error: id is not defined .findOne@ localhost:8080/myapp/scripts/services.js:126:79 $scope.findOne@ localhost:8080/myapp/scripts/controllers.js:280:4 Spring MVC Controller @RequestMapping(value = "/rest/chartConfigs/getById", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @RolesAllowed(AuthoritiesConstants.ADMIN) public ChartConfigs findOne(@RequestParam(value = "id") Integer id) { System.out.println(chartConfigService.getOne(id)); return chartConfigService.getOne(id); } AngularJS Service myappApp.factory('ChartConfigService', function ($http) { return { findOne: function() { var promise = $http.get('app/rest/chartConfigs/getById',{params: {id: id}}). then(function (response) { return response.data; }); return promise; } } }); AngularJS Controller myappApp.controller('ChartConfigController', function ($scope, ChartConfigService) { $scope.findOne= function() { ChartConfigService.findOne($scope.id).then(function(obj) { $scope.message=obj; console.log(obj.type); }); }; }); Html page &lt;input ng-model="id" ng-change="findOne()" required&gt;
tagged with: javascript
has answer: http://stackoverflow.com/a/27779946
type: AnsweredQuestion
has title: AngularJS Spring mvc @RequestParam
downvote count: 0
score: 1
favorite count: 0

http://stackoverflow.com/q/27720181
type: Question
has answer: http://stackoverflow.com/a/27720214
has comment: http://stackoverflow.com/comment/43851856
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43852085
has comment: http://stackoverflow.com/comment/43852156
score: 0
possible better answer: http://stackoverflow.com/a/27720206
has comment: http://stackoverflow.com/comment/43852136
linked to: http://stackoverflow.com/q/508269
has answer: http://stackoverflow.com/a/27720206
has answer: http://stackoverflow.com/a/27720321
linked to: http://stackoverflow.com/q/14170153
has title: issue with jquery .append function
accepted answer: http://stackoverflow.com/a/27720214
has comment: http://stackoverflow.com/comment/43851830
has answer: http://stackoverflow.com/a/27720213
tagged with: append
answer count: 4
has body: i am trying to append some html content to a div. here is my jquery script jQuery( "#navigation" ).append(' '); but this not working. showing some error. please help me. Thanks
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43851850

http://stackoverflow.com/a/27734560
upvote count: 1
has body: I think you are looking for AJAX. It can send httpRequests on client side or please tell what do you exactly need.
has comment: http://stackoverflow.com/comment/43888030
has comment: http://stackoverflow.com/comment/43892138
downvote count: 0
answers question: http://stackoverflow.com/q/27734531
type: Answer
score: 1

http://stackoverflow.com/comment/43780433
type: QuestionComment
comment on: http://stackoverflow.com/q/27682880
type: Comment
has text: please post your HTML. Ran your code through my webpage. Renders ok. So there's no error in there on parsing.
score: 0

http://stackoverflow.com/q/27782959
has body: So I wrote this Regex for validating e-mail addresses: (?=^([A-Za-z\xC0-\xFF0-9\!\#\$\%\&amp;\'\*\+\-\/\=\?\^\\_\`\{\|\}\~]\.?){0,63}[A-Za-z\xC0-\xFF0-9\!\#\$\%\&amp;\'\*\+\-\/\=\?\^\\_\`\{\|\}\~]@[A-Za-z\xC0-\xFF0-9]([A-Za-z\xC0-\xFF0-9-]{0,61}[A-Za-z\xC0-\xFF0-9])?(\.[A-Za-z\xC0-\xFF]([A-Za-z\xC0-\xFF0-9-]{0,61}[A-Za-z\xC0-\xFF0-9])?)*$)(?=^.{3,254}$) And I wanted to test it in js console: var patt = new RegExp("(?=^([A-Za-z\xC0-\xFF0-9\!\#\$\%\&amp;\'\*\+\-\/\=\?\^\\_\`\{\|\}\~]\.?){0,63}[A-Za-z\xC0-\xFF0-9\!\#\$\%\&amp;\'\*\+\-\/\=\?\^\\_\`\{\|\}\~]@[A-Za-z\xC0-\xFF0-9]([A-Za-z\xC0-\xFF0-9-]{0,61}[A-Za-z\xC0-\xFF0-9])?(\.[A-Za-z\xC0-\xFF]([A-Za-z\xC0-\xFF0-9-]{0,61}[A-Za-z\xC0-\xFF0-9])?)*$)(?=^.{3,254}$)") patt.test("jake@domain.domain.domain.domain.domai.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domain.domai") And that freezes my tab. Shorter addresses seem to be working fine. Tested in C# and online regex tools (e.g. regex101.com) without any problems. What's going on? Is the JavaScript Regex engine faulty, or is it just my Regex? (I am aware that this might not be a perfect email validation, but this question is about why doesn't it work)
has answer: http://stackoverflow.com/a/46767060
has comment: http://stackoverflow.com/comment/43976149
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/25433413
has answer: http://stackoverflow.com/a/27791628
type: Question
upvote count: 5
has comment: http://stackoverflow.com/comment/43975825
has comment: http://stackoverflow.com/comment/43976095
possible better answer: http://stackoverflow.com/a/46767060
has comment: http://stackoverflow.com/comment/43975969
answer count: 2
score: 5
downvote count: 0
tagged with: javascript
favorite count: 0
has title: JS regex freezes my browser(s)
accepted answer: http://stackoverflow.com/a/27791628
tagged with: regex

http://stackoverflow.com/comment/43844526
has text: but i'm using removeEventListener too. is there another way?
comment on: http://stackoverflow.com/a/27716238
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43966296
comment on: http://stackoverflow.com/q/27777984
has text: @SimonStaton thought it was obvious :) but of course fixed, thank you
score: 0
type: Comment
type: QuestionComment

dialog
tag name: dialog
tags question: http://stackoverflow.com/q/27693146
tags question: http://stackoverflow.com/q/27739508
type: Tag
tags question: http://stackoverflow.com/q/27711387
tags question: http://stackoverflow.com/q/27658619

http://stackoverflow.com/q/27759132
tagged with: date
has comment: http://stackoverflow.com/comment/43930288
has title: Javascript Format returns day of 0
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has body: Javascript rookie here: function calcExpiration(){ var getState = jQuery( "#state" ).text(); var getcalldate = jQuery( "#date" ).text(); var date = new Date( getcalldate ); if (getState == "KY" || getState == "IN"){ date.setDate(date.getDate() + 30); } if (getState == "WV" || getState == "OH"){ date.setDate(date.getDate() + 10); } var expmonth = date.getMonth()+1; var expdate = date.getDay(); var expyear = date.getFullYear(); jQuery( "#expiration" ).html( expmonth + "/" + expdate + "/" + expyear); } calcExpiration(); When getcalldate = 01/02/2015 Returns 2/0/2015 What am I missing?
upvote count: 1
linked to: http://stackoverflow.com/q/2587345
type: Question
type: AnsweredQuestion
tagged with: format
score: 1
has answer: http://stackoverflow.com/a/27759208
accepted answer: http://stackoverflow.com/a/27759208

http://stackoverflow.com/q/27770942
score: -1
type: UnansweredQuestion
downvote count: 1
type: Question
has body: I am using Google Cloud Channels in Android's WebView, but the same problem probably occurs as well when using any socket in a similar way. Problem: The argument is not passed on by the handler, possibly because functions are called in a different scope. Here is my code: onMessage has a single argument (string) and my onMessage function is properly called, but the argument is 'undefined', probably because it is in a different scope. This question might be a duplicate of these or other similar questions, and I tried to apply the recipes given there, but no success. How do I pass arguments to an event handler? How to pass event as argument to an inline event handler in JavaScript? I actually applied the code from here http://2cor214.blogspot.com/2010/08/passing-arguments-to-event-handler-in.html and tried to play with things like this: socket.onmessage = (function (message) {return onMessage})(message) in many variants, but couldn't get it to work. I admit I am not normally developing JavaScript and I don't exactly understand what JavaScript does here, but it seems to me that the argument needs to be extracted the function wrapped somehow. Can anybody shed light please. -- I removed parts of my code for brevity.
tagged with: channel-api
has answer: http://stackoverflow.com/a/27772869
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has title: JavaScript Argument not passed across handler
linked to: http://stackoverflow.com/q/24783099
tagged with: android
linked to: http://stackoverflow.com/q/16404327

http://stackoverflow.com/a/27722821
upvote count: 2
answers question: http://stackoverflow.com/q/27722795
has body: $(".test &gt; .sub").filter(function(index) { return $(this).text() == 'hello' || $(this).text() === 'stackoverflow'; }).css(someCSS); or var values = [ 'hello', 'stackoverflow' ] $(".test &gt; .sub").filter(function(index) { return values.indexOf($(this).text()) &gt; -1 }).css(someCSS);
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/a/27754139
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43919143
has comment: http://stackoverflow.com/comment/43984917
has body: Try JSON.stringify(data), its a Javascript function. Hope it might help. Refer: Detail Explaination If you are using PHP then use json_encode Refer: json_encode manual
upvote count: 2
has comment: http://stackoverflow.com/comment/43919253
accepted answer of: http://stackoverflow.com/q/27754077
has comment: http://stackoverflow.com/comment/43961363
answers question: http://stackoverflow.com/q/27754077

http://stackoverflow.com/comment/43834806
type: Comment
comment on: http://stackoverflow.com/q/27661926
has text: This is covered in the docs under [Using Authentication with Routers](https://www.firebase.com/docs/web/libraries/angular/guide.html#section-routes) and there is also an [angularFire-seed](https://github.com/firebase/angularFire-seed) which implements these concepts.
score: 0
type: QuestionComment

http://stackoverflow.com/a/27737835
upvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27735083
accepted answer of: http://stackoverflow.com/q/27735083
type: Answer
downvote count: 1
has body: So after learning that you can't change the tagName directly itself. There's still a few ways to do this. The sample below is by using a hidden textarea to hold are html and changing our tag using a textbox, a button, and .replaceWith. This way we have more control rather than just using keyup. Also this way I don't have to worry about loosing my element, but also I'm saving processing power as I don't have the browser doing anymore work than it needs to do. Here's a fiddle using a JQuery plugin called .replaceTagName. (This plugin was not not handy for my needs. As I also wanted to call input[type=text] and this plugin would not allow such a thing as it handles html not values. However this plugin may still be helpful for someone else) Here's a demo of the same thing below, but instead I'm using conditional/ternary operators instead. $(document).ready(function() { // Change selected element's tag function var changeTagName = function() { var $val = $(".newtag").val().trim().toLowerCase(); // If no value is set return to default if ($.inArray($val, [""]) > -1) { $(".selected").replaceWith( ""); $(".selected").html( $(".code").val() ); // Check if it's a textbox } else if ($.inArray($val, ["input[type=text]", "input", "textbox"]) > -1) { $(".selected").replaceWith( " "); $(".selected").val( $(".code").val() ); // Check if it's an input button } else if ( $val === "input[type=button]" ) { $(".selected").replaceWith( " "); $(".selected").val( $(".code").val() ); // Check if it's a textarea } else if ( $val === "textarea" ) { $(".selected").replaceWith( "<" + $val + " class=\"selected\" \>"); $(".selected").val( $(".code").val() ); // Use text as a placeholder to make a span tag } else if ( $val === "text" ) { $(".selected").replaceWith( ""); $(".selected").html( $(".code").val() ); } else { // Make any others specified $(".selected").replaceWith( "<" + $val + " class=\"selected\" \>"); $(".selected").html( $(".code").val() ); } // Return tagName $(".newtag").val( $(".s…
score: -1

http://stackoverflow.com/comment/43714480
type: AnswerComment
type: Comment
has text: I guess you _think_ you're making an extension when in fact it's an app. No, there are no built-in methods.
comment on: http://stackoverflow.com/a/27648034
score: 0

http://stackoverflow.com/comment/43991805
comment on: http://stackoverflow.com/a/27790964
has text: how can i use getElementsByClassName in my code if it is more better way of what i am doing now then i would use that
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43955840
has text: DOM manipulation should never be done in controllers. You should use directives to do DOM manipulation if required. Generally it's best to use the framework directives as much as possible
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27772404

http://stackoverflow.com/comment/43898233
type: Comment
comment on: http://stackoverflow.com/a/27743437
score: 0
type: AnswerComment
has text: @DmytroBorysovskiy, in your javascript call when the button is pressed, did you preventDefault() the event? Because what it sounds like that it's not bothering with the ajax at all, its following a "submit" type button event

http://stackoverflow.com/comment/43724242
type: Comment
comment on: http://stackoverflow.com/a/27653692
score: 1
has text: the button client click seems to be fine. though you can remove `javascript:` and write juse `OnClientClick="return ValidateAll();"`
type: AnswerComment

http://stackoverflow.com/comment/43760400
type: Comment
comment on: http://stackoverflow.com/q/27672735
has text: Boolean(x) will NOT correctly convert your String to true or false. It considers every non-empty (`""`) String to be true. Instead compare your String to `"true"` or whatever other value you want to signal a positive boolean output.
score: 0
type: QuestionComment

http://stackoverflow.com/q/27706961
has comment: http://stackoverflow.com/comment/43825777
has body: I am in the success handler of an ajax request like : $.ajax({ type: "POST", url: "{{ path('getevents') }}", data: {start: start, end : end}, success: function (data) { for ( var i = 0; i < data['rdv'].length; i++ ) { var divRdv = ' My div '; $('myElement').append(divRdv); $(divRdv).draggable(); // THIS DOESN'T WORK } }, error: function (xhr, status, error) { console.log(xhr.responseText); } }); So, in a loop, i need to create a div divRdv, append this div to myElement, and after that, i want this div draggable. How can i do ? I'm trying to add draggable to each div, one by one, there is a way to add draggable to multiple element in one time ?
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: jQuery, add draggable to append object
has answer: http://stackoverflow.com/a/27707053
has comment: http://stackoverflow.com/comment/43825855
has answer: http://stackoverflow.com/a/27707062
type: UnansweredQuestion
upvote count: 1
type: Question
tagged with: jquery-ui
score: 1

http://stackoverflow.com/q/27745645
accepted answer: http://stackoverflow.com/a/27748658
has title: Yii2: Jquery selecting id of a table cell not working
has comment: http://stackoverflow.com/comment/43902583
has comment: http://stackoverflow.com/comment/43902591
type: Question
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43902354
has comment: http://stackoverflow.com/comment/43902251
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43902474
has comment: http://stackoverflow.com/comment/43902616
has body: I am using Yii2 and using this jquery code to access the value of a cell(td) column. I have set the id of the column say 'room_name' I am using this code which works fine on a form, but in grid-view(table) I am getting a blank alert. &lt;?php $script = &lt;&lt;&lt;EOD alert ($('#room_name').val()); EOD; $this-&gt;registerJs($script); ?&gt; Do I need to do it differently for tables, as the id is getting repeated over multiple rows. Thanks for a suggestion.
tagged with: php
has comment: http://stackoverflow.com/comment/43902487
has comment: http://stackoverflow.com/comment/43902401
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27748658

http://stackoverflow.com/q/27778987
has comment: http://stackoverflow.com/comment/44015629
score: 0
answer count: 0
tagged with: contenteditable
type: UnansweredQuestion
tagged with: iframe
has title: Pasting content into iframe with designMode on in IE
type: Question
tagged with: copy-paste
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/43980750
has comment: http://stackoverflow.com/comment/44018346
has body: We have identified a problem with editable iframes in Internet Explorer 9 and 10 (it may also occur in other versions but thus far have not been able to confirm). If you create a simple iframe with designMode set to on, type a couple of words, and then paste some complex content in (in this example, an email including signature directly from Outlook, or a formatted document from MS Word), then upon modifying the original content, characters typed become invisible until space is pressed or focus is lost from the iframe. What is more bizarre about the behaviour is that if the user presses return before pasting their content, then the problem does not occur. Also, performing the same steps in a content editable DIV does not result in the same problem (however, putting an editable DIV inside a non-editable iframe does result in the problem, so the iframe definitely appears to be the problem). The problem does not occur in Google Chrome or Mozilla Firefox and the only workaround seems to be to ensure that there is a line break between the initial content and the pasted content. I have also just noticed that the behaviour can be replicated very easily by ensuring that the iframe scrolls. The following code will replicate: &lt;iframe id="theframe" style="height:50px;"&gt;&lt;/iframe&gt; &lt;script&gt; $(function() { var iframe = document.getElementById('theframe'); iframe.contentDocument.designMode = 'on'; }); &lt;/script&gt; I have also setup a fiddle at http://jsfiddle.net/z76x7gzL/ that reliably replicates the problem. In the fiddle, if you type "this is a test" followed by a space and then pasting at least 2 lines from Word, then go back to the end of the "this is a test" line and attempt to type, the text will be invisible. Any help much appreciated,
tagged with: javascript

http://stackoverflow.com/comment/43811555
score: 0
type: Comment
has text: I tried the polyfills listed in the Github repository, but they didn't work.
comment on: http://stackoverflow.com/a/27690303
type: AnswerComment

http://stackoverflow.com/a/27707288
upvote count: 2
type: Answer
score: 2
has body: like an objet maybe: http://jsfiddle.net/mig1098/ekLmquap/ var replace = { replaceWordST:function(person) { var toReplace = /Smith/g; var replaceWith = "Jones"; jsonData = person; for(var obj in jsonData){ if(jsonData.hasOwnProperty(obj)){ for(var prop in jsonData[obj]){ if(jsonData[obj].hasOwnProperty(prop)){ jsonData[obj][prop] = replace.name(jsonData[obj][prop],toReplace,replaceWith); } } } } return jsonData; }, name:function(name,toReplace,replaceWith){ return name.replace(toReplace, replaceWith); } }
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27706772
answers question: http://stackoverflow.com/q/27706772

http://stackoverflow.com/comment/43809938
type: Comment
comment on: http://stackoverflow.com/a/27698393
has text: @sia, I don't know how to do that. If you need a button, a ` Submit ` does the same thing, but it's not `type="button"`
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43963675
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27776277
type: Comment
has text: I know that it must be shown before 'save', I updated my answer.

http://stackoverflow.com/comment/43884868
comment on: http://stackoverflow.com/a/27735239
type: Comment
type: AnswerComment
has text: Works perfectly, didn't benchmark, but works very quickly with sets under 1000 so far. The problem is, if i add a third element to each subarray. just adding `temp[id2]` is clearly not a solution. i'll keep trying to see if there is a way to use subarrays of `n` length as opposed to just 2.
score: 0

http://stackoverflow.com/comment/43717893
type: AnswerComment
comment on: http://stackoverflow.com/a/27649457
score: 0
type: Comment
has text: you can try the library multimarker that seems works fastly with even 1000 markers: https://code.google.com/p/multimarker/

ecmascript-harmony
tag name: ecmascript-harmony
type: Tag
tags question: http://stackoverflow.com/q/27709394
tags question: http://stackoverflow.com/q/27778105

http://stackoverflow.com/comment/43884753
has text: What's the `c#` connection?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27736624
score: 0

http://stackoverflow.com/comment/43834365
score: 0
comment on: http://stackoverflow.com/a/27709878
type: AnswerComment
type: Comment
has text: @supriya I updated the code to work on keyUp event on any `.elm` element. Hope that helps.

http://stackoverflow.com/a/27726718
score: 0
has body: I would prefer AngularJS. This will be a good technology and you can do pagination with one HTML. So i think this will be good framework for you as your using static content. In AngularJS MVC concept is there please read the AngularJS Tutorial. So this framework will be worth for your new project. Happy coding
type: Answer
answers question: http://stackoverflow.com/q/27645478

http://stackoverflow.com/q/27705996
accepted answer: http://stackoverflow.com/a/27712307
tagged with: angularjs
has body: In my mean js app i have an account model and corresponding routes and controllers. To remove a specific account i need to have authorization and I need to be logged in. All users can however list all accounts, I only wont to list the accounts created by the specific user. So i need to add autorization to the list part of the code. I update the routes for app.route('/accounts') with users.requiresLoginandaccounts.hasAuthorization as shown below: module.exports = function(app) { var users = require('../../app/controllers/users.server.controller'); var accounts = require('../../app/controllers/accounts.server.controller'); // Accounts Routes app.route('/accounts') .get(users.requiresLogin,accounts.hasAuthorization,accounts.list) .post(users.requiresLogin, accounts.create); app.route('/accounts/:accountId') .get(users.requiresLogin, accounts.hasAuthorization,accounts.read) .put(users.requiresLogin, accounts.hasAuthorization, accounts.update) .delete(users.requiresLogin, accounts.hasAuthorization, accounts.delete); // Finish by binding the Account middleware app.param('accountId', accounts.accountByID); }; Now I get an errror since req is not provided with user. GET /modules/accounts/views/list-accounts.client.view.html 304 8.266 ms - - TypeError: Cannot read property 'user' of undefined at exports.hasAuthorization (/Users/david/Repositories/budget/app/controllers/accounts.server.controller.js:103:17) So I imagine i need to update the accounts.server.controller somehow. The delete account does provide an account in the req, so that only the creator can delete as I mentioned earlier. How do I update the code so that the "List of accounts" part work and list only the accounts belonging to that specific user? /** * Delete an Account */ exports.delete = function(req, res) { var account = req.account ; account.remove(function(err) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.jsonp(account); } }); }; /** * List of Acco…
has answer: http://stackoverflow.com/a/27712307
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: mean-stack
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43824178
has title: MEAN js require authorization to list items
tagged with: node.js

http://stackoverflow.com/comment/43762053
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27673452
has text: how do you interpret a blocking while loop in a nonblocking language?

http://stackoverflow.com/comment/43928788
type: AnswerComment
comment on: http://stackoverflow.com/a/27758562
score: 0
type: Comment
has text: This does seem to work although with some texts it will select a previous word and display it twice. Is there a way around this?

http://stackoverflow.com/a/27707173
type: Answer
answers question: http://stackoverflow.com/q/27707015
has body: Try This : document.forms.myForm.elements.key.value = ****anyvalue****;
has comment: http://stackoverflow.com/comment/43826813
score: 0

http://stackoverflow.com/comment/43874207
comment on: http://stackoverflow.com/q/27731330
type: QuestionComment
has text: thanks @wolff..can you please share some sample code on how should return from the php file..
score: 0
type: Comment

http://stackoverflow.com/comment/43956978
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27772785
has text: @PSL find code in UPDATE

http://stackoverflow.com/q/27673479
has comment: http://stackoverflow.com/comment/43761915
type: AnsweredQuestion
has title: POST form dynamically generated inputs
accepted answer: http://stackoverflow.com/a/27673691
upvote count: 1
tagged with: forms
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43762126
has comment: http://stackoverflow.com/comment/43762010
has comment: http://stackoverflow.com/comment/43761965
has body: I have a form to which inputs are dynamically added upon click of button that calls an append function. Once the form is submitted, I only have access to the inputs that were created on page load. I have double checked this fact using the following debug code. The alert indeed does not display the dynamically generated IDs. $('form').submit(function() { alert($(this).serialize()); return false; }); The script is as follows: $(document).ready(function() { var max_fields = 10; //maximum input boxes allowed var wrapper = $(".input_fields_wrap"); //Fields wrapper var add_button = $(".add_field_button"); //Add button ID var x = 0; //initlal text box count $(add_button).click(function(e){ //on add input button click e.preventDefault(); if(x < max_fields){ //max input box allowed x++; var printCounter = document.getElementById("product_counter"); printCounter.value = x; //increment $(wrapper).append(' ' + ' ' + 'Nom'+ ' '+ ' '+ ' '+ 'Description'+ ' '+ ' '+ ' '+ 'Prix à l’unité'+ ' '+ ' '+ ' '+ 'Quantité'+ ' '+ ' '+ ' '+ 'Taxe Fédérale'+ ' '+ ' '+ ' '+ 'Taxe Provinciale'+ ' '+ ' '+ 'Supprimer '+ ' '); //add input box } }); $(wrapper).on("click",".remove_field", function(e){ //user click on remove text e.preventDefault(); $(this).parent('div').remove(); x--; }) }); jsfiddle.net/52VtD/9763 Any help is greatly appreciated
answer count: 1
tagged with: submit
has answer: http://stackoverflow.com/a/27673691
score: 1
favorite count: 0
tagged with: php

http://stackoverflow.com/q/27688742
upvote count: 1
type: AnsweredQuestion
tagged with: enums
score: 1
tagged with: telerik-grid
type: Question
tagged with: c#
accepted answer: http://stackoverflow.com/a/27722567
has title: What is the Javascript comparison operator for Telerik grid's IsContainedIn FilterOperator
downvote count: 0
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/263965
has comment: http://stackoverflow.com/comment/43792754
has body: I want to use the IsContainedIn FilterOperator for Telerik grid. The following is the FilterOperator enum public enum FilterOperator { IsLessThan = 0, IsLessThanOrEqualTo = 1, IsEqualTo = 2, IsNotEqualTo = 3, IsGreaterThanOrEqualTo = 4, IsGreaterThan = 5, StartsWith = 6, EndsWith = 7, Contains = 8, IsContainedIn = 9, DoesNotContain = 10, } Operator Description eq Is equal to ne Is not equal to gt Is greater than ge Is greater than or equal to lt Is less than le Is less than or equal to But I need Operator for IsContainedIn FilterOperator.
favorite count: 0
has comment: http://stackoverflow.com/comment/43792186
has answer: http://stackoverflow.com/a/27722567

string
tags question: http://stackoverflow.com/q/27697051
tags question: http://stackoverflow.com/q/27785245
tags question: http://stackoverflow.com/q/27644473
tags question: http://stackoverflow.com/q/27721562
tags question: http://stackoverflow.com/q/27739443
tags question: http://stackoverflow.com/q/27656575
tags question: http://stackoverflow.com/q/27758483
tags question: http://stackoverflow.com/q/27706772
tags question: http://stackoverflow.com/q/27736141
tags question: http://stackoverflow.com/q/27794706
tags question: http://stackoverflow.com/q/27667796
tags question: http://stackoverflow.com/q/27696647
tags question: http://stackoverflow.com/q/27650386
tags question: http://stackoverflow.com/q/27690429
tags question: http://stackoverflow.com/q/27732062
tags question: http://stackoverflow.com/q/27649758
tag name: string
tags question: http://stackoverflow.com/q/27655845
type: Tag
tags question: http://stackoverflow.com/q/27792422
tags question: http://stackoverflow.com/q/27688924
tags question: http://stackoverflow.com/q/27736680
tags question: http://stackoverflow.com/q/27749176
tags question: http://stackoverflow.com/q/27702413
tags question: http://stackoverflow.com/q/27733192
tags question: http://stackoverflow.com/q/27763023
tags question: http://stackoverflow.com/q/27709952
tags question: http://stackoverflow.com/q/27656283

http://stackoverflow.com/comment/43757759
type: QuestionComment
has text: is this a form? if so need to prevent default submit if `.save` is type=submit
comment on: http://stackoverflow.com/q/27671472
score: 0
type: Comment

http://stackoverflow.com/a/27773680
has comment: http://stackoverflow.com/comment/43992333
has body: Note that months are zero indexed so January is 0, February 1 and so on so December is 11. Pretty easy to fix, just add 1 to the month number returned by getMonth. The code can be greatly simplified since you don't really need the else part. Each if returns a discrete value, so just use a sequence of ifs. Also, the season can be determined by dividing the month number by 3 and using the modulus operator: // Return the southern hemisphere season for a date // If no date provided, uses current system date function getSeason(d) { d = d || new Date(); var mon = d.getMonth() + 1; // Adjust to be indexed from 1 var day = d.getDate(); var seasons = ['summer','autumn','winter','spring']; // Do silly seasons here if (mon == 12) { if (day &gt;= 13 &amp;&amp; day &lt;= 27) { return 'xmas'; } if (day &gt;= 28 &amp;&amp; day &lt;= 31) { return 'nye'; } } // If wasn't a silly season, do others mon = Math.floor((mon % 12) / 3); return seasons[mon]; } console.log('Currently it is ' + getSeason()); // Currently it is summer Then: $(document).ready(function(){ document.body.className = getSeason(); });
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27773195
score: 0
answers question: http://stackoverflow.com/q/27773195
has comment: http://stackoverflow.com/comment/43985204
type: Answer
has comment: http://stackoverflow.com/comment/43992421
has comment: http://stackoverflow.com/comment/59812001
has comment: http://stackoverflow.com/comment/59837884

http://stackoverflow.com/a/27786244
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27785810
has body: Don't remove item by index maybe your $scope.posts order and rendered order not the same. When u use orderBy filter ng-repeat create new array for render, don't reorder $scope.posts. You can remove item by its id. it is more safe. var index; $filter($scope.posts, function(val, key){ if(val._id === id &amp;&amp; !index) index = key; }) if(index){ $scope.posts.splice(index, 1); } Also if you want to show inserted row at first you should use unshift instead of push
has comment: http://stackoverflow.com/comment/43982763
upvote count: 1

http://stackoverflow.com/q/27795938
score: 0
type: UnansweredQuestion
has title: blocking off certain time in anytime picker
has body: Hi is there a way i can block off certain hours in the anytime picker, so that the user wont be able to click on those hours. For example grey off the hours ( 19,20,21,22,23,00,01,02,03,04,05,06,07,08). Im trying to create a UI for the user to block off after work hours. Thanks
tagged with: anytime
type: Question
has answer: http://stackoverflow.com/a/27823997
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/44015249
score: 1
comment on: http://stackoverflow.com/a/27801524
has text: That would require some image processing on the canvas I guess to detect pixel colours near one another, ratios, etc. or something? It could probably be done, but might be a few thousand lines of code :P (and could potentially eat your processor for breakfast in doing so)
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27662406
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43741102
accepted answer: http://stackoverflow.com/a/27666155
downvote count: 4
has title: Is is possible to do an element attribute change as part of an animation chain?
has comment: http://stackoverflow.com/comment/43741227
answer count: 1
has comment: http://stackoverflow.com/comment/43747307
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43741175
has comment: http://stackoverflow.com/comment/43741134
has comment: http://stackoverflow.com/comment/43746482
has comment: http://stackoverflow.com/comment/43746454
has body: I'm trying to create a jQuery animation sequence where an image is swapped. I'm able to do what I want using callbacks, but not using a promise. Any suggestions? Here's the example code showing a callback method that works, and a promise chain that doesn't. var img1 = "[binary]"; var img2 = "[binary]"; $('#button1').on('click', function() { animation1(); }); function animation1(){ var image1 = $(" ", { css : { position : 'absolute', left : '0px', top : '0px', }, src : img1 }); $("#animationcontainer").append(image1); image1.fadeOut('slow', function () { image1.attr('src', img2); image1.fadeIn('slow'); }); } $('#button2').on('click', function() { animation2(); }); function animation2(){ var image1 = $(" ", { css : { position : 'absolute', left : '50px', top : '0px', }, src : img1 }); $("#animationcontainer").append(image1); return image1.animate({opacity: 0}, "slow") .attr("src", img2) .animate({opacity: 1}, "slow") .promise(); } Animation 1 Animation 2
linked to: http://stackoverflow.com/q/26939524
has comment: http://stackoverflow.com/comment/43740834
has comment: http://stackoverflow.com/comment/43746473
has answer: http://stackoverflow.com/a/27666155
has comment: http://stackoverflow.com/comment/43741959
score: -3
tagged with: animation
has comment: http://stackoverflow.com/comment/43741024
upvote count: 1

http://stackoverflow.com/comment/43813543
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27700026
has text: Since the request is cross domain. Either your server should be configured with CORS, or should be able to handle JSONP request from client. You have not detailed about the server impelmentation.

http://stackoverflow.com/comment/43844841
type: AnswerComment
has text: @user1027620 [Yes, it should work on those (click "Show all")](http://caniuse.com/#search=table)
comment on: http://stackoverflow.com/a/27716314
type: Comment
score: 0

http://stackoverflow.com/comment/43722764
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27652922
type: Comment
has text: Yep, thats why you dont want to do var timeoutID = within a deeply nested function because you'll never be able to retrieve what that ID actually is unless its declared in a function within the same scope as the processing of clearTimeout (or you use external storage)

http://stackoverflow.com/a/43028804
upvote count: 3
answers question: http://stackoverflow.com/q/27754101
score: 3
has body: Since it sounds like you only need to change the previous icon back to the original, I wouldn't recommend looping through every marker. In a map with a lot of markers, this could become quite heavy. Instead, I would store the active marker in a variable on the click event, and just update that one when it changes. var marker; var activeMarker; var iconDefault = iconBase + 'Stock%20Index%20Up.png'; var iconSelected = 'https://cdn3.iconfinder.com/data/icons/musthave/24/Stock%20Index%20Down.png'; for (i = 0; i &lt; locations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: iconDefault }); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(locations[i][0], locations[i][6]); infowindow.open(map, marker); // check to see if activeMarker is set // if so, set the icon back to the default activeMarker &amp;&amp; activeMarker.setIcon(iconDefault); // set the icon for the clicked marker marker.setIcon(iconSelected); // update the value of activeMarker activeMarker = marker; } })(marker, i)); }
downvote count: 0
type: Answer

http://stackoverflow.com/comment/44011098
type: QuestionComment
has text: And what isn't working with your code?
comment on: http://stackoverflow.com/q/27801153
score: 0
type: Comment

http://stackoverflow.com/comment/43969782
comment on: http://stackoverflow.com/q/27668501
score: 0
has text: This question seems to have gone unnoticed.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27792109
has comment: http://stackoverflow.com/comment/43993876
has title: JavaScript: Deep Copy Image() Object
has comment: http://stackoverflow.com/comment/44026483
type: AnsweredQuestion
tagged with: object
has comment: http://stackoverflow.com/comment/44010228
has body: I have this object merging function: function merge( obj1, obj2 ) { var result = {}; for( var prop in obj1 ) { if( obj2.hasOwnProperty(prop) ) { if( 'object' === typeof obj1[prop] &amp;&amp; 'object' === typeof obj2[prop] ) { result[prop] = merge( obj1[prop], obj2[prop] ); } else { result[prop] = obj2[prop]; } } else { result[prop] = obj1[prop]; } } return result; }; The purpose of this function is to merge two objects into one, overriding the values of obj1 with those of obj2, if exists. It works fine with most objects, however when I try to use it to merge two Image() objects, I'm thrown into an infinite loop. For example: merge(new Image(), new Image()) results in: Uncaught RangeError: Maximum call stack size exceeded I think it has something to do with the object's events, but I'm not sure. Why do you think this is this happening, and how can this function be improved to fix this issue?
type: Question
accepted answer: http://stackoverflow.com/a/27792235
has comment: http://stackoverflow.com/comment/43993923
tagged with: javascript
has comment: http://stackoverflow.com/comment/43993828
score: 0
tagged with: deep-copy
has answer: http://stackoverflow.com/a/27792235
answer count: 1
has comment: http://stackoverflow.com/comment/43993894
has comment: http://stackoverflow.com/comment/43993862

http://stackoverflow.com/a/27711109
accepted answer of: http://stackoverflow.com/q/27710585
has comment: http://stackoverflow.com/comment/43838065
answers question: http://stackoverflow.com/q/27710585
has comment: http://stackoverflow.com/comment/43837285
has comment: http://stackoverflow.com/comment/43834518
has comment: http://stackoverflow.com/comment/43834270
has comment: http://stackoverflow.com/comment/43836830
has comment: http://stackoverflow.com/comment/43837904
type: AcceptedAnswer
has body: I added the fix to http://jsfiddle.net/20dw5ex8/6 use jquery show() and hide() functions. Like $('#export-div').show(); or $('#export-div').hide(); you can set your div hidden at the beginning Click Me and show it when the ajax call is returned.
has comment: http://stackoverflow.com/comment/43835129
has comment: http://stackoverflow.com/comment/43837075
score: 0
has comment: http://stackoverflow.com/comment/43834188
type: Answer

http://stackoverflow.com/comment/43755407
has text: @NPE ten. I've just run it on chrome console
type: QuestionComment
comment on: http://stackoverflow.com/q/27670312
score: 0
type: Comment

http://stackoverflow.com/comment/43757643
type: QuestionComment
has text: never _ever_ use HTML serialisation and deserialisation to manipulate DOM nodes - move the nodes directly.
comment on: http://stackoverflow.com/q/27671053
score: 0
type: Comment

http://stackoverflow.com/q/27700561
favorite count: 0
has answer: http://stackoverflow.com/a/27700811
has body: I need to get value of according to checked checkbox... using HTML and jQuery or Javascript I have tried following code: jQuery code: HTML markup: No Name City Check 1 select select select 2 select select select 3 select select select 4 select select select I need to get value of of any row which checkbox is checked and I require multiple values also if multiple checkboxes are checked...
answer count: 5
upvote count: 1
tagged with: checkbox
downvote count: 1
has answer: http://stackoverflow.com/a/27700624
has answer: http://stackoverflow.com/a/27700930
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43814083
has comment: http://stackoverflow.com/comment/43814087
has comment: http://stackoverflow.com/comment/43813963
has title: Getting value of according to checked checkbox
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27700654
possible better answer: http://stackoverflow.com/a/27700624
accepted answer: http://stackoverflow.com/a/27700811
has answer: http://stackoverflow.com/a/27701017
score: 0
has comment: http://stackoverflow.com/comment/43813902
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27721272
downvote count: 0
has title: Is there a way to cause a Grunt plugin to fail if input files are missing?
tagged with: javascript
favorite count: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/27721484
has body: I've been working with the Grunt cssmin plugin. I had a block in my Gruntfile which looks approximately like this: cssmin: { target: { files: { '&lt;%= config.target %&gt;/mytarget.css': [ 'bower_components/normalize.css/*.css', 'bower_components/html5-boilerplate/css/main.css', '&lt;%= config.src %&gt;/css/*.css' ] } } } For a while this was working fine; but I moved this to another machine and didn't set up my bower components correctly - the html5-boilerplate/css/main.css file was missing - and yet the task still completed successfully. In fact, I can put completely fake paths in that array and the minification still completes. Is there a way, in general, to cause Grunt to fail and quit if files are missing from an array like this? (I'm not sure if the files array is a general Grunt concept or one provided by cssmin). If not, is there a way to cause this specific plugin to fail? (By the way, I am aware that HTML5 Boilerplate is probably somewhat old-fashioned these days, but I'm in the process of migrating an old site. I've also fixed my Bower install process so that it's run before this step automatically now. I'd still like to understand a more general solution to the problem of missing files, though).
has answer: http://stackoverflow.com/a/32655933
has answer: http://stackoverflow.com/a/27721484
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/55688385
type: Question
upvote count: 9
accepted answer: http://stackoverflow.com/a/32655933
tagged with: gruntjs
score: 9

http://stackoverflow.com/q/27678442
score: 0
has comment: http://stackoverflow.com/comment/43771741
has title: Call jstl in java script error
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43772291
tagged with: jstl
has body: I'm trying to run a jstl query when i click submit button in webpage(jsp). (I'm developing web application on net beans using glassfish server) Here is my code. Jsp java script. I know this code is wrong.But im new to this . Just started learning .any help would be great.
answer count: 0
tagged with: jsp
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/43772267

http://stackoverflow.com/q/27748888
has title: twig_js bundle with Symfony 2.3
answer count: 1
accepted answer: http://stackoverflow.com/a/28266206
tagged with: symfony
has comment: http://stackoverflow.com/comment/43919256
has body: I install the twig_js bundle : https://github.com/schmittjoh/JMSTwigJsBundle/blob/master/Resources/doc/index.rst I use packagist: https://packagist.org/packages/jms/twig-js-bundle I have this code in my layout : {% javascripts '@AcmeFooBundle/Resources/public/js/ajax.js' filter='twig_js, ?yui_js' %} &lt;script type="text/javascript" src="{{ asset_url }}"&gt;&lt;/script&gt; {% endjavascripts %} But when I try to dump my assets with this command line: php app/console assetic:dump I have this error: [InvalidArgumentException] Template name "Resources/public/js/ajax.js" is not valid (format is "bundle :section:template.format.engine"). Here the assetic configuration of the app/config.yml file: # Assetic Configuration assetic: debug: "%kernel.debug%" use_controller: false bundles: - AcmeFooBundle - JMSTwigJsBundle filters: yui_js: jar: "%kernel.root_dir%/Resources/java/yuicompressor.jar" twig_js: resource: "%kernel.root_dir%/../vendor/jms/twig-js-bundle/JMS/TwigJsBundle/Resources/config/services.xml" apply_to: "\.twig$" cssrewrite: ~ #java: /usr/bin/java #closure: # jar: "%kernel.root_dir%/Resources/java/compiler.jar" #yui_css: # jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar" Anyone have an idea about this ? Thank you by advance.
type: AnsweredQuestion
tagged with: twig
has comment: http://stackoverflow.com/comment/43916650
type: Question
has answer: http://stackoverflow.com/a/28266206
tagged with: javascript
score: 0

http://stackoverflow.com/comment/85228400
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27724488
has text: This does not work with the official fb login butotn https://developers.facebook.com/docs/plugins/like-button#configurator even though it works with a custom button as in the example. Any idea?

http://stackoverflow.com/comment/43855990
score: 0
type: AnswerComment
has text: So I have updated the code you have kindly provided and I can see why you have changed what you did. However, I am still getting undefined as mentioned above...?
type: Comment
comment on: http://stackoverflow.com/a/27722033

http://stackoverflow.com/a/27780268
accepted answer of: http://stackoverflow.com/q/27774464
type: Answer
has comment: http://stackoverflow.com/comment/43970803
has comment: http://stackoverflow.com/comment/44006239
has comment: http://stackoverflow.com/comment/43970561
score: 0
type: AcceptedAnswer
has body: You can send the same input name values into the AJAX $("#submit").on("click", function(e){ var form_data = $('#frm_id').serialize(); $.ajax({ type: "POST", url: serverURL + "/php/sendRequestProcess.php", data: form_data, dataType: "json", success: function(response){ //data - response from server error: function (jqXHR, textStatus, errorThrown) { } }); }); form_data: can be an array or name value pairs. success: callback function is called when the AJAX POST is successful error: callback function is called when the AJAX POST is failed To handle JSON data, set dataType=”json”
has comment: http://stackoverflow.com/comment/44005936
has comment: http://stackoverflow.com/comment/44006479
answers question: http://stackoverflow.com/q/27774464

http://stackoverflow.com/comment/43822823
has text: But why not `run-sequence`? If you care about "bloating Gulpfile" you can create additional files and `require` them.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27704727

http://stackoverflow.com/comment/43810327
comment on: http://stackoverflow.com/q/27688496
score: 0
has text: It's getting into the if statement successfully.I think maybe the reason is that click event attaching to body element in the implementation of backbone.js.So stopImmediatePropagation() can solve my problem
type: Comment
type: QuestionComment

kendonumerictextbox
type: Tag
tag name: kendonumerictextbox
tags question: http://stackoverflow.com/q/27729624
tags question: http://stackoverflow.com/q/27692143

http://stackoverflow.com/comment/43854068
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27719443
has text: What does {Game} actually mean?

http://stackoverflow.com/comment/43738216
comment on: http://stackoverflow.com/q/27661190
score: 0
type: Comment
type: QuestionComment
has text: That would be called an attack ...

http://stackoverflow.com/q/27678592
type: Question
tagged with: javascript
has title: Pin Markers with D3js
upvote count: 1
has body: I'm implementing a map that will markers by latitude and longitude. I'm using D3Js to create svg from a topojson file. This is the implementation: var places = [ { name: "Longo, England", location: { latitude: 51.5, longitude: -0.116667 } }, { name: "Dublin, Irland", location: { latitude: 53.428590, longitude: -6.188024 } } ] var margin = {top: 10, left: 10, bottom: 10, right: 10}; var width = parseInt(d3.select('#map').style('width')); width = width - margin.left - margin.right; var mapRatio = 1; var height = width * mapRatio; var svg = d3.select("#map").append("svg") .attr("width", width) .attr("height", height); d3.json("data/uk.json", function(error, uk) { if (error) return console.error(error); var subunits = topojson.feature(uk, uk.objects.subunits); var projection = d3.geo.mercator() .center([0, 55.4]) .rotate([4.4, 0]) .scale(500) .translate([width / 2, height / 2]); var path = d3.geo.path() .projection(projection); svg.append("path") .datum(subunits) .attr("d", path) .attr("class", "subunit-boundary IRL"); svg.selectAll(".subunit") .data(topojson.feature(uk, uk.objects.subunits).features) .enter().append("path") .attr("class", function(d) { return "subunit " + d.id; }) .attr("d", path); svg.selectAll(".pin") .data(places) .enter() .append('image') .attr('class', 'datamaps-pin') .attr('xlink:href', 'http://a.tiles.mapbox.com/v3/marker/pin-m+7e7e7e@2x.png') .attr('height', 40) .attr('width', 40) .attr("transform", function(d) { return "translate(" + projection([ d.location.longitude, d.location.latitude ]) + ")" }); However the pins are out of position. When I change the markers for simple points, it shall be in the right position svg.selectAll(".pin") .data(places) .enter().append("circle", ".pin") .attr("r", 5) .attr("transform", function(d) { return "translate(" + projection([ d.location.longitude, d.location.latitude ]) + ")" });
answer count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27685408
tagged with: http://stackoverflow.com/tag/svg
downvote count: 0
tagged with: d3.js
score: 1

http://stackoverflow.com/comment/43777971
comment on: http://stackoverflow.com/a/27681250
score: 0
type: AnswerComment
type: Comment
has text: Nice. I tried using minWidth for resizable, but it only limits left div. Is it possible to limit both div?

http://stackoverflow.com/a/75192161
has body: To disable all rules on a specific line: // @ts-ignore $scope.someVar = ConstructorFunction();
upvote count: 8
type: Answer
answers question: http://stackoverflow.com/q/27732209
downvote count: 1
has comment: http://stackoverflow.com/comment/134848517
has comment: http://stackoverflow.com/comment/134624449
score: 7

http://stackoverflow.com/q/27744260
tagged with: ddp
answer count: 2
has answer: http://stackoverflow.com/a/27745325
downvote count: 0
tagged with: javascript
score: 1
tagged with: meteor
favorite count: 0
tagged with: protocols
has title: Using Ember.js with DDP / Meteor backend
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/36447877
tagged with: ember.js
has body: After past experience with Laravel and Backbone, I've recently gotten into contact with Ember.js and Meteor (for different projects). I really like Ember.js for its structured, route-based approach and for its open and forward-thinking community. On the other hand, I really like Meteor for its simplicity; how fast you can get something working. There is one thing that I really love about Meteor, which is the DDP Protocol. The reason I ended up using Meteor for a project was because I wanted the best Websocket solution, and DDP's simple combination of RPC for client->server and PubSub for server->client is absolutely brilliant. Would it be possible to connect Ember.js with a Meteor backend, and how would I go about doing this?
upvote count: 1
type: Question

http://stackoverflow.com/comment/43819638
score: 0
comment on: http://stackoverflow.com/a/27697613
type: Comment
has text: Let us know how you get on with debugging, @TrueCode.
type: AnswerComment

http://stackoverflow.com/a/27713732
type: Answer
answers question: http://stackoverflow.com/q/27713591
downvote count: 0
has comment: http://stackoverflow.com/comment/43840146
score: 1
has comment: http://stackoverflow.com/comment/43840269
upvote count: 1
has comment: http://stackoverflow.com/comment/43840255
type: AcceptedAnswer
has body: I would change the way you're implementing this a bit. Instead of using a different inline click event handlers for each rectangle, delegate a single click event programmatically to all rectangles. To differentiate which character should be appended, you can add data attributes to your rectangles that contain the character they represent and retrieve their values in the click handler. To handle physical keyboard input, you have a separate event binding specifically for that. Here's a working example of how I would approach this, with some comments for clarification on what it's doing. function yourOtherFunction(input) { console.log('You typed a "' + input + '"'); } $(function() { // Handle on-screen keyboard clicks (only on rects with a data-character // attribute present) $('svg rect[data-character]').click(function() { // Retrieve the "data-character" attribute value var character = $(this).data('character'); // Modify the value of the textarea by appending the character $('#text').val(function(i, old) { return old + character; }); // Call your other function yourOtherFunction(character); }); // Handle physical keyboard key presses: $('#text').keypress(function(e) { // Retrieve the character representation of the event's key code var character = String.fromCharCode(e.which); // Call your other function yourOtherFunction(character); }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;svg width="60px" height="60px"&gt; &lt;rect width="50" height="50" data-character="a" /&gt; &lt;/svg&gt; &lt;svg width="60px" height="60px"&gt; &lt;rect width="50" height="50" data-character="b" /&gt; &lt;/svg&gt; &lt;textarea id="text"&gt;&lt;/textarea&gt;
has comment: http://stackoverflow.com/comment/43840098
has comment: http://stackoverflow.com/comment/43840347
accepted answer of: http://stackoverflow.com/q/27713591

http://stackoverflow.com/comment/43853293
type: QuestionComment
comment on: http://stackoverflow.com/q/27719945
has text: @MiroslavMocek Ok I now switched my client script on the end of my page and I am getting an error message. I would appreciate your reply!
score: 0
type: Comment

http://stackoverflow.com/a/27749644
answers question: http://stackoverflow.com/q/27748931
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43910864
downvote count: 0
has comment: http://stackoverflow.com/comment/43910766
type: Answer
has body: I think no way, because attributes attr consumes only strings. Workable solution might be the following: Then, attach listener to the polymer and catch succEventTrigger var fooBar = document.querySelector('foo-bar'); sayHello.addEventListener('foo-bar-done', function(e) { alert('hi'); }); and polymer:
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27748931

http://stackoverflow.com/comment/43978283
score: 0
comment on: http://stackoverflow.com/q/27784072
type: QuestionComment
type: Comment
has text: You shoul play with angular.js before starting an app. Read documentations, try create simple aplication, hello world app, use $http, $timeout, dependency injection etc. I think it is not the right time to start developing app with angular.js

http://stackoverflow.com/comment/43882957
type: AnswerComment
has text: unless he-she is using a CDN to deliver CSS the best solution is to find where the selector gets defined
type: Comment
comment on: http://stackoverflow.com/a/27735113
score: 0

http://stackoverflow.com/comment/43722575
comment on: http://stackoverflow.com/a/27652618
score: 0
type: AnswerComment
has text: Adding `LIMIT 1` won't change anything. He's only calling `mysql_fetch_assoc` once, so even if it returns multiple rows, he only uses the first one.
type: Comment

http://stackoverflow.com/q/27757666
linked to: http://stackoverflow.com/q/27889930
has body: I installed the "selectize-rails" gem into my rails app, and I'm trying to get it to work. I keep getting this error in my web console: TypeError: $(...).selectize is not a function and nothing happens in the browser. Here's the code I have so far, following the "Email Contacts" example from this page: http://brianreavis.github.io/selectize.js/ views/emails/new.html.erb application.html.erb <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> <%= javascript_include_tag "application", "data-turbolinks-track" => true %> <%= csrf_meta_tags %> <%= javascript_include_tag "jquery.endless-scroll" %> <%= yield(:head) %> javascripts/application.js //= require jquery //= require jquery_ujs //= require jquery-ui //= require bootstrap //= require turbolinks //= require selectize //= require_tree . Selectize.js seems to be included in my application: this is the from my page source: Gemfile: source 'https://rubygems.org' ruby '2.0.0' gem 'rails', '4.0.10' gem 'bootstrap-sass', '~> 2.3.2.0' gem 'sprockets', '~> 2.12' gem 'chosen-rails' gem 'bcrypt', '~> 3.1.7' gem 'therubyracer' gem 'sass-rails', '4.0.5' gem 'uglifier', '~> 2.1.1' gem 'coffee-rails', '~> 4.0.1' gem 'jquery-rails', '~> 2.3.0' gem 'turbolinks', '~> 1.1.1' gem 'jbuilder', '~> 1.0.2' gem 'libv8', '3.16.14.7' gem 'yaml_db_improved' gem 'selectize-rails' group :development, :test do gem 'sqlite3', '~> 1.3.8' gem 'rspec-rails', '~> 2.13.1' end group :test do gem 'selenium-webdriver', '~> 2.35.1' gem 'capybara', '~> 2.1.0' end group :doc do gem 'sdoc', '~> 0.3.20', require: false end group :production do gem 'rails_12factor', '~> 0.0.2' end config/environments/production.rb: Website::Application.configure do config.cache_classes = true config.eager_load = true config.consider_all_requests_local = false config.action_controller.perform_caching = true config.serve_static_assets = false config.assets.js_compressor = :uglifier config.assets.compile = false config.assets.digest = true config…
has comment: http://stackoverflow.com/comment/43961461
has comment: http://stackoverflow.com/comment/43981046
tagged with: selectize.js
tagged with: ruby-on-rails
downvote count: 1
has comment: http://stackoverflow.com/comment/44061463
has title: TypeError: $(...).selectize is not a function
has comment: http://stackoverflow.com/comment/43961680
has comment: http://stackoverflow.com/comment/44171326
has comment: http://stackoverflow.com/comment/43940932
has comment: http://stackoverflow.com/comment/44115562
has answer: http://stackoverflow.com/a/27832618
has comment: http://stackoverflow.com/comment/44159227
tagged with: rubygems
score: 7
has comment: http://stackoverflow.com/comment/44181855
has comment: http://stackoverflow.com/comment/44156994
has answer: http://stackoverflow.com/a/39424638
has comment: http://stackoverflow.com/comment/44164902
has comment: http://stackoverflow.com/comment/44141459
has comment: http://stackoverflow.com/comment/44159005
has comment: http://stackoverflow.com/comment/44162895
type: Question
has comment: http://stackoverflow.com/comment/43953818
has comment: http://stackoverflow.com/comment/44067898
has comment: http://stackoverflow.com/comment/43929562
has comment: http://stackoverflow.com/comment/44070753
has comment: http://stackoverflow.com/comment/43926028
has comment: http://stackoverflow.com/comment/43929686
has comment: http://stackoverflow.com/comment/44162416
tagged with: javascript
has comment: http://stackoverflow.com/comment/44159147
tagged with: jquery
has comment: http://stackoverflow.com/comment/43952934
has comment: http://stackoverflow.com/comment/44140084
has comment: http://stackoverflow.com/comment/44153587
has comment: http://stackoverflow.com/comment/44159646
has comment: http://stackoverflow.com/comment/44159381
answer count: 3
has comment: http://stackoverflow.com/comment/44010010
has comment: http://stackoverflow.com/comment/44180240
has comment: http://stackoverflow.com/comment/43961245
has comment: http://stackoverflow.com/comment/43981226
linked to: http://stackoverflow.com/q/27637820
has comment: http://stackoverflow.com/comment/44140151
has answer: http://stackoverflow.com/a/42229321
has comment: http://stackoverflow.com/comment/43940942
has comment: http://stackoverflow.com/comment/44157835
has comment: http://stackoverflow.com/comment/44154115
has comment: http://stackoverflow.com/comment/43943572
favorite count: 0
has comment: http://stackoverflow.com/comment/43935819
upvote count: 8
has comment: http://stackoverflow.com/comment/44158926
has comment: http://stackoverflow.com/comment/44158560
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44180161

intervals
tags question: http://stackoverflow.com/q/27680703
type: Tag
tag name: intervals

http://stackoverflow.com/a/27649764
upvote count: 4
accepted answer of: http://stackoverflow.com/q/27649693
has body: No, there can be no race condition. The asynchronous task could complete before you start listening to the event, but that doesn't matter. The completion of the task creates an event, and that event won't be handled until the function (or code block) ends and the control is returned to the browser.
type: AcceptedAnswer
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/27649693
type: Answer

http://stackoverflow.com/a/27702606
has body: You have to add a listener for checkbox to show the progress bar $('input#'+obj.value).change( function(){ if (this.checked) { $('.pbar').css('display','block'); /*Rest of your code*/ } else { $('.pbar').css('display','none'); } }); Here is the updated JSFiddle
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27702271

http://stackoverflow.com/comment/43822365
comment on: http://stackoverflow.com/q/27703320
type: Comment
type: QuestionComment
has text: You can try to use a scroll, jscrollpane for example
score: 0

http://stackoverflow.com/a/27662960
score: 1
has comment: http://stackoverflow.com/comment/43742864
upvote count: 1
has comment: http://stackoverflow.com/comment/43741923
has comment: http://stackoverflow.com/comment/43741953
downvote count: 0
has comment: http://stackoverflow.com/comment/43742787
type: Answer
answers question: http://stackoverflow.com/q/27662882
has comment: http://stackoverflow.com/comment/43742475
has body: This might help: $( document ).ready(function(){ $('html, body').animate({ scrollTop: $(document).height() }, 0); $('html, body').animate({ scrollTop: 0 }, 1000); }); Here is the working example: http://jsfiddle.net/xvafa479/

http://stackoverflow.com/comment/44007665
has text: you need to listen to `.blur()` as well to remove the class
score: 1
comment on: http://stackoverflow.com/q/27799613
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/49510327
comment on: http://stackoverflow.com/a/30710031
has text: It seems to be a wrong code for this task as we may have many users, sorry for this!
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43885181
type: Comment
comment on: http://stackoverflow.com/a/27736836
has text: Thanks! I figured that out searching the web... However, PhantomJS still doesn't get the info I need from the page. Maybe you know what could be wrong? Here's another question I posted regarding this issue: http://stackoverflow.com/questions/27736883/phantomjs-how-to-get-googles-knowledge-graph-people-also-search-for-content Thank you!
score: 0
type: AnswerComment

http://stackoverflow.com/q/27648531
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27648594
downvote count: 0
tagged with: button
favorite count: 0
type: Question
score: 5
has body: I have created a button with CSS like this: Click me! Now I don't know how I can execute a javascript function when this button is clicked?! onClick like for HTML buttons doesn't work here. Can you please help me? Thank you! EDIT: This is what I have basically: The HTML Kaufe Arbeiter Neither onClick nor onclick do work. The javascript function farmArbeiter() { alert("it works");}
has comment: http://stackoverflow.com/comment/43714402
tagged with: css
has comment: http://stackoverflow.com/comment/43714390
has comment: http://stackoverflow.com/comment/43714366
answer count: 3
possible better answer: http://stackoverflow.com/a/27648589
has answer: http://stackoverflow.com/a/27648589
has comment: http://stackoverflow.com/comment/43714340
upvote count: 5
has answer: http://stackoverflow.com/a/27648553
tagged with: javascript
has answer: http://stackoverflow.com/a/27648594
has title: CSS Button calling a javascript function

http://stackoverflow.com/a/27730110
has comment: http://stackoverflow.com/comment/43873719
type: Answer
answers question: http://stackoverflow.com/q/27729822
has comment: http://stackoverflow.com/comment/43873761
has comment: http://stackoverflow.com/comment/43873712
accepted answer of: http://stackoverflow.com/q/27729822
has body: I ll prefer doing it this way : $("select").on('focus', function () { previous = this.value; }).change(function() { $("select[value="+$(this).val()+"]").not(this).val(previous); }); Whenever the user choose a value, you select the &lt;select&gt; element with the same value and switch them. Moreover, there is a restriction. You have to load the page with distinctive values for each select element as I did in the fiddle below. Fiddle The previous variable gets the old value of the select before change, so you can use it to set the value of the select which have the same value as your target select.
score: 0
upvote count: 1
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/43873847

http://stackoverflow.com/a/27708135
accepted answer of: http://stackoverflow.com/q/27694167
score: 2
has body: WebGL defines vertices and faces with coordinates, colors, and normals. A face normal is a normalized vector, perpendicular to the face plane (and generally pointing 'outside' the mesh). It defines its orientation and enables calculation of lightning for instance. In three.js you can access it via face.normal. If your floor-like faces are stricly horizontal, then their normals are all precisely {x:0,y:1,z:0}. And since normals are normalized, simply check whether face.normal.y === 1 also checks that x and y equal 0. If your faces are not strictly horizontal, you may need to set a limit angle with the y-axis. You can calculate this angle with var angle=Math.acos(Yaxis.dot(faceNormal)) where Yaxis=new THREE.Vector3(0,1,0).
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27694167
upvote count: 2

http://stackoverflow.com/q/27668926
has answer: http://stackoverflow.com/a/27691250
has answer: http://stackoverflow.com/a/29956561
type: Question
upvote count: 4
possible better answer: http://stackoverflow.com/a/44876161
accepted answer: http://stackoverflow.com/a/27691250
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
answer count: 3
favorite count: 0
has title: How can I parse gridstack.js items?
type: AnsweredQuestion
has body: Maybe this is quite simple, but I'm still learning JS and stuff. I'm using the plugin https://github.com/troolee/gridstack.js and want to send ajax requests whenever a widget gets repositioned/resized. I wrote this (according to the official readme): var serialize_widget_map = function (items) { console.log(items); }; // onchange position/size $('.grid-stack').on('change', function (e, items) { console.log(items); }); Just to see what the console says: [Object, Object] - maybe because I have 2 widgets on page, but I have to notice that this quantity may vary (widgets might be removed/added dynamically). How can I "parse" this "items" thing so I can access properties of the widgets?
has answer: http://stackoverflow.com/a/44876161

http://stackoverflow.com/comment/43875012
has text: Thanks for the feedback! I agree with you
comment on: http://stackoverflow.com/q/27731484
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43918577
has text: am i missing something?
type: Comment
comment on: http://stackoverflow.com/a/27753419
type: AnswerComment
score: 0

http://stackoverflow.com/a/27707120
score: 1
downvote count: 0
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27707032
has body: As suggested by tymeJV, remove the , in the jQuery selector. Try this: $('p:lt(5) [src$="'+a+'"]').replaceWith('&lt;img src="images/backcard.png" width = 118, height = 166, border=3, style = "border-color: #FFFFFF;" /&gt;');

http://stackoverflow.com/q/27686851
type: Question
upvote count: 2
has title: jQuery Waypoints handles the first element with a specified class only
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27725537
downvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27725537
has body: I am trying to implement the jQuery Waypoints plugin to add an .active class to any element with a .foo class as it gets into the viewport: &lt;div class="foo"&gt;&lt;/div&gt; &lt;div class="foo"&gt;&lt;/div&gt; var inview = new Waypoint.Inview({ element: $('.foo')[0], entered: function(direction) { $(this.element).addClass("active"); } }); JS Fiddle: http://jsfiddle.net/g6mouxnd/ The example above will add the .active class to the first .foo container only. How do I make it work for the second and any subsequent .foo container as well?
score: 2
type: AnsweredQuestion
tagged with: jquery-waypoints

http://stackoverflow.com/a/27758113
upvote count: 1
score: 1
downvote count: 0
type: Answer
has body: Do you have a Code pen account? Working on this side. Try this link. http://codepen.io/dfrierson2/pen/RNoWZe Dropdown trigger Oculistica Venturino
answers question: http://stackoverflow.com/q/27737707

http://stackoverflow.com/comment/43954779
type: AnswerComment
comment on: http://stackoverflow.com/a/27770106
type: Comment
has text: When you say global data, what do you mean? A model with all of the current user's data or a model with every users data? If the former you'd use one URL to fetch the user's data and one URL to persist the data (not necessarily the same). THe URLs are nothing more than a command to your back-end controller specifying what business/data layer rules to implement. If you're fetching data from a specific user, or updating data for a specific user, you'd want to pass in that user's id to the controller. Then the controller would perform the specific fetch/update routine for that user.
score: 0

http://stackoverflow.com/comment/43853313
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27720750
has text: So shortly put you want to clip/crop the background image?

http://stackoverflow.com/a/36024501
downvote count: 0
answers question: http://stackoverflow.com/q/27771631
upvote count: 2
has body: This works for the x axis: &lt;%= line_chart @model.group(:created_at).count, library: { hAxis: { format: 'MM/dd' } } %&gt;
type: Answer
score: 2

http://stackoverflow.com/q/27650834
has comment: http://stackoverflow.com/comment/43718853
has answer: http://stackoverflow.com/a/27650875
tagged with: events
accepted answer: http://stackoverflow.com/a/27650871
possible better answer: http://stackoverflow.com/a/27650875
upvote count: 2
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27650871
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has title: How to rewrite using preventDefault instead of return false?
favorite count: 0
has body: Just so I get a better understanding of how to write preventDefault as opposed to return false. Here is an example of return false. I would like to rewrite this code using preventDefault My HTML: Enter your Name: Enter your Age: Please Select Your Favorite Fruit Select A Fruit Bannana Kiwi Mango Apple Cherry My JavaScript function validateForm() { var x = document.forms["myForm"]["age"].value; var x2 = document.forms["myForm"]["fruit"].value; if ((x==null || x=="") || (x2 == null || x2=="nothing")) { alert("Age and fruit selection must be filled out"); return false; } }

http://stackoverflow.com/comment/43701756
comment on: http://stackoverflow.com/q/27641485
score: 0
type: Comment
type: QuestionComment
has text: not sure, my understanding is that a listener is added to this which is a parent of the child nodes where 'core-select' will be fired. since the event should bubble up, this event listener should catch the childs 'core-select' event when fired, with a reference to that child. This does seem to work how I assume it will. If my understanding is completely wrong, please correct me.

http://stackoverflow.com/q/27747713
has comment: http://stackoverflow.com/comment/43908189
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43906667
has comment: http://stackoverflow.com/comment/43908203
has body: In my incremental game code someone asked me to replace my anchors with divs or spans. I tried this but then I was no longer able to click on my "tabs" to cycle through content. is there another way to get rid of the anchors so the page does not move down each time an anchored href is clicked. example index: LOCATIONS CRAFTING UPGRADES STATS example css: .tabs a { text-decoration: none; display: block; background: #000000; padding: 0.10em 0.80em; color: #145266; width: 6em; text-align: center; } I tried replacing the a with div but then the clickable area became dormant. But when I used the same method to replace the anchored content in the "tabInner" Everything worked fine because all my content inside has an onclick="CONTENT". Does this mean I have to make an onclick on locations, crafting, upgrades, and stats? Source Code - http://hexmerchant.github.io/
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27751616
has comment: http://stackoverflow.com/comment/43906557
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43907861
has comment: http://stackoverflow.com/comment/43906920
has comment: http://stackoverflow.com/comment/43906841
has comment: http://stackoverflow.com/comment/43907879
has title: Clickable links without anchors
has comment: http://stackoverflow.com/comment/43906694
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43906631
tagged with: css
has comment: http://stackoverflow.com/comment/43906624
has answer: http://stackoverflow.com/a/27751616
tagged with: anchor
linked to: http://stackoverflow.com/q/796087

http://stackoverflow.com/q/27796019
tagged with: javascript
has comment: http://stackoverflow.com/comment/52033289
answer count: 1
downvote count: 0
has title: AngularJs element on change event
favorite count: 0
has answer: http://stackoverflow.com/a/36719921
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44000765
score: 3
has body: There is the following code: handleFileSelect = (evt) -> console.log(1) file = evt.currentTarget.files[0] reader = new FileReader() reader.onload = (evt) -> $scope.$apply ($scope) -> $scope.myImage = evt.target.result reader.readAsDataURL(file) angular.element(document.querySelector('#fileInput')).on('change', handleFileSelect) And HTML: Image: I want to get '1' in console after I change some file in #fileInput. But when I choose file I get nothing. How can I fix it? Thanks!
upvote count: 3
has comment: http://stackoverflow.com/comment/44001027
type: Question

http://stackoverflow.com/comment/43835590
score: 0
type: AnswerComment
has text: Thanks alot. It did the trick., SLaks also told me that this can't work. I feel stupid now.
type: Comment
comment on: http://stackoverflow.com/a/27711743

http://stackoverflow.com/q/27676455
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has title: How to generate interactive multi page graphics on the web?
has comment: http://stackoverflow.com/comment/43792523
has comment: http://stackoverflow.com/comment/43772019
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
has body: I want to create a web application / page that has 2D graphical content and where the user can interactively click on the graphics to interact / modify it there. Allowed languages are PHP and JavaScript, only modern browsers (Firefox and Chrome as well as Android and iOS) necessary. This is the easy part as it can be done with &lt;canvas&gt; or with SVG. But the problem arises that the result must be printable and the graphics is so big that it will span multiple pages. The page break must be closely controlled by the program and each page also get some defined frame / background. What would be the best technique to implement such an application? A &lt;canvas&gt; where the Print-View will use multiple &lt;canvas&gt; (content closely controlled by the application) and hope that the browser does the page break exactly between the canvases? Is there a way force the browser to do that? Or can that be done with SVG? SVG1.2 has multi page support but that got dropped for SVG2 AFAIK... (Additional note: if both would be possible, I'd prefer SVG as the content is highly vector orientated and when the user prints into a PDF it would generate a much nicer result)
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43798601
tagged with: javascript
has comment: http://stackoverflow.com/comment/43768842
tagged with: canvas
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43792649

http://stackoverflow.com/a/27799373
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27799125
has body: How about this? http://jsfiddle.net/stackmanoz/vymmb10s/ CSS- div[class^="box"]{ width:100px; height:100px; border:1px solid; display:inline-block; } jQuery- var colors = ['red', 'blue', 'green', 'gray', 'black', 'yellow']; $(function(){ $("#btn").click(function() { $('div[class^="box"]').each(function(){ var randomColor = Math.floor(Math.random() * colors.length) $(this).css('background-color', colors[randomColor]) }); }); });
downvote count: 0

http://stackoverflow.com/q/27728832
score: 0
answer count: 1
has title: Select Box Validation In angularJS
has answer: http://stackoverflow.com/a/27729038
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27729038
type: AnsweredQuestion
has body: I want to enable the save button on successfully validation: Assign Job Schedule Select Job {{job.jobName}} Save On successfull validation I am unable to get the enable button its always in disabled mode.. Please help me out or guide where I am doing mistake...
type: Question
tagged with: javascript

http://stackoverflow.com/q/27702418
has title: FormData ajax upload on IE8 -> alternatives and how it works
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43817992
upvote count: 3
has comment: http://stackoverflow.com/comment/43817947
has comment: http://stackoverflow.com/comment/43817523
has answer: http://stackoverflow.com/a/27718046
type: Question
score: 3
has comment: http://stackoverflow.com/comment/43818009
tagged with: internet-explorer-8
has answer: http://stackoverflow.com/a/34917038
has body: I'm tyring to upload a picture with ajax, so I'm using FormData, but it's not working with IE8. I've looked about it and it's not possible to use FormData with IE8, but I've found nothing I've been able to use instead in order to make it work on IE8 and other browser. Could someone tell me what to do please, and how to do it ? The form I'm trying to submit &lt;form id="addImgForm" name="addImgForm" method="post" action="#URL(Action('ChiliTest-ImageUpload'))#" enctype="multipart/form-data"&gt; &lt;input id="newImage" type="file" name="newImage"&gt; &lt;input type="hidden" name="MAX_FILE_SIZE" value="12345"&gt; &lt;span id="addImage" class="button-addImage" type="submit"&gt;&lt;isTradConstant keyword="l_customizationsChiliEditor_AddImageButtonTitle" template="CustomizationsChiliEditor" init="Ajouter"&gt;&lt;/span&gt; &lt;/form&gt; Called on addImgForm submit $.ajax({ url: myUrl, type: "POST", data: new FormData($(this).parent()[0]), contentType : false, async: false, processData: false, cache: false, success: function(data) { //do something } }); return false;
tagged with: javascript
has comment: http://stackoverflow.com/comment/43817503
linked to: http://stackoverflow.com/q/7899513
has answer: http://stackoverflow.com/a/27716197
has comment: http://stackoverflow.com/comment/43817431
answer count: 3
linked to: http://stackoverflow.com/q/10852446
downvote count: 0
tagged with: jquery
linked to: http://stackoverflow.com/q/15475215
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43818121

http://stackoverflow.com/q/27645619
type: Question
has comment: http://stackoverflow.com/comment/43709346
has answer: http://stackoverflow.com/a/53115000
score: 9
has comment: http://stackoverflow.com/comment/43709396
has answer: http://stackoverflow.com/a/55473259
tagged with: javascript
has comment: http://stackoverflow.com/comment/43709334
favorite count: 0
upvote count: 9
possible better answer: http://stackoverflow.com/a/55473259
has comment: http://stackoverflow.com/comment/43709361
has title: Javascript on key press trigger only once
accepted answer: http://stackoverflow.com/a/27645669
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43709367
has body: I don't know why this appears to be so difficult to figure out. I want to be able to execute code when a key is pressed and held but only once. Instead when I use onkeypress or onkeydown the function that I bound gets executed repeatedly which is not what I want. How can I have the handler be executed just once when the key is held down? Note: I don't want to embed logic into the function that will limit its execution, I want it not to be firing the event more than once no matter how long I hold the key. EDIT I Here is the demo and the code HTML 0 JS var counter = 0, div = document.getElementById('counter'); document.body.onkeypress = function(){ div.innerHTML = counter++; } Notice how when you press and hold any key the counter keeps going, I want it to count just once no matter how long I hold the key, and keep in mind the notice from above. EDIT II Sorry forgot to mention removing the listener is not acceptable, I need to increase the counter by 1 every time a key is pressed but no matter how long it's held.
downvote count: 0
has comment: http://stackoverflow.com/comment/43709343
has answer: http://stackoverflow.com/a/27646028
has answer: http://stackoverflow.com/a/27645669

mocha.js
tags question: http://stackoverflow.com/q/27784949
tags question: http://stackoverflow.com/q/27681354
tags question: http://stackoverflow.com/q/27790950
tags question: http://stackoverflow.com/q/27714398
tags question: http://stackoverflow.com/q/27784668
tag name: mocha.js
tags question: http://stackoverflow.com/q/27667547
type: Tag
tags question: http://stackoverflow.com/q/27803108
tags question: http://stackoverflow.com/q/27652868
tags question: http://stackoverflow.com/q/27736710
tags question: http://stackoverflow.com/q/27758833
tags question: http://stackoverflow.com/q/27789492
tags question: http://stackoverflow.com/q/27720881

http://stackoverflow.com/a/70548423
has body: This code works since 5.8.x version: $('.wpcf7').on('wpcf7invalid wpcf7spam wpcf7mailsent wpcf7mailfailed', function () { // your code here });
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27798264
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27798264
type: AcceptedAnswer

http://stackoverflow.com/a/27785863
accepted answer of: http://stackoverflow.com/q/27785046
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27785046
has body: You mention that you already use the copy task, but don't want to include this specific copying in your default task... so I would recommend using multiple targets in your config and just specifying which to perform in your default task array: grunt.initConfig({ copy: { js: { files: [{ expand: true, src: ['path/to/js/*.js'], dest: 'dest/js' }] }, otherstuff: { files: [{ expand: true, src: ['src/**'], dest: 'dest/' }] } }, // ... }); // notice that in our default task we specify "copy:js" grunt.registerTask('default', ['jshint', 'concat', /* etc, */ 'copy:js']); Now you can run ~$ grunt copy:otherstuff separately from ~$ grunt copy:js and when you just run ~$ grunt it will run the default task which only runs copy:js.

http://stackoverflow.com/comment/95134012
has text: This warning still appears even when the `async` option is not explicitly used because jQuery still sends a boolean representative to XMLHttpRequest.open(), defaulted to `true`. I've come to the conclusion that this is not an issue as I never explicitly set `async`, and the notice will stop occurring once the `async` option is removed from jQuery.
comment on: http://stackoverflow.com/a/27736383
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27652266
answer count: 1
tagged with: javascript
score: 0
has body: Please note: Since I'm not too familiar with coding terminology, I'll try my best to explain what I'm exactly going for! We first start with a page, for demonstration purposes, I'll call it one.html. The page is populated with divs. The div's width and height are measured by percentage, and have padding. These are responsive, too: Inside these divs are one.html content that range from images and text to nothing at all. I'll color-code one.html content in blue. The content are either on the left side or the right side of the div: Now heres the question: When a person scrolls up (purple circle represents mouse and touch), all the content scrolls up together, and the content for two.html (colored in red) scrolls in. In addition, the url goes from one.html to two.html: Technical stuff: to ensure one.html content and two.html content won't dangle in the divs, it'll automatically complete the scroll. For example, scroll in http://u-p.co/aesop/ -- see how it automatically completes it's scroll? Is this possible to do? Also, would it be a good idea if I start a jsfiddle? Thank you very much in advance :)
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/12522807
tagged with: css
type: UnansweredQuestion
tagged with: scroll
has title: Content inside figure scrolls together?
has answer: http://stackoverflow.com/a/27652585
type: Question

http://stackoverflow.com/comment/114419466
type: Comment
comment on: http://stackoverflow.com/q/27746304
has text: why doesn't `... instanceof Promise` work?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43720696
has text: *preventDefault* is part of the W3C event model, you don't need jQuery to call it, see [*Document Object Model (DOM) Level 3 Events Specification §3.2*](http://www.w3.org/TR/DOM-Level-3-Events/#event-flow-default-cancel). For IE, support was added in [*version 9*](http://msdn.microsoft.com/en-us/library/ie/ff975460(v=vs.85).aspx).
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27651427
type: AnswerComment

http://stackoverflow.com/comment/43936239
type: Comment
type: QuestionComment
has text: @user3263194 still null
comment on: http://stackoverflow.com/q/27762526
score: 0

http://stackoverflow.com/comment/90785773
type: AnswerComment
has text: @timkado works like expected: https://codepen.io/internetztube/pen/aaoLqM
score: 0
type: Comment
comment on: http://stackoverflow.com/a/37048027

http://stackoverflow.com/a/27708533
has body: change to this on your "-=220px": setInterval(function(){ $("#CObject").animate({ 'marginLeft' : "-=220px" //moves left }, 900); }, 900); to match 900 time interval, it's offset by 100.
answers question: http://stackoverflow.com/q/27708460
score: 4
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/43828883
has comment: http://stackoverflow.com/comment/43829015
has comment: http://stackoverflow.com/comment/43828921
has comment: http://stackoverflow.com/comment/43828873
type: Answer

http://stackoverflow.com/comment/43864746
score: 0
comment on: http://stackoverflow.com/q/27726278
type: Comment
type: QuestionComment
has text: As for what I've tried, that would be nothing. I'd like to find out if it's possible....hence, the question on a knowledge-based site with 800k+ users.

http://stackoverflow.com/comment/43896838
type: Comment
has text: I had to put field.value = value.replace(reg, '') under the alert and I got what I needed. Thanks!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27736708

http://stackoverflow.com/a/27736836
downvote count: 0
answers question: http://stackoverflow.com/q/27736747
type: Answer
has body: You can't using node's request as you are merely downloading the static content. In order to render JavaScript you have to use a browser. Fortunately there are headless browsers just for this purpose. I suggest PhantomJS.
has comment: http://stackoverflow.com/comment/43885181
upvote count: 2
score: 2

http://stackoverflow.com/q/27694003
favorite count: 0
has title: form validation in javascript vs html5
has answer: http://stackoverflow.com/a/27694038
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/43801319
tagged with: javascript
linked to: http://stackoverflow.com/q/8212041
upvote count: 1
accepted answer: http://stackoverflow.com/a/27694038
has comment: http://stackoverflow.com/comment/43801417
tagged with: validation
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/43801372
has body: During client-side form validation certain parts can be validated using html(using the required or type attribute in &lt;input>). I can achive those same things using js. So, what parts of the form validation should be done in js and what parts can be left for html? Which one is more safe?

http://stackoverflow.com/comment/43727536
has text: @Jai hope this will work ? $(this).next('span.name').hide();
comment on: http://stackoverflow.com/q/27655648
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43765816
type: Comment
has text: @IshfaqMuzaffar also it's of no help if you add HTML that is not relevant for your *Gallery*. By posting unnecessary code you just make people wonder *wth is that here for*. Strip the code to the essentials `.clear, #project-show, .w-arrows, .btn bla bla` are just noise.
type: QuestionComment
comment on: http://stackoverflow.com/q/27675377
score: 0

http://stackoverflow.com/comment/43891556
comment on: http://stackoverflow.com/q/27740378
has text: use:) `.live('click touchstart'`
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/43737719
comment on: http://stackoverflow.com/a/27660428
score: 1
type: AnswerComment
has text: When you use defaultValue with the input control in the ColorPicker component you are creating an uncontrolled component. To update it via prop you need a controlled component. see this: http://facebook.github.io/react/docs/forms.html
type: Comment

http://stackoverflow.com/q/27737899
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/27738040
score: 0
has title: How to render JSON data in HTML page Using Angular JS
tagged with: angularjs
has body: I have a Json data like this Object {Science: Array[3], Accounts: Array[3], History: Array[3], Mathematics: Array[3]} Accounts: Array[3] 0: Object 1: Object 2: Object length: 3 History: Array[3] Mathematics: Array[3] Science: Array[3] Now to render this data in HTML page like this Accounts Object Object ..................
possible better answer: http://stackoverflow.com/a/27738040
has answer: http://stackoverflow.com/a/27738142
accepted answer: http://stackoverflow.com/a/27738142
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43887183
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/43887226

http://stackoverflow.com/comment/43864626
score: 1
comment on: http://stackoverflow.com/q/27726224
type: Comment
type: QuestionComment
has text: Shouldn't be very hard, something like this -> **http://jsfiddle.net/d8c4z300/**

http://stackoverflow.com/comment/43728712
comment on: http://stackoverflow.com/a/27656355
type: Comment
has text: This worked perfectly thank you! Can you expand on this propagation function? whats happening here exactly?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43946665
type: Comment
has text: I added this at the end of my application.js, but nothing change. But actually, I don't really use gmaps4rails, I use Gmaps (froms the scripts) and I don't think this comes from the application.js, It juste seems like heroku doesn't load theses 3 script googlemaps on the top of my file
comment on: http://stackoverflow.com/a/27767356
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44000415
type: QuestionComment
has text: you are missing `()`. Use like `var split = this._ddlName.value().split('-')[0];'
comment on: http://stackoverflow.com/q/27795813
score: 0
type: Comment

http://stackoverflow.com/comment/43770785
comment on: http://stackoverflow.com/q/27676850
score: 0
type: Comment
type: QuestionComment
has text: Then you probably don't need a constructor, just a regular function called without `new`.

http://stackoverflow.com/comment/43825367
score: 0
type: AnswerComment
type: Comment
has text: Well currently I have the id as an index of an array so I can do ` ` to easily in one line check a property of an object. Or I can also easily show other data: `Amount of steps in this test: {{myArray[id].steps}}`, `Test description: {{myArray[id].description}}`, etcetera.
comment on: http://stackoverflow.com/a/27701664

http://stackoverflow.com/q/27728480
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27728521
accepted answer: http://stackoverflow.com/a/27728521
type: Question
downvote count: 0
tagged with: javascript
has title: How to return ArrayBuffer from $http request in Node.js?
answer count: 1
favorite count: 0
has body: I sent a $http.post request from Angular.js to Node.js in order to get an ArrayBuffer as following: $http.post('/api/scholarships/load/uploaded-files', Global.user, {responseType:'arraybuffer'}).success(function(ab){ console.log(ab); // Return ArrayBuffer {} }); Then, in Node.js, I retrieved uploaded files data and transform a Buffer object to ArrayBuffer object: exports.loadUploadedFiles = function(req, res) { db.UserFile.findAll().success(function(files) { var buffer = files[0].dataValues.data; // Get buffer var arrayBuffer = new ArrayBuffer(buffer.length); // Start transforming Buffer to ArrayBuffer var views = new Uint8Array(arrayBuffer); for(var i = 0; i &lt; buffer.length; ++i) { views[i] = buffer[i]; } res.type('arraybuffer'); res.send(arrayBuffer); // Send the ArrayBuffer object back to Angular.js }).error(function(err) { console.log(err); res.sendStatus(500); }); }; When I tried to print the response from above $http.post, I always got ArrayBuffer{}. What did I do wrong? Any help would be appreciated.
tagged with: angularjs
score: 6
upvote count: 6

http://stackoverflow.com/q/27675101
favorite count: 0
type: Question
upvote count: 2
tagged with: twitter-bootstrap
answer count: 1
has body: For a website i am creating, i would like to show company information in different tabs. One is specific on company information, the second would show Google charts with historic information, the 3rd would show other graphs. I am using a Bootstrap template that create the different tabs: Company information network Sales Now i have different tabs: company description company network I created a Google Chart and pasted this in a hidden tab (div) but this doesn't show up in the correct size. I expect this to have to do with the fact the dimensions of the div are still unclear at render time? How could i render it, ONLY if the tab is clicked? i use the following script: google.load("visualization", "1", {packages: ["corechart"], callback: init}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('number', 'x'); data.addColumn('number', 'values'); data.addColumn({id:'i0', type:'number', role:'interval'}); data.addColumn({id:'i1', type:'number', role:'interval'}); data.addColumn({id:'i2', type:'number', role:'interval'}); data.addColumn({id:'i2', type:'number', role:'interval'}); data.addColumn({id:'i2', type:'number', role:'interval'}); data.addColumn({id:'i2', type:'number', role:'interval'}); data.addRows([ [1, 100, 90, 110, 85, 96, 104, 120], [2, 120, 95, 130, 90, 113, 124, 140], [3, 130, 105, 140, 100, 117, 133, 139], [4, 90, 85, 95, 85, 88, 92, 95], [5, 70, 74, 63, 67, 69, 70, 72], [6, 30, 39, 22, 21, 28, 34, 40], [7, 80, 77, 83, 70, 77, 85, 90], [8, 100, 90, 110, 85, 95, 102, 110]]); // The intervals data as narrow lines (useful for showing raw source data) var options_lines = { title: 'Line intervals, default', curveType: 'function', lineWidth: 4, intervals: { 'style':'line' }, legend: 'none' }; var chart_lines = new google.visualization.LineChart(document.getElementById('chart_lines')); chart_lines.draw(data, options_lines); Thanks in advance, Robbie
tagged with: toggle
tagged with: javascript
type: UnansweredQuestion
has title: Render a tab that is hidden (on tab-toggle click)
score: 2
has answer: http://stackoverflow.com/a/27675856
downvote count: 0

http://stackoverflow.com/q/27695597
score: 0
has body: I've thought that this is how the data will look for every query operation having a unique id (which is 1 &amp; 2 in below example). var finalData = { queryData: { "1": { // here "1" will be the auto-incrementing query operation id generated from somewhere jiraList: ["abc-123", "bcd-234"], jiraDetail: [ { jiraKey: "abc-123", status: "Closed" }, { jiraKey: "bcd-234", status: "Open" } ] }, "2": { jiraList: ["xyz-987", "wxy-876"], jiraDetail: [ { jiraKey: "xyz-987", status: "Open" }, { jiraKey: "wxy-876", status: "Closed" } ] } } }; I've a function which accepts the query's unique id &amp; jira List (which is already an array): var addJiraList = function (key, jiraList) { // sample params will be key: 1, jiraList: ['abc-123', 'bcd-234'] finalData.queryData[key] = {jiraList: jiraList}; }; So the above function creates a key value pair in finalData.queryData if not present, and if present, it'll add/update jiraList with required values to it. This works. I've another function which accepts the query's unique id &amp; a single jiraDetail which is: var addJiraData = function (queryKey, extractedData) { // sample params will be queryKey: 1, extractedData: { jiraKey: "abc-123", status: "Closed" } finalData.queryData[queryKey]["jiraDetail"].push(extractedData); }; I want to push the extractedData coming as parameter in the array finalData.queryData.2.jiraDetail. Now the problem is that finalData.queryData.&lt;queryId&gt; is dynamic &amp; jiraDetail is an array inside it. So for the first time if queryKey is 1 &amp; extractedData is {something}, how would I add one item extractedData into an array (jiraDetail) of queryKey which is not even created. At present it is throwing finalData.queryData[queryKey] is undefined error which is valid as I cannot add inside an object which is not yet created. Solution in my mind is to check if finalData.queryData[queryKey] is undefined and if it is undefined then first create the object with empty jiraDetail array in it so that the following…
has comment: http://stackoverflow.com/comment/43804547
answer count: 1
has comment: http://stackoverflow.com/comment/43811766
accepted answer: http://stackoverflow.com/a/27696947
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/27696947
type: Question
has title: creating dynamic array in a dynamic javascript object (key/value pair)
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/comment/104456699
type: QuestionComment
comment on: http://stackoverflow.com/q/27722307
has text: control panel> Internet Options > Advanced > Uncheck "Disable Script Debugging
score: 0
type: Comment

http://stackoverflow.com/a/27654881
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27654757
accepted answer of: http://stackoverflow.com/q/27654757
has body: Try the below code: <?php if(isset($_POST["buy"])) { echo" "; } ?> This should work.
type: AcceptedAnswer

http://stackoverflow.com/q/27652694
upvote count: 1
has body: I am trying to get the image data from a canvas to which I added a HTML element's data by using MDN's method. After I insert the HTML data, I can't access the canvas' image data anymore though (in Chrome): //This function is a direct copy of https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas#JavaScript onload = function() { var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); var data = '&lt;svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"&gt;' + '&lt;foreignObject width="100%" height="100%"&gt;' + '&lt;div xmlns="http://www.w3.org/1999/xhtml" style="font-size:14px"&gt;' + 'example' + '&lt;/div&gt;' + '&lt;/foreignObject&gt;' + '&lt;/svg&gt;'; var DOMURL = window.URL || window.webkitURL || window; var img = new Image(); var svg = new Blob([data], {type: 'image/svg+xml;charset=utf-8'}); var url = DOMURL.createObjectURL(svg); img.onload = function () { ctx.drawImage(img, 0, 0); DOMURL.revokeObjectURL(url); getData(ctx); }; img.src = url; }; //the part where it goes wrong: function getData(ctx) { try { ctx.getImageData(0,0,100,100); } catch(e) { alert(e); } } &lt;canvas id="canvas"&gt;&lt;/canvas&gt; My question is: is it possible to insert the HTML data, and still be able to access the image data?
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27652926
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27657790
accepted answer: http://stackoverflow.com/a/27657790
tagged with: google-chrome
type: Question
possible better answer: http://stackoverflow.com/a/27652926
tagged with: javascript
has title: Inserting HTML into canvas without creating CORS restriction
answer count: 2
tagged with: cors
tagged with: canvas

http://stackoverflow.com/comment/43806856
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27662990
type: Comment
has text: Thanks - that is an interesting approach! I think this would work nicely. Your comment about optimizing the first page is what I'm after - for sites with low visitor count, I assume it will always mean the page would load slower than usual, as it's likely not in the cache.

http://stackoverflow.com/comment/43736516
comment on: http://stackoverflow.com/q/27659036
has text: You require the files you need, or shim them if all are required.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43806702
score: 0
type: AnswerComment
type: Comment
has text: Thank you for your contribution :). The code is pretty fine! But the problem here is that i don't have different classes for each . These ones are added dynamically. The code of imnancysun worked well so far.
comment on: http://stackoverflow.com/a/27695588

http://stackoverflow.com/comment/43981476
comment on: http://stackoverflow.com/a/27785691
score: 1
type: AnswerComment
has text: For *development* there is little concern waiting a few extra milliseconds as it's likely the server is "local". That isn't to say that it isn't messy or can't be improved.
type: Comment

http://stackoverflow.com/a/48500577
score: 1
downvote count: 0
has body: For those who use type="date" (introduced with HTML5) instead of type="text", it can be done this way: function checkDate() { var date = this.value; if(date.valueAsDate &lt;= new Date()) { //Date in the past } else { //Date in the future } }
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27714469

http://stackoverflow.com/a/27684230
score: 1
accepted answer of: http://stackoverflow.com/q/27684020
answers question: http://stackoverflow.com/q/27684020
upvote count: 1
has body: Could strip out the script and style tags import requests from bs4 import BeautifulSoup session = requests.session() soup = BeautifulSoup(session.get('http://stackoverflow.com/questions/27684020/extracting-only-words- from-html-pages').text) #This part here will strip out the script and style tags. for script in soup(["script", "style"]): script.extract() print soup.get_text()
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/27786658
has comment: http://stackoverflow.com/comment/45874978
answer count: 1
tagged with: windows-8.1
downvote count: 0
tagged with: javascript
score: 6
favorite count: 0
upvote count: 6
has answer: http://stackoverflow.com/a/29210165
has body: On the Surface Pro 3 with Firefox only: When making a swiping gesture with a single finger over an element, the browser will fire wheel events instead of touchmove or mousemove events. How do you stop the wheel behavior, and allow a single finger to always be treated as touch/mouse movement instead? So I want to treat a single finger swipe as a series of mousemove or touchmove instead of as wheel events. I do not want a single finger swipe to scroll the page at all if swiping over this element. This is easy to do in Chrome and IE11. This seems not-possible right now in Firefox. Current I think this is a bug, but there may be something I'm missing. Here is a simplistic example: http://codepen.io/simonsarris/pen/PwbdRZ var can = document.getElementById('can'); can.addEventListener('mousemove', function(e) { // Will never happen on the Surface Pro 3 in Firefox // Will happen in IE11 though console.log('mouseMove') }); can.addEventListener('touchmove', function(e) { // Will never happen on the Surface Pro 3 in Firefox // Will happen in Chrome though console.log('touchMove') }); // Stops the window from scrolling in firefox when you swipe on the element // But stopping this does not allow the single touch gesture to register as mousemove or touchmove events can.addEventListener('wheel', function(e) { console.log('wheel') e.preventDefault(); }); // consider also the 'DOMMouseScroll' event, though preventing this event will not stop firefox from panning the page. Because I am preventing default in wheel, scrolling the page is stopped when one-finger swiping up or down The window scrolling is stopped in firefox if you swipe in the red box, but no mousemove or touchmove events will fire. (yet mousemove will fire if you swipe horizontally instead of vertically)
has title: Surface Pro 3 with Firefox - Have single touch trigger touch/mouse events instead of wheel events
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29210165
type: Question
tagged with: firefox

http://stackoverflow.com/comment/43743389
type: Comment
type: QuestionComment
has text: @user1898778 What's the desired result?
comment on: http://stackoverflow.com/q/27663731
score: 0

http://stackoverflow.com/comment/43813425
has text: Post a fiddle at http://jsfiddle.net/
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27700171
type: QuestionComment

http://stackoverflow.com/comment/112395472
type: AnswerComment
comment on: http://stackoverflow.com/a/27736383
score: 0
type: Comment
has text: Anybody else: turn on LogXMLHttpRequests in Console. It showed me that inside the page that I was correclty loading with an async get there was a ` ` tag in the body, which made a synchronous request causing the error above.

http://stackoverflow.com/comment/44134612
has text: Hey @RanjithVaradan, I was looking at your code yesterday and trying to make it work (sorry for the delay, don't have so much time). I couldn't make it work. I've tried the [official example](http://oblador.github.io/angular-parallax/) (apart from your code) and it works. I suspect that is something about the structure html that you're using in onsen. In the official demo you can see the scrollbar, but not in your webpage. I think that's a tip, and somehow the plugin can't calculate the topScroll position.
type: Comment
comment on: http://stackoverflow.com/a/27753419
score: 0
type: AnswerComment

http://stackoverflow.com/q/27659211
has title: how to insert variable into jquery selector
has answer: http://stackoverflow.com/a/27659286
tagged with: jquery
has answer: http://stackoverflow.com/a/27659426
favorite count: 0
has comment: http://stackoverflow.com/comment/43734078
has answer: http://stackoverflow.com/a/27659236
has comment: http://stackoverflow.com/comment/43734231
has comment: http://stackoverflow.com/comment/43734263
downvote count: 2
possible better answer: http://stackoverflow.com/a/27659286
type: Question
has comment: http://stackoverflow.com/comment/43734308
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43734291
tagged with: javascript
score: -1
has body: I need to insert a variable inside a jQuery selector like this example, how can I fix my problem? var index = 5; $(".tables li:nth-child('+index+')").addClass('vr_active');
accepted answer: http://stackoverflow.com/a/27659236
answer count: 3
upvote count: 1

http://stackoverflow.com/comment/43706390
type: Comment
comment on: http://stackoverflow.com/a/27642444
score: 3
type: AnswerComment
has text: For Employee to re use and extend getinfo of person it could simply do `return Person.prototype.getInfo.call(this) + + "and earns " + this.salary + " dollar.";` Instead of copy paste code re use.

http://stackoverflow.com/comment/43743866
type: Comment
comment on: http://stackoverflow.com/a/27664027
has text: Why that line has been added. Please put some explanation as well in the answer.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43876241
comment on: http://stackoverflow.com/a/27732389
type: AnswerComment
has text: why 15-minutes slots?
type: Comment
score: 0

http://stackoverflow.com/q/27677478
answer count: 1
downvote count: 0
favorite count: 0
type: AnsweredQuestion
tagged with: famo.us
score: 1
has body: I'm trying to learn how to use the Famo.us library. For starters I just want to present a surface in my . So I tried this: However I'm getting the following error: Uncaught ReferenceError: require is not defined So I tried to add the scripts to : And now I'm getting this error: Uncaught Error: Module name "js/famous/core/Engine" has not been loaded yet for context: _. Use require([]) http://requirejs.org/docs/errors.html#notloaded What am I doing wrong and how can I present this Surface in the ?
accepted answer: http://stackoverflow.com/a/27679537
has title: Implementing Famo.us
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27679537
upvote count: 1

http://stackoverflow.com/comment/43888471
type: Comment
comment on: http://stackoverflow.com/a/27736822
has text: As my comment above, you can check your SQL statement, use `mysql_error()` to show MySQL error
score: 0
type: AnswerComment

http://stackoverflow.com/a/27766674
has comment: http://stackoverflow.com/comment/43943884
answers question: http://stackoverflow.com/q/27766362
score: 0
has body: That's because you only ever emit once when a new socket.io connection is made. If the app.post callback is called again, there's nothing to emit another message from socket.io. You want to emit from within your app.post callback, and stop using global variables.
type: Answer

http://stackoverflow.com/comment/58150461
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29146028
type: Comment
has text: What if I want to upload through a rest api call. What should I pass to single() function?

http://stackoverflow.com/comment/44012166
type: Comment
has text: possible duplicate of [How to Use Sockets in JavaScript\HTML?](http://stackoverflow.com/questions/1736382/how-to-use-sockets-in-javascript-html)
type: QuestionComment
comment on: http://stackoverflow.com/q/27801712
score: 0

http://stackoverflow.com/q/27735360
score: 7
accepted answer: http://stackoverflow.com/a/27742464
tagged with: key-events
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: codemirror
has title: codemirror search simulate CTRL+F keys with javascript
has body: I'm trying to open the codemirror search dialog (normally activated by pressing CTRL+F) by pressing a button: I tried to use window.find() but it does not open the dialog, it only highlights the text in the editor... DEMO
upvote count: 7
has comment: http://stackoverflow.com/comment/43882345
type: Question
has answer: http://stackoverflow.com/a/27742464
type: AnsweredQuestion

http://stackoverflow.com/a/27757584
type: Answer
has body: Try this. function minmax(){ var max = Math.max.apply(Math, arguments); var min = Math.min.apply(Math, arguments); console.log(max); // print 6 console.log(min); // print -2 } minmax (3, 6, 1, 5, 0, -2, 3);
answers question: http://stackoverflow.com/q/27757246
score: 0

http://stackoverflow.com/a/27704740
accepted answer of: http://stackoverflow.com/q/27702274
has body: There is an option to access Shadow DOM directly using, this.shadowRoot.querySelector('.classname'); Otherwise, as @Eugene suggested, add an identifier (#container) to the custom element and then use, this.$.container.querySelector('.classname'); Additional information, - https://www.polymer-project.org/docs/polymer/polymer.html#automatic-node-finding
downvote count: 0
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27702274

http://stackoverflow.com/a/27705229
answers question: http://stackoverflow.com/q/27705204
has comment: http://stackoverflow.com/comment/43823376
accepted answer of: http://stackoverflow.com/q/27705204
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43823075
type: Answer
has body: You can return with an array: return [this._mMet[sMet].ret,this._mMeth[sMet].ret.default]; or by an object: return {'one': this._mMet[sMet].ret, 'two': this._mMeth[sMet].ret.default}; EDIT Based on OP comment, he want some validation on those values: if (typeof this._mMet[sMet].ret == 'undefined' || typeof this._mMeth[sMet].ret.default == 'undefined') { return false; } else { return {'one': this._mMet[sMet].ret, 'two': this._mMeth[sMet].ret.default}; }
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43823309

http://stackoverflow.com/comment/43917188
has text: ["Note that some/many error events do not trigger window.onerror, you have to listen for them specifically"](https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.onerror).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27753053
score: 1

http://stackoverflow.com/q/27803159
type: Question
tagged with: c#
has body: I want to send a command to my browser, let's say chrome. For example, I use a website which has a really neat audio player, i know this audioplayer has a javascript function called prevTrack() and nextTrack() etc etc etc.... what i wan't to do is to create a program (in java/c#) that would go into the browser console and send that command, if for example, I hit some kind of hotkey "ctrl + n" for example. Is there any way to manipulate chrome like that? Thanks
tagged with: javascript
has comment: http://stackoverflow.com/comment/44017609
has comment: http://stackoverflow.com/comment/44015283
downvote count: 0
answer count: 1
score: 1
favorite count: 0
has title: Send JS commands to browser tab
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44015686
has answer: http://stackoverflow.com/a/29857085
tagged with: java
upvote count: 1
tagged with: google-chrome

http://stackoverflow.com/comment/43716065
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27649258
score: 0
has text: @Waki yes I know about this. Callback seemed to me as an overkill, I thought there must be a method like getDate() or something. I spent quite a time googling for it, no success, so I've posted the question.

ruby-on-rails
tags question: http://stackoverflow.com/q/27766778
type: Tag
tags question: http://stackoverflow.com/q/27763655
tags question: http://stackoverflow.com/q/27748265
tags question: http://stackoverflow.com/q/27732858
tags question: http://stackoverflow.com/q/27722596
tags question: http://stackoverflow.com/q/27723113
tags question: http://stackoverflow.com/q/27751649
tags question: http://stackoverflow.com/q/27726479
tags question: http://stackoverflow.com/q/27744329
tags question: http://stackoverflow.com/q/27761903
tags question: http://stackoverflow.com/q/27644589
tags question: http://stackoverflow.com/q/27715070
tags question: http://stackoverflow.com/q/27663126
tags question: http://stackoverflow.com/q/27681782
tags question: http://stackoverflow.com/q/27748042
tags question: http://stackoverflow.com/q/27788902
tags question: http://stackoverflow.com/q/27757666
tags question: http://stackoverflow.com/q/27693737
tags question: http://stackoverflow.com/q/27796237
tags question: http://stackoverflow.com/q/27801381
tags question: http://stackoverflow.com/q/27662505
tags question: http://stackoverflow.com/q/27678046
tags question: http://stackoverflow.com/q/27661570
tags question: http://stackoverflow.com/q/27705990
tags question: http://stackoverflow.com/q/27717257
tags question: http://stackoverflow.com/q/27673591
tags question: http://stackoverflow.com/q/27733978
tags question: http://stackoverflow.com/q/27743486
tags question: http://stackoverflow.com/q/27712859
tags question: http://stackoverflow.com/q/27755257
tag name: ruby-on-rails
tags question: http://stackoverflow.com/q/27711108
tags question: http://stackoverflow.com/q/27716565
tags question: http://stackoverflow.com/q/27642322
tags question: http://stackoverflow.com/q/27728377
tags question: http://stackoverflow.com/q/27771631
tags question: http://stackoverflow.com/q/27689984
tags question: http://stackoverflow.com/q/27710193
tags question: http://stackoverflow.com/q/27672257
tags question: http://stackoverflow.com/q/27650602
tags question: http://stackoverflow.com/q/27692154
tags question: http://stackoverflow.com/q/27641578
tags question: http://stackoverflow.com/q/27787911
tags question: http://stackoverflow.com/q/27676825
tags question: http://stackoverflow.com/q/27672765
tags question: http://stackoverflow.com/q/27798029
tags question: http://stackoverflow.com/q/27747939
tags question: http://stackoverflow.com/q/27736326
tags question: http://stackoverflow.com/q/27641191
tags question: http://stackoverflow.com/q/27697843
tags question: http://stackoverflow.com/q/27762860
tags question: http://stackoverflow.com/q/27723140
tags question: http://stackoverflow.com/q/27737324
tags question: http://stackoverflow.com/q/27693960
tags question: http://stackoverflow.com/q/27696743
tags question: http://stackoverflow.com/q/27640622
tags question: http://stackoverflow.com/q/27749803
tags question: http://stackoverflow.com/q/27772681
tags question: http://stackoverflow.com/q/27750397
tags question: http://stackoverflow.com/q/27737872
tags question: http://stackoverflow.com/q/27760480
tags question: http://stackoverflow.com/q/27643794
tags question: http://stackoverflow.com/q/27745060

http://stackoverflow.com/comment/43930985
score: 0
has text: use `change` event not `click`.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27759958

http://stackoverflow.com/a/27785430
upvote count: 3
score: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27785175
answers question: http://stackoverflow.com/q/27785175
type: Answer
has body: Problem is with your controller. Try changing your controller like this var myApp = angular.module('***',[]); myApp.controller('firstCtrl', ['$scope', function($scope) { $scope.data = {message: "Hello"}; }]);

http://stackoverflow.com/a/27695666
answers question: http://stackoverflow.com/q/27695624
has body: I am thinking you have bound the click handler twice, so the first time it is not found and you get the second case (and add it) but the second time it is found (added the first time) and shows the first case.
type: Answer
upvote count: 4
downvote count: 0
score: 4

http://stackoverflow.com/q/27738372
has comment: http://stackoverflow.com/comment/43887882
has comment: http://stackoverflow.com/comment/43887940
has answer: http://stackoverflow.com/a/27738430
has answer: http://stackoverflow.com/a/27738416
answer count: 7
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/27738412
has answer: http://stackoverflow.com/a/27738433
accepted answer: http://stackoverflow.com/a/27738433
tagged with: http://stackoverflow.com/tag/html
has body: Here, I need to get options text from the select dropdown and do some operations. But, I don't know where I missed. I am getting both the options text. Here what I tried. $('#sel').change(function(){ alert($(this).val()); temp = $('#sel option:selected').text(); alert("temp value " +temp); if(temp = "Option 1") { alert("Option 1 is selected"); //DO SOME OPERATIONS } if(temp = "Option 2") { alert("Option 2 is selected"); //DO SOME OPERATIONS } }).change(); Option 1 Option 2</option Option 3</option JS FIDDLE
has answer: http://stackoverflow.com/a/27738412
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27738419
has title: How to get options text in select dropdown in jquery
has answer: http://stackoverflow.com/a/27738428
has answer: http://stackoverflow.com/a/27738476
tagged with: javascript
type: Question
score: 0

http://stackoverflow.com/comment/43763905
type: AnswerComment
has text: OH WOWWWWW!!!! @TracholarZuo THAT WORKED!!!! Thank you so very very very much. So crazy how little things like using camel case rather than downcase and putting in a () when I shouldn't have just threw everything for a loop!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27674402

http://stackoverflow.com/comment/43918500
type: Comment
has text: It's a bit too complicated for me - I think you need to get the number at the end of the ActionInst string out of there and into its own variable: the way you're doing it is too brittle and prone to errors: you have to run substring and then maybe use parseInt. And you seem to be putting both submenus and menus in the same place in the array under 'MenuNum', I think you can simplify this. Sorry if my reply took a while.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27732526

http://stackoverflow.com/a/27764971
has comment: http://stackoverflow.com/comment/43940535
downvote count: 0
answers question: http://stackoverflow.com/q/27764942
has body: No you can't do that without JavaScript
has comment: http://stackoverflow.com/comment/43940572
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/27680204
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43781330
has comment: http://stackoverflow.com/comment/44427451
has comment: http://stackoverflow.com/comment/43775299
has body: I've been facing the same problem recently using huge datagrids in jqGrid and I've been able to find a tricky solution which turned out to be working very well. Thing is you cannot render all this data at once - this is just too much, especially considering how slow DOM manipulations are. So you need some sort of queue. You can split this data into chunks and render them sequentiali using setTimeout() or setInterval() but those doesn't have well reputation in terms of performance as well. I ended up using reuestAnimationFrame and splitting my huge data into pieces and rendering them whenever an animation frame was available. So you need to start with polyfill to make sure what you are going to do will actually work, I'm using a great one by Paul irish: Heres an awsome jsFiddle: http://jsfiddle.net/cjw5eota/1/ And here's the JS: var dataRows = 5000; // enter ammount of returned rows var chunkSize = 200; // define single chunk size, optimize for best performance bu trying different values, if your DOM manipulation is heavy use less, if its lightweight you can use more, use 1 to see in slowmo how it works // We are simulating big returned object here var data = {} for (var i = 0; i &lt; dataRows; i++) { data[i] = { 'id': i, 'name': 'I am data for row ' + i }; } // shim layer with setTimeout fallback window.requestAnimFrame = (function () { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (callback) { window.setTimeout(callback, 1000 / 60); }; })(); function renderRecords(data) { var dataLength = Object.keys(data).length; var i = 0; function renderInQueue() { console.time('Rendering in queue'); for (t = 0; t &lt; chunkSize; t++) { if (i &lt; dataLength) { var row = '&lt;tr&gt;&lt;td&gt;' + data[i].id + '&lt;/td&gt;&lt;td&gt;' + data[i].name + '&lt;/td&gt;&lt;/tr&gt;' $('table').append(row); } i++; } if (i &lt; dataLength) { requestAnimationFrame(renderInQueue); } else { console.log('Done rendering')…
has comment: http://stackoverflow.com/comment/43775281
answers question: http://stackoverflow.com/q/27679839

http://stackoverflow.com/comment/43998352
type: QuestionComment
comment on: http://stackoverflow.com/q/27794288
has text: http://stackoverflow.com/questions/19586137/addeventlistener-using-for-loop-and-passing-values
type: Comment
score: 1

http://stackoverflow.com/q/27745727
has comment: http://stackoverflow.com/comment/43903806
favorite count: 0
has comment: http://stackoverflow.com/comment/43903939
has comment: http://stackoverflow.com/comment/43903231
has answer: http://stackoverflow.com/a/27746415
accepted answer: http://stackoverflow.com/a/27746415
has comment: http://stackoverflow.com/comment/43903876
type: AnsweredQuestion
score: 1
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has title: How to make the following template helper reactive (Meteor)?
has body: I have Chapters collection, and I show a list of chapters in one of the templates: {{title}} As you can see, I created a isCurrentChapter to use like this: // book_page.js Template.bookPage.events "click .open-chapter": function() { localStorage.setItem "currentChapter", this._id } // chapter_item.js Template.chapterItem.helpers({ isCurrentChapter: function() { var currentChapterId = localStorage.getItem("currentChapter"); var selectedChapterId = this._id; if selectedChapterId === currentChapterId) { return "active"; } } }); The problem now is that the active is returned only changes when the page loads. How can I do it so that isCurrentChapter becomes reactive? Fires up on the click .open-chapter event?
upvote count: 1
has comment: http://stackoverflow.com/comment/43904130
tagged with: meteor

http://stackoverflow.com/a/27784186
answers question: http://stackoverflow.com/q/27783768
score: 0
type: Answer
has body: You are actually better off using promises. Simply return the $.ajax promise and handle the data returned external to that function: // GetRows promises to return rows of data... var getRows = function () { // simply return the ajax promise return $.ajax({ type: "GET", url: hostUrl, contentType: "application/json;", dataType: "json", }); }; And consume like this: // Use the returned promise to process the data getRows().done(function(rows){ $('#bootstrap-table').bootstrapTable({ data: rows }); }); The problem with callbacks or a success: handler is you are building GUI dependencies into the GetRows method.

http://stackoverflow.com/a/27661377
type: Answer
accepted answer of: http://stackoverflow.com/q/27661188
answers question: http://stackoverflow.com/q/27661188
has body: I updated like this, it works for me var ob = {}; var catcheBars = {}; var sidebar = $('div.sidebar'); for(i=1; i &lt;= 5; i++) { if(!ob.hasOwnProperty(i+'page')) { ob[i+'page'] = sidebar.clone(false); } var x = function (x) { $(ob[x+'page']).addClass('sideBar'+x); }(i); } sidebar.empty(); $("#sideBar").html(ob['1page']); console.log(ob); Thanks to everyone! Live
score: 0
has comment: http://stackoverflow.com/comment/43738660
type: AcceptedAnswer

http://stackoverflow.com/q/27678052
downvote count: 0
tagged with: template-strings
favorite count: 0
has answer: http://stackoverflow.com/a/65297860
has answer: http://stackoverflow.com/a/75422836
has answer: http://stackoverflow.com/a/64381503
has title: Usage of the backtick character (`) in JavaScript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/106637643
has answer: http://stackoverflow.com/a/46124173
tagged with: backticks
has body: In JavaScript, a backtick† ( ` ) seems to work the same as a single quote. For instance, I can use a backtick to define a string like this: var s = `abc`; Is there a way in which the behavior of the backtick actually differs from that of a single quote? † Note that among programmers, "backtick" is one name for what is more generally called the grave accent. Programmers also sometimes use the alternate names "backquote" and "backgrave". Also, on Stack Overflow and elsewhere, other common spellings for "backtick" are "back-tick" and "back tick".
has comment: http://stackoverflow.com/comment/101242371
has answer: http://stackoverflow.com/a/57387871
has answer: http://stackoverflow.com/a/79415156
has answer: http://stackoverflow.com/a/40062505
tagged with: backquote
has answer: http://stackoverflow.com/a/64660448
has answer: http://stackoverflow.com/a/27678299
type: Question
upvote count: 465
has answer: http://stackoverflow.com/a/54299776
has answer: http://stackoverflow.com/a/40544333
linked to: http://stackoverflow.com/q/33194138
has answer: http://stackoverflow.com/a/78316112
tagged with: javascript
has answer: http://stackoverflow.com/a/52612901
score: 465
answer count: 13
has comment: http://stackoverflow.com/comment/130859388
tagged with: single-quotes
has comment: http://stackoverflow.com/comment/129965164

http://stackoverflow.com/comment/44376883
has text: Thanks. I noticed the same issue on a site I built recently, and the more votes we get on that bug, the more likely they are to fix it soon!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27833483
type: AnswerComment

http://stackoverflow.com/comment/43963477
has text: Thank you, but I am not sure where this code should be placed? Should this code be placed in `$scope.someFunction(){...}` in BController? Or some other place that will be called when the controller is loaded?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27774217

http://stackoverflow.com/a/27696401
has comment: http://stackoverflow.com/comment/43806160
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27696066
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27696066
has comment: http://stackoverflow.com/comment/43806504
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/43806298
has body: You want to create a chart with live data. First thing is getting the data. The script you are including basically creates the chart for you. So you don't have direct access to the data itself, so it would be a little tricky to use that. You should google around for a,preferrably REST API, that provides you with data on-demand. 1. Find a suitable REST API and perform calls to fetch data You perform HTTP requests to the API and it provides data - so on page-load for example you will request data from this API. So each time a user loads your website a call is made and it fetches the most recent data on movies. 2. Parse the data, perform calculations and built your own custom JSON Then you need to parse that data - Take from this raw feed the data you actually need - perform calculations if needed(from what I take from your question, it's gonna be simple elementary school maths), then build you own custom JSON data structure that can be used to display the data. 3. Visualize the JSON Include a JS library that renders Charts. Chart.js, is an excellent example and it's dead-simple to provide a JSON and render a really nice looking chart. That's how it ,usually, goes.

http://stackoverflow.com/a/27732331
answers question: http://stackoverflow.com/q/27731935
type: Answer
score: 1
upvote count: 1
has body: You made a small typo. Instead of "task" inside the watch configuration block it should be "tasks" watch: { files: 'public/admin/js/*.js', tasks: ['uglify'], options: { nospawn: false }, }, Source: https://github.com/gruntjs/grunt-contrib-watch
downvote count: 0

http://stackoverflow.com/q/27759170
answer count: 1
has answer: http://stackoverflow.com/a/27759220
tagged with: angularjs
has title: AngularJS - Check if subarray contains something
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
type: Question
tagged with: angularjs-directive
tagged with: arrays
tagged with: javascript
has body: I have a list of classrooms with each a subarray of actions to be done to the classroom. { "id": 1, "name": "GR302", "actions": [ { "date": "19/04/2011", "deadline": "21/04/2011", "priority": "high" }, { "date": "15/01/2012", "deadline": "20/12/2014", "priority": "low" } ], } I made a list with ng-repeat: room in rooms and in there another ng-repeat: action in room.actions. Now I'd love to place a flag next to the name of the room where there is an action with high priority. But I have no idea how, I'm a beginner with AngularJS. The only thing I could think of is using ng-model &amp; ng-class? &lt;h4&gt;{{room.name}} &lt;span class="glyphicon" ng-class="(something) ? 'glyphicon-flag' : ''"&gt;&lt;/span&gt;&lt;/h4&gt;
score: 0
accepted answer: http://stackoverflow.com/a/27759220

http://stackoverflow.com/comment/43879841
score: 0
has text: No. You should keep doing what you are doing now. Add an example of something that's being "lost" so we can find out _why_. It's not because of the iFrames.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27733805

http://stackoverflow.com/q/27735723
answer count: 1
has comment: http://stackoverflow.com/comment/43892306
has body: As I understand it, there are two potential outcomes for an IndexedDB transaction: There is some error, so no changes in the transaction are written and oncomplete never fires. Everything works, so the changes are written and then oncomplete fires. But I've heard reports from some users about my application intermittently not working in Chrome, and one of them claims to have debugged it to the point of identifying oncomplete as the problem. He says that sometimes oncomplete is not firing even though the data is being saved and no error messages are produced. I understand that this might not be correct because I haven't been able to observe the problem myself and nobody can come up with a set of steps to reproduce it. But I have seen weird browser-specific bugs in IndexedDB before, especially when writing lots of data in multiple transactions to large object stores (which is where the problem occurs). Has anyone noticed something like this?
type: UnansweredQuestion
tagged with: google-chrome
tagged with: indexeddb
has comment: http://stackoverflow.com/comment/43884686
has answer: http://stackoverflow.com/a/27735847
has comment: http://stackoverflow.com/comment/43885247
type: Question
has title: In IndexedDB, is there any scenario where data from a transaction is written to disk but oncomplete does not fire?
tagged with: javascript
score: 0

http://stackoverflow.com/q/27664437
has answer: http://stackoverflow.com/a/27664768
tagged with: polymer
accepted answer: http://stackoverflow.com/a/27664768
has comment: http://stackoverflow.com/comment/43744986
possible better answer: http://stackoverflow.com/a/27664666
has answer: http://stackoverflow.com/a/27664666
has body: I'm using polymer, and jquery to change an attribute of a tag, if one tag's attribute is false, using an if/else statement, currently the one I am using doesn't work, how would I make it work? HTML <p flex>Would you like notifications on? <p flex>Private Message Notifications? <p flex>Game Update Notifications? <p flex>Website Update Notifications? JavaScript var main = document.querySelector('#onoff'); var pmn = document.querySelector('#pmn'); var wun = document.querySelector('#wun'); var gun = document.querySelector('#gun'); if ( $('#onoff').attr('checked') == 'true' ) { // do this } else { pmn.removeAttribute("checked"); wun.removeAttribute("checked"); gun.removeAttribute("checked"); pmn.setAttribute("disabled", "true"); wun.setAttribute("disabled", "true"); gun.setAttribute("disabled", "true"); } I currently have #onoff checked="false" so the other toggles would automatically be disabled and the attribute checked would equal false, but it doesn't, anyone can tell me what I'm doing wrong, and how to fix it?
has comment: http://stackoverflow.com/comment/43744901
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
type: Question
has comment: http://stackoverflow.com/comment/43745004
has title: Cannot properly update attribute with jQuery
has comment: http://stackoverflow.com/comment/43744961
has comment: http://stackoverflow.com/comment/43744933
has comment: http://stackoverflow.com/comment/43745000
score: 0
answer count: 2

http://stackoverflow.com/a/27715335
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43842678
has comment: http://stackoverflow.com/comment/43842685
has comment: http://stackoverflow.com/comment/43842755
type: Answer
accepted answer of: http://stackoverflow.com/q/27715316
answers question: http://stackoverflow.com/q/27715316
has body: How about $("div:not(.doneAnimated)") Looking at the class property directly is a fragile programming practice. The class is a list, so checking for simple equality doesn't always work &mdash; and if it works today, it may not work after later changes. If you need to check when your jQuery object is not formed by a selector, you can use .not(): $(this).not(".doneAnimated") If you want to just test the state of this: if (!$(this).is(".doneAnimated")) { // do something } The .is() method returns true or false, while .not() acts like a filter on the jQuery object contents. edit a comment points out that an alternative to the general-case .is() is .hasClass(): if (!$(this).hasClass("doneAnimated")) { // do something } Note that with .hasClass() you pass in just the class name, without a leading ., a mistake I've made more than once.
has comment: http://stackoverflow.com/comment/43842853
has comment: http://stackoverflow.com/comment/43842694
has comment: http://stackoverflow.com/comment/43842764
score: 4

http://stackoverflow.com/comment/43885071
type: AnswerComment
has text: Thx. That's about what I had gathered, but modernizr is so ubiquitous I thought I might be missing another benefit of that route. If you don't mind... I checked out the calc polyfill (among others), but the notes are sparse, and I'm new to js. Is it finding all instances of "calc" in the stylesheet, doing the computations in js, then passing the value back to the stylesheet? I think that's what I want, but I'm honestly not sure whether the industry preference to avoid js for layouts, minimize calc is a philosophical/semantic one, or if there are repercussions for the end user. thx
comment on: http://stackoverflow.com/a/27735484
type: Comment
score: 0

http://stackoverflow.com/a/40127671
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27793437
downvote count: 0
has body: I run into the same problem. For reproduction, the dropzone selector new Dropzone('#selector') is not working as aspected on default templates. The selector fails on async. loaded views. There is a easy fix. Init dropzone on a form will enforce dropzone template rendering correctly. View &lt;form id="dropzone-form" class="dropzone"&gt;&lt;/form&gt; JavaScript var myDropzone = new Dropzone('#dropzone-form', { url: "/file/post" });

http://stackoverflow.com/comment/43859823
score: 0
has text: See http://stackoverflow.com/questions/2312817/javascript-switch-with-logical-operators
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27723903

http://stackoverflow.com/comment/43952419
type: Comment
has text: @EricTaylor shouldn't it be `activePeriods(_removeAllFreeDays(freeDay));` and not `activePeriods(_removeAllFreeDays());`
comment on: http://stackoverflow.com/a/27672860
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43921833
comment on: http://stackoverflow.com/a/27755548
has text: thanks, I just tried it though but it still does nothing
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27766710
has comment: http://stackoverflow.com/comment/43972193
has comment: http://stackoverflow.com/comment/43955955
has body: I recently started uses Onsen-ui, and I am having a lot of fun with it. I am using crosswalk for my Android application and this has gotten rid of almost every performance issue I've had. Pages scroll smoothly and everything is super responsive! The only issue that remains is that there is a noticeable stutter between page changes. When I tap the button to go back (or to navigate forward to another page), the app will seem to 'pause' very briefly (similar to the 300ms click issue, but not the same because everything else is instantly responsive), then it will proceed to play the first one or two frames of the page transition animation, stutter again, and then complete the animation smoothly. This is very jarring and really ruins the experience in an app where you navigate from page to page frequently! I don't known what's causing the issue, but if I had to guess I would say that the first stutter is caused by AngularJs loading in the template data and the second is AngularJs actually processing the data once it is loaded (binding to all the properties - or whatever the correct term is! I'm new, forgive me :) ). Maybe the issue could be resolved by caching templates if angular supports such a thing? Of course this is just a guess, love to hear if you guys had similar issues and would love a solution! Note that this is tagged as Android + Crosswalk, but I don't mean to single out Android. The issue might be persistent in iOS too, but I don't have an iOS device to test on.
has title: Noticeable pause and stutter between page navigation
type: Question
tagged with: crosswalk-runtime
tagged with: javascript
has comment: http://stackoverflow.com/comment/43971733
tagged with: onsen-ui
score: 0
tagged with: android
answer count: 0
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/q/27800088
score: 0
upvote count: 1
downvote count: 1
has body: I'd like to embed a ready made google chart, but without using the &lt;script&gt; tag. When I go to Google Charts and press "Publish Chart", a window pops up saying that I should put this code anywhere in HTML: &lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/static/modules/gviz/1.0/chart.js"&gt; {"dataSourceUrl":"//docs.google.com/spreadsheet/tq?key=....","options":{"titleTextStyle":{"bold":true,"color":"#000","fontSize":16},"legendTextStyle":{"bold":true,"color":"#000000","fontSize":12},"animation":{"duration":0},"width":600,"hAxis":{"useFormatFromData":true,"minValue":null,"viewWindowMode":null,"viewWindow":null,"maxValue":null},"vAxes":[{"useFormatFromData":true,"title":null,"minValue":null,"viewWindow":{"max":null,"min":null},"maxValue":null},{"useFormatFromData":true,"minValue":null,"viewWindow":{"max":null,"min":null},"maxValue":null}],"booleanRole":"certainty","title":"A title","height":371,"legend":"right","focusTarget":"series","tooltip":{"trigger":"none"},"isStacked":false},"state":{},"view":{},"isDefaultVisualization":false,"chartType":"ColumnChart","chartName":"Chart 1"} &lt;/script&gt; It would be very easy, just copy and paste... The problem is that I can't put a &lt;script&gt; tag anywhere in the HTML, because the editor rejects it. I can only make a &lt;div id="mychart"&gt;&lt;/div&gt; in the HTML and add something to a javascript file which will be loaded at the end of &lt;head&gt;. So, my javascript code would do something like: jQuery(document).ready(function() { jQuery("#mychart").text("google chart here..."); }); But I can't figure out how to embed the chart mentioned above into this code (it's just a script tag with json chart definition).
favorite count: 0
linked to: http://stackoverflow.com/q/11494659
has comment: http://stackoverflow.com/comment/44019677
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44008917
has title: How to embed a google chart in javascript instead of HTML?
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/44015463
tagged with: google-visualization
has comment: http://stackoverflow.com/comment/44008943
tagged with: javascript
has comment: http://stackoverflow.com/comment/44014708

http://stackoverflow.com/comment/43750869
type: QuestionComment
has text: UM, you change the value manually. Even when you call change and it would check, it would NOT know the previous value. You could write a custom fn method that sets the value and does it for you, but any way you do it, you will need to do a check.
score: 0
comment on: http://stackoverflow.com/q/27668074
type: Comment

http://stackoverflow.com/q/27722349
upvote count: 1
tagged with: less
type: Question
has comment: http://stackoverflow.com/comment/43861430
has answer: http://stackoverflow.com/a/27750286
tagged with: javascript
tagged with: jquery
has body: I am in the middle of a project and this morning the less JS file (I am currently using the "less.min.js" JS file for the browser (Chrome) states in the console "failed to save". This is causing my "scripts.js" file to fail when functions are in the "$(window).load()". Interesting enough, however, Bootstrap is still working, as is my LESS CSS (all my styles are on the page as it should be). I also have Web Essestials installed, and is set to auto-compile on save (this setting was set previous to the error). @title @*TODO: pre-compile less and remove script*@ I have checked my security settings for IIS and they seem to be fine (once again, these are all the same settings as I was using yesterday prior to the error). XHR finished loading: GET "http://local.lenders-one.com/Content/bootstrap/v-635549376660341373/bootstrap.less". less.js:408 XHR finished loading: GET "http://local.lenders-one.com/Content/v-635556102777513301/styles.less". less.js:771 failed to save - less.js:771 The "Fingerprint" class is a utility class that applies fake folders for file caching. I removed the utility class from the javascript/LESS files and I was still receiving the error. I am using LESS v2.0.0 - any help is appreciated.
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/27750286
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/43859305
tagged with: css
has title: LESS.js - Error msg "failed to save"
has comment: http://stackoverflow.com/comment/43856539
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/44004587
has text: @Hardik You've changed the result of the code (the original value of the element is ignored).
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27797980

http://stackoverflow.com/comment/43859490
type: Comment
comment on: http://stackoverflow.com/a/27723730
has text: @user1027620 it says it was resolved, and because theres a small space between the sub-sections that pushes 50% to the next line, probably something to do with the spacing of divs, i usually use bootstrap when dealing with grid spacings instead of tables
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43750354
type: Comment
has text: Why add `*` to the key when creating the regexp? That means the last character of the key can appear zero or more times. So it will match if the last character is missing.
type: AnswerComment
comment on: http://stackoverflow.com/a/27667837
score: 0

http://stackoverflow.com/q/27745417
has body: I have a date formatted in Moment.JS but when I call currentDay.month() //Or currentDay.date() I get a 1 digit number (for example Jan 1st would be 0 for month and 1 for day). I need to get this with a leading 0 for date and month if less than 10. I can do this with something like... currentDay.date() &gt;= 10 ? currentDay.date() : '0'+currentDay.date() But I was looking for something a bit nicer. Can I do this easily with MomentJS? I don't see anything in docs.
has title: Pad day and time in MomentJS without extra logic
answer count: 1
accepted answer: http://stackoverflow.com/a/27745733
favorite count: 0
downvote count: 2
upvote count: 1
tagged with: momentjs
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/107753070
has answer: http://stackoverflow.com/a/27745733
type: Question
tagged with: javascript
score: -1

http://stackoverflow.com/a/27727283
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/43881353
answers question: http://stackoverflow.com/q/27726902
downvote count: 0
has body: Read "JavaScript the Good Parts" by Douglas Crockford http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742/ref=sr_1_1?ie=UTF8&amp;qid=1419857713&amp;sr=8-1&amp;keywords=javascript+the+good+parts This will give you what you need for JavaScript. I don't know "the best" source for jQuery, but start here: http://learn.jquery.com/
type: AcceptedAnswer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27726902

http://stackoverflow.com/q/27749873
has body: I've just started creating unit tests using Jasmine and Karma for my angular app. I have a test that is failing when I think it shouldn't be. I want to get the console output from the controller itself, not just the jasmine tests that run on the controller, is this possible? Here is a code example: the test: it('First test', function() { var ctrl = controller('controller', {$scope: scope, MyHttpService: MyHttpMock}); scope.update(); console.log("I can see this console output"); expect(scope.campaignID).toEqual(''); expect(scope.data.pending).toEqual(20); // &lt;--- fails here }); the controller: $scope.update = function() { MyHttpService.get('stats').then(function(data) { console.log("the data: ", data); // &lt;-- can't see this output $scope.data = data; }); } --EDIT-- Here is the code for MyHttpMock: var MyHttpMock = { get: function(key) { var deferred = $q.defer(), promise = deferred.promise; promise.then(function(data) { return data; }); if (key == "stats") { deferred.resolve({"pending": 20}) } else { deferred.resolve({}); } return promise; } }; I originally didn't include it because my question is about how to see the debug output from within the controller, not debugging this specific problem. But here it is anyway just in case it helps. --END EDIT-- I can see in the console log from the test that the return value looks correct. The mock service seems to be doing what it is supposed to do. But the test is failing, and it shows scope.pending as undefined. MyHttpService returns a promise, and I have a suspicion that it is not structured correctly, or something like that. However, I'm not sure how to inspect it. Is there a way to view the console log from within the controller to see what data is actually getting passed in?
answer count: 2
downvote count: 0
tagged with: jasmine
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/23803743
has title: Angular Jasmine: View console output from controller?
accepted answer: http://stackoverflow.com/a/27749966
type: AnsweredQuestion
tagged with: karma-runner
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/27750028
tagged with: unit-testing
type: Question
has comment: http://stackoverflow.com/comment/43910866
possible better answer: http://stackoverflow.com/a/27750028
tagged with: javascript
has answer: http://stackoverflow.com/a/27749966

onclicklistener
tag name: onclicklistener
tags question: http://stackoverflow.com/q/27755132
type: Tag

http://stackoverflow.com/comment/43768525
type: QuestionComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/67790/discussion-between-bas-and-axel-amthor).
comment on: http://stackoverflow.com/q/27675849
score: 0
type: Comment

http://stackoverflow.com/comment/43853815
has text: As said in the specifications if no expression is present after the return statement an undefined value will be returned : _Syntax ReturnStatement : return ; return [no LineTerminator here] Expression ; Semantics An ECMAScript program is considered syntactically incorrect if it contains a return statement that is not within a FunctionBody. A return statement causes a function to cease execution and return a value to the caller. If Expression is omitted, the return value is undefined. Otherwise, the return value is the value of Expression._
comment on: http://stackoverflow.com/a/27721023
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/q/27751285
has answer: http://stackoverflow.com/a/58425137
tagged with: javascript
has comment: http://stackoverflow.com/comment/43913777
has body: I am trying to get it so the HTML5 video player smoothly loads and transitions to another video or plays back the video. However, when it does reload the file, the video disappears and then reappears. I don't want that to happen. Here is my code: How would I make the player look smooth and simply replay without the player disappearing and then reappearing when it reloads and plays the video?
score: 2
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: video
has comment: http://stackoverflow.com/comment/43913970
has comment: http://stackoverflow.com/comment/43943315
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27751368
has title: HTML5 video changes width/height or glitches when loading new video?
downvote count: 0

slick.js
tag name: slick.js
tags question: http://stackoverflow.com/q/27798824
type: Tag
tags question: http://stackoverflow.com/q/27781770
tags question: http://stackoverflow.com/q/27795730

http://stackoverflow.com/comment/43743463
comment on: http://stackoverflow.com/q/27663338
type: Comment
type: QuestionComment
score: 0
has text: That text input needs a label. Those images need alt text.

http://stackoverflow.com/comment/43976879
type: QuestionComment
has text: You should have shared service between both application and second applicaton must listen this service when ivoked then refresh itself.
score: 0
comment on: http://stackoverflow.com/q/27783396
type: Comment

http://stackoverflow.com/comment/43932299
type: QuestionComment
score: 0
has text: *"When I click on the icon to generate the email I get nothing."* - Not even an error in the browser's debug console? Is all of that code inside a function?
comment on: http://stackoverflow.com/q/27760633
type: Comment

http://stackoverflow.com/comment/43969027
has text: created a [plnkr](http://plnkr.co/edit/XYjPnXN7ho28h32m6k5g?p=preview). I have same controller twice on same page. Change on one controller switch will reflect same to another controller switch.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27777921
type: Comment

http://stackoverflow.com/a/27677524
type: Answer
upvote count: 11
score: 11
has body: http://jsfiddle.net/ys4je40u/ add lazy-load class to item object use slide.bs.carousel event CSS: .lazy-load { background: url("http://www.mozart.it/images/preloader.gif") center center no-repeat; } JQ: var cHeight = 0; $('#myCarousel').on('slide.bs.carousel', function (e) { var $nextImage = null; $activeItem = $('.active.item', this); if (e.direction == 'left'){ $nextImage = $activeItem.next('.item').find('img'); } else { if ($activeItem.index() == 0){ $nextImage = $('img:last', $activeItem.parent()); } else { $nextImage = $activeItem.prev('.item').find('img'); } } // prevents the slide decrease in height if (cHeight == 0) { cHeight = $(this).height(); $activeItem.next('.item').height(cHeight); } // prevents the loaded image if it is already loaded var src = $nextImage.data('lazy-load-src'); if (typeof src !== "undefined" &amp;&amp; src != "") { $nextImage.attr('src', src) $nextImage.data('lazy-load-src', ''); } });
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27675968
answers question: http://stackoverflow.com/q/27675968

http://stackoverflow.com/a/27693880
downvote count: 0
type: Answer
has body: Synchronous XMLHttpRequests are disabled by default for Chrome apps. Check this link to see all disabled web features and the workarounds. For this case: Use async-only XMLHttpRequest: Getting Rid of Synchrounous XXRs.
answers question: http://stackoverflow.com/q/27693814
accepted answer of: http://stackoverflow.com/q/27693814
score: 5
upvote count: 5
type: AcceptedAnswer

http://stackoverflow.com/comment/43905665
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27746057
type: Comment
has text: @JacobCarpenter Yeah this is more of a job for a server-side lanugage like PHP. Although I didn't know that you where using PHP. Anyways I've updated my answer to show you how to do this with just JavaScript.

http://stackoverflow.com/comment/54909636
comment on: http://stackoverflow.com/a/27808902
score: 0
type: AnswerComment
has text: This exampled worked, and looks like the solution! but for some reason I could not get this working connecting to telerik everlive platform. Anyone got it working with everlive?
type: Comment

http://stackoverflow.com/comment/43885198
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27736694
type: Comment
has text: this have output PLACE, what i need is song name, like "Abba - Happy new year", not the PLACE.....

http://stackoverflow.com/a/33443434
answers question: http://stackoverflow.com/q/27694465
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/54698417
has body: I have replicated your code and works fine, all I had to do was obviously change the sample clientid to fit mine, have you done the same? I suppose yes but never knows... I do not run the page from a web server, I'm opening it directly from disk I´m not an expert but it doesn't work, you have to serve it, maybe with xampp...

http://stackoverflow.com/comment/43851393
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27719767
score: 0
has text: Also relevant: http://stackoverflow.com/questions/13508803/how-to-get-transformed-rotated-svg-path-points

http://stackoverflow.com/comment/43841335
comment on: http://stackoverflow.com/a/27714551
type: Comment
has text: It's not working. But it seems the issue is something else. Even if I do this: $("#datepicker").change(function() { alert( "test" ); }); the alert doesn't show
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43967107
has text: when I opene new window, controller will be initialized. So how service instance will return the old value which is assigned by main page?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27777921

http://stackoverflow.com/comment/43989317
score: 0
type: Comment
type: QuestionComment
has text: Not sure what you are asking about.
comment on: http://stackoverflow.com/q/27789535

http://stackoverflow.com/q/27677796
has comment: http://stackoverflow.com/comment/43771092
accepted answer: http://stackoverflow.com/a/27678154
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27678154
score: 0
has body: One of my APP dev requires I clone a link 3 times and stored in to an object. after i stored to object i have added some click event to stored object's link element. I have a navigation link, when user click on the navi number, i am appending the stored element to container. All it works. the issue is: the click event of the link only works on page load. it's not working after shuffling the other stored object to container. how to fix this. the event all are goes away. click event not working further. here is my js: var listLength = $('li').length; var origional = $('.content'); var catcheEl = {}; for(i=1;i&lt;= listLength;i++){ catcheEl['content'+i] = origional.clone(); var link = $(catcheEl['content'+i]).find('a').addClass('link'+i); addEvent(link); } function addEvent (link) { var x = 0; link.click(function(e){ e.preventDefault(); x++; console.log(x); $(this).addClass('p'+x); //only adds on page load. }); } $('li').click(function(){ var num = $(this).find('button').prop('class'); $('#newContainer').html(catcheEl['content'+num]); //not working once other elements loaded. }); $('.content').hide(); Live Demo What i require is : I should shuffle the link element clicking the navi button the class name of element should continue the added event should be continue. Thanks in Advance.
answer count: 1
has comment: http://stackoverflow.com/comment/43769950
has comment: http://stackoverflow.com/comment/43770231
tagged with: jquery
has comment: http://stackoverflow.com/comment/43769969
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: jQuery element stored with `click` event not working as required

http://stackoverflow.com/comment/44033673
comment on: http://stackoverflow.com/q/27802508
score: 0
type: QuestionComment
has text: @Kingpin2k may be i didn get your point the right way but i feel i didn explain well either. The example stated is just an example and not the actual use case i am ending up with! I am computing something that is being used but i am computing more than one. Since i am computing more than one i felt its better to use observers than computed properties!
type: Comment

http://stackoverflow.com/comment/43857589
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27721427
has text: thanx for ur help so far..Have you seen the extension adblock ..it searches for advertisements without a request on the page..hows it done like that ..any idea ?
score: 0

http://stackoverflow.com/q/27728214
has answer: http://stackoverflow.com/a/27728250
tagged with: javascript
has comment: http://stackoverflow.com/comment/43868455
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/27728250
tagged with: jquery
has comment: http://stackoverflow.com/comment/43868371
has body: I'm basically trying to replicate what you get on google images with a div appearing from an onClick event directly below the row of images containing the anchor that is clicked. I've found code for the show and hide methods which is pretty easy, as per below: $(document).ready(function(){ $("#hide").click(function(){ $("#imageBox").hide("slow"); }); $('a').click(function(){ $("#imageBox").show("slow"); document.getElementById("displayImage").innerHTML = '&lt;img src = "images/profiles/male-silhouette.jpg" style="margin:20px;" /&gt;'; }); }); However I can't get around the div appearing wherever I place it in the HTML. For instance, in the code below the div with image and text will obviously always appear between the first and second lists, in the same place: &lt;ul&gt; &lt;li&gt;Item 1&lt;/li&gt; &lt;li&gt;Item 2&lt;/li&gt; &lt;/ul&gt; &lt;div id="imageBox"&gt; &lt;button id="hide" class="hButton"&gt;X Close&lt;/button&gt; &lt;p id="displayImage"&gt;&amp;nbsp;&lt;/p&gt; &lt;/div&gt; &lt;ul&gt; &lt;li&gt;Item 1&lt;/li&gt; &lt;li&gt;Item 2&lt;/li&gt; &lt;/ul&gt; &lt;ul&gt; &lt;li&gt;Item 1&lt;/li&gt; &lt;li&gt;Item 2&lt;/li&gt; &lt;/ul&gt; After searching on Google and Stack Overflow I've not even come close to learning how to do this. Can anyone point to some open source code or a tutorial?
has comment: http://stackoverflow.com/comment/43868388
has comment: http://stackoverflow.com/comment/43868369
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27728230
accepted answer: http://stackoverflow.com/a/27728230
has title: display div dynamically on click
has comment: http://stackoverflow.com/comment/43868445
type: Question
has answer: http://stackoverflow.com/a/27728259

http://stackoverflow.com/comment/43852136
comment on: http://stackoverflow.com/q/27720181
score: 0
type: Comment
type: QuestionComment
has text: possible duplicate of [SyntaxError: unterminated string literal strange error](http://stackoverflow.com/questions/14170153/syntaxerror-unterminated-string-literal-strange-error)

http://stackoverflow.com/q/27755257
has answer: http://stackoverflow.com/a/27755943
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27755943
has body: I am using Twitter Bootstrap 3. I have column system that represent 4 similar advertisements at the bottom of page. In view: <% @recomended_ads.each do |advertisement| %> <%= link_to (image_tag advertisement.pictures.first.image,:title=> advertisement.name, :width=>210),advertisement %> BASIC CONTENT! <%end%> NEW CONTENT @location.id).where("recomend >= ?", Time.now).where.not(id: @advertisement.id).limit(4).order("RAND()") Basicaly it generates maximum 4 columns. What I need: I need to change last 2 column content when user clicks on specifick link. So far I have created: NEW CONTENT </div NEW CONTENT 2 These two columns are hidden and are inside the same row as those I want to hide/replace. I came up with script, that show/hide those hidden colums $(document).ready(function() { $('.question4').click(function(e){ $('#vips').slideToggle("fast"); $('#vips2').slideToggle("fast"); e.preventDefault(); }) });//end of read Works perfect if there is just TWO default columns .limit(2) in controller action. If there is at more than 2 those colums are pushed down to next row. And that is what I don't want. Question: 1) Is there possible to change that limit value from 4 to 2 if click on link has made? Without page reload? I believe Jquery can't change anything on server side. 2) Or there are other trick to achieve something like this ? At this point my code does this. And bullets show how It should look like. Any advise would be great? Thanks in advance.
answer count: 1
favorite count: 0
tagged with: twitter-bootstrap
has title: Replace 2 Bootstrap columns with 2 hidden columns on click. Rails 4, Bootstrap
tagged with: ruby-on-rails
tagged with: css

http://stackoverflow.com/comment/43746878
score: 0
type: AnswerComment
has text: Haha like this, a good idea. [adding-h1-around-a-selection](http://stackoverflow.com/questions/25221555/adding-h1-around-a-selection)
type: Comment
comment on: http://stackoverflow.com/a/27665115

http://stackoverflow.com/comment/43989065
score: 0
comment on: http://stackoverflow.com/q/27788367
has text: Why do you need the A1 notation? Will you use somewhere else or just to get the values? Also why do you need a collumn at a time? It's usually good practice to use getDataRange().getValues(); or getSheetValues(1, 1, -1, -1);.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43857675
type: QuestionComment
comment on: http://stackoverflow.com/q/27714085
score: 0
has text: Sorry about imgur... I need a higher rep to add pictures :( I tried your advice by adding the "XXX YYY" and the "XXX and YYY" Showed up, but the Sign In button, which should have shown up between them, did not show up... as for am Android equivalent to check the DOM I'm not really sure if that exists... maybe I'll check StackOverflow for it!
type: Comment

http://stackoverflow.com/comment/49598090
score: 0
comment on: http://stackoverflow.com/a/27773201
has text: Hi Rahul, Are you using hml2canvas.js to take screenshots? Which platform you are using either mobile or desktop? Did you try it after hosting in the server, like wamp?
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43979640
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27784547
has text: Also, if you are minifying your code, the $scope won't work. You need to use the syntax app.controller('createController', ['$scope', createController]); It's a good habit to get into, because this causes huge headaches on a prod environment.

http://stackoverflow.com/comment/45318264
comment on: http://stackoverflow.com/a/28400193
has text: In the meanwhile this works (after installing `glob`): `opal -rnodejs -ce 'exit 127' | node; echo $?`
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27710617
type: Question
has comment: http://stackoverflow.com/comment/43833345
tagged with: javascript
has answer: http://stackoverflow.com/a/27725958
has body: have done this before but converting this part of IIM code to JAVSCRIPT, is giving me an error IIM code (runs fine) URL GOTO=abcDOTcom EVENT TYPE=CLICK SELECTOR="#\\7 1RB7&gt;DIV:type(1)" BUTTON=A Converted to JAVSCRIPT Code var macro; macro = "CODE:"; macro += "URL GOTO=abcDOTcom" + "\n"; macro += "EVENT TYPE=CLICK SELECTOR=\"#\\7 1RB7&gt;DIV:type(1)\" BUTTON=A" + "\n"; iimPlay(macro) i read that we have to comment out quotes with a \ before it. I did but still it isnt working I feel the two \\ in the code before the 7 is an issue OR the SPACE after the 7 is an issue How do i make sure sure it runs fine in JAVASCRIPT Some syntax issue i am pretty sure Thanks
has comment: http://stackoverflow.com/comment/43833120
answer count: 2
has comment: http://stackoverflow.com/comment/43833183
downvote count: 0
has title: IMACROS Error in code after converting iim code to javascript
has comment: http://stackoverflow.com/comment/43833234
favorite count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: imacros
tagged with: syntax
has answer: http://stackoverflow.com/a/38352256
score: 1

http://stackoverflow.com/comment/43884294
has text: It returns 0 for the count. See gist in comment above for actual output.
type: AnswerComment
comment on: http://stackoverflow.com/a/27735960
score: 0
type: Comment

http://stackoverflow.com/a/27730302
has comment: http://stackoverflow.com/comment/43872334
has comment: http://stackoverflow.com/comment/43872550
score: 0
has comment: http://stackoverflow.com/comment/43883893
has body: I'm not familiar with server-side js (you mean nodejs?). so shot in the dark: some companies require params both in the URL &amp; POST body and linkedin require HTTPS request, maybe www.linkedin.com is not right. PS. can't edit comments,just post here;(
type: Answer
has comment: http://stackoverflow.com/comment/43872665
answers question: http://stackoverflow.com/q/27728151
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/43963847
score: 0
type: Comment
has text: @MarcRasmussen - why do you think it needs to be called 15 times - `setTimeout` executes only once, you just want to clear the executing one.
type: AnswerComment
comment on: http://stackoverflow.com/a/27776617

http://stackoverflow.com/comment/43985257
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27787573
has text: You also need to learn to check for errors `$('#list'.length)` is invalid syntax that will throw error
score: 0

http://stackoverflow.com/a/27752154
has comment: http://stackoverflow.com/comment/43926221
downvote count: 0
has body: localStorage.setItem("signature", dataURL); var signature = localStorage.getItem("signature");
answers question: http://stackoverflow.com/q/27752038
score: 1
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/43915345

geolocation
tags question: http://stackoverflow.com/q/27652225
tags question: http://stackoverflow.com/q/27687740
tags question: http://stackoverflow.com/q/27731674
tags question: http://stackoverflow.com/q/27751258
tags question: http://stackoverflow.com/q/27788677
type: Tag
tag name: geolocation

http://stackoverflow.com/comment/43733309
comment on: http://stackoverflow.com/a/27658603
score: 1
type: AnswerComment
type: Comment
has text: I updated my answer to show what the output in my Chrome console looks like.

http://stackoverflow.com/comment/43837745
type: QuestionComment
comment on: http://stackoverflow.com/q/27712313
has text: Any link to some sample code or anything similar levi? I'll be looking up see what I can find on PDF.js. Thanks!
score: 0
type: Comment

http://stackoverflow.com/q/27755454
type: Question
has comment: http://stackoverflow.com/comment/43922336
has comment: http://stackoverflow.com/comment/43922174
has title: Can't click div
has answer: http://stackoverflow.com/a/27755548
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43921647
answer count: 3
has answer: http://stackoverflow.com/a/27755621
has comment: http://stackoverflow.com/comment/43922292
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43921671
has body: I am working on a website to view your stats from my Minecraft Pocket Edition server, and I am having a problem. I have one div with the id "tabs-minigames" and in this div there are 4 boxes with icons, which are these "tabs", and this div is currently not shown (in css display none) Now, I have a image at the top of the website that you should be able to click to show the div "tabs-minigames", and the tabs show, but don't disappear after clicking a second time. I cannot see what I am doing wrong. I am using this function in jQuery to show and hide the minigames tab: $(document).ready(function(){ var status = false; $('#sliderimg').on('click', function(){ if(!status){ $("#tabs-minigames").show(); status = true; }else{ $("#tabs-minigames").hide(); status = false; } }); }); I don't see anything wrong with the function, and here is the HTML View your stats - Legion PE Legion PE You can see the website live here: http://legionpvp.eu/pe/login/stats.html Thanks!
has comment: http://stackoverflow.com/comment/43922163
has comment: http://stackoverflow.com/comment/43921753
has comment: http://stackoverflow.com/comment/43921580
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43922509
has answer: http://stackoverflow.com/a/27755628
upvote count: 1
has comment: http://stackoverflow.com/comment/43921563
score: 1

http://stackoverflow.com/comment/43748090
score: 0
type: Comment
has text: How to display what? Perhaps you can provide an example of the object and the type of display you're trying to achieve? Or at least the objectives of the display?
type: QuestionComment
comment on: http://stackoverflow.com/q/27666569

http://stackoverflow.com/a/27679540
downvote count: 0
has body: I think you are overthinking it. I'd bet that the combined two calls that you are worried about are going to run in roughly the same amount of time as the single webforms page_load would if you coded otherwise - only difference now being that the initial page load is going to be really fast (because you are only loading a lightweight, html/css/images page with no slowdown for running any server code. Common solution would be to then have a 'spinner' or some sort (an animated GIF) that gives the user an visual indication that the page isn't done loading while your ajax calls wait to complete. Watch a typical page load done from almost any major website in any language, you are going to see many, many requests that make up a single page being loaded, wether it be pulling css/images from a CDN, js from a CDN, loading google analytics, advertisements from ad networks etc. Trying to get 100% of your page to load in a single call is not really a goal you should be worried about.
upvote count: 2
answers question: http://stackoverflow.com/q/27645478
type: Answer
score: 2

http://stackoverflow.com/q/27696788
has comment: http://stackoverflow.com/comment/43806926
upvote count: 0
possible better answer: http://stackoverflow.com/a/27696905
favorite count: 0
accepted answer: http://stackoverflow.com/a/27696883
has comment: http://stackoverflow.com/comment/43806829
has comment: http://stackoverflow.com/comment/43806878
tagged with: regex
has body: Abstraction problem: Match strings that do not start with 'char' and return matches. My regex (not perfect): /( ){1}([^#]*)(<\/XX>){1}/ig does: #test // not matched test // matched + return 'test' te#st // not matched but should do: #test // not matched test // matched + return test te#st // matched + return te#st plus return the fragment (i.e. group between tags = 'test', for example by '$2'). Problem example: https://www.regex101.com/r/vT9kS7/1
has title: Regex match: does not contain char on beginning of a string
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43806887
downvote count: 2
tagged with: regex-negation
type: Question
has answer: http://stackoverflow.com/a/27696883
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/27696905
answer count: 2

http://stackoverflow.com/comment/43886782
has text: Yes ..... ,.......... of no use
type: Comment
comment on: http://stackoverflow.com/q/27737643
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43982337
type: Comment
has text: It's failing in firefox and chrome but it needs to work in all browsers
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27786056

http://stackoverflow.com/q/27689207
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27689285
tagged with: dom
type: Question
has comment: http://stackoverflow.com/comment/43791623
tagged with: javascript
tagged with: jquery
score: 0
has title: display loading image until all data gets loaded
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/27689285
has body: Right now i am simply giving a definite time interval after which the loading image disappears but i want to place a loading image which will be display until all the content in the background is not fully loaded. current code #loadingImgDIv{ position:fixed; width:100%; height:100%; top:0px; left:0px; z-index:14; } &lt;script&gt; setTimeout("removeLoadingImg()",5000); function removeLoadingImg(){ //using css display:hidden; attribute on #loadingImgDiv using javascript } &lt;/script&gt; But this is not the right way to do it...so please help me
has comment: http://stackoverflow.com/comment/43791689
has comment: http://stackoverflow.com/comment/43791634

http://stackoverflow.com/comment/44034799
has text: You obviously need to give more info. The given link gives all steps coordinates for one route. My answer gives all steps coordinates for all routes. Now what do you need??
type: AnswerComment
comment on: http://stackoverflow.com/a/27803979
type: Comment
score: 2

http://stackoverflow.com/q/27700519
has comment: http://stackoverflow.com/comment/43814534
tagged with: javascript
possible better answer: http://stackoverflow.com/a/30641086
has comment: http://stackoverflow.com/comment/86312621
upvote count: 3
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27701230
tagged with: angularjs
tagged with: papaparse
accepted answer: http://stackoverflow.com/a/27702432
tagged with: http://stackoverflow.com/tag/csv
has comment: http://stackoverflow.com/comment/49714703
has answer: http://stackoverflow.com/a/30641086
answer count: 4
has comment: http://stackoverflow.com/comment/43814970
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43815074
has title: PapaParse with Angular JS
has answer: http://stackoverflow.com/a/27702432
has body: Liked the nice CSV parser &amp; unparser of PapaParse. Can any one help me to get this combine with Angular JS. I like to make PapaParse work in Angular Way. Trying for a solution.
linked to: http://stackoverflow.com/q/14968297
type: Question
has answer: http://stackoverflow.com/a/46700957

http://stackoverflow.com/comment/43722301
type: QuestionComment
comment on: http://stackoverflow.com/q/27652564
score: 0
has text: I suspect the problem you're having is becaue you reuse the same `id=element_to_pop_up` for every DIV. IDs are supposed to be unique.
type: Comment

http://stackoverflow.com/a/27663715
answers question: http://stackoverflow.com/q/27663660
downvote count: 0
score: 4
has body: Bootstrap your angular app, and register your controller var app = angular.module('app',[]); app.controller('ctrl', function($scope){ $scope.name = 'james'; $scope.age = 20; }); HTML &lt;body ng-app="app" ng-controller="ctrl"&gt; {{name}}&lt;br /&gt; {{age}} &lt;/body&gt;
type: Answer
has comment: http://stackoverflow.com/comment/43765685
upvote count: 4

http://stackoverflow.com/comment/43983225
comment on: http://stackoverflow.com/a/27781818
score: 0
type: AnswerComment
has text: Do I add the jQuery to the functions table in wordpress?
type: Comment

http://stackoverflow.com/comment/43926405
score: 0
type: AnswerComment
type: Comment
has text: isnt that the same dialog box that pops up..check my fiddle once more..
comment on: http://stackoverflow.com/a/27757819

http://stackoverflow.com/a/27753638
type: AcceptedAnswer
has body: First of all, let's assume the following in the manifest file. This snippet is equivalent to what you've posted in the question, but just a bit shorter, "*://" = http and https; You don't need to declare the permission if you inject a content script through the manifest file. "content_scripts": [{ "matches": [ "*://youtube.com/watch?v=*" ], "css": [ "src/inject/inject.css" ], "js": [ "src/inject/inject.js" ] }] About your two questions: shouldn't it only inject the CSS/JS on the video pages due to "watch?v=*"? Yes, and it does. However, YouTube does not really "unload" the page when you navigate to a different page. Instead, the displayed HTML is updated and the URL is changed using the history.pushState API. Consequently, extension developers usually find that their code is "not injecting" or "run too often" even when they restrict content scripts/styles to "watch?v=" pages. "not injecting" occurs when you initially visit a non-watch page (e.g. the home page) and then click on a video. You would expect that the script activates on the video page because the URL has changed to "watch?v", but this does not happen because the page did not actually reload. "run too often" occurs when you navigate from a watch-page to a non-video page (e.g. the home page). You'd expect that the script does not run on the home page, because the URL does not match "watch?v=", but since the page did not unload, the previous scripts are still active. Is there a better way to go about detecting video pages? You could use the method described here to detect these transitions and appropriately respond to these events. E.g. enable/disable your logic depending on whether the current page is a /watch page. This implies that you have to code carefully, and make sure that you properly clean up your DOM and events. (note that getting this right is not straightforward: merely inserting one element in the document for which you keep a reference is sufficient to prevent the garbage collector from freei…
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27747290
answers question: http://stackoverflow.com/q/27747290
has comment: http://stackoverflow.com/comment/43949412
upvote count: 2

http://stackoverflow.com/q/27763520
answer count: 1
tagged with: meteor
tagged with: meteor-accounts
type: AnsweredQuestion
type: Question
tagged with: mongodb
has title: Add custom user fields to Meteor.js
tagged with: javascript
has answer: http://stackoverflow.com/a/27763688
accepted answer: http://stackoverflow.com/a/27763688
score: 0
has body: I am new to programming and Meteor.js. I am trying to build a question app where an admin can post questions, then after awhile be able to mark them as true or false. When user clicks on "Yes" or "No" the app adds their user id to either usersTrue or usersTrue arrays. Also the question _id is added to the users profile so it can check if the user has already answered the question. Finally, when the admin clicks true or false it loops through the list of users who answered correctly and increases their rightCount by 1 or if they answered incorrect increases their wrongCount by 1. I have figured out how to insert the user's id into the right question array. My question is how can I add custom fields to the user when their account is created, so I can check if the user has answered the question already. I have tried creating /server/user.js with onCreateUser Accounts.onCreateUser(function(options, user){ profile = _.insert({ questionsAnswered: [], rightCount: 0, wrongCount: 0 }); user.profile = profile return user; If I am doing this completely wrong or there is a more efficient way of doing this whole process, I would be interested in hearing it.

http://stackoverflow.com/a/27808360
upvote count: 1
answers question: http://stackoverflow.com/q/27685928
has body: @markE's answer is right on for 1 &amp; 2 (3) Is due to the fact that your animation loop is infinitely recursive: function animateParallaxImages() { $.each(parallaxImages, function(index, parallaxImage) { var speed = 3; var delta = ((lastKnownScrollTop + ((viewportDims.height - parallaxImage.containerHeight) / 2)) - parallaxImage.offsetY) / speed; parallaxImage.image.css({ 'transform': 'translate3d(0,'+ delta +'px,0)' }); }); window.requestAnimationFrame(animateParallaxImages); //recursing here, but there is no base base } animateParallaxImages(); //Kick it off If you look at the example on MDN: var start = null; var element = document.getElementById("SomeElementYouWantToAnimate"); function step(timestamp) { if (!start) start = timestamp; var progress = timestamp - start; element.style.left = Math.min(progress/10, 200) + "px"; if (progress &lt; 2000) { window.requestAnimationFrame(step); } } window.requestAnimationFrame(step); I would suggest either stopping recursion at some point, or refactor your code so functions/variables aren't being declared in the loop: var SPEED = 3; //constant so only declare once var delta; // declare outside of the function to reduce the number of allocations needed function imageIterator(index, parallaxImage){ delta = ((lastKnownScrollTop + ((viewportDims.height - parallaxImage.containerHeight) / 2)) - parallaxImage.offsetY) / SPEED; parallaxImage.image.css({ 'transform': 'translate3d(0,'+ delta +'px,0)' }); } function animateParallaxImages() { $.each(parallaxImages, imageIterator); // you could also change this to a traditional loop for a small performance gain for(...) window.requestAnimationFrame(animateParallaxImages); //recursing here, but there is no base base } animateParallaxImages(); //Kick it off
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/comment/43779424
comment on: http://stackoverflow.com/q/27681838
score: 0
type: Comment
type: QuestionComment
has text: What did you try so far and how did it not work?

http://stackoverflow.com/a/27781143
answers question: http://stackoverflow.com/q/27740138
downvote count: 0
score: 9
has body: You can include jQuery or use default Dom7 library, it has the same Ajax methods: var $$ = window.Dom7; //do get request $$.get('path-to-file.php', {id: 3}, function (data) { console.log(data); }); //do post request $$.post('path-to-file.php', {id: 3}, function (data) { console.log(data); }); //get JSON request $$.getJSON('path-to-file.js', function (json) { console.log(json); });
upvote count: 9
type: Answer

http://stackoverflow.com/comment/43767852
has text: @ArtjomB., does it work on page.open??
comment on: http://stackoverflow.com/q/27659514
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43755040
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27670017
has text: Oh I see :) That might Acualy be It Let ME Give It A Try :P
score: 0

apache
tag name: apache
tags question: http://stackoverflow.com/q/27702552
tags question: http://stackoverflow.com/q/27774998
tags question: http://stackoverflow.com/q/27799594
tags question: http://stackoverflow.com/q/27699069
tags question: http://stackoverflow.com/q/27723961
type: Tag
tags question: http://stackoverflow.com/q/27642588

http://stackoverflow.com/q/27755212
score: 1
has title: moment.js "invalid date" calculating time difference
upvote count: 1
accepted answer: http://stackoverflow.com/a/27755640
has comment: http://stackoverflow.com/comment/43921086
type: Question
has body: I'm trying to calculate the time difference in hours &amp; mins between 2 form fields, but I get "Invalid Date" returned. I've tried to use other examples and make them work to suit my needs. The input is for both start and end fields. &lt;script type="text/javascript" src="/js/moment.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function calculate(){ var start = document.getElementById(StartTime); var end = document.getElementById(EndTime); var diff = moment.utc(moment(end,"HH:mm").diff(moment(start,"HH:mm"))).format("HH:mm") document.form.total.value = diff; } &lt;/script&gt; &lt;form method="POST" name="form" id="form" action="test2.php"&gt; &lt;?php echo "time1: &lt;input type='text' name='StartTime' id='StartTime' onChange='calculate()'/&gt; &lt;br /&gt;"; echo "time2: &lt;input type='text' name='EndTime' id='EndTime' onChange='calculate()' /&gt; &lt;br /&gt;"; echo "difference: &lt;input type='text' name='total' id='total' /&gt; &lt;br /&gt; "; echo "&lt;Br /&gt;"; ?&gt; &lt;/form&gt; Thanks
tagged with: javascript
has comment: http://stackoverflow.com/comment/43921696
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43921478
has comment: http://stackoverflow.com/comment/43921650
tagged with: php
tagged with: momentjs
has answer: http://stackoverflow.com/a/27755640
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/12593653

http://stackoverflow.com/q/27737307
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/32046129
has comment: http://stackoverflow.com/comment/43905560
tagged with: semantic-ui
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43886717
has comment: http://stackoverflow.com/comment/43907079
has comment: http://stackoverflow.com/comment/43886233
type: Question
has title: Semantic-UI Special PopUp not showing
has body: I'm trying to build a special pop up with custom html, to add content later to it ... My console is showing this message = Popup: No visible position could be found for the popup. $(document) .ready(function() { $('.item.messages') .popup({ inline: true, hoverable: true, popup: '.special.popup', position: 'bottom left', delay: { show: 300, hide: 800 } }); }); Custom Header Click Me Any thoughts?
has answer: http://stackoverflow.com/a/53644821
has answer: http://stackoverflow.com/a/33471662
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/q/27652868
tagged with: should.js
tagged with: node.js
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27652910
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/27652910
tagged with: javascript
tagged with: mocha.js
has title: How do I reuse a test function with async calls in nodejs?
linked to: http://stackoverflow.com/q/6066846
has comment: http://stackoverflow.com/comment/43726125
has body: I'm new to node.js and it's been a while since I've worked with an asynchronous framework. In a procedural language such as python it's easy to have a list of inputs and expected outputs then to loop through them to test: tests = { 1: [2, 3], 2: [3, 4], 7: [8, 9], } for input, expected_out in tests.items(): out = myfunc(input) assert(out == expected_out) I'm attempting to do something similar with nodejs/mocha/should: var should = require('should'); function myfunc(x, cb) { var y = x + 1; var z = x + 2; cb([y, z]); }; describe('.mymethod()', function() { this.timeout(10000); it('should return the correct output given input', function(done) { var testCases = { 1: [2, 3], 2: [3, 4], 7: [8, 9], }; for (input in testCases) { myfunc(input, function (out) { var ev = testCases[input]; out.should.equal(ev); }); } }) }) This results in: AssertionError: expected [ '11', '12' ] to be [ 2, 3 ] + expected - actual [ + 2 + 3 - "11" - "12" ] I have no idea where [ '11', '12' ] comes from, but it smacks of a thread safety issue. Can anyone explain to me where these unexpected values are coming from?
downvote count: 0
answer count: 1
tagged with: asynchronous
favorite count: 0

http://stackoverflow.com/comment/43830706
type: QuestionComment
comment on: http://stackoverflow.com/q/27697813
score: 0
has text: Any idea to solve this issue?
type: Comment

http://stackoverflow.com/a/27697743
has comment: http://stackoverflow.com/comment/43812912
has body: I found this answer to be very helpful, courtesy of Josh David Miller: .controller('MainCtrl', function ( $scope, myService ) { $scope.loading = true; myService.get().then( function ( response ) { $scope.items = response.data; }, function ( response ) { // TODO: handle the error somehow }).finally(function() { // called no matter success or failure $scope.loading = false; }); }); &lt;div class="spinner" ng-show="loading"&gt;&lt;/div&gt; &lt;div ng-repeat="item in items&gt;{{item.name}}&lt;/div&gt; Source: https://stackoverflow.com/a/15033322/4040107
downvote count: 0
answers question: http://stackoverflow.com/q/27697542
type: Answer
has comment: http://stackoverflow.com/comment/43831498
score: 5
upvote count: 5

http://stackoverflow.com/a/27641587
type: Answer
has comment: http://stackoverflow.com/comment/43704677
has body: Javascript is pass-by-value. (Objects, arrays, and other non-primitives are passed by value-of-reference.) That means that the value of the variable (or reference) is passed to the function, but the function parameter does not become an alias for the actual argument. Thus, you cannot change a variable outside a function without referencing it (as you do in your last example). See this answer in another thread for more information.
score: 4
accepted answer of: http://stackoverflow.com/q/27641524
upvote count: 4
answers question: http://stackoverflow.com/q/27641524
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27764272
has comment: http://stackoverflow.com/comment/43973604
has comment: http://stackoverflow.com/comment/43984730
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43954433
upvote count: 3
has comment: http://stackoverflow.com/comment/43986248
type: Answer
has body: basically I just want to run a function after "enter" og "space" is hit. You could use the event binding. ko.applyBindings({ mytext: ko.observable("initial value"), handleKey: function(data, event) { if (event.keyCode == 0x20) { console.log("Space has been pressed!"); } return true; } });
downvote count: 0
has comment: http://stackoverflow.com/comment/43965383
accepted answer of: http://stackoverflow.com/q/27764194
score: 3
answers question: http://stackoverflow.com/q/27764194
has comment: http://stackoverflow.com/comment/43983424
has comment: http://stackoverflow.com/comment/43952759
has comment: http://stackoverflow.com/comment/43985071

http://stackoverflow.com/a/27791117
upvote count: 1
has comment: http://stackoverflow.com/comment/43992032
has comment: http://stackoverflow.com/comment/43992056
has comment: http://stackoverflow.com/comment/43992230
score: 1
has comment: http://stackoverflow.com/comment/43992061
downvote count: 0
has comment: http://stackoverflow.com/comment/43992084
answers question: http://stackoverflow.com/q/27791099
has comment: http://stackoverflow.com/comment/43992045
has comment: http://stackoverflow.com/comment/43992212
has comment: http://stackoverflow.com/comment/43992091
has comment: http://stackoverflow.com/comment/43992204
type: Answer
has body: james syntax, you are trying to write statements directly in an object literal which you can't do. Use { key: 'value'} syntax Should be: var james = { // add properties to this object! job : "programmer", married : false } Or var james ={}; james.job= "programmer"; or var james = {}; james['job'] = "programmer";

http://stackoverflow.com/q/27696917
has comment: http://stackoverflow.com/comment/43807439
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27697057
upvote count: 1
possible better answer: http://stackoverflow.com/a/34663692
downvote count: 1
has answer: http://stackoverflow.com/a/34663692
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27697003
has comment: http://stackoverflow.com/comment/43807332
tagged with: tumblr-themes
type: Question
has comment: http://stackoverflow.com/comment/43807228
answer count: 3
has title: JQuery hover function opacity animation
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43807297
favorite count: 0
linked to: http://stackoverflow.com/q/8947441
accepted answer: http://stackoverflow.com/a/27697003
score: 0
has body: trying to animate a divs opacity when hovering some other element. First I tried it with display none/block, but it read somewhere it's impossible to make a transition for that. This is a little complicated, because this is supposed to work on each element of the same type with a different id the same. (Picture gallery with a caption to appear on the bottom of the img element when the picture is hovered.) The HTML structure is like this: Caption of the picture. First I went with a mouseover, mouseout approach added to the post-content div which looked like this: onmouseover="document.getElementById('{PostID}').getElementsByClassName('post-content--padded')[0].style.opacity='1.0';" onmouseout="document.getElementById('{PostID}').getElementsByClassName('post-content--padded')[0].style.opacity='0.0';" That worked, but there was no transition. I've set the CSS up with transition handlers to apply to all the css changes within post-content--padded like so: -webkit-transition: all 0.3s; -moz-transition: all 0.3s; transition: all 0.3s; This doesn't seem to affect the mouseover, mouseout opacity change I do, so I tried adding .animate() to that, without much success. Well I got post-content to fade in and out, but not post-content--padded Different approach That all didn't work so much. So I tried using the JQuery function hover(). Long story short I added this above the html in question: This just doesn't want to work though. Endless browsing of stackoverflow and other sources didn't seem to help me with this. Being stuck on this for over an hour I decided to simply ask. It cannot be that hard to add a hover > opactiy transition. Hope I've not been clear and people understand my issue here.

http://stackoverflow.com/comment/44010157
type: Comment
type: QuestionComment
has text: Please show your complete page source. A failure of any Javascript will cause the handler to not run at all, which will leave the normal submit behavior in place. You may just be missing a library include or have placed your JavaScript in the `head` element without a DOM ready handler.
score: 0
comment on: http://stackoverflow.com/q/27792416

http://stackoverflow.com/comment/54161148
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27771671
type: Comment
has text: Thanks for you complete answer. However, there is still something I don't understand. What's the point of having an official extension which can be installed to Chrome whereas this is already the native and used library?

http://stackoverflow.com/comment/43755763
type: Comment
type: QuestionComment
has text: What makes you think PHP does not automatically create an instance of the `RoadTaxDataParser` class?
score: 1
comment on: http://stackoverflow.com/q/27670526

http://stackoverflow.com/comment/43720798
has text: See here - https://developer.chrome.com/apps/manifest/file_handlers
comment on: http://stackoverflow.com/q/27651596
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/27716401
has comment: http://stackoverflow.com/comment/43845821
score: 1
has comment: http://stackoverflow.com/comment/43845433
accepted answer of: http://stackoverflow.com/q/27716347
has body: chack the answer of Alois Mahdal from here &lt;style&gt; #tuxie { width: 25px; height: 25px; background: url('images/tuxie.png') no-repeat left top; } #tuxie:hover { background-position: -25px 0px } &lt;/style&gt; &lt;div id="tuxie" /&gt; JSFiddle
answers question: http://stackoverflow.com/q/27716347
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/43845033
downvote count: 0

http://stackoverflow.com/comment/43823238
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27685875
has text: Umm it's strange, I'm using this same notation in my current project and works perfectly. Maybe it is a problem with Angular libs but I doubt it. Try to ignore any other folder and ignore these folders in other Git project to know exactly where is the problem.
score: 0

http://stackoverflow.com/q/27693535
has title: Deactivating Smarty Streets functionality
downvote count: 0
favorite count: 0
upvote count: 2
score: 2
has answer: http://stackoverflow.com/a/30174389
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/30174389
type: Question
tagged with: smartystreets
has comment: http://stackoverflow.com/comment/48509536
has comment: http://stackoverflow.com/comment/55849267
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/34027409
has answer: http://stackoverflow.com/a/34027409
answer count: 2
has body: I have a form with which I am using Smarty Streets Live Address validation. In general it works well. In the case where a user has begun entering address information, though, the Live Address validation can get in the way. The most specific problem encountered is in the case where address information has been entered but the user chooses to cancel the form. The Live Address validation takes precedence of operation and blocks attempts to deactivate the validation and clear the form. A fiddle example of the issue can be found here. Cancel When no data has been entered the click event works as desired, but once address information has been entered the Live Address validation prevents the event handler from firing. On the click of the cancel button the form should be cleared or returned to the previous page, but instead the Live Address validation takes over and blocks all other actions. How can the Live Address validation be deactivated on the button click event?
tagged with: validation

http://stackoverflow.com/a/27722556
has body: Just use String.indexOf and check if it is present (that is not -1, which means it doesn't exist) if(url.indexOf("core[call]=prj_name.contactform") &gt; -1){ // valid. Brew some code here }
score: 3
has comment: http://stackoverflow.com/comment/43856905
type: AcceptedAnswer
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/27722511
accepted answer of: http://stackoverflow.com/q/27722511
downvote count: 0

http://stackoverflow.com/comment/43966244
type: QuestionComment
has text: can you also post your css so we can see the initial visability of the elements
comment on: http://stackoverflow.com/q/27777774
score: 0
type: Comment

http://stackoverflow.com/comment/43999995
has text: What do you want to accomplish? `Html.ActionLink` just renders the `` tag on the page, it doesn't produce any javascript
comment on: http://stackoverflow.com/q/27795437
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27763801
has comment: http://stackoverflow.com/comment/43939678
has comment: http://stackoverflow.com/comment/43939360
answer count: 1
has comment: http://stackoverflow.com/comment/43939427
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27765781
has comment: http://stackoverflow.com/comment/43941504
has comment: http://stackoverflow.com/comment/43939417
type: AnsweredQuestion
tagged with: datagrid
has comment: http://stackoverflow.com/comment/43939331
tagged with: jquery
has comment: http://stackoverflow.com/comment/43938738
has comment: http://stackoverflow.com/comment/43939543
has body: I have used bootgrid for my website after having issues on rendering table by datatables. Bootgrid render the table well. The table becomes a data grid with it and not like with datatables as i asked from a previous question. But after bootgrid renders the table all the values become 0s. Why is that ? Is there any solution to fix this ? I just used this piece of code $( document ).ready(function() { $('#data_table').bootgrid(); }); I'm referencing JQuery with this &lt;script src="//code.jquery.com/jquery-1.11.2.min.js"&gt;&lt;/script&gt;
has title: Bootgrid generates 0s for every data in the table
type: Question
has comment: http://stackoverflow.com/comment/43939381
has comment: http://stackoverflow.com/comment/43939376
has answer: http://stackoverflow.com/a/27765781
tagged with: twitter-bootstrap-3
score: 0

http://stackoverflow.com/q/27702271
tagged with: javascript
has body: Im trying to make a selection with progress bar for each checkbox when user checked one of the checkbox, the progress bar will show/display. So bar I already coded the css of progress bar is display:none; and also set if checkbox if checked $('.pbar').css('display','block'); , but this doesn't work , anyone can help me check my code please ? what mistake I have made . Thanks JS Fiddle HTML JS var PG = { divid: "", multiselection: "", optionitem: [], init: function (divid, multiselection, optionitem) { PG.divid = divid; PG.multiselect = multiselection; PG.optionitem = optionitem; }, test: function () { for (var i = 0; PG.optionitem.length > i; i++) { alert(PG.optionitem[i].name); } }, render_1: function () { $.each(array, function (i, obj) { var selection = " " + " " + obj.value + " " + " "; $("#" + PG.divid).append(selection); if ($('input#'+obj.value).is(':checked')) { $('.pbar').css('display','block'); } }); $("#survey_title").append("What is your favorite fruit??"); $("#choose").append("Please select 1 fruit only:"); $('.the_checkbox').on('change', function (evt) { if ($(this).siblings(':checked').length >= PG.multiselect) { this.checked = false; } }); }, render_2: function () { $.each(w_array, function (i, obj) { var selection = " " + " " + obj.value + " "; $("#" + PG.divid).append(selection); }); $("#survey_title").append("item??"); $("#choose").append("Please select 3 item :"); $('.the_checkbox').on('change', function (evt) { if ($(this).siblings(':checked').length >= PG.multiselect) { this.checked = false; } }); }, save: function () {} } var array = []; array[0] = { "name": "fruit", "value": "mango" }; array[1] = { "name": "fruit", "value": "apple" }; array[2] = { "name": "fruit", "value": "orange" }; array[3] = { "name": "fruit", "value": "banana" }; var w_array = []; w_array[0] = { "name": "com", "value": "RAM" }; w_array[1] = { "name": "com", "value": "DISK" }; w_array[2] = { "name": "com", "value": "BOOK" }; w_array[3] = { "name": "com", "value": "PEN" };…
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43817464
type: UnansweredQuestion
tagged with: checkbox
tagged with: css
has answer: http://stackoverflow.com/a/27702606
type: Question
has title: Jquery if checkbox checked doesn't work?
answer count: 1

http://stackoverflow.com/q/27794821
linked to: http://stackoverflow.com/q/27598753
tagged with: math
linked to: http://stackoverflow.com/q/849211
has body: I already posted this question here And I got the solution thanks to Fang but the problem is that the coordinates I need to use are GPS coordinates and apparently GPS needs a different formula than cartesian. So I am working with Google Maps APIv3 polygons and having coordinates of AB (by drawing them with the polygon tool) I click on position C which I need to be moved to D which is perpendicular to AB and CD is parallel to AB So the question would be: Having A = 50.88269282423443,6.0036662220954895 B = 50.882753744583226,6.003803014755249 C = 50.88252571592428, 6.003832183778286 - D is perpendicular to AB - CD is parallel to AB What would be the formula to get D I've been trying a long time to figure it out but no succes so far.
linked to: http://stackoverflow.com/q/27251745
type: Question
has answer: http://stackoverflow.com/a/27820393
possible better answer: http://stackoverflow.com/a/27795676
tagged with: javascript
score: 0
answer count: 3
linked to: http://stackoverflow.com/q/27161655
accepted answer: http://stackoverflow.com/a/27947180
tagged with: geometry
has answer: http://stackoverflow.com/a/27795676
has title: Getting coordinates perpendicular to AB
has answer: http://stackoverflow.com/a/27947180
tagged with: line
type: AnsweredQuestion
tagged with: 2d

http://stackoverflow.com/comment/43706256
has text: thanks, i bug some things and renew my code but it is still not working here is the new [code](http://herbalista.hol.es/invite.html). sorry i am new with FB JS SDK, i've being working with graph api on google apps script and it its ok...i am working with this [guide](https://developers.facebook.com/docs/games/multi-friend-selector/v2.2)
comment on: http://stackoverflow.com/a/27642190
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/52033289
comment on: http://stackoverflow.com/q/27796019
has text: any luck with this, having similar problem??
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43859629
comment on: http://stackoverflow.com/q/27723830
score: 2
has text: Please include a minimal working example of code that reproduces your issue. No way would I download and open a random ZIP file from the interwebs.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27686265
has comment: http://stackoverflow.com/comment/43787275
answers question: http://stackoverflow.com/q/27685627
has comment: http://stackoverflow.com/comment/43788026
has comment: http://stackoverflow.com/comment/43787776
type: Answer
has comment: http://stackoverflow.com/comment/43788177
has comment: http://stackoverflow.com/comment/43787216
has comment: http://stackoverflow.com/comment/43787387
has comment: http://stackoverflow.com/comment/43787038
has comment: http://stackoverflow.com/comment/43788402
has comment: http://stackoverflow.com/comment/43787188
has comment: http://stackoverflow.com/comment/43787327
score: 0
has comment: http://stackoverflow.com/comment/43788563
has comment: http://stackoverflow.com/comment/43787826
has body: .swf files are Flash video files. Follow these approaches to play .swf files. Method 1: You can add the object element and set the attributes on the "onclick" event of the div/image. And then set the "autostart" attribute to true. This should do the trick. We will add the object element inside the below div. &lt;div id="video_wrapper"&gt;&lt;/div&gt; Assuming the div id as "video_div", on which the uer will click, use the below code. document.getElementById("video_div").addEventListener("click", playVideo); function playVideo() { var obj = document.createElement('object'); obj.setAttribute('data', 'nav.swf'); obj.setAttribute('autostart', true); obj.setAttribute('play', true); document.getElementById('video_wrapper').appendChild(obj); } Also check swfobject Method2: You can call Actionscript functions from Javascript using ExternalInterface. Refer the documentation here
has comment: http://stackoverflow.com/comment/43787145

http://stackoverflow.com/q/27773878
tagged with: function
tagged with: javascript
has title: Inputting JSON Data In Element's Containing Same ID - Troubleshooting
tagged with: jquery
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43958550
has answer: http://stackoverflow.com/a/27781775
has body: Currently I have JSON data that is being inputted/entered into all articles containing the ID #viewed. While the JSON data is showing that it is being inputted into all article's with the ID, the function checkViewers() is only functioning correctly for the first article ID #viewed. Ideally, the checkViewers() function should make all #viewed IDs appear as the first article ID #viewed is currently appearing (e.g. First name Last name and Remaining Number of People have viewed this post.) However, the total number of people remaining is incorrect in the first article, as it is gathering all the repeated data. It should only be gathering the data once and totaling that number per article ID. What is the best fix for this situation? I am guessing the checkViewers() function is gathering all the data on the page and only needs to be gathering the data from it's parent section? A sample of the current code: //Content Viewer Information function checkViewers() { //Base Variables //var viewer = $('#viewed span.user'); //var totalViews = $('#viewed span.user').length; //var shortenViews = $('#viewed span.user').length -1; var viewer = $("#viewed span[class^='user']"); var totalViews = $("#viewed span[class^='user']").length; var shortenViews = $("#viewed span[class^='user']").length -1; if (totalViews === 0) { ($('#viewed').html(' 0 people have viewed your post.')); } if (totalViews === 1) { $(' has viewed your post.').insertAfter(viewer.last()); } if (totalViews === 2) { $(' and ').insertAfter(viewer.first()); $(' have viewed your post.').insertAfter(viewer.last()); } if (totalViews >= 3) { viewer.slice(1).hide(); $(' and ').insertAfter(viewer.first()); $('').insertAfter(viewer.eq(2)); $('.count').html(shortenViews + ' more people'); $(' have viewed your post.').insertAfter(viewer.last()); } } The function is then being called with the updated content. //Update Page With New Content var viewerSection = $("article[id^='viewed']"); viewerSection.html(newViewers); checkViewer…
has comment: http://stackoverflow.com/comment/43958803
type: Question
accepted answer: http://stackoverflow.com/a/27781775
has comment: http://stackoverflow.com/comment/43973600
score: 0
tagged with: http://stackoverflow.com/tag/json
answer count: 1

http://stackoverflow.com/q/27681284
type: Question
has title: angular why the value is not updated
tagged with: javascript
has answer: http://stackoverflow.com/a/27681374
answer count: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/27681374
has answer: http://stackoverflow.com/a/27681493
favorite count: 0
tagged with: angularjs
has body: I'm thinking in using angular, and found my first problem. Probably it is a begginer problem. Here is my controller: (function () { angular .module('account.controllers') .controller('CreateController', CreateController); CreateController.$inject = ['$location', '$scope', 'Account']; /** * @namespace CreateController */ function CreateController($location, $scope, Account) { vm = this; vm.model = Account.get(1).then(getSuccessFn); /** * @name postsSuccessFn * @desc populate with the data of the current account */ function getSuccessFn(data, status, headers, config) { vm.account = data.data; } } })(); And here is my form: Register name Operation Cost member Submit So, the page loads fine, the data is retrieved, the vm.account variable is with the correct values, but the values are not shown, it remains the default values. Why?
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/27681493
upvote count: 1

http://stackoverflow.com/a/27736464
answers question: http://stackoverflow.com/q/27736432
upvote count: 1
has comment: http://stackoverflow.com/comment/43884529
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43884619
has body: $.map() expects an object or an array, not a string. It is not clear what result you're trying to achieve in your jsFiddle, but you should not be stringifying your object (e.g. turning it into a JSON string) before passing it to $.map(). Perhaps you just want: var keys = $.map(getCarData()[0], function(element,key) { return key; }); .
type: Answer
accepted answer of: http://stackoverflow.com/q/27736432

http://stackoverflow.com/a/27739284
accepted answer of: http://stackoverflow.com/q/27738121
answers question: http://stackoverflow.com/q/27738121
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/78675738
type: Answer
has body: I got it working: $('#sandbox-container .input-group.date').datepicker({ format: "dd-mm-yyyy", todayBtn: "linked", daysOfWeekDisabled: "1,2,3,4,5,6", calendarWeeks: true, autoclose: true, todayHighlight: true, }).datepicker("setDate",new Date(&lt; ?php echo date("Y,m,d"); ?>));
upvote count: 1

http://stackoverflow.com/comment/43704602
has text: And it doesn't matter if i use my code, or your code within that block, it gives the same error. i tried to clear all code within the then block and it still gives the same error.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27642359

http://stackoverflow.com/a/27659513
has comment: http://stackoverflow.com/comment/43734787
has comment: http://stackoverflow.com/comment/43734783
has comment: http://stackoverflow.com/comment/43734706
has comment: http://stackoverflow.com/comment/43736872
has body: Probably you can use deepEqual() or modify it to your needs var deepTest = function (x, y) { if ((typeof x == "object" &amp;&amp; x != null) &amp;&amp; (typeof y == "object" &amp;&amp; y != null)) { if (Object.keys(x).length != Object.keys(y).length) return false; for (var prop in x) { if (y.hasOwnProperty(prop)) { if (! deepEqual(x[prop], y[prop])) return false; } else return false; } return true; } else if(x &amp;&amp; (typeof y != "undefined")) return true; else return false; } document.write(deepEqual({a:{b:true}},{a:{c:1}}),'&lt;br&gt;'); document.write(deepEqual({a:{b:true}},{a:{b:1}}),'&lt;br&gt;'); document.write(deepEqual({a:{b:false}},{a:{c:1}}),'&lt;br&gt;'); document.write(deepEqual({a:{b:false}},{a:{b:1}}),'&lt;br&gt;'); document.write(deepEqual(true,true),'&lt;br&gt;'); document.write(deepEqual(true,false),'&lt;br&gt;'); document.write(deepEqual(false,false),'&lt;br&gt;'); document.write(deepEqual(false,false),'&lt;br&gt;'); document.write(deepEqual([true],[1]),'&lt;br&gt;'); document.write(deepEqual([true],[]),'&lt;br&gt;'); document.write(deepEqual([true],[]),'&lt;br&gt;'); document.write(deepEqual([true,true],[]),'&lt;br&gt;'); document.write(deepEqual([true,true],[1,2]),'&lt;br&gt;');
upvote count: 2
has comment: http://stackoverflow.com/comment/43734714
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27659434
type: Answer
has comment: http://stackoverflow.com/comment/43734736
answers question: http://stackoverflow.com/q/27659434
score: 2
has comment: http://stackoverflow.com/comment/43737501
downvote count: 0

http://stackoverflow.com/comment/44006065
comment on: http://stackoverflow.com/a/27798743
type: AnswerComment
has text: Correct, the same instance is then injected
score: 0
type: Comment

http://stackoverflow.com/a/27769223
type: Answer
upvote count: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/43949462
score: 2
has body: You could do this: http://jsfiddle.net/AndyMardell/rqgh699w/ I used the following "isScrolledIntoView" function from this post: Check if element is visible after scrolling function isScrolledIntoView(elem) { var docViewTop = $(window).scrollTop(), docViewBottom = docViewTop + $(window).height(), elemTop = $(elem).offset().top, elemBottom = elemTop + $(elem).height(); return ((elemBottom &lt;= docViewBottom) &amp;&amp; (elemTop &gt;= docViewTop)); } $(window).scroll(function(){ if (isScrolledIntoView('.box')) { $('img').addClass('animated flip').css('background', 'red'); } }); It waits for your parent .box element to be visible in the window, then triggers
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27768998
answers question: http://stackoverflow.com/q/27768998

http://stackoverflow.com/comment/43885189
type: AnswerComment
has text: Hi @itsfawwaz, I think you should check the number of elements in `$NoTelefon`
score: 0
comment on: http://stackoverflow.com/a/27736822
type: Comment

http://stackoverflow.com/q/27776631
has title: Array.map and lifted functions in Javascript
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27776731
has comment: http://stackoverflow.com/comment/43964069
has comment: http://stackoverflow.com/comment/43968047
upvote count: 1
linked to: http://stackoverflow.com/q/25214922
has comment: http://stackoverflow.com/comment/43967997
score: 1
has answer: http://stackoverflow.com/a/27776789
has body: How come var a = "foo / bar/ baz ".split('/'); a.map( function (e) { return String.prototype.trim.call(e) } ) works, while this doesn't... a.map( String.prototype.trim );
linked to: http://stackoverflow.com/q/21186398
has comment: http://stackoverflow.com/comment/43968295
type: Question
has comment: http://stackoverflow.com/comment/43965928
tagged with: function
has answer: http://stackoverflow.com/a/27776795
tagged with: ecmascript-5
tagged with: javascript
answer count: 3
downvote count: 0

http://stackoverflow.com/comment/44000642
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27787718
has text: In JS I'd do this `(function (ng, app) { app.controller(...` nicely "scoped". I want to do the same in TS so I thought I'd use the module for this scoping. But I can't call `mod.controller(...` in the 2nd file and I can't do `angular.module('myApp', []).controller('appCtrl', AppCtrl);` in the 1st file because AppCtrl isn't defined yet. Also I really don't want to worry about execution order when I later have to bundle and minify.

http://stackoverflow.com/comment/138175579
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28217250
type: AnswerComment
has text: it seems onvoiceschanged exists in speechsysnthesis but it never be called

http://stackoverflow.com/comment/43761752
type: Comment
type: QuestionComment
has text: So, are you just asking why `.hasOwnProperty()` returns `false` in your case? If so, then maybe you should actually ask that.
score: 6
comment on: http://stackoverflow.com/q/27673323

http://stackoverflow.com/q/27745438
score: 38
answer count: 6
has comment: http://stackoverflow.com/comment/43903745
has answer: http://stackoverflow.com/a/39838622
has title: How to compute getBoundingClientRect() without considering transforms?
accepted answer: http://stackoverflow.com/a/35543016
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/76357490
upvote count: 38
has body: getBoundingClientRect() returns the coordinates of an element on the screen after being transformed. How do I calculate those coordinates before being transformed? i.e. without transforms. The simplest way I found was: element.style.transform = 'none'; //temporarily reset the transform var untransformedOffset = element.getBoundingClientRect().top; //get the value element.style.transform = ''; //set it back but that causes slow layout thrashing, especially noticeable if done on many elements. Live demo: http://jsbin.com/nibiqogosa/1/edit?js,console,output Is there a better way? That javascript code can be applied to: &lt;div id="element"&gt;&lt;/div&gt; &lt;style&gt; #element { transform: translateY(20px); }&lt;/style&gt; And the result will be 0 (excluding the page's margin) The result of element.getBoundingClientRect().top will be 20 (excluding the page's margin) Edit: Answers roundup http://jsbin.com/kimaxojufe/1/edit?css,js,console,output
has comment: http://stackoverflow.com/comment/43911241
has answer: http://stackoverflow.com/a/67561660
has answer: http://stackoverflow.com/a/73387139
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/57876601
has answer: http://stackoverflow.com/a/35543016
type: Question
has comment: http://stackoverflow.com/comment/43904947
has comment: http://stackoverflow.com/comment/122368570
possible better answer: http://stackoverflow.com/a/57876601

http://stackoverflow.com/comment/43922823
type: AnswerComment
has text: My first idea : check that you wait for the resolution of all the deferred objects before generating the zip (`$.when.apply($, deferreds)` line 75). Other than that, you can use a debugger (or console.log) to check what contains `data` (it should be an ArrayBuffer on a recent browser). If you still can't find the issue, I'll need a working code sample :)
type: Comment
comment on: http://stackoverflow.com/a/27750160
score: 1

http://stackoverflow.com/comment/44433701
has text: But Placeholder gets deleted when we type in the textbox, I want fixed __/__/____ in the textbox and user will only type the date for eg. for 01/02/2015, user will only type 01022015 in the textbox. As user will write 01 (i.e. day) then cursor should set to the place where user will write 02 (i.e. month).
comment on: http://stackoverflow.com/a/27656221
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27784977
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27784776
type: AcceptedAnswer
has body: You can know the angle of any sin with this formula: Math.asin(sinOfAngleX) * 180/Math.PI With sinOfAngleX = 0.5, Math.asin(sinOfAngleX) would give 0.5235987755982989. This is expressed in radians. To pass it to degrees you can multiply by 180/Math.PI, which results in 30º
type: Answer
score: 19
upvote count: 19
answers question: http://stackoverflow.com/q/27784776

http://stackoverflow.com/comment/44005844
score: 0
type: QuestionComment
type: Comment
has text: anywhere else to get a good grip on angular ?
comment on: http://stackoverflow.com/q/27798170

http://stackoverflow.com/a/27706702
has comment: http://stackoverflow.com/comment/43825473
answers question: http://stackoverflow.com/q/27706555
upvote count: 2
type: AcceptedAnswer
has body: Do check your conditional statements properly: if (document.getElementById('question1').value.toUpperCase() == "GROUNDHOG DAY"){ correct = (correct +1); } instead of: if document.getElementById('question1').value.toUpperCase() = "GROUNDHOG DAY"{ correct = (correct +1); } You did not wrap the conditions with open close brackets ( and ) and it should be == instead of = And your variable correct is not defined
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27706555

http://stackoverflow.com/a/27670349
has comment: http://stackoverflow.com/comment/43757718
answers question: http://stackoverflow.com/q/27669979
has comment: http://stackoverflow.com/comment/43758339
score: 0
upvote count: 1
downvote count: 1
type: Answer
has body: You need to put the script inside some block for it to be inserted in the resulting html file.

http://stackoverflow.com/q/27680744
upvote count: 1
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/43777063
has comment: http://stackoverflow.com/comment/43777590
has answer: http://stackoverflow.com/a/27681506
tagged with: javascript
score: -1
tagged with: google-maps-api-3
has title: JQuery and Google Maps API issue
has body: I'm currently working on a web app that updates a google maps marker every 10 seconds. I am getting the lat long coordinates from a database then loading them into an object like this : I make the ajax request then var da = JSON.parse(data); then loop through all the results: $.each(da, function(idx, obj) { var latLng = new google.maps.LatLng(obj.Lat, obj.Longitude); markers[obj] = new google.maps.Marker({position: latLng,map: map}); }); But later on in the code i am having a problem trying to do this : markers[obj].setPosition(latLng); It is not moving the marker to the new position, am i missing something? the 'markers[]' object is declared globally.
tagged with: google-maps
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43776198
type: UnansweredQuestion
downvote count: 2

http://stackoverflow.com/comment/43893098
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27741102
score: 0
has text: You could use [prompt](https://developer.mozilla.org/en-US/docs/Web/API/Window.prompt)

http://stackoverflow.com/comment/43827662
type: Comment
comment on: http://stackoverflow.com/a/27707327
type: AnswerComment
has text: See the updated fiddles, and my updated answer. They include the ` ` elements nested in the ` ` tags, which you appear to be adding programmatically. Either way, it will work the same
score: 0

http://stackoverflow.com/comment/43870796
type: QuestionComment
has text: that's everything besides the html tags
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27729247

http://stackoverflow.com/comment/43762519
has text: Define "not working". I don't see how you are actually using the results of `collected_objs`. Are you properly handling the asynchronous nature of your ajax request?
comment on: http://stackoverflow.com/q/27673724
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43791770
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27682207
has text: @teleaziz Sorry that was a typo - it's defined in a more global scope but I've refactored it. It still doesn't work.
type: Comment

audio-analysis
type: Tag
tag name: audio-analysis
tags question: http://stackoverflow.com/q/27724790

http://stackoverflow.com/q/27729380
downvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43870348
has body: I'm using superfish for menu.Since it doesn't come with active class to denote current page tab.I added the following javascript. &lt;script type="text/javascript"&gt; var path = window.location.pathname.split('/'); path = path[path.length-1]; if (path !== undefined) { $("ul.sf-menu") .find("a[href$='" + path + "']") // gets all links that match the href .parents('li') // gets all list items that are ancestors of the link .children('a') // walks down one level from all selected li's .addClass('active'); } &lt;/script&gt; I also added a class named active in css as the script requires. .sf-menu a.active{ margin-top:-5px; height: 51px; padding-top: 15px; z-index: 100; background-color:#072438; } It worked just fine.However for some reason I would like to change the css from a.active into a:active But how do I change this part in javascript to suit the css please? .addClass('active');
tagged with: css
type: AnsweredQuestion
score: 1
type: Question
has comment: http://stackoverflow.com/comment/43870545
tagged with: javascript
has answer: http://stackoverflow.com/a/27729512
has title: How to change class named active into link's active attribute in javascript
accepted answer: http://stackoverflow.com/a/27729512
upvote count: 1

http://stackoverflow.com/a/27705847
has comment: http://stackoverflow.com/comment/43829881
has body: React doesn't render falsy values, be it a component or an attribute (like in the Preview case), e.g. &lt;div&gt;{null}&lt;/div&gt; &lt;img src={null} /&gt; renders to &lt;div&gt;&lt;/div&gt; &lt;img/&gt; So typically you just create a variable and conditionally assign it a component or null as was also suggested in another answer: var button = null; if(myConditionForShowingButton) { button = &lt;SubmitButton /&gt;; } -- or simply -- var button = myConditionForShowingButton ? &lt;SubmitButton /&gt; : null; In cases where the component gets bigger it's typically more readable and cleaner to have a subroutine for rendering that part var complexComponent = condition ? this.renderComplexComponent() : null
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27699250
answers question: http://stackoverflow.com/q/27699250

http://stackoverflow.com/a/27642590
type: Answer
has comment: http://stackoverflow.com/comment/43706269
has comment: http://stackoverflow.com/comment/43704004
has body: document.body.scrollLeft = ( divRef.scrollWidth - divRef.offsetWidth ) / 2 ; NOTE: This can give odd results with IE8 and earlier.
answers question: http://stackoverflow.com/q/27642536
score: 0

http://stackoverflow.com/a/27646359
has body: $("#dest").html($('#content-1')); should be $("#dest").html($('#content-1').html()); and $("#dest").html($('#content-2')); should be $("#dest").html($('#content-2').html()); $("#from-content-1").on("click",function(){ $("#dest").html($('#content-1').html()); }); $("#from-content-2").on("click",function(){ $("#dest").html($('#content-2').html()); });
upvote count: 1
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/43710645
has comment: http://stackoverflow.com/comment/43710575
answers question: http://stackoverflow.com/q/27646302
score: 1

http://stackoverflow.com/comment/43963623
type: AnswerComment
comment on: http://stackoverflow.com/a/27776581
has text: My "program" is a quiz and the function you see is a 15 sec count down animation on screen this is why it has to be repeated untill seconds is 0
type: Comment
score: 0

http://stackoverflow.com/q/27777890
has answer: http://stackoverflow.com/a/27815531
has title: Create Dynamic checkboxes by iterating JSONArray in DOJO
tagged with: checkbox
has body: I am new to DOJO and I am using DOJO 1.5.0 version. I want to create dynamic checkboxes by iterating JSONArray in DOJO. This dynamic creation will be done on a particular event like when we selecting some combo-box value. For example consider below JSONArray: var tempJSONArray = [{role_id = '1', role_name = 'role1'},{role_id = '2', role_name = 'role2'},{role_id = '3', role_name = 'role3'}] I want display checkboxes corresponding to Role Name. Lable for checkbox will be role_name and value will be role_id from JSON object. Also I want to add 'onChange' event to check-boxes, as on this event I want to do a Ajax call to server with role_ids. Thank you for reading and also please let me know if further clarification is needed.
tagged with: dojo
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27815531
type: Question
has comment: http://stackoverflow.com/comment/43981378
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/43995237
score: 0
possible better answer: http://stackoverflow.com/a/27797453
has comment: http://stackoverflow.com/comment/43972591
has answer: http://stackoverflow.com/a/27797453

http://stackoverflow.com/comment/43773550
has text: Don't hesitate to up my comment if it is useful :)
comment on: http://stackoverflow.com/a/27678802
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27654916
favorite count: 0
type: Question
linked to: http://stackoverflow.com/q/27656310
tagged with: http://stackoverflow.com/tag/csv
linked to: http://stackoverflow.com/q/20035101
has comment: http://stackoverflow.com/comment/43727004
linked to: http://stackoverflow.com/q/10752055
has comment: http://stackoverflow.com/comment/43726872
accepted answer: http://stackoverflow.com/a/27655301
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/43726835
has body: I am new to Javascript and with the help of SO I wrote the following code to read a csv file . Program:- Circles The csv file is as follows : data.csv 'Chicago', 41.878113, -87.629798, 4 'New York', 40.714352, -74.005973, 5 'Los Angeles', 34.052234, -118.243684, 3 'Phoenix', 33.4483771, -112.0740373, 2 'Dallas', 32.7802618, -96.8009781, 5 But my code is not display the map. Can anyone please look into it and help me fix my code please .\ I am reading the csv (data.csv) and copying it into an array data. And copying data to citymap. I have to access the code like var city = citymap[0][0] from csv
has title: Unable to read data from csv in Javascript
tagged with: javascript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43726973
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27655301

http://stackoverflow.com/a/27790886
type: Answer
answers question: http://stackoverflow.com/q/27790820
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43991570
has body: Trim the string to remove surrounding spaces. function showResult(str) { str = str.trim(); ... }
upvote count: 2

http://stackoverflow.com/comment/44008248
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27798337
has text: @Tasos, I was waiting for replay, thanks, Just I am telling What i want, I am fetching the list of collage from database for given Distance, So this collage list must be in different size depending on the distance, Now I have to added this information to the jquery mobile list, So please tell me How to handle dynamic list in success funtion(response), I am waiting for your reply. Thanks..

http://stackoverflow.com/comment/45112889
type: QuestionComment
comment on: http://stackoverflow.com/q/27672757
score: 1
has text: The first if statement checking for "items_to_recieve" seems pretty pointless as you are then immediately checking for no "items_to_give". That might be where your bot is getting caught.
type: Comment

http://stackoverflow.com/q/27666980
has answer: http://stackoverflow.com/a/27667006
has body: If I include two scripts like so (one directly in the page, one in a remote resource): Is the order of evaluation guaranteed?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43748831
type: Question
accepted answer: http://stackoverflow.com/a/27667006
duplicate of: http://stackoverflow.com/q/8996852
tagged with: javascript
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/8996852
has title: Is the order of evaluation defined by a specification for JavaScripts in a page

http://stackoverflow.com/comment/52944556
score: 0
comment on: http://stackoverflow.com/a/32543730
has text: What additional information does this add to an already answered question?
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27716892
has answer: http://stackoverflow.com/a/27716928
accepted answer: http://stackoverflow.com/a/27716928
possible better answer: http://stackoverflow.com/a/27716943
type: Question
has title: Get value of appended textarea
has body: i append a textarea with a button $(".mydiv").append(" my button "); After that , i'm writing new texts into textarea and trying to get new writed value inside from textarea with this on click function ; jQuery(document).on('click','.sendReply', function () { var myNewText = $("#myTextarea").val(); console.log(myNewText); }); But it says that this an "empty string" , if i add text area with a value like some text my fucntion works and gives me "some text" but if i edit textarea and click sendReply button (my on click function), it is still gives me "some text" , it don't change How can i get edited textarea value after apppend a textarea?
score: 0
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/27717054
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27716943
favorite count: 0
answer count: 3
type: AnsweredQuestion

http://stackoverflow.com/comment/43706603
type: QuestionComment
has text: Can you verify that for all values of `MyNumber` that it is actually a number (and not null, a string, an object, an array, etc.)?
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27642386

http://stackoverflow.com/a/27725919
answers question: http://stackoverflow.com/q/27725822
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Change the increment amount as you please... var arr = []; var i = 1; var incrementAmt = 2000; for(var j = 0; j &lt; 1000; j++) { var num = i + incrementAmt; arr.push(num); i = num; i++; incrementAmt = incrementAmt / 2; // cause incrementer to decrease each iteration } console.log(arr)
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43864669
accepted answer of: http://stackoverflow.com/q/27725822

http://stackoverflow.com/comment/43890337
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27739404
has text: Well I need to do that in browser.

http://stackoverflow.com/a/27748811
downvote count: 0
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27748296
score: 2
has body: Thanks for the comments! After doing a little more research I was able to fix my issue. The problem was - I am using JSON.stringify which turns my id into a string therefore adding "" around it. To prevent this from happening I simply remove JSON.stringify Here is what I changed: document.getElementById("user-id").value = row.id; So the end code looks like this: .on('check.bs.table', function (e, row) { $result.text('Are you sure you want to delete ' + JSON.stringify(row.username) + '?'); document.getElementById("user-id").value = row.id; })
has comment: http://stackoverflow.com/comment/43908966

http://stackoverflow.com/q/27686543
type: UnansweredQuestion
tagged with: pagerjs
has body: I'm creating a single page application with KnockoutJS. It has 2 sections, home and history. At the homepage there is an button and with the onclick you navigate to the historical section. function initialize() { model = new MonitoringViewModel(); pager.extendWithPage(model); ko.applyBindings(model); pager.start('home'); } When the button is clicked i'm calling a method in wich pager.start('history'); is called. It works correct, but at the historical section when i refresh the page i'm navigating back to the home-page.. How can i make sure that when the page refreshes, the page doesn't goes back to the homepage?
tagged with: knockout.js
type: Question
has title: PagerJS refreshing navigates back to first page
has answer: http://stackoverflow.com/a/27768807
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/q/27759958
tagged with: javascript
tagged with: ajax
has answer: http://stackoverflow.com/a/27760030
answer count: 1
downvote count: 0
has body: I'm trying to utilize the JQM Flipswitch but I'm encountering some problems. My goal: when the flipswitch is turned on or off → java notices → php → mysql This code sort-of works but there are two issues: 1) Always returns OFF 2) Doesn't update Any help would be appreciated HTML Alarm: JAVA/AJAX $('#alarm_box').on('click', function () { var checkStatus = this.checked ? 'ON' : 'OFF'; $.post("main_send.php", { "alarm": checkStatus }, function (data) { $('#alarm_n').html(data); }); });
favorite count: 0
upvote count: 1
tagged with: php
accepted answer: http://stackoverflow.com/a/27760030
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43930985
score: 1
type: Question
has title: Flipswitch updating mysql using jquery-mobile
tagged with: jquery-mobile

http://stackoverflow.com/comment/44022839
score: 0
type: Comment
has text: @SinanSamet well that is easy after separation of t1,t2 you get two equations `t1=f(t2)` and `t2=g(t1)` so instead of `t2` you wrote `g(t1)` (that is called substitution) so it became `t1=f(g(t1))` now separate the `t1` again and that is the result. if you use `dx,dy` instead of `(B.x-A.x),(B.y-A.y),Q.x,Q.y` then it will be more readable to avoid mistakes. if the angle of `A B is 0,90,180 or 270 deg` then one axis has zero change and one of the solution is wrong therefore you should evaluate the correct one
type: AnswerComment
comment on: http://stackoverflow.com/a/27795676

http://stackoverflow.com/q/27689454
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27689710
tagged with: css
has title: How to format text wrapped inside specific symbols within a html structure and format it
type: AnsweredQuestion
tagged with: cpu-word
has body: I want to add an external script to a website so I can format how certain elements looks in order to make my life easier editing the content. I am wondering if there is a way to find a text that is wrapped between a hashtag and two dots within a paragraph and give it a specific format via css. Javascript, Jquery or Css would work, I just dont manage to find a solution yet. The html structure is like this: &lt;p class="title"&gt; ::before #home: research paper &lt;/p&gt; And I would like to make it like this: &lt;p class="title"&gt; ::before &lt;span&gt;#home:&lt;/span&gt; research paper &lt;/p&gt; Keeping in mind that the values of what's after the hashtags won't be always the same (although it will be always after the hashtag and before the two dots). It would be possible to search for specific words (example: #home: or #house) as I already know which words will be in the website and they wont change. Could anyone point me in the right direction to do this? Many thanks!
tagged with: dom
has answer: http://stackoverflow.com/a/27689710
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/44048241
comment on: http://stackoverflow.com/a/27820393
has text: It does work sometimes but it has some mistakes I think. For example when I have a polygon which has no exact 90 degree angles and I edit the polygon with your function, sometimes it does go to the right spot. But depending on which side I choose I guess it goes to the opposite side sometimes. So when I have this polygon http://prntscr.com/5pjev1 and I edit the upper right corner it does this: http://prntscr.com/5pjf82 The unfilled edge is where I dropped the point, and your function moved it to the bottom.
score: 0
type: AnswerComment
type: Comment

ruby
tags question: http://stackoverflow.com/q/27722596
tag name: ruby
tags question: http://stackoverflow.com/q/27726479
tags question: http://stackoverflow.com/q/27748042
tags question: http://stackoverflow.com/q/27757040
tags question: http://stackoverflow.com/q/27771631
tags question: http://stackoverflow.com/q/27650602
tags question: http://stackoverflow.com/q/27673591
tags question: http://stackoverflow.com/q/27642322
tags question: http://stackoverflow.com/q/27723235
tags question: http://stackoverflow.com/q/27672765
tags question: http://stackoverflow.com/q/27798029
tags question: http://stackoverflow.com/q/27697843
tags question: http://stackoverflow.com/q/27664144
tags question: http://stackoverflow.com/q/27696743
tags question: http://stackoverflow.com/q/27749803
tags question: http://stackoverflow.com/q/27788273
tags question: http://stackoverflow.com/q/27722857
tags question: http://stackoverflow.com/q/27644589
tags question: http://stackoverflow.com/q/27643794
type: Tag

http://stackoverflow.com/comment/43799232
comment on: http://stackoverflow.com/q/27662980
has text: See https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.File_for_the_main_thread
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27675232
has comment: http://stackoverflow.com/comment/43765276
has comment: http://stackoverflow.com/comment/43765155
has comment: http://stackoverflow.com/comment/43765198
accepted answer of: http://stackoverflow.com/q/27675212
has comment: http://stackoverflow.com/comment/43765327
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27675212
has comment: http://stackoverflow.com/comment/43765478
has comment: http://stackoverflow.com/comment/43765446
has body: thenum = +thenum || false is to make sure that thenum is really a valid number. If it is not, then thenum will be assigned false. The +thenum would try to convert the string value in thenum (document.getElementById("sr_num").value would give a string value) to a number. If it fails, it would return NaN, which is considered as falsy. You can confirm that like this console.log(+"All hail lelouch"); // NaN So, if thenum is not a valid number, then the expression becomes thenum = NaN || false Since NaN is falsy, the false will be assigned in thenum. Note: The only valid numeric input for which this expression won't work is 0. Because when the input is "0", the expression becomes thenum = +"0" || false = 0 || false So, thenum will still be assigned false.
type: Answer
has comment: http://stackoverflow.com/comment/43765489
score: 3
has comment: http://stackoverflow.com/comment/43765452
upvote count: 3
has comment: http://stackoverflow.com/comment/43765804
has comment: http://stackoverflow.com/comment/43765449

http://stackoverflow.com/comment/43983608
score: 0
type: Comment
has text: What's the purpose? What if the `div` has no content?
type: QuestionComment
comment on: http://stackoverflow.com/q/27786815

http://stackoverflow.com/a/27790329
has comment: http://stackoverflow.com/comment/44002993
has comment: http://stackoverflow.com/comment/44045398
has comment: http://stackoverflow.com/comment/44015941
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27790219
accepted answer of: http://stackoverflow.com/q/27790219
type: Answer
score: 2
downvote count: 0
has body: You need to enclose the following within a jQuery DOM ready event handler function because the corresponding HTML does not yet exist when this code is called... $("#tabs").tabs({ select: function(event, ui) { console.log("Tab selected"); } }); $("#tabs-1 &gt; #subtabs").tabs({ select: function(event, ui) { console.log("subTab selected"); } }); Should be... $(document).ready(function() { $("#tabs").tabs({ select: function(event, ui) { console.log("Tab selected"); } }); $("#tabs-1 &gt; #subtabs").tabs({ select: function(event, ui) { console.log("subTab selected"); } }); }); It only works in your jsFiddle because jsFiddle automatically wraps your JavaScript in a DOM ready event handler function on its back end.

http://stackoverflow.com/q/27755291
has title: Removing duplicate data out of a store and binding it to a combobox doesn't work
has body: Below is the pseudo code. After removing the duplicate data and binding it to another pre-defined combobox, the duplicated values still show up in the drop down list. Please advise. Thank you! var k,state=[],repeat=[]; mystore.each(function(r){ k=r.get('Action'); if(state[k]) repeat.push(r); else state[k]=true; }); mystore.remove(repeat); // sorry, forgot this line my A_combobox=Ext.ComponentQuery.query('#A_combobox')[0]; A_combobox.bindStore(mystore);
has comment: http://stackoverflow.com/comment/43921769
has comment: http://stackoverflow.com/comment/43923650
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: extjs
score: 0
has answer: http://stackoverflow.com/a/27782148
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43923471
has answer: http://stackoverflow.com/a/27768748
has comment: http://stackoverflow.com/comment/43938651

http://stackoverflow.com/comment/43929920
type: Comment
has text: Thanks! This looks useful but I don't fully understand it. How is the (function(){} called if it's not within the promise.then() method?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27758120

http://stackoverflow.com/a/27689329
type: Answer
has body: function changeNumber() { var average = Math.round((list.rating[0].score)/(list.rating[0].votecount)); return isNaN(average) ? 0 : average; }
answers question: http://stackoverflow.com/q/27689240
score: 0
has comment: http://stackoverflow.com/comment/43791957

http://stackoverflow.com/comment/92341378
has text: @RizwanPatel where in this world is a URL of that sort
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27653576
type: Comment

http://stackoverflow.com/q/27649708
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/27649823
tagged with: object.observe
has comment: http://stackoverflow.com/comment/43716818
type: Question
has title: Object.observe order
tagged with: javascript
has body: I am using Object.observe() on node v0.11.13. It looks like the time of the observation callback to be called can't be predicted. is it a bug or a feature? Take a look at this code: function observe(obj,name){ Object.observe(obj, function(o){ console.log(name,o); }); return obj; } var boo = observe({foo:1},'a'); var doo = observe({foo:1},'b'); doo.foo=2; boo.foo=2; The output looks like: a [ { type: 'update', object: { foo: 2 }, name: 'foo', oldValue: 1 } ] b [ { type: 'update', object: { foo: 2 }, name: 'foo', oldValue: 1 } ] I would expect an opposite order. I wonder if this is related to the spec or to node impl' of this feature.
score: 0
answer count: 1

http://stackoverflow.com/comment/43912405
has text: Nit, Is it fair to say that although the ajax transmitted javascript objects from the server side do not have an order to their properties property this is set solely by the columns property which takes an array (ordered) of objects in handsontable?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27750075
type: Comment

http://stackoverflow.com/q/27683042
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has title: How to load an image in a div from server with navigation buttons?
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/10863658
has answer: http://stackoverflow.com/a/27683078
has comment: http://stackoverflow.com/comment/43780678
has body: I have thumbnails and a previous and next button already set up. When a thumbnail is clicked it loads a blank div with the navigations buttons in it. I already have the large images in a folder on the site. http://www.robertfikesiv.com/ So my question is how do I load the image into the div when a thumbnail is clicked and have those images change swap in and out when using the previous/next button to remove the current image and load in the next or previous image in the list? Would this require AJAX? PHP? or will jQuery be enough? Originally I was going to load all the images on the page with a property of display:none and use jQuery to navigate through them. This site will have a preloader on it eventually but I want the best strategy for preformance and load time.
type: UnansweredQuestion
tagged with: php
tagged with: css
has answer: http://stackoverflow.com/a/27683116
type: Question

http://stackoverflow.com/comment/44015199
has text: Your `php` opening tags are wrong. It should be `<?php` not `<php`.
score: 1
comment on: http://stackoverflow.com/q/27803056
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27683730
has body: I'd like to mock the save() function of a Mongoose model. The function I want to test looks like this in a file called user.js: var User = import('User.js') post: function(req, res) { var user = new User({ password : req.body.password, email : req.body.email, }); user.save( function(err) { if (err) { .... } else { .... } }); I tried to write a test that looks like this in another file called user_spec.js: var Hander = require('user.js') it('works properly', function() { spyOn(User, 'save').andReturn(null) Handler.post(req, res); }); but that gives me the error: save() method does not exist I've done some more digging and it looks like the User model itself does not have the save() method, an instance does. This would mean I have to mock the constructor of User, but I'm having a lot of trouble with this. Other posts refer to a statement like: spyOn(window, User) to fix this, but in NodeJS, global (the window equivalent here), does not have User, since I import is as a variable. Is it possible to mock the constructor to give me something with a mocked save()? I've also taken a look at an npm module called rewire, but I was hoping I could do this without mocking and replacing the entire user module in my handler.
has comment: http://stackoverflow.com/comment/45621496
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28798716
has answer: http://stackoverflow.com/a/33789204
answer count: 3
downvote count: 0
tagged with: mongoose
tagged with: jasmine
possible better answer: http://stackoverflow.com/a/33789204
favorite count: 0
has title: Jasmine spyOn mongoose save
upvote count: 6
has answer: http://stackoverflow.com/a/28798716
has comment: http://stackoverflow.com/comment/43841398
type: AnsweredQuestion
score: 6
has answer: http://stackoverflow.com/a/39170961
type: Question

http://stackoverflow.com/comment/43713036
comment on: http://stackoverflow.com/q/27647387
has text: Related: [console.log object at current state](http://stackoverflow.com/questions/7389069/console-log-object-at-current-state)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27799562
has body: You can just append new input field with it's name containing [] or [some_array_key]: $(document).ready(function() { $(".plus").click(function() { $(".files").append(" "); }); }); +
score: 1
has comment: http://stackoverflow.com/comment/44008526
upvote count: 1
has comment: http://stackoverflow.com/comment/44036530
accepted answer of: http://stackoverflow.com/q/27799015
has comment: http://stackoverflow.com/comment/44007724
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44034040
type: Answer
answers question: http://stackoverflow.com/q/27799015

http://stackoverflow.com/a/27679599
type: Answer
accepted answer of: http://stackoverflow.com/q/27679172
answers question: http://stackoverflow.com/q/27679172
has comment: http://stackoverflow.com/comment/43774458
score: 0
type: AcceptedAnswer
has body: Why not just loading each controller at startup passing to each controller the router object: Use this module to load each controller at startup: module.exports = function(router) { var fs = require('fs'); // Setup controllers var controllers = fs.readdirSync(__dirname + '/controllers'); // &lt;-- use your controllers path controllers.forEach(function(controllerName){ var module = require('./controllers/' + controllerName); if (typeof handle === "function") { module(router); } }); }; Then exampleController may be like this: var proto = exampleController.prototype; function exampleController(router) { // GET router.get('/', proto.index) }; proto.index = function(req, res) { ... }; module.exports = exampleController; Remember to call the first module in your entry point .js file : i.e: server.js: var controllersLoader = require('path-to-module'); var express = require('express'); var router = express.Router(); controllersLoader(router);

http://stackoverflow.com/comment/43847909
type: Comment
type: QuestionComment
has text: Are you going to add to the last result?
comment on: http://stackoverflow.com/q/27718050
score: 0

http://stackoverflow.com/comment/43966225
type: QuestionComment
comment on: http://stackoverflow.com/q/27775442
score: 0
type: Comment
has text: Really nobody knows?

http://stackoverflow.com/a/27711090
has comment: http://stackoverflow.com/comment/43834322
upvote count: 7
type: Answer
has comment: http://stackoverflow.com/comment/43834583
answers question: http://stackoverflow.com/q/27711059
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27711059
has comment: http://stackoverflow.com/comment/43834463
has comment: http://stackoverflow.com/comment/43834366
score: 7
type: AcceptedAnswer
has body: Absolutely possible. You just need yo place your code AFTER the relevant html elements definition. You just need to avoid referencing elements that are not yet created. For instance, this code would perfectly work outside document ready event &lt;div id="myDiv"&gt;&lt;/div&gt; &lt;script&gt; $('#myDiv').hide(); // &lt;-- will hide 'myDiv' since the element is already created &lt;/script&gt; While this code would do nothing &lt;script&gt; $('#myDiv').hide(); // &lt;-- won't hide 'myDiv' since the element is not created yet &lt;/script&gt; &lt;div id="myDiv"&gt;&lt;/div&gt;

http://stackoverflow.com/q/27791824
linked to: http://stackoverflow.com/q/12247681
has answer: http://stackoverflow.com/a/55289536
has answer: http://stackoverflow.com/a/37968617
has answer: http://stackoverflow.com/a/27829752
downvote count: 0
has body: I am tryng to override the default tinymce in peranhacms like suggested here Configure / override Piranha CMS html editor so as not to add &nbsp's to html I spend already about one hour trying to fix that problem. There is a lot of resources on that problem but cant get it work. https://wordpress.org/support/topic/correct-way-to-allow-nbsp-entity-in-tinymce tinyMCE adding p tags and nbsp automatically http://blog.room34.com/archives/5075 TinyMCE is adding &nbsp instead of the space when using the word paste Here is how my tinymce.init looks like. here is the example of html I use to paste in to tinyice textarea Dance Dis purus arcu etiam auctor risus aliquam mid turpis eu vel, nunc rhoncus lacus natoque ridiculus... And it is how it is looking in browser source: I put alerts to check if paste_postprocess and my_cleanup_callback actually firing, but they are not. And I am still have &nbsp in the html. I was trying to set cleanup: true and paste_auto_cleanup_on_paste: true but it is didnt help to fire paste_postprocess and my_cleanup_callback How would you fix the &nbsp problem?
linked to: http://stackoverflow.com/q/61221847
type: Question
linked to: http://stackoverflow.com/q/25079234
score: 10
has answer: http://stackoverflow.com/a/31872756
tagged with: javascript
has answer: http://stackoverflow.com/a/43101825
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/24499866
favorite count: 0
has title: Tinymce adding &nbsp
tagged with: tinymce
answer count: 5
type: UnansweredQuestion
upvote count: 10
tagged with: piranha-cms

http://stackoverflow.com/a/37187900
downvote count: 0
has comment: http://stackoverflow.com/comment/99236412
has comment: http://stackoverflow.com/comment/132220871
upvote count: 8
has body: String.prototype.match() and RegExp.prototype.exec() are similar in both finding multiple occurrences and returning them in an array. Yet exec method returns an array of more detailed information. For instance unlike match it can find multiple occurrences of the capture groups as well. So if you have capture groups, exec is essential. One thing to keep in mind when working with exec you shouldn't invoke if from a literal regexp. Assign your regex to a variable first and use it to call your exec method from. One other thing is, while match would bring multiple occurrences in an array of items at one go, with exec you have to iterate for each occurrence to be captured. Invoking match is fairly simple. Since it is a string prototype method you just chain it to a string and provide a regexp as an argument to the match method like; "test".match(/es/) A literal representation of a regex can be used with no problem. Invoking exec is more complicated. As i mentioned previously it's best to have the regex assigned to something previously. Ok lets see an example var text = '["job name 1","nat 1"],["job name 2","nat 2"],["job name 3","nat 3"]', reg = /([^"]+)","([^"]+)/g, tm = [], te = []; tm = text.match(reg); // tm has result of match while(te[te.length]=reg.exec(text)); // te has result of exec + an extra null item at the end te.length--; // te normalized. document.write("&lt;pre&gt;" + JSON.stringify(tm,null,2) + "&lt;/pre&gt;\n"); document.write("&lt;pre&gt;" + JSON.stringify(te,null,2) + "&lt;/pre&gt;\n"); As you see exec's result also includes the capture groups. The way i choose to populate te array is somewhat unorthodox but i hate to use a temp array just in the conditional part of while loop. This looks to me much more neat. The only thing is, the final null to stop the while loop gets inserted to the end of te array. Hence the following te.length-- instruction. Edit: Now there is also the String.prototype.matchAll() functionality available in modern browsers which …
type: Answer
score: 8
answers question: http://stackoverflow.com/q/27753246
has comment: http://stackoverflow.com/comment/132235011
has comment: http://stackoverflow.com/comment/65854682

http://stackoverflow.com/q/27795254
accepted answer: http://stackoverflow.com/a/28075422
favorite count: 0
score: 2
type: AnsweredQuestion
has title: Difference between IE script and notification settings
downvote count: 2
has answer: http://stackoverflow.com/a/28075422
tagged with: internet-explorer-10
has body: What are the differences among these IE settings: Disable script debugging (Internet Explorer) Disable script debugging (Other) Display a notification about every script error If I turn on all of the three settings what type of errors would be disabled and what type of errors would be displayed as notifications? I noticed that by default script debugging (the first two settings) is disabled in the IE. Is it recommended to test the web application with script debugging enabled?
type: Question
possible better answer: http://stackoverflow.com/a/28023193
has comment: http://stackoverflow.com/comment/44479225
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/28023193
tagged with: internet-explorer-11
tagged with: javascript
upvote count: 4
tagged with: browser
answer count: 2

http://stackoverflow.com/a/27789906
has comment: http://stackoverflow.com/comment/44021766
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44019016
has comment: http://stackoverflow.com/comment/44020947
has comment: http://stackoverflow.com/comment/47863689
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27788211
type: Answer
answers question: http://stackoverflow.com/q/27788211
has comment: http://stackoverflow.com/comment/44019148
score: 4
has body: In your tick function just recalculate the xy position of your text based on source and target xy: function tick() { d3.selectAll("text") .attr("x", function(d) {return (d.source.x + d.target.x) / 2}) .attr("y", function(d) {return (d.source.y + d.target.y) / 2}) } Here's an updated jsFiddle with path labels: http://jsfiddle.net/rco31ofe/2/
upvote count: 4

http://stackoverflow.com/q/27751120
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43913429
has comment: http://stackoverflow.com/comment/43913311
score: 0
possible better answer: http://stackoverflow.com/a/27751226
has comment: http://stackoverflow.com/comment/43913480
has answer: http://stackoverflow.com/a/27751226
type: Question
has answer: http://stackoverflow.com/a/27752058
has title: Links not clickable when not block
has comment: http://stackoverflow.com/comment/43913404
answer count: 2
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27752058
tagged with: html-lists
has body: I have a html list containing links. For some reason when the list items are set to display:inline or display:inline-block the links are not clickable and the hover states on the list items don't work. Only when the list items are set to display:block are the links clickable and the hover states work. This is a jsfiddle demonstrating the problem. This is a jsfiddle with the list items set to block and the links are clickable. How can I set the list items to display:inline and still have them function?
has comment: http://stackoverflow.com/comment/43913515

highcharts
tags question: http://stackoverflow.com/q/27790387
tags question: http://stackoverflow.com/q/27780037
tags question: http://stackoverflow.com/q/27800139
tags question: http://stackoverflow.com/q/27789973
tags question: http://stackoverflow.com/q/27700263
tags question: http://stackoverflow.com/q/27657067
tags question: http://stackoverflow.com/q/27708361
tags question: http://stackoverflow.com/q/27780447
tags question: http://stackoverflow.com/q/27662502
tags question: http://stackoverflow.com/q/27718189
tags question: http://stackoverflow.com/q/27790880
tags question: http://stackoverflow.com/q/27781171
tags question: http://stackoverflow.com/q/27783698
tags question: http://stackoverflow.com/q/27704894
tags question: http://stackoverflow.com/q/27701259
tags question: http://stackoverflow.com/q/27710149
tags question: http://stackoverflow.com/q/27727821
tags question: http://stackoverflow.com/q/27785677
tags question: http://stackoverflow.com/q/27721945
tags question: http://stackoverflow.com/q/27739835
tags question: http://stackoverflow.com/q/27708283
tags question: http://stackoverflow.com/q/27692037
tags question: http://stackoverflow.com/q/27669937
tags question: http://stackoverflow.com/q/27783525
tags question: http://stackoverflow.com/q/27771707
tags question: http://stackoverflow.com/q/27709320
tags question: http://stackoverflow.com/q/27785453
tags question: http://stackoverflow.com/q/27694332
tags question: http://stackoverflow.com/q/27784288
type: Tag
tags question: http://stackoverflow.com/q/27797142
tag name: highcharts
tags question: http://stackoverflow.com/q/27751879

http://stackoverflow.com/comment/43826372
score: 0
has text: @Aminul http://jsfiddle.net/lollipopwizardkid/ujp0b1uw/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27699377

http://stackoverflow.com/comment/43781982
score: 0
type: Comment
has text: Even with the invalid identifier, it still works. I can still get the ID.
comment on: http://stackoverflow.com/a/27683744
type: AnswerComment

http://stackoverflow.com/a/27662808
has comment: http://stackoverflow.com/comment/43748071
has comment: http://stackoverflow.com/comment/43752132
has body: Move the variable declaration var trafficInterval = null; before the keyup eventhandler (to move it to the outside scope). See working, stripped down example here: http://jsbin.com/yitiquwoce/1/
type: Answer
has comment: http://stackoverflow.com/comment/43741976
has comment: http://stackoverflow.com/comment/43742061
score: 0
has comment: http://stackoverflow.com/comment/43742132
has comment: http://stackoverflow.com/comment/43741915
answers question: http://stackoverflow.com/q/27662513
has comment: http://stackoverflow.com/comment/43741493
has comment: http://stackoverflow.com/comment/43741467
has comment: http://stackoverflow.com/comment/43745308

http://stackoverflow.com/a/27679543
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43773884
accepted answer of: http://stackoverflow.com/q/27678881
type: Answer
answers question: http://stackoverflow.com/q/27678881
upvote count: 3
score: 3
has body: You could use a data attributes (HTML5 assumed) to attach the Id as meta data to your divs. Your PHP (note I am adding data-id attributes): <?php $url = 'DataBase'; $json_response = file_get_contents ( $url ); $json_arr = json_decode ( $json_response, true ); for($i = count ( $json_arr )-1; $i > 0; $i--) { $json_obj = $json_arr [$i]; echo ' '; echo $json_obj ['id'] ; echo $json_obj ['title']; echo $json_obj ['article']; echo ' Read more '; echo ' ' } ?> JS - simple click handler attachment, using jQuery .data() [docs] to get data attribute: $('div').click(function(e) { var id = $(this).data("id"); alert(id); }); JSFiddle Demo

http://stackoverflow.com/q/27651956
has answer: http://stackoverflow.com/a/27651979
favorite count: 0
type: UnansweredQuestion
has body: I am a new coder skimming the basics of JavaScript, and was trying to follow this tutorial but could not get this to work. Any help would be appreciated :) var userChoice = prompt("Do you choose rock, paper or scissors?") var computerChoice = Math.random(); console.log(computerChoice); if (computerChoice &gt; 0 &amp;&amp; &lt; 0.33) { (computerChoice = "rock"); } else if (computerChoice &gt; 0.34 &amp;&amp; &lt; 0.66) { (computerChoice = "paper"); } else (computerChoice &gt; 0.67 &amp;&amp; &lt; 1) { (computerChoice = "scissors"); }
upvote count: 0
has answer: http://stackoverflow.com/a/27652218
has comment: http://stackoverflow.com/comment/43721972
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43721013
tagged with: if-statement
has comment: http://stackoverflow.com/comment/43720966
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/43720945
has title: I am getting errors saying that the comparisons are not valid, whats wrong with this?
has comment: http://stackoverflow.com/comment/43721072
downvote count: 1

http://stackoverflow.com/a/57387871
type: Answer
answers question: http://stackoverflow.com/q/27678052
score: 22
has body: Apart from string interpolation, you can also call a function using back-tick. var sayHello = function () { console.log('Hello', arguments); } // To call this function using `` sayHello`some args`; // Check console for the output // Or sayHello` some args `; Check styled component. They use it heavily.
upvote count: 22
downvote count: 0

http://stackoverflow.com/comment/44011001
type: Comment
type: QuestionComment
score: 1
has text: I'm not seeing why the question you linked (or rather, its answers) aren't applicable to your scenario...?
comment on: http://stackoverflow.com/q/27801176

http://stackoverflow.com/comment/43812871
has text: one more question when input name is right but email is wrong then after clicking please enter valid email all the values are missing like valid name
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27699819

http://stackoverflow.com/a/28829435
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27737203
has body: I found out the link was blocked in the basic page. so just had to change access permissions.

http://stackoverflow.com/comment/43994510
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27791057
score: 0
has text: I'm already doing that, but I don't see how it helps with the fundamental transaction issues. Whether it's in a callback or a promise or whatever, the concept is the same.

http://stackoverflow.com/q/27662103
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/27664919
has comment: http://stackoverflow.com/comment/43740516
has body: On my web page I'm trying to load an image to asp image control using Javascript, I'm setting the src to image control in the correct way but the image is not been load. Preview function OnClientItemSelected(sender, args) { var pvwImage = $telerik.$("#pvwImage"); var imageSrc = args.get_path(); if (imageSrc.match(/\.(gif|jpg)$/gi)) { pvwImage.src = imageSrc; $("#pvwImage").attr("src", pvwImage.src); //pvwImage.style.display = ""; document.getElementById("pvwImage").style.display = "block"; pvwImage.alt = imageSrc.substring(imageSrc.lastIndexOf('/') + 1); } else { pvwImage.style.display = "none"; } } That's my src path: C:/Inetpubb/IRPictures/SSC/2013/8/IR-9897/9897(2).jpg what can be the problem? By the way if I'm changing the path to let's say: http://img.s-msn.com/tenant/amp/entityid/BBdrGbm.img?h=194&w=300&m=6&q=60&u=t&o=t&l=f&x=1036&y=497 it's working fine.
has title: Cannot display an image when reading from the local machine
type: AnsweredQuestion
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43740225
has comment: http://stackoverflow.com/comment/43740295
has comment: http://stackoverflow.com/comment/43740235
score: -1
has comment: http://stackoverflow.com/comment/43740200
accepted answer: http://stackoverflow.com/a/27664919
has comment: http://stackoverflow.com/comment/43740551
has comment: http://stackoverflow.com/comment/43741641
upvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/27780393
has comment: http://stackoverflow.com/comment/43970631
type: Question
possible better answer: http://stackoverflow.com/a/27780453
has answer: http://stackoverflow.com/a/27780453
tagged with: arrays
tagged with: setattribute
tagged with: javascript
tagged with: getelementsbytagname
answer count: 3
has answer: http://stackoverflow.com/a/27781853
downvote count: 0
has comment: http://stackoverflow.com/comment/43971177
has answer: http://stackoverflow.com/a/27780449
favorite count: 0
has title: Javascript: How to call a value in an array for usage in GetElementsByTagName by setAttribute?
upvote count: 2
has body: I'm a javascript beginner trying to utilize .setAttribute, array and GetElementsByTagName in a single function. I want to make it such that the font color of h1 changes depending on what value is being input. Each value (0-9) corresponds to a specific value in the array. Then, using multiple 'if' statements (or other alternative ways), I hope to use .setAttribute to change the property of the h1 tag. I keep either getting "Cannot read property 'setAttribute' of undefined" or "undefined is not a function", no matter how I tweak my code. Sometimes I get no console errors at all, but my code does not work. function change() { var y = document.getElementsByTagName('h1').innerHTML; var color = ["Grey", "Blue", "Green", "Red", "Pink", "Yellow", "Orange", "Indigo", "Violet", "Black"]; var x = parseInt(document.getElementById('cn').value); for (var i = 0; i < color.length; i++) { var bgcolor = color[i]; if (x == 1) { y.setAttribute("style", "color: blue;"); } else if (bgcolor > 9){ alert('Please enter a number from 0 to 9'); } } } Header Input a number from 0 to 9: Thank you in advance.
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43970799
accepted answer: http://stackoverflow.com/a/27781853

http://stackoverflow.com/q/27734531
has answer: http://stackoverflow.com/a/27734560
accepted answer: http://stackoverflow.com/a/27734724
possible better answer: http://stackoverflow.com/a/27734560
tagged with: php
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/27734550
tagged with: mysql
has body: what I'm trying to achieve is to call a webpage with JavaScript get the HTML and send it to a server to be further analyzed. Is it even possible? Where should I start looking?
has answer: http://stackoverflow.com/a/27734724
type: Question
tagged with: javascript
answer count: 3
has title: Can I request a webpage with JavaScript and then send it as is to a server to be analyzed further?

http://stackoverflow.com/comment/126715859
has text: Also, in the `async` context `await thing` makes it to resolve either to the `thing`s value or to its *promised* value.
type: AnswerComment
type: Comment
score: 2
comment on: http://stackoverflow.com/a/27746324

http://stackoverflow.com/comment/43888895
type: AnswerComment
comment on: http://stackoverflow.com/a/27738914
type: Comment
has text: @Thunk: check this : http://stackoverflow.com/questions/2048720/get-all-attributes-from-a-html-element-with-javascript-jquery
score: 0

http://stackoverflow.com/a/49726538
type: Answer
downvote count: 0
has body: Use this $('#settle_check\\['+id+'\\]').val()
score: 1
accepted answer of: http://stackoverflow.com/q/27717827
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27717827

http://stackoverflow.com/comment/43838363
comment on: http://stackoverflow.com/q/27712385
has text: A function's execution context includes a *this* parameter that is set **by how the function is called**, or using *bind*. If you change how you call a function, they you will likely change its *this*. Or not.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27678961
has comment: http://stackoverflow.com/comment/43772476
has comment: http://stackoverflow.com/comment/43772526
has title: jQuery dropdown div on hover dissapears when you hover on the dropdown
downvote count: 1
has comment: http://stackoverflow.com/comment/43772491
has comment: http://stackoverflow.com/comment/43772513
favorite count: 0
has body: So I made a very simple bare-bones dropdown menu in jQuery. When you hover over the menu button, the sub-menu properly displays, but if you try to move your mouse into the submenu it rapidly dissapears. Any ideas how to keep that submenu open but at the same time have it close if the user moves their mouse away from the opening icon and NOT into the menu? var moreCatsHovered = false; $(".moreCatsRight").mouseenter(function () {// show pohelp $(".moreCatsRightMenu").fadeIn(100); }); $(".moreCatsRightMenu").mouseenter(function () {// show pohelp moreCatsHovered = true; }); $(".moreCatsRightMenu").mouseleave(function(){ // hide pohelp on mouse out from pohelp $(".moreCatsRightMenu").fadeOut(100); moreCatsHovered = false; }); $(".moreCatsRight").mouseleave(function(){ // hide pohelp on mouse out from pohelp if (moreCatsHovered == false) { $(".moreCatsRightMenu").fadeOut(100); } }); Here is my fiddle: http://jsfiddle.net/c3qz0eva/ * EDIT: I cannot change the HTML structure unfortunately *
has comment: http://stackoverflow.com/comment/43772669
type: AnsweredQuestion
upvote count: 0
possible better answer: http://stackoverflow.com/a/27679011
has answer: http://stackoverflow.com/a/27679357
accepted answer: http://stackoverflow.com/a/27679357
has answer: http://stackoverflow.com/a/27679011
has comment: http://stackoverflow.com/comment/43772493
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/12014321
tagged with: javascript
tagged with: jquery
score: -1

http://stackoverflow.com/comment/44040898
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27799087
type: Comment
has text: I want the solution for the below link. Its the same usecase which i need. http://stackoverflow.com/questions/27816976/using-customized-layouts-and-variable-no-of-fields-with-backbone-forms @Seebiscuit

http://stackoverflow.com/q/27751696
has title: Push Notification sent to controller Angularjs
type: Question
tagged with: javascript
score: 0
answer count: 3
has body: I'm implementing push notification service. I want send a variable e.regid to AppCtrl controller in AngularJS. Could any one help me solving this problem..? PushCustom.js function onNotification(e) { switch (e.event) { case 'registered': if (e.regid.length &gt; 0) { // Your GCM push server needs to know the regID before it can push to this device // here is where you might want to send it the regID for later use. //alert("regID = " + e.regid); AppCtrl(e.regid); } break; case 'message': if (e.foreground) { var soundfile = e.soundname || e.payload.sound; var my_media = new Media("/android_asset/www/" + soundfile); my_media.play(); } break; case 'error': break; default: break; } } app.js app.controller('AppCtrl', ['$scope','$http', function($scope, $http, e.regid){ alert(e.regid); $scope.regid = e.regid; }]); Anyone got any idea on how to make this work? Thanks!
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27751902
has answer: http://stackoverflow.com/a/27752618
has answer: http://stackoverflow.com/a/27752430

http://stackoverflow.com/comment/43728335
has text: Now this :( `http://localhost:8080/demo/data.csv` for `No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access`
type: Comment
comment on: http://stackoverflow.com/a/27655301
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43978001
has text: Browsers will kill open HTTP requests, it is a race condition for the call to go out.
comment on: http://stackoverflow.com/q/27783878
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/q/27736314
answer count: 1
has body: I have a paper-dialog set up and for some reason when the user presses either the affirmative or dismissive buttons the paper-dialog doesn't close. My buttons are setup as follows, which seems to be correct: Cancel Submit Here's a plunker that is very similar to what I am doing: http://plnkr.co/edit/6aNT88vi9lHLwLN9Pab3?p=preview Any thoughts on why this isn't working?
has answer: http://stackoverflow.com/a/27736929
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27736929
tagged with: material-design
type: Question
tagged with: polymer
has title: Polymer paper-dialog not hiding on button press
tagged with: javascript
score: 0

http://stackoverflow.com/q/27753394
score: 0
answer count: 3
tagged with: validation
has answer: http://stackoverflow.com/a/27753433
tagged with: javascript
has answer: http://stackoverflow.com/a/27753435
possible better answer: http://stackoverflow.com/a/27753493
has answer: http://stackoverflow.com/a/27753493
tagged with: regex
has title: Search validation regex not working in JavaScript
type: Question
accepted answer: http://stackoverflow.com/a/27753435
type: AnsweredQuestion
has body: I want to validate my textbox with a regex. The textbox's value should be like this – "/word/Search" – i.e. forward slash, then any word, then forward slash again, then the fixed word "Search". Here is an example input: /admin/Search I tried the following pattern, but it's not matching: [/\/][\w][/\/][\Search] What is wrong in this pattern?

http://stackoverflow.com/a/27759598
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27759186
answers question: http://stackoverflow.com/q/27759186
upvote count: 2
type: AcceptedAnswer
has body: Supposing your dialog is indeed off screen, press [alt][space][m]. Then swing around with your mouse or press your arrow keys like hell and your dialog will eventually come in scope. See also http://www.dpreview.com/forums/post/42206189
has comment: http://stackoverflow.com/comment/43931606
has comment: http://stackoverflow.com/comment/71429647
type: Answer

http://stackoverflow.com/a/44836014
type: Answer
score: 2
upvote count: 3
downvote count: 1
has body: it('should return a promise', function() { var result = testedFunctionThatReturnsPromise(); expect(result).toBeDefined(); // 3 slightly different ways of verifying a promise expect(typeof result.then).toBe('function'); expect(result instanceof Promise).toBe(true); expect(result).toBe(Promise.resolve(result)); });
answers question: http://stackoverflow.com/q/27746304

http://stackoverflow.com/q/27641875
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43702555
score: 1
has comment: http://stackoverflow.com/comment/43702530
has comment: http://stackoverflow.com/comment/43702626
has comment: http://stackoverflow.com/comment/43702597
upvote count: 1
has comment: http://stackoverflow.com/comment/43702856
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I'm trying to get the fetchFilm methode to work but I can not fix the ajax part in the method. I'm not getting the output(Finished! or results) at the console. "Test1" is being alerted. I appreciate any help index.php <?php require 'function.php'; if(isset($_POST['q'])){ connect(); $film = get_film_by_title($_POST['q']); } include 'views/index.tmpl.php'; index.tmpl.php: <?php include '_partials/header.php'; ?> Search films by title: <?php $alphabet = str_split('abcdefghijklmnopqrstuvwxyz'); foreach ($alphabet as $letter) { echo " $letter "; } ?> Go! <?php if(isset($film)): ?> <?php foreach ($film as $a) { echo " film_id}'> film_id}'>{$a->title} "; } ?> <?php endif; ?> <?php include '_partials/footer.php'; ?> script.js var Film = { init: function(config){ this.config = config; this.bindEvents(); }, bindEvents: function(){ this.config.letterSection.on('change', this.fetchFilm); }, fetchFilm: function(){ alert('Test1'); var self = Film; $.ajax({ url: 'index.php', type: 'POST', data: self.config.form.serialize(), success: function(results){ console.log('Finished!'); console.log(results); } }); } }; Film.init({ letterSection: $('#q'), form: $('#film-selection') });
tagged with: ajax
has comment: http://stackoverflow.com/comment/43702579
has comment: http://stackoverflow.com/comment/43702800
has comment: http://stackoverflow.com/comment/43703055
has title: $.ajax is not working?
has comment: http://stackoverflow.com/comment/43702701
answer count: 0
downvote count: 0

http://stackoverflow.com/comment/43765765
score: 0
type: QuestionComment
type: Comment
has text: @IshfaqMuzaffar would be much easier to help you by having an example that includes CSS
comment on: http://stackoverflow.com/q/27675377

http://stackoverflow.com/q/27722511
has body: I've a variable called url as follows : url = "http://56.177.59.250/static/ajax.php?core[ajax]=true&amp;core[call]=prj_name.contactform&amp;width=400&amp;core[security_token]=c7854c13380a26ff009a5cd9e6699840" Now I want to use if condition only if core[call] is equal to the value it currently has i.e. prj_name.contactform otherwise not. How should I do this since the parameter from query-string is in array format?
has title: How to execute if condition based on a value from query string in JavaScript/jQuery?
linked to: http://stackoverflow.com/q/901115
tagged with: javascript
tagged with: query-string
has comment: http://stackoverflow.com/comment/43856807
tagged with: jquery
tagged with: querystringparameter
has answer: http://stackoverflow.com/a/27722556
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27722556
has comment: http://stackoverflow.com/comment/43856787
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27722577
tagged with: if-statement
possible better answer: http://stackoverflow.com/a/27722577

http://stackoverflow.com/comment/43841525
comment on: http://stackoverflow.com/a/27714672
score: 4
type: AnswerComment
type: Comment
has text: If they are using the upcoming 2.0 release, then `src` is correct.

http://stackoverflow.com/q/27724135
upvote count: 1
type: Question
score: 1
has answer: http://stackoverflow.com/a/27724234
tagged with: ckeditor
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: how to add attribute to tags in CKEDITOR?
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I need that my link will have attribute vfoto='advert'. For example: How to realize that? What files to edit?
tagged with: php
linked to: http://stackoverflow.com/q/20671519

flash
tags question: http://stackoverflow.com/q/27747565
tags question: http://stackoverflow.com/q/27792919
tags question: http://stackoverflow.com/q/27685627
tags question: http://stackoverflow.com/q/27726006
tags question: http://stackoverflow.com/q/27711670
tags question: http://stackoverflow.com/q/27784114
tags question: http://stackoverflow.com/q/27778364
tags question: http://stackoverflow.com/q/27701434
tags question: http://stackoverflow.com/q/27641303
tag name: flash
tags question: http://stackoverflow.com/q/27640320
type: Tag
tags question: http://stackoverflow.com/q/27730392

http://stackoverflow.com/a/27675354
has body: var selected = new Array(); $(document).ready(function() { $("input:checkbox[name=tags]:checked").each(function() { selected.push($(this).val()); }); });
score: 0
has comment: http://stackoverflow.com/comment/43767842
has comment: http://stackoverflow.com/comment/43765425
type: Answer
answers question: http://stackoverflow.com/q/27674593

http://stackoverflow.com/q/27681404
possible better answer: http://stackoverflow.com/a/27681660
has answer: http://stackoverflow.com/a/27682133
accepted answer: http://stackoverflow.com/a/27682133
tagged with: css
has body: I'm doing a mobile (responsive to be exact) version of an already existing desktop site that already has a lot of hefty hover effects on it. It often happens, than when I scroll it on mobile by touching the screen it fires some performance heavy hover actions like fading in a big box-shadow and/or animating border. I don't need that on mobile browser for obvious reasons and I've heard that just disabling hovers on scroll for mobile devices can result in a big performance gains. Is there a way to easily, temporarily disable all hover effects for the time of scrolling on mobile devices only? Is it safe (from UX perspective) and is it worth implementing (from performance perspective)?
answer count: 4
type: AnsweredQuestion
score: 3
tagged with: performance
downvote count: 0
type: Question
has title: How to disable :hover when scrolling on mobile?
tagged with: mobile
tagged with: javascript
tagged with: jquery
upvote count: 3
has answer: http://stackoverflow.com/a/27681660
has answer: http://stackoverflow.com/a/27681682
has answer: http://stackoverflow.com/a/27681616
favorite count: 0

http://stackoverflow.com/comment/43831345
type: QuestionComment
has text: can you recreate in a fiddle? It's hard to tell what you mean by `The overflow hidden property is not working as expected`
comment on: http://stackoverflow.com/q/27709714
score: 0
type: Comment

http://stackoverflow.com/a/27792028
has comment: http://stackoverflow.com/comment/44037161
downvote count: 0
score: 1
has body: I've been playing around with this source code the last couple minutes, and it seems to me the problem stems from the use of position: absolute on the rumbling elements themselves. In the jRumble docs http://jackrugile.com/jrumble/#documentation it says that 'For rumble elements that are position fixed/absolute, they should instead be wrapped in an element that is fixed/absolute'. So if you set your container element to position: absolute and then position all the interior divs relative to the container, you'll no longer need to alter the jRumble source code and redefine the plugin every iteration to change the default position or compute the offset of each element - all you'll have to do is increment the x and y values in the jRumble call itself. The code below is UNTESTED, but I think you want something closer to this (again, this all hinges on the .offreg elements being position: relative): $(document).ready(function(){ var count = 0; function addone(){ count++; $('.offreg').jrumble({ x: count, y: count, rotation: 1 }); $('.offreg').trigger('startRumble'); setTimeout(addone, 1000); } });
has comment: http://stackoverflow.com/comment/43993834
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27790870
answers question: http://stackoverflow.com/q/27790870
has comment: http://stackoverflow.com/comment/44025541
type: Answer

http://stackoverflow.com/comment/43832185
comment on: http://stackoverflow.com/a/27661635
type: AnswerComment
has text: @EddieB I haven't read on what promises actually are, could they be implemented in my case?
score: 0
type: Comment

google-chrome
tags question: http://stackoverflow.com/q/27773864
tags question: http://stackoverflow.com/q/27789653
tags question: http://stackoverflow.com/q/27758435
tags question: http://stackoverflow.com/q/27679134
tags question: http://stackoverflow.com/q/27706858
tags question: http://stackoverflow.com/q/27708614
tags question: http://stackoverflow.com/q/27727429
tags question: http://stackoverflow.com/q/27781735
tags question: http://stackoverflow.com/q/27665917
tags question: http://stackoverflow.com/q/27802146
tags question: http://stackoverflow.com/q/27767954
tags question: http://stackoverflow.com/q/27736604
tags question: http://stackoverflow.com/q/27718034
tags question: http://stackoverflow.com/q/27665677
tags question: http://stackoverflow.com/q/27688975
tags question: http://stackoverflow.com/q/27779363
tags question: http://stackoverflow.com/q/27759186
tags question: http://stackoverflow.com/q/27733795
tags question: http://stackoverflow.com/q/27652694
tags question: http://stackoverflow.com/q/27764949
tags question: http://stackoverflow.com/q/27715379
tags question: http://stackoverflow.com/q/27752213
tags question: http://stackoverflow.com/q/27762943
tags question: http://stackoverflow.com/q/27773816
tags question: http://stackoverflow.com/q/27740692
tags question: http://stackoverflow.com/q/27783298
tags question: http://stackoverflow.com/q/27768291
tags question: http://stackoverflow.com/q/27786048
tags question: http://stackoverflow.com/q/27785052
tags question: http://stackoverflow.com/q/27685863
tags question: http://stackoverflow.com/q/27728050
tags question: http://stackoverflow.com/q/27695709
tags question: http://stackoverflow.com/q/27701760
tags question: http://stackoverflow.com/q/27732137
tags question: http://stackoverflow.com/q/27803159
tags question: http://stackoverflow.com/q/27772802
tags question: http://stackoverflow.com/q/27747290
tags question: http://stackoverflow.com/q/27664615
tags question: http://stackoverflow.com/q/27774534
tags question: http://stackoverflow.com/q/27699641
tags question: http://stackoverflow.com/q/27729351
tags question: http://stackoverflow.com/q/27770677
tags question: http://stackoverflow.com/q/27660474
tags question: http://stackoverflow.com/q/27735723
tags question: http://stackoverflow.com/q/27773369
tags question: http://stackoverflow.com/q/27712860
type: Tag
tags question: http://stackoverflow.com/q/27789572
tags question: http://stackoverflow.com/q/27701247
tag name: google-chrome
tags question: http://stackoverflow.com/q/27742208
tags question: http://stackoverflow.com/q/27747925
tags question: http://stackoverflow.com/q/27788273
tags question: http://stackoverflow.com/q/27790999
tags question: http://stackoverflow.com/q/27699059
tags question: http://stackoverflow.com/q/27738155
tags question: http://stackoverflow.com/q/27645834
tags question: http://stackoverflow.com/q/27785494
tags question: http://stackoverflow.com/q/27653017
tags question: http://stackoverflow.com/q/27759625
tags question: http://stackoverflow.com/q/27705738
tags question: http://stackoverflow.com/q/27757113
tags question: http://stackoverflow.com/q/27680329
tags question: http://stackoverflow.com/q/27762655
tags question: http://stackoverflow.com/q/27700840
tags question: http://stackoverflow.com/q/27772211
tags question: http://stackoverflow.com/q/27776642
tags question: http://stackoverflow.com/q/27722440
tags question: http://stackoverflow.com/q/27726799
tags question: http://stackoverflow.com/q/27763066
tags question: http://stackoverflow.com/q/27653695
tags question: http://stackoverflow.com/q/27785153
tags question: http://stackoverflow.com/q/27763205

http://stackoverflow.com/a/27741269
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27741134
has comment: http://stackoverflow.com/comment/43893644
has body: All you are getting is because of event bubbling, whenever an event is triggered in the child element it is caried to the top level. Try by adding return false; like below, $('.myclass').mouseover( function(){ $(this).addClass('hovered'); return false; } ) .mouseout( function(){ $(this).removeClass('hovered'); }); .parent{ width: 100px; height:100px; display:block; background-color:#eee; margin:80px; } .child{ width: 70px; height:70px; display:block; background-color:#00f; } .hovered{ -webkit-box-shadow: inset 0px 0px 0px 2px #f00; -moz-box-shadow: inset 0px 0px 0px 2px #f00; box-shadow: inset 0px 0px 0px 2px #f00; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="parent myclass"&gt; parent &lt;div class="child myclass"&gt; child &lt;/div&gt; &lt;/div&gt;
answers question: http://stackoverflow.com/q/27741134
type: Answer
score: 1

task
type: Tag
tag name: task
tags question: http://stackoverflow.com/q/27781989

http://stackoverflow.com/comment/43911067
comment on: http://stackoverflow.com/q/27749879
score: 0
type: Comment
type: QuestionComment
has text: Why isn't app defined in each of the javascript files?

http://stackoverflow.com/comment/43808117
comment on: http://stackoverflow.com/a/27697359
type: Comment
score: 0
type: AnswerComment
has text: I think it's a good idea to make the event delegation as specific as possible, rather than arbitrarily binding to the `document`. In this example, if there is another ` ` somewhere else on the page (like a "contact me" form or something), a `mouseup` on it will also trigger an event that is clearly only intended for the table. Better to use `$('table')` instead in my opinion.

http://stackoverflow.com/q/27741466
tagged with: ajax
tagged with: angularjs
tagged with: abort
has answer: http://stackoverflow.com/a/27741671
has title: Abort pending ajax request in AngularJS
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43893921
linked to: http://stackoverflow.com/q/13928057
has comment: http://stackoverflow.com/comment/43893788
has body: How can I abort my pending ajax requests in AngularJS? I am using a Service for making an ajax call and want to abort all pending requests if a new one is made on the same route. Here is my service: myService.service('angService', function($http){ this.getfromRemote=function(url){ return $http.get(location+'/dev/apiv-1-0-2/'+url); } }); Here I am calling the service. Before running next, I want to abort the pending ajax requests. angService.getfromRemote('paymentStatement/'+$scope.username) .success(function(response){ })
type: Question
score: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/27643817
type: Answer
has body: result2 calculate only once and never update. you may need $watch to update it whenever salary and invest changed. like: $scope.$watch('salary+invest', function(newValue, oldValue) { $scope.result2 = $scope.salary * $scope.invest * 0.01; });
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27643595

http://stackoverflow.com/comment/43723216
type: Comment
has text: I updated my answer with the fix before posting my last comment. the jsfiddle (the one that connects the whole route) and code snippet now work as expected (at least by me).
comment on: http://stackoverflow.com/a/27642187
score: 0
type: AnswerComment

http://stackoverflow.com/a/27680539
type: Answer
score: 30
has body: Tampermonkey scripts are run in a separate scope. This means that to make a function available globally you'll want to do something along the following: window.updateGUI = function () {...} If you want to add a number of functions to the global scope, it's better to store them under a single object and address your functions through there. That helps avoid any possible collisions you might otherwise have. var myFunctions = window.myFunctions = {}; myFunctions.updateGUI = function () {...}; After that you can simply call myFunctions.updateGUI();.
downvote count: 0
upvote count: 30
has comment: http://stackoverflow.com/comment/138500161
accepted answer of: http://stackoverflow.com/q/27680230
answers question: http://stackoverflow.com/q/27680230
type: AcceptedAnswer

http://stackoverflow.com/comment/43783634
score: 0
comment on: http://stackoverflow.com/q/27684676
type: Comment
type: QuestionComment
has text: I have seen a few sample in the Internet but it confuses me.. Can you give me an highlight for this a very brief code.?

http://stackoverflow.com/q/27732474
has answer: http://stackoverflow.com/a/27732606
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27732624
favorite count: 0
has comment: http://stackoverflow.com/comment/43876652
has body: I need to use else if in angularjs template .What is the syntax ? For example in c i would write the code like below: if (data.sender=='system') {data.receiver} else if (data.sender=='mail') {data.receiver} else {data.sender} My code: {{data.sender == 'System' ? data.receiver : ' '}} {{data.sender =='mail' ? data.receiver : data.sender }}
has answer: http://stackoverflow.com/a/27732619
linked to: http://stackoverflow.com/q/15810278
has answer: http://stackoverflow.com/a/27732950
has answer: http://stackoverflow.com/a/27733029
tagged with: angularjs
duplicate of: http://stackoverflow.com/q/15810278
score: 9
answer count: 5
has comment: http://stackoverflow.com/comment/43876260
has comment: http://stackoverflow.com/comment/43876454
possible better answer: http://stackoverflow.com/a/27732950
has answer: http://stackoverflow.com/a/27732624
type: AnsweredQuestion
upvote count: 9
has title: Else if in angular js template
type: Question

http://stackoverflow.com/comment/43741516
score: 0
comment on: http://stackoverflow.com/q/27659786
type: Comment
type: QuestionComment
has text: You are liking getting an error on the www.hfpersonaltrainer.com side. It has to be listening for json posts in order to know how to send an email. Try looking there.

http://stackoverflow.com/q/27743805
answer count: 1
favorite count: 0
type: UnansweredQuestion
score: 0
has title: Resizing Marker Image dynamically in Google Map
has body: I have added a marker on Google Map. Is there any way I can resize marker image once it is placed on Google Map just like a Rectangle is resizable by setting editable: true. I know there are scaledSize and size properties to set size of Marker Image but I don't know new size of image. How can I make marker resizable? Here is sample code I am using. I took this from Maps documentation section. Simple markers
has answer: http://stackoverflow.com/a/27747185
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43899633
type: Question
tagged with: javascript
tagged with: google-maps-api-3
tagged with: google-maps
tagged with: google-maps-markers

http://stackoverflow.com/comment/43913836
type: AnswerComment
type: Comment
has text: Thank you! However, I believe AngularJS must be strictly used on frontend.
score: 1
comment on: http://stackoverflow.com/a/27751276

http://stackoverflow.com/a/27707896
answers question: http://stackoverflow.com/q/27706963
has body: Well I don't think setTimeout blocks the event loop,it just queues up the function for execution after x seconds.So you could use a variable to check if the callback is fired.Also you can call the setTimeout inside the FS.prototype func but after listobjects. FS.prototype.myfunc = function(base, url, size, callBackArg) { var timeout = true;//will be true before the callback is fired var s3ForHead = new AWS.S3({ httpOptions: { timeout: 5000 } }); console.log("Define s3Forhead Object"); s3ForHead.listObjects({ "Prefix": url, "Bucket": S3_BUCKET }, function(err, data) { timeout = 'false';//set to false here since callback is fired console.log("Callback is done"); if (err != null) { console.log(err); callBackArg("404"); } else { if (data.Contents.length &gt; 0) callBackArg("200"); else callBackArg("404"); } }); setTimeout(function() { if (timeout) return callback("404");//Only call 404 if callback is not fired }, 5000); console.log('see settimeout does not block');//settimeout does not block,it executes callback after x secs. };
type: Answer
score: 0

http://stackoverflow.com/comment/43756091
comment on: http://stackoverflow.com/q/27661873
has text: Doesn't `em` create sizes based on total screen width?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/27643807
has body: You need to use $('.owl-carousel') and not $('#owl-carousel') as you're targeting an Id instead of a class In jquery the selector # targets an ID where a period . Targets a class name Either change that or change &lt;div class="owl-carousel"&gt; To &lt;div id="owl-carousel"&gt; And leave your javascript as is
answers question: http://stackoverflow.com/q/27643794
has comment: http://stackoverflow.com/comment/43707302
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/43706451
type: Answer
score: 2

http://stackoverflow.com/a/27696357
has comment: http://stackoverflow.com/comment/43806033
type: AcceptedAnswer
upvote count: 5
has comment: http://stackoverflow.com/comment/43806334
has body: You can your use regex within Javascript's sort function, like the following. var model = [ { "title": "test3" }, { "title": "test1" }, { "title": "test2" }, { "title": "test0" } ]; Update: As Danilo Valente stated in comments, if your integer begins with a 0, you need to extract the first 0 from the string. Since 02 =&gt; 0 model.sort(function (a, b) { //Strips out alpha characters a = a.title.replace(/\D/g, ''); b = b.title.replace(/\D/g, ''); //sets value of a/b to the first zero, if value beings with zero. //otherwise, use the whole integer. a = a[0] == '0' ? +a[0] : +a; b = b[0] == '0' ? +b[0] : +b; return a - b; });
has comment: http://stackoverflow.com/comment/43806183
type: Answer
has comment: http://stackoverflow.com/comment/43806075
has comment: http://stackoverflow.com/comment/43806170
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27696272
has comment: http://stackoverflow.com/comment/43806240
answers question: http://stackoverflow.com/q/27696272
score: 5

http://stackoverflow.com/q/27695459
score: 0
possible better answer: http://stackoverflow.com/a/27695635
accepted answer: http://stackoverflow.com/a/27695632
has comment: http://stackoverflow.com/comment/43804560
type: AnsweredQuestion
has body: I have a form that has lets say 3 items with a qty select element. $someArray = array( '1', '2', '3' ); foreach($someArray as $k => $v) { echo " Qty "; for ($a = 0; $a <= 5; $a++) { echo " " . $a . " "; } echo " "; } now in jquery, i want to make it so if you change the qty of any element, it changes all the elements of class qty to the selected value. I do not know what $v will equal, this is a dynmaic key of a db query result. jquery $('.qty').change(function() { var newQty = $(this).val(); $.each($('.qty'), function() { var thisId = $(this).attr('id'); alert(thisId+newQty); $('#'+thisId).val(newQty); }); }); the alert reads correct (1[qty]1, 2[qty]1 ,3[qty]1), however the select values are not changed by the next line. The brackets in the element id messing things up. how can i adjust?
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27695632
has title: change select values with id that has brackets
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27695635

http://stackoverflow.com/comment/43792086
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27689407
type: AnswerComment
has text: @Justin I get it. But you need to understand that if the division itself returns a `NaN`, what would `Math.round()` do?

http://stackoverflow.com/q/27699717
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43812511
has comment: http://stackoverflow.com/comment/43813401
answer count: 4
type: AnsweredQuestion
has body: I want to make a form validation using JavaScript but its not working properly. Can someone please help me? here is my code: JavaScript HTML Name: E-mail: UserName: Password:
type: Question
has answer: http://stackoverflow.com/a/27699819
has answer: http://stackoverflow.com/a/27699829
has comment: http://stackoverflow.com/comment/43812484
has title: Javascript validation on my form not working properly
has answer: http://stackoverflow.com/a/27699968
possible better answer: http://stackoverflow.com/a/27699819
score: 0
has comment: http://stackoverflow.com/comment/43812492
tagged with: javascript
has answer: http://stackoverflow.com/a/27699785
accepted answer: http://stackoverflow.com/a/27699785

http://stackoverflow.com/comment/43986505
score: 0
comment on: http://stackoverflow.com/a/27788187
type: Comment
has text: You clearly don't understand how to use this website properly. Try giving this a read: http://stackoverflow.com/tour
type: AnswerComment

http://stackoverflow.com/q/27676323
tagged with: jquery
has answer: http://stackoverflow.com/a/27676343
favorite count: 0
has title: Using draggable jQuery function
has answer: http://stackoverflow.com/a/27676370
score: 1
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27676370
has body: I create a popup window(here). HTML: &lt;div id = "window"&gt; &lt;div id = "title"&gt; "some title" &lt;/div&gt; &lt;div id = "innerDiv"&gt; &lt;/div&gt; &lt;/div&gt; CSS: #window { height:200px; width:150px; border: 5px solid red; } #innerDiv { height:90%; width:100%; background-color: #00ff00; } #title { cursor:move; height:10%; width:100%; background-color: yellow; } jQUERY: $( document ).ready(function() { $('#title').draggable({appendTo:'div'}); }); I want to make this window draggale only when I drag a title line but, now I can dragg only the title line the rest window is staying on his place. My question is how can I make draggable window not only the title line?
tagged with: javascript
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27676343
downvote count: 0

http://stackoverflow.com/comment/43898150
score: 0
type: Comment
type: QuestionComment
has text: This is what I'm trying to prevent from happening. http://i.imgur.com/ZLQYZIu.png and never happens with that site!
comment on: http://stackoverflow.com/q/27742951

http://stackoverflow.com/comment/43730912
has text: This question is not clear what it's want. You'r code not working as any opinion correctly, clear but what you expect from code exactly! not clear. Please avoid writing questions in this way.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27657421

http://stackoverflow.com/q/27766900
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has answer: http://stackoverflow.com/a/38732569
tagged with: twitter-bootstrap
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/35336043
type: Question
has title: Bootstrap Off Canvas Show Full Height
tagged with: javascript
has answer: http://stackoverflow.com/a/29108689
has body: I am trying to use Bootstrap off canavas left side bar to toggle on small devices. here is the bootply code example: www.bootply.com/C2wQEkdSAn The problem when displaying on mobile when you click on the accordion the contents are not pushing the footer down but hides behind it. Here is the full code: Project name Home About Contact Sidebar Link Link Link Link Sidebar Link Link Link Link Sidebar Link Link Link Collapsible Group Item #1 Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Collapsible Group Item #2 Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text... Sidebar text..…
has comment: http://stackoverflow.com/comment/44099318
linked to: http://stackoverflow.com/q/24579948
downvote count: 0
tagged with: jquery
linked to: http://stackoverflow.com/q/3508605
favorite count: 0
has answer: http://stackoverflow.com/a/27849454

http://stackoverflow.com/comment/43822636
has text: You need the literal HTML inside that `div`?
type: AnswerComment
comment on: http://stackoverflow.com/a/27705060
score: 0
type: Comment

http://stackoverflow.com/comment/43993085
has text: Thank you so much.. Problem is solved. I changed this to
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27773074

http://stackoverflow.com/a/27716083
score: 2
has body: JavaScript is single-threaded, a function cannot stop another function, because they cannot run at the same time. That being said, your issue is actually a jQuery animate issue. Just use the jQuery stop method to tell jQuery to stop animating the element. function stop() { $("#block").stop(); } Working Example: Start
downvote count: 0
answers question: http://stackoverflow.com/q/27716067
upvote count: 2
type: Answer

http://stackoverflow.com/a/27784106
upvote count: 3
type: Answer
score: 3
downvote count: 0
has body: You need to escape the / in the pattern as patt.search(/.*:\/\/.*waw\d\.omegle\.com/); Also escape . for more saftey as . alone could match anything in regex Example var patt = "http://asdfwaw1.omegle.com"; patt.search(/.*\/\/.*waw\d\.omegle\.com/); =&gt; True
answers question: http://stackoverflow.com/q/27784081

http://stackoverflow.com/q/27758575
type: UnansweredQuestion
tagged with: google-chrome-extension
has answer: http://stackoverflow.com/a/27761501
has title: Need help to pass information between content script and web_accessible_resources(js file)
type: Question
has answer: http://stackoverflow.com/a/27813580
score: 0
answer count: 2
tagged with: javascript
has body: I have a content script with some data read form the content script //Manifest file { "manifest_version": 2, "name": "Random App", "description": "This App will do random stuff", "version": "1.0", "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", "content_scripts": [ { "matches": ["https://www.youtube.com/*"], "js": ["content.js"], "run_at": "document_start", "all_frames": true } ], "web_accessible_resources": ["InjectScript.js"], "permissions": ["tabs", "background", "storage","https://www.youtube.com/*" ], "browser_action": { "default_title": "This is just a random app", "default_icon": "hello.png" } } //Content.js My requirement is to send firstParamTobeSent and secondParamTobeSent to InjectScript var firstParamTobeSent = "Stackoverflow"; var secondParamTobeSent = "Stackoverflow2"; var s = document.createElement('script'); s.src = chrome.extension.getURL('InjectScript.js'); alert("got the URL on InjectScript"); s.onload = function() { alert("1." + firstParamTobeSent + "----" + secondParamTobeSent); this.parentNode.removeChild(this); }; window.postMessage("YourName_expectedMessage"); //If I comment this line alert 1 and 2 start working. alert("2." + firstParamTobeSent + "----" + secondParamTobeSent); (document.head||document.documentElement).appendChild(s); //InjectScript.js window.addEventListener("message", function(request) { alert("Reaching here = " + request.data + "ORGIN = " + request.origin); if (request.data == "YourName_expectedMessage") //note that there are likely many script on the page or it's child frames that also send messages to this page, so you better name { alert("It works"); } }, true);

http://stackoverflow.com/comment/43889919
type: Comment
type: AnswerComment
has text: Thanks for the link, I wil check it out.
score: 0
comment on: http://stackoverflow.com/a/27739308

http://stackoverflow.com/comment/43794833
has text: The links to rx in your fiddle are wrong - they give a 404.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27674823

http://stackoverflow.com/comment/43839605
comment on: http://stackoverflow.com/q/27713621
has text: By default you should be able to start typing and populate the option which begins with the letters you have been typing.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44453999
type: QuestionComment
has text: You are comparing an ol3 build to an ol2 build here. ol3 and ol2 are very different beasts. Replacing ol2 by ol3 in an application requires changing that application's code.
comment on: http://stackoverflow.com/q/27767493
score: 0
type: Comment

http://stackoverflow.com/comment/88040890
score: 0
type: Comment
has text: all but mongodb... who doesn't seem to be able to do this yet
comment on: http://stackoverflow.com/a/28751577
type: AnswerComment

http://stackoverflow.com/comment/43706983
has text: What does the shadow tree look like? If the `.draggable` element is a shadow element, then `:host(.draggable)` and `:host-context(.draggable)` aren't correct.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27644154

http://stackoverflow.com/q/27717360
favorite count: 0
has answer: http://stackoverflow.com/a/71170773
tagged with: http://stackoverflow.com/tag/html
tagged with: spring
score: 2
has answer: http://stackoverflow.com/a/30883468
type: UnansweredQuestion
has title: Retrieve ModelMap value from Spring MVC controller to jquery in html
tagged with: spring-mvc
type: Question
upvote count: 2
answer count: 2
downvote count: 0
tagged with: javascript
has body: I am doing project in Spring 4.0.2. In Spring MVC controller I have used ModelMap attributes and I want to retrieve the same in jquery in html file. My Servlet code @RequestMapping(value = "/search", method = RequestMethod.GET) public String search(ModelMap model,@ModelAttribute TravelSearchDTO travelSearchForm, HttpServletRequest request) { Integer maxSeatSelection = dto.getMaxSeats(); model.addAttribute("maxSeatNo",maxSeatSelection); String returnText = "static/html/search"; return returnText; } My jquery code in search.html &lt;script type="text/javascript"&gt; var ss = '${maxSeatNo}'; alert(ss); &lt;/script&gt; No alert for ss value appeared. Also I am in great doubt that whether I need to use the variable in script declaration or in document.ready function. Please clarify above doubts to access the Modelmap value in html.
tagged with: jquery

http://stackoverflow.com/comment/44011354
has text: onChange doesn't fire on form elements. What kind of event are you trying to capture?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27801316
score: 0

http://stackoverflow.com/a/27792002
downvote count: 0
has body: The problem is with the [^...] character you're allowing almost anything in your regex and jshint detects a security risk. This is what jslint docs says about [^...]: true if . and [^...] should be allowed in RegExp literals. They match more material than might be expected, allowing attackers to confuse applications. These forms should not be used when validating in secure applications.
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27791951

http://stackoverflow.com/q/27761789
score: 0
has answer: http://stackoverflow.com/a/27761800
accepted answer: http://stackoverflow.com/a/27761800
answer count: 3
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27762331
has title: Click input on page load with jQuery
type: AnsweredQuestion
has body: I have three radio buttons and I want, by default, to have the "BOTH" location which has a value of 3 to be clicked on page load so that it will run my jQuery post function. The radio button is filled-in giving the appearance of being clicked, but the click is not happening to post my function. Once I change the radio button however, the code works fine. This is my code: $("input:radio[name='location'][value='3']").click(); $('input[name="location"]').change(function() { var location = $('input[name="location"]:checked').val(); var category = getUrlVars()["category"]; $.post( 'db/functions/package_conf.php', {category:category, location:location}, function(data) { $('#package_info').html(data); }); });
type: Question
has answer: http://stackoverflow.com/a/68145618
has answer: http://stackoverflow.com/a/27762331
tagged with: javascript

http://stackoverflow.com/comment/43979676
type: QuestionComment
comment on: http://stackoverflow.com/q/27782140
score: 0
has text: I add an image to show what I expect as a result
type: Comment

http://stackoverflow.com/comment/44159227
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27757666
has text: If both are still false inside the document.ready handler, you don't have an element with the ID `select-to` in your document (or you have more than one) ?

http://stackoverflow.com/comment/43740366
has text: @adeneo unfortunately there is no `>==` operator :)
comment on: http://stackoverflow.com/a/27661684
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43775526
type: Comment
comment on: http://stackoverflow.com/a/27662954
has text: can you try adding https://github.com/desandro/imagesloaded plugin and see if you still have the issue.
type: AnswerComment
score: 0

http://stackoverflow.com/q/27727699
has comment: http://stackoverflow.com/comment/43867437
type: Question
answer count: 1
has body: I am making a mobile application using Intel XDK for Android devices, I have been using an emulator and my local development server (127.0.0.1) to test my PHP code. I have been contacting my server using the following ways $.ajax(), $.post() and $.get(). I then decided that I'd reached a suitable point where I should build the application APK file, push the PHP source on to a online website and test it through a proper mobile. So I did, I made the database by exporting my current data from PMA then changed all the URLs in all my requests to point to the right place and pushed my PHP source to the FTP. I then tested my application and was quite shocked by the results. Error #1: PHP Fatal error: Can't use function return value in write context in /home/scrifalr/public_html/sm/api/v1/modules/register/register.php on line 9 What I did to fix: I checked the source and apparently after changing this !empty(trim($_POST['username'])) to empty($_POST['username']) seemed to fix that error. So question one. Why did this error not show up on my local server and not tell me then that I can't do that? Error #2: I have a login/register which sends requests which all works, I changed the above PHP and they started to work. However I have a logout page which doesn't seem to work, the code is shown below: logout.html Logout As you can see, it has nothing besides the includes. The following file is the JavaScript file: logout.js window.onload = function () { getSessionData(); $.post( "http://sm.script47.net/api/v1/modules/logout/logout.php", { "userID": window.userID }, function (data) { alert(data); if (data == 1) { document.location.href = "index.html"; } else { showTimedMessage(data, "error", 4000); } } ); }; As you can see, it contains the post request and a function called getSessionData(), so after what seemed like an age of trying to debug I came to the conclusion that it is getSessionData() which is failing which again seems odd as it was working in the emulator and all the pa…
tagged with: javascript
tagged with: jquery
has title: jQuery requests on mobile application not working
tagged with: ajax
score: 0
tagged with: android
has answer: http://stackoverflow.com/a/27728067
has comment: http://stackoverflow.com/comment/43867845
accepted answer: http://stackoverflow.com/a/27728067
has comment: http://stackoverflow.com/comment/43867784
has comment: http://stackoverflow.com/comment/43867391
has comment: http://stackoverflow.com/comment/43867807
has comment: http://stackoverflow.com/comment/43867407
has comment: http://stackoverflow.com/comment/43867793
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/comment/43759288
has text: Looks like `casperjs` is your passion :)
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27672186

http://stackoverflow.com/comment/43912805
has text: @AleveWinter Readability isn't the only reason to use variables. Variables will prevent JS from re-computing the same thing many times in a row. I strongly suggest that you reconsider this. Personnaly, I even go as far as defining a one-liner function `_e` that returns `document.getElementById`. Believe me, sooner or later you WILL mistype this and then everything's broken.
comment on: http://stackoverflow.com/q/27750465
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27706376
favorite count: 0
has title: Save input into Parse (Javascript)
has comment: http://stackoverflow.com/comment/43824559
tagged with: parse-platform
has answer: http://stackoverflow.com/a/27706447
type: AnsweredQuestion
score: 2
has body: Currently when the user select a file, it gets directly uploaded into Parse. I have added now couple input text field such as name of individual, address that I would want to be recorded into Parse at the same time only when the user has click the select button as of now its automatically submitted once the user has selected the file. $(document).ready(function() { // *************************************************** // NOTE: Replace the following your own keys // *************************************************** Parse.initialize("id", "id"); function saveDocumentUpload(objParseFile) { var documentUpload = new Parse.Object("Scan"); documentUpload.set("Name", ""); documentUpload.set("DocumentName", objParseFile); documentUpload.save(null, { success: function(uploadResult) { // Execute any logic that should take place after the object is saved. var photo = uploadResult.get("profileImg"); $("#profileImg")[0].src = photo.url(); }, error: function(uploadResult, error) { // Execute any logic that should take place if the save fails. // error is a Parse.Error with an error code and description. alert('Failed to create new object, with error code: ' + error.description); } }); } $('#documentFileUpload').bind("change", function(e) { var fileUploadControl = $("#documentFileUpload")[0]; var file = fileUploadControl.files[0]; var name = file.name; //This does *NOT* need to be a unique name var parseFile = new Parse.File(name, file); parseFile.save().then( function() { saveDocumentUpload(parseFile); }, function(error) { alert("error"); } ); }); }); Update 2: **Updated 2:**
possible better answer: http://stackoverflow.com/a/27706447
upvote count: 2
has answer: http://stackoverflow.com/a/27720714
has answer: http://stackoverflow.com/a/27706438
type: Question
has comment: http://stackoverflow.com/comment/43824662
tagged with: javascript
answer count: 3
accepted answer: http://stackoverflow.com/a/27706438
downvote count: 0
tagged with: jquery

http://stackoverflow.com/comment/43948304
type: QuestionComment
has text: You are totally right. I didn't copy the object that contains the category info. The object items is the one that contains them. I dont know how to move forward from this point.
comment on: http://stackoverflow.com/q/27765718
score: 0
type: Comment

http://stackoverflow.com/comment/43702856
score: 0
has text: when i select the letter 'j', I'm getting the following in the network console "green 200 GET index.php?q=j localhost html 1.36 KB ->7ms"
type: QuestionComment
comment on: http://stackoverflow.com/q/27641875
type: Comment

http://stackoverflow.com/comment/43885902
type: Comment
has text: the menu should expand and collapse onclick.Here I have expended Menu. Then the 2nd object in it and then the first array in it. I dont think there is a better way to put it. And i cannot follow most of the answers below as my JSON is not as small as this example JSON. it have about 200 menus and each menu have about 10 to 40 menuItems.
comment on: http://stackoverflow.com/q/27729956
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43900990
has text: my problem did get resolved. and I thank you. I do notice that its bit slow for it occur (like there is lag between when someone enters the information in the textfield, the information gets populated. I wonder if I could integrate somekind of on screen loading
type: Comment
comment on: http://stackoverflow.com/a/27744897
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43851128
comment on: http://stackoverflow.com/q/27719833
type: Comment
has text: Start from [here](http://learn.jquery.com/plugins/basic-plugin-creation/)
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43928504
type: AnswerComment
has text: There is a small library you could use: https://github.com/desandro/imagesloaded , unfortunately the normal document ready event does not necessarily fires after the images are loaded
type: Comment
comment on: http://stackoverflow.com/a/27756056
score: 0

http://stackoverflow.com/a/31104845
type: Answer
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/27744531
downvote count: 0
has body: You may consider using JSON-schema validators. http://json-schema.org/implementations.html Validators benchmark: https://github.com/ebdrup/json-schema-benchmark Disclaimer: I created ajv

http://stackoverflow.com/q/27762015
tagged with: javascript
has comment: http://stackoverflow.com/comment/43935367
tagged with: jquery
has answer: http://stackoverflow.com/a/27762070
score: 0
has comment: http://stackoverflow.com/comment/43935264
has comment: http://stackoverflow.com/comment/43935298
has body: How do I get the function checkViewers(); to work properly? I believe I am calling it wrong within the JS document file and therefore the JS is not reading the function properly. The current code: //Content Viewer Information function checkViewers() { //Base Variables var viewer = $('#viewed span.user'); var totalViews = $('#viewed span.user').length; var shortenViews = $('#viewed span.user').length -1; if (totalViews === 0) { $('&lt;span&gt; 0 people have &lt;/span&gt;').insertBefore($('#viewed span:last-child')); } if (totalViews === 2) { $('&lt;span&gt; and &lt;/span&gt;').insertAfter(viewer.first()); } if (totalViews &gt;= 3) { viewer.slice(1).hide(); $('&lt;span&gt; and &lt;/span&gt;').insertAfter(viewer.first()); $('&lt;span class="user count"&gt;&lt;/span&gt;').insertAfter(viewer.eq(2)); $('.count').html(shortenViews + ' more people'); } } The function is called towards the bottom of the remaining JS, after the JSON Data has been called. Ideally, the JSON Data should be inputted into the HTML and the function should catch the number of viewers. This should then effect how the viewers are being shown in the HTML, upon how many viewers are being listed. View the Plunker.
accepted answer: http://stackoverflow.com/a/27762070
has title: Basic Calling Function Troubleshooting
type: Question
linked to: http://stackoverflow.com/q/4559032
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43935281
tagged with: function
answer count: 1

http://stackoverflow.com/comment/43757823
type: Comment
has text: Haha, I only written about this and you already provided the solution. Well, considering I will make so for IE8 only, those guys can live with that.
type: AnswerComment
comment on: http://stackoverflow.com/a/27671464
score: 0

http://stackoverflow.com/a/27715617
has body: in HTML5 you can wrap your inside an anchor element. SEO-wise is always better to use an Anchor tag instead of JavaScript onclick handlers: Yey I'm clickable PS: make sure to not have other anchor or action button elements within the wrapping .
downvote count: 0
score: 9
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27715582
accepted answer of: http://stackoverflow.com/q/27715582
type: Answer
upvote count: 9

http://stackoverflow.com/q/27770643
type: UnansweredQuestion
tagged with: php
has title: Reading values in dynamic drop down menus using PHP
has comment: http://stackoverflow.com/comment/43952455
type: Question
score: 0
has comment: http://stackoverflow.com/comment/43952489
tagged with: javascript
has comment: http://stackoverflow.com/comment/43952349
tagged with: http://stackoverflow.com/tag/html
has body: I am using a Javascript function so that the user can create some html controls on the fly, such as whenever he needs to add a text field he can call this function, the function can be used to create these dynamic controls including text fields, drop down menus and radio buttons which I treat them in the code as arrays After the user creates this controls on the fly; he uses them to enter values and I am writing a php code to read the arrays values in order to inset them later into the MySQL DB but the php code I am using can only read the value of the first drop down in an array and can't read the rest of the values although the same code is working fine with text fields and radio buttons: HYG the HTML code that is inserted for the text fields drop down menus whenever the user calls the JS function: Relationship Spouse Friend Parent Child And HYG the PHP code that I am using to read the text fields and the drop down (select input type) For text fields it works: $name = implode(",", $_POST["APersonName"]); echo $name . " "; For drop downs it doesn't work: $relation = implode(",", $_POST["APersonRelation"]); echo $relation . " "; Am I missing something regarding the drop down menus should the value of the drop down referenced in some other way while I am handling it as an array? Adding the JS function that creates the dynamic controls: Thanks
answer count: 0
tagged with: dynamic

http://stackoverflow.com/comment/43741424
type: QuestionComment
score: 0
has text: @Era Try to inspect element, replace the html from the whole page by the html inside the frame and resize it.
type: Comment
comment on: http://stackoverflow.com/q/27653695

http://stackoverflow.com/q/27762864
has answer: http://stackoverflow.com/a/27763000
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27762956
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43936834
score: 0
has body: I'm trying to validate a dynamically array of inputs but I can't figure out how to do it, this is my html: &lt;input type="text" class="form-control" name="studentContactDesc" placeholder="Description"&gt; &lt;input type="text" class="form-control" name="studentContactPhone" placeholder="Phone"&gt; When the user clicks on a button the process add more inputs like this: &lt;input type="text" class="form-control" name="studentContactDesc" placeholder="Description"&gt; &lt;input type="text" class="form-control" name="studentContactPhone" placeholder="Phone"&gt; &lt;input type="text" class="form-control" name="studentContactDesc" placeholder="Description"&gt; &lt;input type="text" class="form-control" name="studentContactPhone" placeholder="Phone"&gt; Every time the user clicks on the button the process add the same two lines. I'm reading the data with: $(document).on('click','#saveRecord',function() { $("input[name=studentContactDesc]").each(function() { alert($(this).val()); }); $("input[name=studentContactPhone]").each(function() { alert($(this).val()); }); }); This function reads all the description fields first, and then all the phone fields. If there any way to read a description field with the phone and the other fields with the same order?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27762956
has comment: http://stackoverflow.com/comment/43936793
has title: Get the values from array with 2 differents inputs
possible better answer: http://stackoverflow.com/a/27763000

http://stackoverflow.com/comment/43862035
type: AnswerComment
has text: Where is data.txt located? On your computer? On a server?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27724947

http://stackoverflow.com/comment/43980884
type: AnswerComment
type: Comment
has text: Jep, I know, just found out my self, 1min after posting the question. Thanks for you reply!
comment on: http://stackoverflow.com/a/27785459
score: 0

http://stackoverflow.com/comment/100232139
type: Comment
comment on: http://stackoverflow.com/a/40650166
has text: I added it, my page still refresh.
score: 0
type: AnswerComment

http://stackoverflow.com/a/27684029
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27683983
downvote count: 0
has body: $('#datepicker').datepicker({ changeMonth : true, changeYear : true, }).on('changeDate', function (e) { window.open("yourURL", "_self"); }); $("#datepickerImage").click(function() { $("#datepicker").show(); }); }); More info on window.open here http://www.w3schools.com/jsref/met_win_open.asp
type: Answer

http://stackoverflow.com/q/27752499
has answer: http://stackoverflow.com/a/30550250
score: 3
has title: Vue JS - Putting Json on data
has body: I want to put my JSON data into Vue data, and a display, why can't I get to work? compiled: function(){ var self = this; console.log('teste'); $.ajax({ url: 'js/fake-ws.json', complete: function (data) { self.$data.musics = data; console.log(self.$data.musics); } }) } {{nome}} I can't get the code to work.. why?
has answer: http://stackoverflow.com/a/43206089
tagged with: javascript
has answer: http://stackoverflow.com/a/27832864
answer count: 3
tagged with: vue.js
downvote count: 0
favorite count: 0
upvote count: 3
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/comment/43963681
comment on: http://stackoverflow.com/a/27776617
type: Comment
has text: how can do this recursively since it has to be called more or less 15 times?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43738730
comment on: http://stackoverflow.com/a/27650561
type: AnswerComment
has text: It does appear the browser (or OS?) has the logic to fallback to necessary fonts on non-english text. For example, google chinese unicode map, you will see in dev-tools under computed styles, the browser uses an appropriate font, automatically. If you are ok with pdf text being non-selectable, you can use html2canavas to render text to image (using browser capabilities), and embed the image in PDF.
type: Comment
score: 0

http://stackoverflow.com/comment/43804378
score: 0
type: Comment
has text: Awesome! Thanks for the help. I wondered if it had something to do with the leave removing the element, but it didn't occur to me to inject $rootScope. A couple follow up questions - why does the leave fire the return function twice (one complete, and one cancelled)? I added logging to your plunkr to illustrate: http://plnkr.co/edit/snf2zz3pp5JszLL0uRZB?p=preview And is there a reason to use jQuery(element).animate instead of just element.animate if the element is already a jqLite object?
type: AnswerComment
comment on: http://stackoverflow.com/a/27694252

http://stackoverflow.com/comment/43701523
score: 0
type: Comment
type: QuestionComment
has text: please show us what you tried so far.
comment on: http://stackoverflow.com/q/27641133

http://stackoverflow.com/a/27673529
type: Answer
answers question: http://stackoverflow.com/q/27672761
has comment: http://stackoverflow.com/comment/44855512
has body: You can use local storage to save your calculations. Note that localStorage is just that, local. As in stored on the physical machine you are using. So if you were to visit this page on your laptop and do some calculations, then visit the page from your desktop, you would not see the calculations you made using the laptop. If you need to access the calculations from different devices, you'll need a backend (server side) solution like using php to connect to a mySql database to store and retrieve the information probly with a little ajax to keep everything asynchronous. If you have this need and dont want to learn php , mySql, and ajax i'd recommend Parse which is basically a super easy to use backend storage API that you can interact with using just javascript. I use parse in several projects and would be lost without it. But first: One issue with your HTML: I would pass the ids of all of the elements when calling calc() instead of two ids and one value. That way A is always the value of the first element and B is always the value of the second element. Before, A was the value of the last element you changed and B was the other element's value. A couple of issues with calc() I would check if either input is empty before trying to call calc() otherwise, changing the first element will alway cause an alert (because the second element is still empty). I would not continue if an input was invalid, you could set to 0, but I don't see how that would benefit you. Though, could be you have a reason for this. After addressing these issues, simply use local storage to store the vars after you set the result as shown below. The comments should help you understand what's happening If your calculations can include more than just addition, I would store another variable to keep up with the operation performed as well as the numbers. Here is a working jsFiddle function calc(A,B,SUM) { //changed the onChange in your HTML to pass both ids instead of the //one value and one id, this …
score: 0
has comment: http://stackoverflow.com/comment/44381175
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44380955
accepted answer of: http://stackoverflow.com/q/27672761

http://stackoverflow.com/comment/43920334
has text: tanks.How hide div with clicking on page?
comment on: http://stackoverflow.com/a/27754797
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43841631
comment on: http://stackoverflow.com/a/27714688
type: AnswerComment
score: 0
type: Comment
has text: Thank you for the response! I tried with your code, but it doesn't seem to work either, as this is what I'm getting back when logging comments: `[ { author: 54a34906af18e2a3db4dff30, message: 'Somerandomtextgoeshere2', posted: Wed Dec 31 2014 01:53:26 GMT+0100 (CET) }, { author: 54a34906af18e2a3db4dff2f, message: 'Somerandomtextgoeshere', posted: Wed Dec 31 2014 01:53:26 GMT+0100 (CET) } ]` Maybe async issues?

http://stackoverflow.com/a/27996959
answers question: http://stackoverflow.com/q/27801261
has body: You should take a look at the Microsoft Office XML Formats here (https://en.wikipedia.org/wiki/Microsoft_Office_XML_formats) You can construct a variable with the xml tags, then output it as XLSX.
type: Answer
score: 0

http://stackoverflow.com/comment/43908177
has text: If you append the name to the raw class name string, you have to make sure you add a space character. It's really not the best way of doing things.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27748457
score: 0

http://stackoverflow.com/comment/43778219
has text: Of course, that error doesn't matter much now that you've already updated the code. `;)`
type: AnswerComment
comment on: http://stackoverflow.com/a/27681637
type: Comment
score: 1

http://stackoverflow.com/a/27707667
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27707392
downvote count: 0
has body: Mr. Polywhirl is right, don't send a single request for each action. Instead, I would add a debounce function that will only fire once after xxx milliseconds have passed since the function was last called. David Walsh's debounce function (linked to above): function debounce(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) func.apply(context, args); }; var callNow = immediate &amp;&amp; !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; }; You should be able to use it kinda like this: var data = []; var sendRequest = debounce(sendAjaxRequest, 200); function sendAjaxRequest() { $.ajax({ /* Send Ajax Request */ }); // Empty out the data array data = []; } // Add data to the array whenever your checkbox is clicked and // queue up the ajax request $('.element').on('click', function() { data[] = $(this).data('my-data'); sendRequest(); })
type: Answer

http://stackoverflow.com/a/27794200
upvote count: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27792887
answers question: http://stackoverflow.com/q/27792887
type: Answer
score: 2
has body: I think you are going about this the wrong way. Use a whitelist regular expression in both angularjs as well as your backend to validate the input. For security, best practice is for each field to have a regular expression which will only allow certain valid input. A simple one for name would be /^[a-z ,.'-]+$/i. This would be on the server side to prevent any data being sent that was not valid. This could also be placed on the client side to also validate. By default Angularjs encodes output when using {{}} to protect against XSS, so abs will appear as is and this is what you want from a security point of view to prevent third party script from executing on your page. In some cases you may want to allow output of html and allow it safely but in which case you can use ng-bind-html with ng-sanitize and don't need to use $sce directly.

http://stackoverflow.com/a/27688350
downvote count: 1
upvote count: 5
has body: In componentDidMount you can do: this.getDOMNode() to get a reference to the underlying DOM for that component. So if you do want to use your mounted component with jQuery you can do: componentDidMount: function() { $(this.getDOMNode()); } http://facebook.github.io/react/docs/working-with-the-browser.html Here's a fiddle which shows jQuery acting on the DOM node of a react component: http://jsfiddle.net/sa5e88ys/1/ As you can see, it adds a border to the div as expected. If you're still having problems I guess it could be with the plugin you're using rather than jQuery or react?
score: 4
accepted answer of: http://stackoverflow.com/q/27688311
has comment: http://stackoverflow.com/comment/43790957
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43790230
type: Answer
answers question: http://stackoverflow.com/q/27688311
has comment: http://stackoverflow.com/comment/132601371

http://stackoverflow.com/q/27679291
has answer: http://stackoverflow.com/a/27688473
has title: Drawing Polygon in google map using javascript
accepted answer: http://stackoverflow.com/a/27688473
type: Question
tagged with: google-maps
tagged with: javascript
has body: I want to draw polygon in google map and I am using the example code at http://jsfiddle.net/rvsMH/1/ but it's not working and not getting array or lat/long value. I don't know what's the problem. <%-- Document : newjsp Created on : Dec 28, 2014, 9:13:28 AM Author : Mona --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> Drawing tools
tagged with: google-maps-api-3
answer count: 1
downvote count: 0
favorite count: 0
score: 14
type: AnsweredQuestion
upvote count: 14

http://stackoverflow.com/comment/43810764
type: Comment
has text: I see what you're saying. Try changing out the 'a' reference in the code to 'img'
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27698742

http://stackoverflow.com/a/27757467
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43977710
has comment: http://stackoverflow.com/comment/43969093
answers question: http://stackoverflow.com/q/27753970
type: Answer
accepted answer of: http://stackoverflow.com/q/27753970
has comment: http://stackoverflow.com/comment/44174160
has body: One easy method is to search through Keywords and hide anything that doesn't match. Demo http://jsfiddle.net/tk27L2es/ Example list items within the span we insert keywords, we also hide these from view themeparkGalaxyland themeparkPlayland themeparkMagic Mountain Water Park familypark canadaCanada's Wonderland familypark renfrewStoryland we also create another list for the user to choose the Keyword that would like to search for All Theme Parks Family Parks Renfrew Theme Parks Canada Theme Parks css #hide { display:none; } Jquery Upon choice of keyword, match keyword and remove the rest from the list var cat; $(document).on("click", "#cats >li", function (event, ui) { cat = $(this).closest("li").attr('id'); if (cat == "all") { $('#filterlist li').show(); } else { $('#filterlist li:contains(' + cat + ')').show(); $('#filterlist li:not(:contains(' + cat + '))').hide(); } $("#mylistitems").collapsible("collapse"); }); ideally if you have a lot of items you want to minimize data in the HTML document so for the keywords you would assign a letter and a number and match items on those. eg A1 = Theme Parks A2 = Family Parks ... and so on For Updating the choice header dynamically upon click, inspecting the element in a browser will show that JQM has inserted it into tags with a class of ui-collapsible-heading-toggle so an easy way to dynamically change the heading is to grab the text from the list choice item and insert it to the header using that class. ch = $(this).closest("li").text() $(".ui-collapsible-heading-toggle").text(ch) Demo http://jsfiddle.net/986q9fy4/ For a dropdown you would use pretty much the same code but with an -- on change -- event and then grabbing the value of the option you select var cat; $(document).on("change", "#cats", function (event, ui) { cat = $("#cats").val(); if (cat == "all") { $('#filterlist li').show(); } else { $('#filterlist li:contains(' + cat + ')').show(); $('#filterlist li:not(:contains(' + cat + '))').hide(); } $("#mylistitems")…
has comment: http://stackoverflow.com/comment/44222018
score: 0

http://stackoverflow.com/a/27781706
has comment: http://stackoverflow.com/comment/43973501
downvote count: 0
has comment: http://stackoverflow.com/comment/43977434
has body: Is there any reason you can't compute the result and then display it? I.e. have ng-init="a = [0,1,2]; fa = f(a);" and then ng-repeat="item in fa" ? Working plunkr example If you need to have that computed result updated when a changes you could just have a $scope.$watch statement watching for changes to a and then updating fa.
has comment: http://stackoverflow.com/comment/43977250
type: Answer
answers question: http://stackoverflow.com/q/27780049
score: 1
has comment: http://stackoverflow.com/comment/43974993
upvote count: 1
has comment: http://stackoverflow.com/comment/43978388
has comment: http://stackoverflow.com/comment/43974399

http://stackoverflow.com/a/27802152
type: Answer
score: 1
upvote count: 1
has body: Try this. You don't even need a switch. $(".menubutton").hover( function() { $(".topmenu a").removeClass("activatedmenubutton"); $(this).addClass("activatedmenubutton"); $(this).prev().addClass("activatedmenubutton"); $(this).next().addClass("activatedmenubutton"); });
answers question: http://stackoverflow.com/q/27802014
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44014100
accepted answer of: http://stackoverflow.com/q/27802014

http://stackoverflow.com/q/27709978
tagged with: javascript
has comment: http://stackoverflow.com/comment/43832103
upvote count: 1
tagged with: jquery
favorite count: 0
tagged with: parse-platform
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43832370
downvote count: 0
answer count: 0
score: 1
has title: Transferring file from Google to Parse.com
has body: I have created a system where user selects files from their Google drive to be uploaded into Parse. I have done so separately though, where I have one code that allows user to select an item from Google drive, and one that allows user to upload a file from their computer into parse. Google drive (Using Google drive picker): eSnail Scan Upload Part 2 That allows a user to upload a file into Parse (PDF):
type: Question

http://stackoverflow.com/comment/43993066
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27791317
has text: @AnshulNigam: This is great for disabling the dropdown. However, my question still remains is that, I need to show the value from the querystring matching with the dropdown and then disabling it. The custom code that I have is the other way (whatever value I select in the dropdown gets added in the input field).

http://stackoverflow.com/q/27791896
type: Question
tagged with: javascript
tagged with: google-maps-api-3
score: 0
tagged with: google-maps-markers
has answer: http://stackoverflow.com/a/27791971
answer count: 1
has comment: http://stackoverflow.com/comment/44006925
tagged with: angularjs
type: UnansweredQuestion
has title: Google Map resize and center, unexpected behaviour
has comment: http://stackoverflow.com/comment/43993421
has body: Depending on the state of my application, I want my google map canvas to be of different size, I change the size by using ng-class. When I call ToggleExploreMap(), the size of my google map changes, but the setCenter isn't applied properly. The position does change, but it doesn't change on my marker, but it is shifted to the top left of the marker position. Is this a bug? See this fiddle for an exemple of the seen behaviour. If you click the resize button, the map is resized, but you need to click a second time to actually have the map centered on the marker. http://jsfiddle.net/bkogdfva/1/ The Controller var exploreMap = new google.maps.Map(document.getElementById("map_explore_canvas"),myOptions); var $scope.ExploreMapStyle = "map_explore_canvas"; //Click Handlers $scope.ExploreDetails = function(marker){ ToggleExploreMap(); google.maps.event.trigger(exploreMap, 'resize'); exploreMap.setCenter(marker.position); }; function ToggleExploreMap(){ if(exploreMode === "explore"){ $scope.ExploreMapStyle = "map_explore_detail"; exploreMode = "detail"; } else{ $scope.ExploreMapStyle = "map_explore_canvas"; exploreMode = "explore"; } }; The HTML &lt;div id="map_explore_canvas" ng-class="ExploreMapStyle"&gt;&lt;/div&gt; The CSS .map_explore_canvas{ width:1080px; height:500px; } .map_explore_detail{ width:400px; height:400px; }

http://stackoverflow.com/comment/43861438
score: 0
type: Comment
has text: I edited the question to be more relevant to what I am trying to accomplish. There should be a better way to do this without modifying the String.prototype, especially if I may return an array, an object or even a function.
type: AnswerComment
comment on: http://stackoverflow.com/a/27724697

http://stackoverflow.com/comment/43919870
has text: http://www.ebay.com/itm/Professional-Slideshow-Simple-HTML-Designs-eBay-Store-Auction-Listing-Templates-/221449031401
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27754032

http://stackoverflow.com/comment/43992028
type: QuestionComment
has text: @PaulG I posted a quick answer below.
comment on: http://stackoverflow.com/q/27790942
score: 0
type: Comment

http://stackoverflow.com/comment/43972385
comment on: http://stackoverflow.com/q/27781198
has text: In fact, sounds like you want just on quote click, load a random new quote without reloading the entire page, is it?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27797530
has comment: http://stackoverflow.com/comment/44003743
has comment: http://stackoverflow.com/comment/44003754
has title: JavaScript methods one works the other doesn't
has answer: http://stackoverflow.com/a/27797957
type: Question
has answer: http://stackoverflow.com/a/27797627
has comment: http://stackoverflow.com/comment/44003703
has answer: http://stackoverflow.com/a/27797617
tagged with: math
tagged with: javascript
has comment: http://stackoverflow.com/comment/44003796
has comment: http://stackoverflow.com/comment/44003822
score: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/27797621
has answer: http://stackoverflow.com/a/27797721
has body: Why does this work? 001 002 003 004 005 006 007 008 009 010 and this does not work? 001 002 003 004 005 006 007 008 009 010 I prefer the second method as it can be used plenty of times not just one. In the first method you must copy/paste the code at each time you need to change. The second method seems cleaner. What I mean in it doesn't work is that it does not centre. The JavaScript seems to fail to work.
answer count: 5
type: UnansweredQuestion

http://stackoverflow.com/q/27775222
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Inserting space or hyphen after 3 and 6 digits, and having prefix +91
downvote count: 0
has answer: http://stackoverflow.com/a/27775349
score: 1
type: Question
tagged with: javascript
has body: Iwant to have +91 pefix in the input text which can be unchanged, and after entering the data getting space or hyphen after 3rd and 6th digits ... Is it possible? this is my code, plz help!! thank you in advance function ValidateMobNumber(txtMobId) { var fld = document.getElementById(txtMobId); if (fld.value == "") { alert("You didn't enter a phone number."); fld.value = ""; fld.focus(); return false; } else if (isNaN(fld.value)) { alert("The phone number contains illegal characters."); fld.value = ""; fld.focus(); return false; } else if (!(fld.value.length == 10)) { alert("The phone number is the wrong length. \nPlease enter 10 digit mobile no."); fld.value = ""; fld.focus(); return false; } } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="text" id="txtMB" /&gt; &lt;!--Or Call on Button--&gt; &lt;input type="submit" id="btnVal" value="Save" onclick="return ValidateMobNumber('txtMB')" /&gt;
upvote count: 1

http://stackoverflow.com/comment/43890932
type: QuestionComment
has text: it would be better if you can explain ur problem more than this!
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27740056

http://stackoverflow.com/comment/43895233
comment on: http://stackoverflow.com/q/27742066
has text: if you want all the 3 child div's to be in same line then you should increase the width .bigParent {width:366px}
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27798264
answer count: 6
has comment: http://stackoverflow.com/comment/78674120
linked to: http://stackoverflow.com/q/30036688
score: 37
tagged with: wordpress
has answer: http://stackoverflow.com/a/70548423
has answer: http://stackoverflow.com/a/38159394
upvote count: 37
has answer: http://stackoverflow.com/a/27799147
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27799147
downvote count: 0
accepted answer: http://stackoverflow.com/a/70548423
tagged with: javascript
tagged with: jquery
has body: Been searching around on this for a while and can't come up with any documentation to outline what i want to achieve. I'm using wordpress and the Contact Form 7 plugin, all is working perfectly, what i want to achieve is to run some particular javascript upon form submit, i know we can use "on_sent_ok:" in the additional settings, but this only performs if the form is actually submitted. What i'd like to do is to do some other javascript when the form doesn't submit ok, which throws the user back to the section which didn't validate. I can use the following code to run after 1.7s of the form submit being clicked, however it's a bit sloppy as if the user was running with a slow connection, there's potential this could run before the form is submitted properly. $('.wpcf7-submit').click(function() { setTimeout(function() { if ($('.fs1 input,.fs1 textarea').hasClass('wpcf7-not-valid')) { $('.pop-up-form').removeClass('pustep2').removeClass('pu-closing'); $('.form-step').hide(); $('.fs1').show(); } if ($('.fs2 *').hasClass('wpcf7-not-valid')) { alert('error on page 2 - take user back to the area with issues') } }, 1700); }); Is there any particular function or hook i can use to run JS when the form AJAX has completed? Thanks!
favorite count: 0
tagged with: ajax
tagged with: contact-form-7
has answer: http://stackoverflow.com/a/75173026
type: Question
has title: Contact Form 7 AJAX Callback
has answer: http://stackoverflow.com/a/49316447
has answer: http://stackoverflow.com/a/42926131

http://stackoverflow.com/a/27709361
type: Answer
has comment: http://stackoverflow.com/comment/43830683
upvote count: 4
downvote count: 0
has body: Because $.getJSON is an async request and is still processing when you try and log. Also, don't use jQuery with Angular, use Angular's $http (this way a $digest cycle is triggered and everything stays in sync): $http.get("categories/1/").success(function(data) { cat1 = data; //returns a JSON $scope.pictures=[cat1,cat2,cat3,cat4,cat5]; }); Dont forget to add $http as a dependency in your controller: app.controller("myCtrl", ["$scope", "$http", function($scope, $http) { }]);
has comment: http://stackoverflow.com/comment/43830771
accepted answer of: http://stackoverflow.com/q/27709318
has comment: http://stackoverflow.com/comment/43830760
answers question: http://stackoverflow.com/q/27709318
score: 4
has comment: http://stackoverflow.com/comment/43830620
has comment: http://stackoverflow.com/comment/43830538
has comment: http://stackoverflow.com/comment/43830575
type: AcceptedAnswer

http://stackoverflow.com/q/27722089
score: -5
has comment: http://stackoverflow.com/comment/43855852
type: Question
has body: I have copied javascript code of smooth scroll from stackoverflow and modified in my page but it is not working. The Original Code is given here: http://jsfiddle.net/swfour/dN4S4/1/ The Modified Code : http://codepen.io/anon/pen/VYmLva
has answer: http://stackoverflow.com/a/27722298
downvote count: 5
tagged with: javascript
has title: Smooth Scroll is not working properly
upvote count: 0
has comment: http://stackoverflow.com/comment/43855951
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/a/27728610
type: Answer
has comment: http://stackoverflow.com/comment/43869102
answers question: http://stackoverflow.com/q/27728598
score: 11
has body: I'm changing my answer according to your requirement. In your HTML give same name to both radio buttons. This will take care of select and deselect. &lt;label&gt;Please specify car:&lt;/label&gt;&amp;nbsp; &amp;nbsp; &lt;label&gt;BMW&lt;/label&gt; &lt;input type="radio" name="car" id="is_BMW" /&gt; &amp;nbsp;&amp;nbsp; &lt;label&gt;Mercedes&lt;/label&gt; &lt;input type="radio" name="car" id="is_Mercedes" /&gt; And put the value changing logic in js like bellow function valueChanged() { if (document.getElementById("is_BMW").checked == true) { document.getElementById("is_BMW").value = 1; document.getElementById("is_Mercedes").value = 0; } else { document.getElementById("is_BMW").value = 0; document.getElementById("is_Mercedes").value = 1; } console.log(document.getElementById("is_BMW").value); console.log(document.getElementById("is_Mercedes").value) } Explanation:- The name setting tells which group of radio buttons the field belongs to. When you select one button, all other buttons in the same group are unselected. updated demo
type: AcceptedAnswer
downvote count: 0
upvote count: 11
accepted answer of: http://stackoverflow.com/q/27728598

http://stackoverflow.com/q/27773150
has body: How do I get an array of all the elements which share a directive so I can iterate over them and have them do different things to each other? I have a directive which is used on multiple elements, and depending on the attribute value of each directive which uses restrict: 'A', I need the directives to all talk to each other and effect each other in different ways within the link function. I've tried using: link : function(scope, elem, attr) { attr.forEach(function(e, i) { if(attr[i] === 'menu') { //do something } else if (attr[i] === 'scroll') { //do something else } }); } but I get forEach as an undefined function. I've also tried a simple for loop, but both: elem.length and attr.length give me undefined. Note that I don't want to use different directives with different logic because I need each element to actually do something specific to each other element. I could just use jQuery to select the elements straight up, but that's less than ideal for several reasons.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27773199
type: Question
tagged with: angularjs-directive
has title: Angular get a list of all elements which share directive
tagged with: javascript
tagged with: dom
possible better answer: http://stackoverflow.com/a/27773233
accepted answer: http://stackoverflow.com/a/27773199
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27773233
tagged with: arrays
tagged with: angularjs
linked to: http://stackoverflow.com/q/20801843

http://stackoverflow.com/a/27682895
score: 0
answers question: http://stackoverflow.com/q/27682751
has body: I suggest you to use re.findall instead of re.search because search would return only the first match. url=urllib.urlopen('http://www.example.com/whatever.asp?profile=1') contents= url.read() soup = BeautifulSoup(contents) js_content= soup.findAll("script")[0].text reg = r'&lt;?(\w+@\w+(?:\.\w+)+)&gt;?' match= re.findall(reg,js_content)
type: Answer

http://stackoverflow.com/q/27772687
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has body: Trying to select the 1st/2nd dd in a dl, to add a to them HTML: JS(Jquery): $("dl dd:nth-child(1)").after("md"); $("dl dd:nth-child(2)").after("lg"); Js Fiddle How can I accomplish for more than one dl? Would I have to use .each? Thank you!
has answer: http://stackoverflow.com/a/27772712
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: jquery nth-child append (first and second dd in dl) trouble
type: AnsweredQuestion
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/27772712
type: Question
tagged with: javascript

http://stackoverflow.com/comment/43832648
has text: @watcher: Nice solution. [David Walsh](http://davidwalsh.name/tutorials/javascript) and [A List Apart](http://alistapart.com/) are great references to practical JavaScript examples.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27707392
score: 0

http://stackoverflow.com/q/27751879
type: Question
accepted answer: http://stackoverflow.com/a/27752907
has title: Highlight point range in Highcharts
tagged with: highcharts
tagged with: javascript
has body: I use following code to create a dynamic Highchart using websocket connection. Is there a way to highlight(with some other color) selected range in the graph. For example, If the value from websocket is higher than 25 then those values must be colored differently until value drops below 25. chart: { type: 'spline', animation: Highcharts.svg, // don't animate in old IE marginRight: 10, events: { load: function () { // set up the updating of the chart each second var series = this.series[0]; var connection = new WebSocket('ws://localhost:8091'); connection.onmessage = function (event) { var x = (new Date()).getTime(), // current time y = parseInt(event.data); series.addPoint([x, y], true, true); }; ////////////////////////// } } },
answer count: 1
downvote count: 0
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43914833
has answer: http://stackoverflow.com/a/27752907
score: 1
upvote count: 1

http://stackoverflow.com/a/27716750
accepted answer of: http://stackoverflow.com/q/27716565
type: Answer
answers question: http://stackoverflow.com/q/27716565
has comment: http://stackoverflow.com/comment/43846216
has body: Just use it when you have it, and retain it for later, like so: &lt;%= button_tag data: {id: technique.id, like_path: like_my_item_path(technique), dislike_path: dislike_my_item_path(technique) } do %&gt; &lt;%= content_tag :p, technique.name, class: 'technique-name' %&gt; &lt;% end %&gt; Then, in your js, you can do stuff like: like_path = $(this).data('like-path'); dislike_path = $(this).data('dislike-path'); $("#myModal .thumbs-up a").attr('href', like_path) $("#myModal .thumbs-down a").attr('href', dislike_path) As a side-note, you may wish to bind the click to a higher-level element, to avoid issues with dynamic replacement (like turbolinks, for example). Something like this: $(document).on 'click', '.box-inner', function() {}
type: AcceptedAnswer
score: 0

http://stackoverflow.com/comment/43932926
score: 0
comment on: http://stackoverflow.com/q/27736195
type: Comment
type: QuestionComment
has text: @Noitidart, do you enable all the 'Recommended development preferences' per https://developer.mozilla.org/en-US/Add-ons/Setting_up_extension_development_environment?redirectlocale=en-US&redirectslug=Setting_up_extension_development_environment#Development_preferences ? Those omit the webgl.enable-privileged-extensions item I saw in about:config that seems to be what you referenced? Being unsure which config was right is why I poked around a bit more.

http://stackoverflow.com/q/27712703
favorite count: 0
upvote count: 2
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/9468055
has comment: http://stackoverflow.com/comment/43837569
tagged with: node.js
duplicate of: http://stackoverflow.com/q/9468055
answer count: 0
has title: Node.js - calling require caches file - but what if you call 'new'?
type: Question
score: 2
downvote count: 0
tagged with: javascript
has body: if you have a simple javascript file foo.js like so: function doSomething (){ console.log('done'); } module.exports = doSomething; if this file/module is required, it will get cached (any information about this online that you could point me to would be great). so, in another JS file we have: var foo1 = require('foo'); // yup and in yet another file we have: var foo2 = require('foo'); // points to same cache as foo1 but what happens with the cache when we call: var foo3 = new foo2(); // doesn't point to same cache as foo2 and foo1? I assume a new copy of something is created, but what exactly happens beneath the surface? I am wondering this because I want to know how robust a particular singleton pattern is in JavaScript.

http://stackoverflow.com/a/27800378
downvote count: 0
type: Answer
has body: Assuming your message documents have a userId field, you can simply do this: Template.message.helpers({ isOwner: function() { return this.userId === Meteor.userId(); } }); and: {{#if isOwner}} &lt;!-- controls --&gt; {{/if}} You could also make a more flexible, reusable global helper for this: Template.registerHelper('isCurrentUser', function(userId) { return userId === Meteor.userId(); }); &lt;!-- in this example, the document might have an `ownerId` field rather than `userId` --&gt; {{#if isCurrentUser ownerId}}{{/if}} Of course, you also need to validate the updates on the server with the allow/deny API or with custom methods.
answers question: http://stackoverflow.com/q/27800257
upvote count: 4
type: AcceptedAnswer
score: 4
accepted answer of: http://stackoverflow.com/q/27800257

http://stackoverflow.com/comment/43737240
comment on: http://stackoverflow.com/q/27654076
type: Comment
type: QuestionComment
has text: thanks for the suggestion, but i want to stop the ball completely after few bounces, for more details (http://jsfiddle.net/ravikiran6763/ct7x3nts/)
score: 0

http://stackoverflow.com/comment/43781966
has text: When you're passing `$telephoneCookie.val()` to the value of the cookie are you sure that it's not null?
comment on: http://stackoverflow.com/q/27683755
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43891876
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27737872
has text: TypeError: undefined is not a function error shown
type: Comment

http://stackoverflow.com/a/27762195
accepted answer of: http://stackoverflow.com/q/27762129
answers question: http://stackoverflow.com/q/27762129
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43935714
upvote count: 3
has comment: http://stackoverflow.com/comment/43935809
type: Answer
score: 3
downvote count: 0
has body: The \ is not causing the whitespace, the indentation is. For example, this variable: var html = '\ \ \ \ \ '; will output:

http://stackoverflow.com/q/27670473
has body: I would appreciate if anyone could help me with a conersion of coordinates. Basically, I have downloaded and integrated the following plug-in into my website: http://sebastien.drouyer.com/jquery.earth-3d/ It is basically a script that creates a model of a globe. Now what I want to do is to display a particular point on the globe, just like in the demo, which you can see on the page. The problem is, that in the code, the coordinates of the points are given as for example in the demo: alpha: 1 * Math.PI / 4, delta: -2 * Math.PI / 4, Now what I would like to do is to display a particular point, location on Earth, given I have the normal geographical coordinates, i.e. latitude and longitude. I was trying to search on the internet and found some formulae, but neither of them worked and basically after pluging them in the point just randomly jumped all over the globe. In the domcumentation of the script it just says "Render locations by indicating spherical coordinates". I looke up spherical coordinates on wikipedia, but that didnt really help.
has title: Coordinates conversion from geographical to spherical
type: UnansweredQuestion
tagged with: coordinates
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27671073
answer count: 1
tagged with: jquery

http://stackoverflow.com/a/27644005
has comment: http://stackoverflow.com/comment/43706844
accepted answer of: http://stackoverflow.com/q/27643992
has comment: http://stackoverflow.com/comment/43706894
answers question: http://stackoverflow.com/q/27643992
type: AcceptedAnswer
score: 4
has comment: http://stackoverflow.com/comment/43706799
type: Answer
has comment: http://stackoverflow.com/comment/43706920
upvote count: 4
has body: The simplest explanation is that the loop iteration finishes before the rendering takes place, and you only get the end result. See this modified version of your code, it's kind of forcing the drawing by using timeouts: for (var i = 0; i &lt; 10; i++) { setTimeout(toggle, i * 100); } function toggle() { if (document.getElementById("box").style.display == "none") { document.getElementById("box").style.display = "block"; } else { document.getElementById("box").style.display = "none"; } } #box { width: 50px; height: 50px; background: #eee; } &lt;div id="box"&gt;&lt;/div&gt;
downvote count: 0
has comment: http://stackoverflow.com/comment/43706819

http://stackoverflow.com/comment/43784656
comment on: http://stackoverflow.com/q/27675432
type: Comment
score: 0
type: QuestionComment
has text: That *is* a pity. I haven't read up on Nashorn much, unfortunately. I wonder what happens if you try it with Rhino.

http://stackoverflow.com/q/27746941
favorite count: 0
possible better answer: http://stackoverflow.com/a/27747151
has answer: http://stackoverflow.com/a/27747151
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27750824
tagged with: css
tagged with: jssor
has comment: http://stackoverflow.com/comment/43904847
has comment: http://stackoverflow.com/comment/43953808
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27750824
has body: I've used Jssor to create a slider/slideshow. I'd ideally like to have a shadow showing beneath each image. I added a box-shadow to my img styling but the shadow only shows up on some of the images and even then, only on one side. I've also tried adding a border but the thing only appears on 3 sides (the missing edge depends on whether the image is portrait or landscape). If I style my tag, of course the thumbnails get the styling too and all of them have similar issues displaying the shadow. here's the css (apologies if I'm not using this correctly, im new here!) img { padding:0px; margin:0px; border:medium solid black; box-shadow: 10px 10px 5px #888; } TIA Rob
type: Question
tagged with: javascript
score: 4
upvote count: 4
answer count: 2
downvote count: 0
has title: any way to add a box-shadow to images in a jssor slider?

http://stackoverflow.com/comment/43810393
comment on: http://stackoverflow.com/q/27698384
type: QuestionComment
has text: thack for your answer i'm find if: http://stackoverflow.com/questions/155188/trigger-a-button-click-with-javascript-on-the-enter-key-in-a-text-box
score: 0
type: Comment

http://stackoverflow.com/comment/43826054
type: AnswerComment
has text: @shruti Well, I can't tell anything about these errors without seeing them in a fiddle. But the example should help you anyway, because it works, even with content. Taking a wild guess is, that you work to much with variables and kills one of your rendered components that way. But like a said, this is just a wild guess...
comment on: http://stackoverflow.com/a/27686597
type: Comment
score: 0

http://stackoverflow.com/comment/44010774
comment on: http://stackoverflow.com/a/27795676
score: 0
type: Comment
has text: I noticed I miscalculated it so I recalculated but this time I got 0 as answer to t1 which would mean D.x = C.x which was not true in my case. I'm trying to do the deriving too but I just don't understand how t2 suddenly disappears for example.
type: AnswerComment

http://stackoverflow.com/comment/43951179
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27770097
has text: yup ill edit question 1 sec. I would use plunker but ui-calendar has a lot of sub dependencies.
type: AnswerComment

http://stackoverflow.com/q/27688160
tagged with: javascript
has body: I'm trying to translate a multistep form with angular translate and for routing, i'm using ui-router . everything works fine except one thing . here is my code : translate .config(function ($translateProvider) { $translateProvider.useStaticFilesLoader({ prefix: 'App/i18n/locale-', suffix: '.json' }); $translateProvider.preferredLanguage('ir'); }) en.json and ir.json { "wizardForm":{ "stepOne":{ "LABEL": "ثبت متقاضی", "NATIONALCODE": "کد ملی", "NAME": "نام", "FATHERNAME": "نام پدر", "GENDER": "جنسیت", } } en.json//////// { "wizardForm":{ "stepOne":{ "LABEL": "Register Requester", "NATIONALCODE": "National Code", "NAME": "NAme", "FATHERNAME": "Father Name", "GENDER": "Gender", } } html &lt;label translate="wizardForm.stepOne.NATIONALCODE"&gt; &lt;/label&gt; translate works fine in other sections but not in form ? am i missing something ?
score: 0
has comment: http://stackoverflow.com/comment/43791530
has answer: http://stackoverflow.com/a/27689265
has comment: http://stackoverflow.com/comment/43790148
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43794058
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43790209
tagged with: angular-translate
type: Question
has comment: http://stackoverflow.com/comment/43790853
has title: Angular translate and ui router
has comment: http://stackoverflow.com/comment/43790367
answer count: 1

http://stackoverflow.com/comment/43960111
has text: in your ajax request if you add dataType: "json" then it should work
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27774655
type: Comment

http://stackoverflow.com/a/27745430
answers question: http://stackoverflow.com/q/27745181
has body: What you posted looks like a piece of Javascript code that concatenates several string literals to build a string representing a valid JSON object. But what you said implies that's a .json file, not a piece of Javascript code, in which case you shouldn't have any of those ' + 's in there. Sampsa already posted a valid version of your JSON object. Just use that.
score: 0
type: Answer

http://stackoverflow.com/comment/43769995
type: Comment
comment on: http://stackoverflow.com/q/27677791
score: 1
has text: Having 10 very simple controllers or 5 more advanced - this is up to u.
type: QuestionComment

http://stackoverflow.com/comment/43779821
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27682320
type: QuestionComment
has text: Thanks for your help. Any other related article or topic you want me to study?

http://stackoverflow.com/comment/43855342
comment on: http://stackoverflow.com/q/27721562
has text: @Duncan when i do JSON.stringify() it will come up as {"test":"test"} in text format but this is not acceptable in SNS
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43836168
score: 0
has text: You are loading `platform.js` twice. Try removing the first one.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27711811

http://stackoverflow.com/q/27713696
favorite count: 0
has body: I am getting this error in browser: Error: [$interpolate:interr] Can't interpolate: {{ displayName(stream.StreamName) }} TypeError: undefined is not a function http://errors.angularjs.org/1.2.25/$interpolate/interr?p0=%0A%20%20%20%20%2…0A%20%20%20%20%20%20&p1=TypeError%3A%20undefined%20is%20not%20a%20function Code is pretty simple, here is the HTML: {{ displayName(stream.StreamName) }} {{key}} {{value}} And here is the Controller javascript code: angular.module('starter') .controller('StreamsCtrl', function ($scope, $timeout) { $scope.displayName = function(s) { return s.subString(s.lastIndexOf('/')+1) } });
tagged with: angularjs
has title: AngularJS can't interpolate error
has answer: http://stackoverflow.com/a/27713697
upvote count: 3
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/27713697
type: Question
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/27657207
score: 3
accepted answer of: http://stackoverflow.com/q/27656976
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27656976
type: Answer
upvote count: 3
has body: Simple in-place style calculation: does the trick. http://jsfiddle.net/15yb42tj/2/

http://stackoverflow.com/comment/48455094
comment on: http://stackoverflow.com/q/27715379
score: 0
has text: @Jürgen'Kashban'Wahlmann: I completely agree. I just would like to know *which versions* the framework *has* been tested against and is known to support.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43815636
score: 0
type: QuestionComment
type: Comment
has text: It is *already* shown...
comment on: http://stackoverflow.com/q/27701440

http://stackoverflow.com/a/27769062
accepted answer of: http://stackoverflow.com/q/27768948
score: 4
answers question: http://stackoverflow.com/q/27768948
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has body: One of the main authors of the Q library has written an article stating that Q.defer() is unnatural and outdated (although it does still have some practical applications). The more modern approach (which is what the article is about) is the revealing constructor pattern. This is also the approach that is in the ES6 Promise standard (defer is not included in the standard), so you are best off using that when it is available: return Q.Promise(function (resolve, reject) { FS.readFile("foo.txt", "utf-8", function (error, text) { if (error) { reject(new Error(error)); } else { resolve(text); } }); }); But to get to (what I think is) the gist of your question, both Q.defer() and the above pattern are useful when you want to create a promise from an Async API that does not produce promises. If you use promises in your code, it's a good idea to use promises for all of your async code rather than mixing and matching. The Q.Promise() constructor and Q.defer() allow you to bridge that gap. Note: Since you are working with a Node-style API, there is a simpler technique designed specifically for this. You can use Q.nfbind to convert a node-style async function into a function that returns promises: var readFile = Q.nfbind(FS.readFile); readFile("foo.txt", "utf-8").then(function (data) { console.log("Got the file!"); });
type: Answer

http://stackoverflow.com/comment/92007384
type: AnswerComment
comment on: http://stackoverflow.com/a/42926131
type: Comment
has text: Thanks, it worked but what if I want to perform some manual validations on form fields? As I can see the list above or on plugin's website does not provide any event before form submission. Any idea about it?
score: 0

http://stackoverflow.com/a/27660065
has comment: http://stackoverflow.com/comment/43736123
type: Answer
accepted answer of: http://stackoverflow.com/q/27660002
answers question: http://stackoverflow.com/q/27660002
upvote count: 1
has comment: http://stackoverflow.com/comment/43736369
score: 1
has body: You would need to remove the li with the same sibling index from the next ul: $('#list-a').on('click', '.delete', function () { var listItem = $(this).closest('li'), index = listItem.index(); listItem.parent().next('ul').find('li:eq(' + index + ')').add(listItem) .fadeOut(500, function () { $(this).remove(); }); }); Demo: http://codepen.io/anon/pen/emdyqX
has comment: http://stackoverflow.com/comment/43736549
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/43934391
type: Comment
comment on: http://stackoverflow.com/a/27721842
has text: yes thats the idea of the separation, you can have as many views as you want for the same controller
score: 0
type: AnswerComment

http://stackoverflow.com/a/27769479
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27769413
downvote count: 0
has body: You are iterating over the object and calling alert for every property of the object. Therefore, you are also alerting the objects z and z1 themselves (not their content), which results in [Object object]. Did you want something like this? $.each(obj, function(i, e) { if (typeof e == 'object') { iterate(e); } else { alert(e); } }

http://stackoverflow.com/comment/43982364
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27786103
score: 1
has text: Please share what you have tried and what didn't work then we can help you fix your issues.

http://stackoverflow.com/comment/43814392
type: QuestionComment
has text: Likely a duplicate of http://stackoverflow.com/questions/17733509/is-not-defined-asp-net-mvc-4
comment on: http://stackoverflow.com/q/27700306
score: 0
type: Comment

http://stackoverflow.com/comment/43882599
has text: What happens if you add a `/` to the end?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27735613
score: 4

http://stackoverflow.com/comment/44003889
type: AnswerComment
comment on: http://stackoverflow.com/a/27797632
has text: It will replace every o in string. I am assuming that /buffer/get/ can be /boffer/get, then this o will also be replaced i want to replace only o which are in between two colons
score: 0
type: Comment

http://stackoverflow.com/a/27732044
has comment: http://stackoverflow.com/comment/43875484
accepted answer of: http://stackoverflow.com/q/27731776
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You can use this one: Payment to view
score: 1
answers question: http://stackoverflow.com/q/27731776
upvote count: 1

http://stackoverflow.com/comment/43744417
comment on: http://stackoverflow.com/q/27664349
score: 0
type: Comment
type: QuestionComment
has text: If you want a jQuery like method, study the jQuery source code

http://stackoverflow.com/a/27676723
accepted answer of: http://stackoverflow.com/q/27676691
has body: Use track by content goes here...
type: Answer
upvote count: 4
score: 4
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27676691

http://stackoverflow.com/q/27777844
linked to: http://stackoverflow.com/q/3808808
score: 0
has comment: http://stackoverflow.com/comment/44010068
tagged with: c#
has comment: http://stackoverflow.com/comment/44006011
has title: LastName FirstName validation
tagged with: javascript
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/8747328
linked to: http://stackoverflow.com/q/27816630
has answer: http://stackoverflow.com/a/27778267
has body: I have a textbox which allows users to enter their name and it should be like LastName,First Name format. The below JS works perfectly as expected. I will call this function on OnClientClick event in the button click. But I have n number of textbox that needs to be validated and now I would need to replicate this function for all the textboxed repeatedly. Is there any way to reconstruct this that can be used for all the textbox which will reduce the code quantity and pain in the neck. function onFirstNameLastName() { var name = /^\w{1,20}\, \w{1,20}$/ var Id = document.getElementById("bodycontent_Updates"); var flabels = document.getElementById('&lt;%=((TextBox)Updates.FooterRow.FindControl("txtName")).ClientID %&gt;'); if (flabels != null) { if (flabels.value != "") { if (!name.test(flabels.value)) { alert('Please enter Last Name, First Name format'); document.getElementById('&lt;%=((TextBox)Updates.FooterRow.FindControl("txtName")).ClientID %&gt;').focus(); return false; } else { return true; } } else if (name.test(flabels.value)) { return true; } else if (flabels.value == "") { return true; } } } The current regular expression I use will allow name like this Clark, Michael but I also need to allow names in this format too Tim Clark, Duncan Vince which my current regex doesn't support. Really appreciate any suggestions.
has comment: http://stackoverflow.com/comment/43965985
has comment: http://stackoverflow.com/comment/43965924
tagged with: asp.net
has comment: http://stackoverflow.com/comment/43966140
type: Question
has comment: http://stackoverflow.com/comment/43966125
has comment: http://stackoverflow.com/comment/44039400
tagged with: regex
answer count: 1

post
tags question: http://stackoverflow.com/q/27706596
tag name: post
tags question: http://stackoverflow.com/q/27697121
tags question: http://stackoverflow.com/q/27802771
tags question: http://stackoverflow.com/q/27687927
type: Tag
tags question: http://stackoverflow.com/q/27748096
tags question: http://stackoverflow.com/q/27651847
tags question: http://stackoverflow.com/q/27670017
tags question: http://stackoverflow.com/q/27739787
tags question: http://stackoverflow.com/q/27648174
tags question: http://stackoverflow.com/q/27742064
tags question: http://stackoverflow.com/q/27746787
tags question: http://stackoverflow.com/q/27790560
tags question: http://stackoverflow.com/q/27728151
tags question: http://stackoverflow.com/q/27796089

http://stackoverflow.com/a/27933992
answers question: http://stackoverflow.com/q/27642322
upvote count: 1
score: 1
downvote count: 0
has body: There are plenty of other great tutorials out there. Maybe you would have more luck with some of these: http://www.arungudelli.com/jquery/simple-jquery-autocomplete-search-tutorial/ http://blattchat.com/2013/01/09/bootstrap-typeahead/ http://www.tutorialrepublic.com/twitter-bootstrap-tutorial/bootstrap-typeahead.php https://twitter.github.io/typeahead.js/examples/ http://www.bootply.com/86571 A Google search will produce even more.
type: Answer

http://stackoverflow.com/a/27789011
downvote count: 0
score: 1
has body: You could just write a remove method to check for quantity and remove the item from the list. In your controller:- $scope.remove = function(product){ var products = $scope.cart.products; product.quantity -= 1; if(!product.quantity){ /*Splice the object from the array based on the index*/ products.splice(products.indexOf(product), 1); } } and on click just call it as: Remove Demo
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43988404
has comment: http://stackoverflow.com/comment/43988378
accepted answer of: http://stackoverflow.com/q/27788966
answers question: http://stackoverflow.com/q/27788966
type: Answer

http://stackoverflow.com/comment/43704172
score: 0
has text: What JavaScript have you already tried?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27642745

http://stackoverflow.com/comment/43761758
comment on: http://stackoverflow.com/q/27673194
score: 0
type: QuestionComment
type: Comment
has text: @Jivan I also tried using "pydot" library following the examples in http://pythonhaven.wordpress.com/2009/12/09/generating_graphs_with_pydot/ but a lot of it involved hard-coding which is not helpful in this problem

http://stackoverflow.com/comment/43761826
comment on: http://stackoverflow.com/a/27669274
type: AnswerComment
has text: I don't know about PhoneGap, maybe search some questions like this one: [StackOverflow Pass Parameters to PhoneGap](http://stackoverflow.com/questions/15781540/how-can-i-pass-parameters-to-a-local-page-in-phonegap-app)
score: 0
type: Comment

http://stackoverflow.com/q/27665043
type: AnsweredQuestion
has title: AUI Auto fields as the tags in liferay6.2
type: Question
upvote count: 4
tagged with: liferay
tagged with: javascript
tagged with: jquery
score: 4
tagged with: alloy-ui
has answer: http://stackoverflow.com/a/28689081
answer count: 1
downvote count: 0
has body: I am displaying data using auto-complete successfully, I am separating each data by using ',' delimiter. Now I have a requirement to implement the auto-complete like Liferay Tags for the fields as shown below: the below is my code : &lt;aui:script&gt; AUI().use('autocomplete-list', 'aui-base', 'aui-io-request', 'autocomplete-filters', 'autocomplete-highlighters', function (A) { A.io.request('&lt;%=getEntities%&gt;',{ dataType: 'json', method: 'GET', on: { success: function(event, id, obj) { try { new A.AutoCompleteList({ allowBrowserAutocomplete: 'false', activateFirstItem: 'true', inputNode: '#&lt;portlet:namespace /&gt;entitiesNames', resultTextLocator: 'entityName', render: 'true', resultHighlighter: 'phraseMatch', resultFilters:['phraseMatch'], maxResults: 10, queryDelimiter : ',', source:this.get('responseData'), autoLoad:false, }); } catch(e) { alert('not working sudheer: ' + e); } } } }); }); &lt;/aui:script&gt; Also posted in Liferay forum: https://www.liferay.com/community/forums/-/message_boards/message/47095147
favorite count: 0
accepted answer: http://stackoverflow.com/a/28689081
tagged with: liferay-6

http://stackoverflow.com/comment/43795188
type: Comment
comment on: http://stackoverflow.com/a/27690880
score: 0
type: AnswerComment
has text: Which version of angular ui-router you are using?

http://stackoverflow.com/comment/43936929
type: QuestionComment
comment on: http://stackoverflow.com/q/27762943
has text: The link you included already answer the question you ask, please carefully read the passage to the end.
score: 0
type: Comment

http://stackoverflow.com/q/27749039
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
downvote count: 0
score: 1
has title: AngularJS: Injecting services and factories into a non-AngularJS function
type: Question
tagged with: javascript
has body: I'd like to be able to execute custom external scripts during runtime and give them access to my AngularJS custom services and factories. The loaded scripts shouldn't be controllers, as I have no interest in linking them to any views. It should look like that: 1) Load an external script during runtime I have my eyes on: https://github.com/urish/angular-load This script would have a single non-AngularJS function 2) Inject into that function custom AngularJS services and factories, then execute it. Is it possible to inject that way?
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/27751943

http://stackoverflow.com/q/27707317
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43856996
tagged with: javascript
tagged with: rxjs
favorite count: 0
has comment: http://stackoverflow.com/comment/43847789
has answer: http://stackoverflow.com/a/27743350
has comment: http://stackoverflow.com/comment/43839576
upvote count: 11
type: AnsweredQuestion
has body: Suppose I have two possibly infinite streams: s1 = a..b..c..d..e... s2 = 1.2.3.4.5.6.7... I want to merge the streams and then map merged stream with slowish asynchronous operation (e.g. in Bacon with fromPromise and flatMapConcat). I can combine them with merge: me = a12b3.c45d6.7e... And then map s1 = a..b..c..d..e... s2 = 1.2.3.4.5.6.7... me = a12b3.c45d6.7e... mm = a..1..2..b..3..c..4..5.. As you see greedier s2 streams gets advantage in the long run. This is undesired behaviour. The merge behaviour is not ok, as I want to have some kind of backpressure to have more interleaved, "fair", "round-robin" merge. Few examples of desired behaviour: s1 = a.....b..............c... s2 = ..1.2.3.................. mm = a...1...b...2...3....c... s1 = a.........b..........c... s2 = ..1.2.3.................. mm = a...1...2...b...3....c... One way to think this is that s1 and s2 send tasks to the worker which can handle only one task at the time. With merge and flatMapConcat I'll get a greedy task manager, but I want more fair one. I'd like to find a simple and elegant solution. Would be nice if it is easily generalisable for arbitrary amount of streams: // roundRobinPromiseMap(streams: [Stream a], f: a -&gt; Promise b): Stream b var mm = roundRobinPromiseMap([s1, s2], slowAsyncFunc); Solution using RxJS or other Rx library is fine too. Clarifications Not zipAsArray I don't want: function roundRobinPromiseMap(streams, f) { return Bacon.zipAsArray.apply(null, streams) .flatMap(Bacon.fromArray) .flatMapConcat(function (x) { return Bacon.fromPromise(f(x)); }); } Compare the example marble diagram: s1 = a.....b..............c....... s2 = ..1.2.3...................... mm = a...1...b...2...3....c....... // wanted zip = a...1...b...2........c...3... // zipAsArray based Yes I'll run into buffering issues ... but so will I with straightforward unfair one: function greedyPromiseMap(streams, f) { Bacon.mergeAll(streams).flatMapConcat(function (x) { return Bacon.fromPromise(f(x)); }); } Ma…
score: 11
accepted answer: http://stackoverflow.com/a/27743350
has title: How to interleave streams (with backpressure)
type: Question
has comment: http://stackoverflow.com/comment/43831927
tagged with: bacon.js
possible better answer: http://stackoverflow.com/a/27731629
has answer: http://stackoverflow.com/a/27731629
has comment: http://stackoverflow.com/comment/43869781

http://stackoverflow.com/comment/43953946
type: Comment
type: QuestionComment
has text: The code actually shouldn't trigger any onLoad events, it should only be executed when the page has an onLoad event. What I'm trying to determine is why, after executing the function searchAddress, does the page send another onLoad event? This event triggers the initialize function which resets all of the changes I previously had made to the map. Also thank you for bringing my attention to Javascript being case-sensitive; that fixed one bug I was working on.
score: 0
comment on: http://stackoverflow.com/q/27770214

http://stackoverflow.com/q/27649368
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/27649575
score: 0
linked to: http://stackoverflow.com/q/13151809
has comment: http://stackoverflow.com/comment/43716091
tagged with: oop
has title: objects convert using js toString() method gives Odd result?
type: UnansweredQuestion
answer count: 2
has body: code in the below shown results of few conversions of data types using toString() method. all other data types can convert to strings using toString() method but when try to convert object to string using toString() method it gives odd result it is "[object Object]" var b =1 b.toString();// produce "1" var x=function(){var y=1;}; x.toString();// produce "function (){var y=1;}" var z = [1,2]; z.toString();// produce "1,2" var a = new Date; //a = Date {Thu Dec 25 2014 22:44:32 GMT+0530 (Sri Lanka Standard Time)} a.toString();// produce "Thu Dec 25 2014 22:44:32 GMT+0530 (Sri Lanka Standard Time)" var obj = { name: 'John' } obj.toString();// produce "[object Object]" i wanna know when we try to convert object to string using toString() method why it gives a odd result . instead of giving "[object Object]" why wont toString() method returns this value "{ name: 'John' }"
has answer: http://stackoverflow.com/a/27649445

http://stackoverflow.com/a/28257166
accepted answer of: http://stackoverflow.com/q/27685301
answers question: http://stackoverflow.com/q/27685301
type: AcceptedAnswer
downvote count: 0
has body: I've managed to get this working now, after trying many different solutions. I have found doing the following passes in the uniqueId for the image file.serverId['UniqueId'],
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/comment/43704656
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27642571
has text: @NickBourlai it'll be better if you ask a new question. ;)

http://stackoverflow.com/a/43464946
downvote count: 0
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/27757758
has body: it’s an issue with jQuery and you can resolve it by adding the following code when the page loads or before using dataTransfer jQuery.event.props.push('dataTransfer'); Example: jQuery.event.props.push('dataTransfer'); event.dataTransfer.setData("Text", event.target.id);
score: 2

http://stackoverflow.com/a/27722605
type: Answer
accepted answer of: http://stackoverflow.com/q/27722485
upvote count: 2
answers question: http://stackoverflow.com/q/27722485
has comment: http://stackoverflow.com/comment/43860843
has comment: http://stackoverflow.com/comment/43863707
has comment: http://stackoverflow.com/comment/43860139
has body: You're javascript was almost correct, just use id.src=img; Complete javascript: function ChgImg() { var list = document.getElementById('availmap'); var indx = list.selectedIndex; var img = list[indx].value; var id = document.getElementById('map'); id.src=img; } I would use the change event instead of the click event. Don't forget to add the code in the head of the page. UPDATE The javascript you're using works fine as you can see in the working example. However, I don't think you're passing a valid value for the src of the image in the code you provide (value=\"".$row['ID']."\). It seems you're using the ID of the row for the value (usually a number) when you actually need to use a valid src for the image (for example http://www.w3schools.com/images/w3schools_green.jpg). Do you have the url of the images stored in some other column of the row? If so, use it instead of $row['ID'] Also, please check your HTML. There are a few mistakes that you should correct (most of them single quotes badly closed). I've also modified your html a bit in the example
has comment: http://stackoverflow.com/comment/43858253
has comment: http://stackoverflow.com/comment/43857392
has comment: http://stackoverflow.com/comment/43859339
has comment: http://stackoverflow.com/comment/43857794
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43858148

http://stackoverflow.com/a/42340743
type: Answer
upvote count: 20
has body: The best way is you should destroy the slick slider after reinitializing it. function slickCarousel() { $('.skills_section').slick({ infinite: true, slidesToShow: 3, slidesToScroll: 1 }); } function destroyCarousel() { if ($('.skills_section').hasClass('slick-initialized')) { $('.skills_section').slick('destroy'); } } $.ajax({ type: 'get', url: '/public/index', dataType: 'script', data: data_send, success: function() { destroyCarousel() slickCarousel(); } });
downvote count: 0
score: 20
answers question: http://stackoverflow.com/q/27795730

http://stackoverflow.com/comment/43786020
type: QuestionComment
comment on: http://stackoverflow.com/q/27685156
has text: @Teemu : i'd say you have the answer.. write it !
score: 0
type: Comment

http://stackoverflow.com/a/27726900
type: AcceptedAnswer
has body: First of all this is quite a mess, which is a big part of the problem, I would suggest cleaning it up to begin with and using template syntax for your while loop while ($row = mysql_fetch_array($routequery)) { $user = get_user_by( 'id', '1' ); echo "&lt;div style='float:left;margin-right:5px;'&gt;"; $smallmap = '[iframe src="http://trailmeister.com/TOPO_VIEWS/showmap2.php'; $smallmap .= '?gpx='.$row[gpx_file].'&amp;trail='.$_GET[tname].'"]'; echo "&lt;a id='bigmap' href='http://trailmeister.com/TOPO_VIEWS/showmap.php?"; echo "gpx=$row[gpx_file]&amp;trail=$_GET[tname]' style //... Becomes &lt;?php $user = get_user_by( 'id', '1' ); //why is this in the loop with static values? while($row = mysql_fetch_array($routequery)): ?&gt; &lt;div style='float:left;margin-right:5px;'&gt; &lt;?php $smallmap = '[iframe src="http://trailmeister.com/TOPO_VIEWS/showmap2.php'; $smallmap .= '?gpx='.$row["gpx_file"].'&amp;trail='.$_GET["tname"].'"]'; ?&gt; &lt;a id='bigmap' href='http://trailmeister.com/TOPO_VIEWS/showmap.php? "gpx=$row["gpx_file"]&amp;trail=$_GET["tname"]' style //... &lt;?php endwhile; ?&gt; Once you do that the problem will be easier to see. Template syntax is like this: &lt;?php while( $bla ) : ?&gt; html &lt;?php endwhile; ?&gt; &lt;?php if( $bla ) : ?&gt; html &lt;?php endif; ?&gt; Look into a syntax highlighter even notpad++, AS other have said put quotes around your array keys $_GET["tname"] Not =$_GET[tname] PHP will see the later as a undefined constant. This may work in " double quote blocks but it's a bad practice to use. Use " text { $_GET['tname'] } text " instead of " text $_GET[tname] text ", it's backwards compatible and not dependent on variable interpolation
type: Answer
upvote count: 2
score: 1
downvote count: 1
accepted answer of: http://stackoverflow.com/q/27726702
has comment: http://stackoverflow.com/comment/43865770
answers question: http://stackoverflow.com/q/27726702
has comment: http://stackoverflow.com/comment/43867804

http://stackoverflow.com/comment/43797628
type: Comment
has text: I'll give you the answer, as the question primarily dealt with the rendering of the pdf and not the exception (although even with your code the exception is still occurring, yet when I take it out, your method works), with one caveat: you don't need meteorhacks:npm to call npm packages, just replace the line Meteor.npmRequre('fs') with Npm.require('fs'), and your code works fine (I've also got Npm.require working all over my server side code (at least with the latest version of Meteor).
comment on: http://stackoverflow.com/a/27672360
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44008573
score: 1
has text: Your form tag isn't even closed nor do you have an 'answer textbox'.
comment on: http://stackoverflow.com/q/27799921
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27766495
score: -2
tagged with: javascript
answer count: 2
upvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27766567
accepted answer: http://stackoverflow.com/a/27766567
tagged with: logic
downvote count: 3
has title: What logical operator will return false only if both statements are false?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43943562
possible better answer: http://stackoverflow.com/a/27766536
has comment: http://stackoverflow.com/comment/43943635
has answer: http://stackoverflow.com/a/27766536
has body: What logical operator will return the following result? If A is true, and B is false, return True If A is true, and B is True, return True If A is false and B is true, return True If A is false and B is false return false
type: Question

http://stackoverflow.com/a/27727647
has body: This should work: $(".p").text(function() { var text = $(this).text(); if (text.length &gt; 80) { return $.trim(text.substr(0, 80)) + '...'; } else { return text; } });
upvote count: 1
answers question: http://stackoverflow.com/q/27727620
score: 1
has comment: http://stackoverflow.com/comment/43868857
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43867668
accepted answer of: http://stackoverflow.com/q/27727620
type: Answer

http://stackoverflow.com/a/28507037
answers question: http://stackoverflow.com/q/27748265
has body: Can I see the version with the link_to in place? I can't tell from what you've provided but are you sanitizing your html before putting it into the jquery string? What I think you're doing: $("<%= link_to 'whatever', 'whatever' %>") #=> $("whatever") What you should be doing: $("<%=j link_to 'whatever' %>") #=> $("whatever") The 'j' in the beginning is a method that makes sure it won't escape from a javascript string. Without more information this is my best guess.
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/67928518
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/43997392
score: 0
type: Comment
has text: Thanks I've tried it but the index.html page was not changed ,any idea?
comment on: http://stackoverflow.com/a/27794068
type: AnswerComment

http://stackoverflow.com/a/35129738
score: 0
answers question: http://stackoverflow.com/q/27752838
has body: Put your Gridview Or Code Inside The UpdatePanel. &lt;asp:UpdatePanel ID="upnldownload" runat="server"&gt; &lt;ContentTemplate&gt; &lt;asp:GridView ID="gvDownload" CssClass="grid" runat="server" AutoGenerateColumns="False" DataKeyNames="Id" /&gt; &lt;Columns&gt; bla//// bla///[![enter image description here][1]][1] &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; &lt;/div&gt; [1]: https://i.sstatic.net/u6EpF.jpg
type: Answer

http://stackoverflow.com/a/27674658
upvote count: 2
has comment: http://stackoverflow.com/comment/43764287
accepted answer of: http://stackoverflow.com/q/27674650
answers question: http://stackoverflow.com/q/27674650
has body: Turn the last group into a positive lookahead assertion. (?=&amp;|$) asserts that the match must be followed by a &amp; or end of the line anchor $ q=(.*?)(?=&amp;|$) DEMO &gt; ".com/?gws_rd=ssl#q=test".match(/q=(.*?)(?=&amp;|$)/) [ 'q=test', 'test', index: 17, input: '.com/?gws_rd=ssl#q=test' ] To print only the chars inside the captured group. &gt; var s = ".com/?gws_rd=ssl#q=test" undefined &gt; console.log(/q=(.*?)(?=&amp;|$)/.exec(s)[1]); test
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43764239
has comment: http://stackoverflow.com/comment/43764295
type: Answer
score: 2

http://stackoverflow.com/q/27720559
tagged with: drawing
upvote count: 2
type: UnansweredQuestion
has title: HTML / CSS / JS line drawing
has comment: http://stackoverflow.com/comment/43852773
has body: I'm trying to find the most efficient way to draw thousands of lines on a page. I have a database that contains every single point that I'd like to draw and I can pull these into a python list of coordinates that looks like: [[0,0],[200,100],[400,250]]. This list includes about 2000 points. And I'd like to connect each of these points together with a line segment forming 1 big line. Each segment may need to be a different colour On every page, I'd like to draw 2-3 of these big lines (so there will be about 2000-6000 points per page) My 2 questions are: What is the most efficient way to draw this many lines without slowing down the browser? Is there a way to make the resulting image/canvas zoomable so users can zoom in on specific sections of this line and navigate around? Im currently using some test code like this, but is there a more efficient way to do this: &lt;canvas id="myCanvas" width="400" height="400" style="border:1px solid #ffffff;"&gt;&lt;/canvas&gt; &lt;script&gt; var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.beginPath(); ctx.moveTo(0,0); ctx.lineTo(200,100); ctx.strokeStyle = '#ff0000'; ctx.stroke(); ctx.closePath(); ctx.beginPath(); ctx.moveTo(200,100); ctx.lineTo(400,250); ctx.strokeStyle = '#6b44cc'; ctx.stroke(); ctx.closePath(); &lt;/script&gt;
score: 2
has answer: http://stackoverflow.com/a/27722889
type: Question
tagged with: canvas
has comment: http://stackoverflow.com/comment/43853792
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43853345
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/43810759
comment on: http://stackoverflow.com/q/27698764
type: Comment
type: QuestionComment
has text: As I said, I tried using the .done(function(data){code}) which is the callback function? I also tried declaring a global variable and having a callback function assign the processed response to the global. The global remains undefined still.
score: 0

http://stackoverflow.com/comment/43915102
comment on: http://stackoverflow.com/q/27752054
has text: The client has to report its timezone to the server, or better yet, it's current time. You cannot "detect" their time without it telling you, as far as I know.
score: 0
type: Comment
type: QuestionComment

source-maps
type: Tag
tag name: source-maps
tags question: http://stackoverflow.com/q/27740801

http://stackoverflow.com/comment/43864503
has text: time to get rid of flash anyway, not cross browser compatible any more
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27726006
score: 1

http://stackoverflow.com/a/27800024
upvote count: 1
downvote count: 0
has body: You are targeting all span elements.you need to only target the child span element of clicked h2 element: jQuery(document).ready(function () { $(".collapse").click(function () { $(this).next().toggle(); $(this).find('span').toggleClass("ui-icon-triangle-1-s"); }).next().hide(); }); and for aligning the icon set style float to left: .ui-icon-triangle-1-e{float:left;} Working Demo
answers question: http://stackoverflow.com/q/27799961
type: Answer
score: 1

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/27739734
tags question: http://stackoverflow.com/q/27745647
tags question: http://stackoverflow.com/q/27697369
type: Tag

http://stackoverflow.com/comment/43821236
score: 0
type: Comment
type: QuestionComment
has text: actually I am calling an upload image button via iFrame section. The flash buttion is inthe main HTML file containing iFrame. So I want the same flash button to be clicked from iFrame. In order to communicate with iFrame (where iFrame content come from any host) I am using jStorage. When my defined variable change in jStorage from iFrame the upload flash button must be clicked from main html page. Where it looks like it is clicked from the iFrame.
comment on: http://stackoverflow.com/q/27701434

http://stackoverflow.com/a/27741216
answers question: http://stackoverflow.com/q/27741114
score: 1
accepted answer of: http://stackoverflow.com/q/27741114
upvote count: 1
type: AcceptedAnswer
has body: var found_name, found_id; for(var i = 0; i &lt; nicknames.length; i++) { var nn = nicknames[i]; if (nn.name == "max" || nn.id = "200") { found_name = nn.name2; found_id = nn.id2; break; } else if (nn.name2 == "max" || nn.id2 = "200") { found_name = nn.name; found_id = nn.id; break; } }
downvote count: 0
has comment: http://stackoverflow.com/comment/43904854
type: Answer

http://stackoverflow.com/a/27774129
type: Answer
has body: When you set tooltip position fixed, it would not move when page scroll, You should set container position relative, and tolltip position absolute. Something like below .menu-toggle-black { position:relative; } .menu-tooltip{ position:absolute; top:0; /* or positive or negative value you need.*/ left:100%; /* or positive or negative value you need.*/ }
accepted answer of: http://stackoverflow.com/q/27774037
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44740254
answers question: http://stackoverflow.com/q/27774037

communication
tag name: communication
tags question: http://stackoverflow.com/q/27647925
type: Tag

http://stackoverflow.com/a/27706290
answers question: http://stackoverflow.com/q/27706133
has comment: http://stackoverflow.com/comment/43824414
score: 0
has body: Try to use it like that way: $SITE_FOLDER_NAME = "demo/"; define('SITEURL', 'http://'.$_SERVER['SERVER_NAME'].'/'.$SITE_FOLDER_NAME); define('SITEURL_CSS', SITEURL.'css/');
type: Answer

http://stackoverflow.com/comment/44034270
has text: Thanks for the responses. I do feel as though I'm a bit in over my head, but mostly from the 3dsmax side of things. I am a web dev and have a lot of experience in javascript, but I can't even get my animations exported yet, heh. I'm trying to mess with openCollada now to see if that is a better path. I've watched some tutorials on 3dsmax via digital-tutors but they don't really talk about exporting your model/animations. THanks again.
comment on: http://stackoverflow.com/q/27792909
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/43765514
has text: What is the HTML for your `` `` element? Is there by any chance an `` `` inside it? That could potentially override the ``submit`` function with a named value, which would explain why it's an object.
type: QuestionComment
comment on: http://stackoverflow.com/q/27675385
score: 0
type: Comment

http://stackoverflow.com/a/27665662
type: Answer
upvote count: 4
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/27665641
has body: The for iteration will run 5 times quickly, and it be equal to running these lines: setTimeout(display(0), 0*1000); setTimeout(display(1), 1*1000); ... setTimeout(display(4), 4*1000); The result would be: display(0) will launch after 0 seconds. display(1) will launch after 1 seconds. ... display(4) will launch after 4 seconds.

http://stackoverflow.com/q/27670656
answer count: 1
accepted answer: http://stackoverflow.com/a/27670721
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I'm working with a text area defined as below: &lt;textarea id="description"&gt;&lt;/textarea&gt; I'm trying to detect when some text is selected by the user and the onselect seems perfect for this. It works perfectly on the w3schools example and I got it working as: &lt;textarea id="description" onselect="alert('testing');"&gt;&lt;/textarea&gt; But when I change this to my own function, nothing happens. I have tried this using: document.getElementById("description").addEventListener("onselect", getSelection("description")); And that executes but on page load and does nothing when I select text. I've just got simple stuff in the function to try and get it working, I've tested my action selection code and that's fine. I just can't get it to run an onselect event. Here is my testing getSelection function. function getSelection(ele) { var ele = document.getElementById(ele); var txt = "Text Selected"; console.log(txt); } Any ideas? There seems to be very little information on onselect with most resources found by people thinking it's for select tags.
has answer: http://stackoverflow.com/a/27670721
tagged with: textselection
type: AnsweredQuestion
tagged with: onselect
has title: DOM onselect failing to work properly
type: Question
tagged with: textarea

http://stackoverflow.com/a/27726395
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27726357
upvote count: 8
answers question: http://stackoverflow.com/q/27726357
type: Answer
score: 8
has body: When using waypoint, this refers to the waypoint object. The waypoint object's element is the current div. So you would want to use $(".my-class").waypoint(function(e) { $(this.element).addClass("hello"); })
has comment: http://stackoverflow.com/comment/43864955
has comment: http://stackoverflow.com/comment/43864990

http://stackoverflow.com/comment/43788330
type: Comment
score: 0
type: QuestionComment
has text: possible duplicate of [Selecting only first-level elements in jquery](http://stackoverflow.com/questions/977883/selecting-only-first-level-elements-in-jquery)
comment on: http://stackoverflow.com/q/27687273

http://stackoverflow.com/comment/43737635
score: 0
type: QuestionComment
type: Comment
has text: can you post the content of $var
comment on: http://stackoverflow.com/q/27660889

http://stackoverflow.com/a/27761762
has comment: http://stackoverflow.com/comment/43949165
has body: The most effective solution to your problem is probably going to be including the dynamic content inline in the document itself. When you copy the function test(arg) to the Javascript file, I suppose you're copying #genstr# as well? So it looks, in the js file, exactly as you have it above? This is working as intended. .js files do not process cold fusion, and if you look at your developer console, you're probably getting a syntax error. You can either keep it inline to the document, or change the extension of the js file to .cfm. At this point, your js_main.cfm (example) file will be treated like any other browser-requested file, and it will drop headers and footers in if your request processing does that, so it will cause more errors. You need to protect these files from that. You can either do this with some cfifs in your application file like ... do includes Or you can do like I would probably do and lock these files in a folder just for serving JS, CSS files with cfm extension with their own application.cfc/cfm to override the site's global file, if I ran into a situation where I felt that a dynamically geerated js/css was truly the best option. You can then do as you show in your OP and relay variables to the client side if you really need to. Alternatively, you can name the two "applications" the same, and while that makes data sharing really easy, I should still advise that you be careful what you share and you expose and making sure to properly secure the sub-application. And yes, as others have suggested, #SerializeJSON()# is the modern approach to copying a server-side variable/object to the client side. For instance.. <cfset CFStruct = {big = "little", red = "blue", subArray = ["A","B","C","D"]} /> Creates JSObj with the elements big, red, subArray (which has the child elements A, B, C, D). Still, no matter which method you choose (wddx or SerializeJSON()), these will not work in a .js file. I must mention that the other option of allowing the server to …
score: 0
answers question: http://stackoverflow.com/q/27761290
type: Answer

http://stackoverflow.com/comment/43945342
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27765708
score: 0
has text: Thanks, I'm often curious about how all the things I don't see work. Like this one.

http://stackoverflow.com/comment/44003180
score: 0
comment on: http://stackoverflow.com/q/27797150
type: Comment
type: QuestionComment
has text: In the fact - yes. I want to rebuild dom structure.

http://stackoverflow.com/comment/43819774
type: Comment
comment on: http://stackoverflow.com/a/27698285
has text: @davidwarne just an `_id` field also works as a `BaseSchema` so a blank `Schema` which is the same as omitting the `this.add(` part of the code is basically that. All the same applies.
score: 0
type: AnswerComment

http://stackoverflow.com/q/27788904
type: Question
tagged with: javascript
has body: I have 2 geojson of polygons in two different radiobox buttons, and in a checkbox a geojson polyline. I need when the checkbox is checked and the polygon layer selection is changed the polyline layer still on the front. How can I fix that polyline layer always on the front with BringToFront() or other method exactly? The project is simplified at jsfiddle http://jsfiddle.net/albertovich/fe0vtytb/ var poligon1 = new L.LayerGroup(); var poligon2 = new L.LayerGroup(); var polyline1 = new L.LayerGroup(); var map = L.map('map', { center: [39.4699075, -0.382881], zoom: 13, layers: [poligon1] }); var baseLayers = { "Poligon1": poligon1, "Poligon2": poligon2 }; var myStylePol1 = { "weight": 2, "opacity": 1, "color": "#FF00CC", "fillOpacity": 1 }; var myStylePol2 = { "weight": 2, "opacity": 1, "color": "#FFFF80", "fillOpacity": 1 }; var myStyle3 = { "weight": 2, "opacity": 1, "color": "#000" }; L.geoJson(poli1, { style: myStylePol1 }).addTo(poligon1), L.geoJson(poli2, { style: myStylePol2 }).addTo(poligon2), L.geoJson(polyl3, { style: myStyle3 }).addTo(polyline1); var overlays = { "Polyline": polyline1 }; L.control.layers(baseLayers, overlays).addTo(map);
score: 0
answer count: 1
has title: How to make polyline layer always on top?
has answer: http://stackoverflow.com/a/27790081
accepted answer: http://stackoverflow.com/a/27790081
type: AnsweredQuestion
tagged with: leaflet

http://stackoverflow.com/comment/43817776
comment on: http://stackoverflow.com/q/27702715
type: Comment
type: QuestionComment
score: 1
has text: Can you show us the code of the actual slider?

http://stackoverflow.com/comment/44015215
type: QuestionComment
has text: @brso05 can you revise the exponential. The base number is not necessary needed. Can you like make the exponent be fixed in a way that when I put a number, it is the same number as your exponent like 2^2 3^3 4^4
score: 0
comment on: http://stackoverflow.com/q/27799921
type: Comment

http://stackoverflow.com/comment/43730768
type: QuestionComment
has text: Is this being called inside an event handler?
comment on: http://stackoverflow.com/q/27657233
score: 0
type: Comment

http://stackoverflow.com/comment/43920506
type: QuestionComment
has text: @Chrillewoodz: I see you have already accepted an answer. [Here](http://jsfiddle.net/hari_shanx/4zy1opco/) is another approach using pseudo-elements and border-image (lesser browser support). I will add as answer if you wish.
score: 0
comment on: http://stackoverflow.com/q/27754103
type: Comment

http://stackoverflow.com/comment/43810750
comment on: http://stackoverflow.com/a/27698742
has text: It is working. Open up the DOM Explorer (hit f12) and you'll see that they have ID's
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43910392
score: 1
type: Comment
type: QuestionComment
has text: It doesn't for me, or am I missing something? http://jsfiddle.net/c11h57f7/
comment on: http://stackoverflow.com/q/27749545

http://stackoverflow.com/a/27778049
answers question: http://stackoverflow.com/q/27777996
score: 0
has body: Decimals in PHP a JS are with ., not ,. When you save them into database, you can replace , for .. $decimal = str_replace(',', '.', $decimal);
type: Answer

http://stackoverflow.com/q/27761682
tagged with: javascript
tagged with: google-chrome-extension
has body: I am just starting o use the chrome.(something) commands and I am not really sure what proper syntax would be regarding them. What I am trying to do here is frist of all a test of concept, basically if the new tab that was created matches a specific url (in this case only facebook but I want it to be more than just one page.) then it should close that tab. I am not really sure how to write that but I think I have an idea and I would like for someone to explain the corrections that were made so I can understand. Thanks. chrome.tabs.onCreated.addListener(function(tab.url){ if (tab.url===*://facebook.com/*){ chrome.tabs.remove(tab) } };
type: UnansweredQuestion
has title: Removing a tab after it is created if certain conditions are true
type: Question
has answer: http://stackoverflow.com/a/27761837
score: 0
answer count: 1

papaparse
type: Tag
tag name: papaparse
tags question: http://stackoverflow.com/q/27704406
tags question: http://stackoverflow.com/q/27741388
tags question: http://stackoverflow.com/q/27780594
tags question: http://stackoverflow.com/q/27700519

http://stackoverflow.com/a/41255407
answers question: http://stackoverflow.com/q/27711108
upvote count: 0
type: Answer
score: -1
has body: I think you pretty much nailed it, you just needed to update the event object stored in the global y variable before calling updateEvent: document.getElementById('button_edit').addEventListener("click", editControl); function editControl(event) { event.preventDefault(); console.log(x); var controlEdited = { "level": document.getElementById('control_level').value, "day": document.getElementById('control_day_edit').value, "period": document.getElementById('control_period').value, "id": x } y.start = document.getElementById('control_day_edit').value; y.title = document.getElementById('control_level').value; $('#calendar').fullCalendar('updateEvent', y); $.post("/editControls", JSON.stringify(controlEdited)); console.log(controlEdited) };
downvote count: 1

http://stackoverflow.com/comment/43726845
has text: does changing `$(window).load()` to `$(document).ready()` change the behavior?
type: QuestionComment
comment on: http://stackoverflow.com/q/27655328
score: 0
type: Comment

http://stackoverflow.com/comment/43938301
type: Comment
has text: Look at how append works: http://api.jquery.com/append/
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27763690

http://stackoverflow.com/a/27802167
accepted answer of: http://stackoverflow.com/q/27800647
downvote count: 0
has body: The version https://www.nuget.org/packages/Trirand.jqGrid/4.6.0 is definitively free. See You can download jqGrid 4.7.0 from here too. The code is published under "Dual licensed under the MIT and GPL licenses". See the first lines of the file jquery.jqGrid.min.js and the comments at the beginning of every JavaScript file included in the package. The version is not published on NuGet. There are some forks of the last free version of jqGrid. See for example my fork, this one or another. I have fixed already (in my fork) many bugs existing in the last free version of jqGrid. I have implemented many new features too. I think that I and other developers will cooperate together to continue developing of free version of jqGrid. I plan to release the currently developing version soon (probably already in January). I will publish it on NuGet and other common known free repositories.
has comment: http://stackoverflow.com/comment/44041039
has comment: http://stackoverflow.com/comment/44017468
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44016454
has comment: http://stackoverflow.com/comment/44015603
has comment: http://stackoverflow.com/comment/44016794
has comment: http://stackoverflow.com/comment/44029459
has comment: http://stackoverflow.com/comment/44041565
type: Answer
has comment: http://stackoverflow.com/comment/44016468
has comment: http://stackoverflow.com/comment/44016957
score: 1
has comment: http://stackoverflow.com/comment/44033915
upvote count: 1
has comment: http://stackoverflow.com/comment/44015794
answers question: http://stackoverflow.com/q/27800647
has comment: http://stackoverflow.com/comment/44015492
has comment: http://stackoverflow.com/comment/44029382
has comment: http://stackoverflow.com/comment/44034113
has comment: http://stackoverflow.com/comment/44014237
has comment: http://stackoverflow.com/comment/44013499

http://stackoverflow.com/q/27670051
tagged with: amazon-web-services
has answer: http://stackoverflow.com/a/28201947
favorite count: 0
linked to: http://stackoverflow.com/q/5827612
linked to: http://stackoverflow.com/q/25883775
type: UnansweredQuestion
tagged with: aws-sdk
has answer: http://stackoverflow.com/a/54347475
tagged with: node.js
has body: I currently upload single objects to S3 using like so: var options = { Bucket: bucket, Key: s3Path, Body: body, ACL: s3FilePermissions }; S3.putObject(options, function (err, data) { //console.log(data); }); But when I have a large resources folder for example, I use the AWS CLI tool. I was wondering, is there a native way to do the same thing with the aws sdk (upload entire folders to s3)?
downvote count: 0
linked to: http://stackoverflow.com/q/51214518
linked to: http://stackoverflow.com/q/2727167
has answer: http://stackoverflow.com/a/29804842
has answer: http://stackoverflow.com/a/63608088
type: Question
answer count: 8
has answer: http://stackoverflow.com/a/46213474
has answer: http://stackoverflow.com/a/65862128
tagged with: amazon-s3
has answer: http://stackoverflow.com/a/61381276
has title: Upload entire directory tree to S3 using AWS sdk in node js
has answer: http://stackoverflow.com/a/62823938
tagged with: javascript
score: 44
upvote count: 44

http://stackoverflow.com/comment/43830888
type: AnswerComment
has text: @yaelalfasi: I suppose I’m not sure what your question is, then. `myCat.prototype` doesn’t exist at all, by the way. Did you mean `myCat.constructor`? (And yes, it replaces the prototype with a `Mammal` completely; that’s why `myCat.constructor === Mammal` and not `Cat`. You need to assign `Cat.prototype.constructor = Cat;` after making the replacement.)
type: Comment
comment on: http://stackoverflow.com/a/27685473
score: 0

http://stackoverflow.com/a/27773166
has comment: http://stackoverflow.com/comment/43957272
score: 0
answers question: http://stackoverflow.com/q/27773000
type: Answer
has body: /r/ should be just a part of relative url where the ajax request is being sent and has no special meaning.

http://stackoverflow.com/comment/43891663
has text: put image between a div with some id and then create a variable insted of this.title and the using jquery append the html to dov id.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27740343
score: 0

http://stackoverflow.com/q/27667619
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27667683
tagged with: regex
has title: Javascript Regex, need to allow the user to select only word(s)
has answer: http://stackoverflow.com/a/27667636
type: Question
tagged with: javascript
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/27667635
has body: I have a paragraph, in the text, user only need to select the valid text. they should not select just a space or nay special charector. so user can select a valid text or number. for that i am trying using regex like this \b(.+)\b But not working. as a paragrap, i would like to avoid selecting meaning less. Any one help me?

http://stackoverflow.com/comment/86986599
score: 0
type: AnswerComment
has text: Doesn't work if there are any newline characters in the base string. Any idea how to solve that?
type: Comment
comment on: http://stackoverflow.com/a/27656651

http://stackoverflow.com/a/27684642
answers question: http://stackoverflow.com/q/27683605
type: Answer
has comment: http://stackoverflow.com/comment/43784425
score: 0
has body: Save an object reference of the opened window to a global variable and do a validation before calling window.open: var windowObjRef = null; // global variable if(windowObjRef== null || windowObjRef.closed) { windowObjRef = window.open("popup.aspx", "myPopup","width=300,height=100,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no,alwaysLowered=yes,location=no,directories=no,titlebar=no"); } else { windowObjRef.focus(); }

http://stackoverflow.com/comment/43896147
has text: Honestly, not really. If you provide a JSFiddle I can play around a little bit, but I am unable to write something from scratch.
type: Comment
comment on: http://stackoverflow.com/q/27742472
score: 0
type: QuestionComment

http://stackoverflow.com/q/27674257
type: Question
upvote count: 2
tagged with: textarea
answer count: 1
accepted answer: http://stackoverflow.com/a/27674296
downvote count: 0
has title: how to change innerHTML of textarea after typing in it?
favorite count: 0
has answer: http://stackoverflow.com/a/27674296
tagged with: http://stackoverflow.com/tag/html
has body: The following code works only if I don't first type in the textarea box. If i type in it, clicking on the div does nothing. Is there any way to fix this in javascript or whatever? Any help is appreciated. change this click here here is the jsfiddle http://jsfiddle.net/69n24agz/
score: 2
type: AnsweredQuestion
tagged with: javascript

http://stackoverflow.com/comment/43775461
score: 0
has text: btw - i never saw a query result, that represents data NOT stored in db. maybe I'm blind.
type: Comment
comment on: http://stackoverflow.com/q/27679415
type: QuestionComment

http://stackoverflow.com/q/27736546
score: 0
accepted answer: http://stackoverflow.com/a/27747308
answer count: 1
has body: I am using getUserMedia to capture the stream from user camera, so initially the video element source would be null, after successful capture, it set the src attribute of video, and call play method the element, html: ...&lt;video&gt;&lt;/video&gt;... JS code: angular.element('video')[0].src = window.URL.createObjectURL(stream); angular.element('video')[0].play(); I am getting a feeling that this is a bad approach, I want to something like html: ...&lt;video ng-src="videoObj.src"&gt;&lt;/video&gt;... JS code: videoObj.src = window.URL.createObjectURL(stream); .... now how do I make the video play automatically when I set videoObj.src ?
tagged with: angularjs
has title: angularJS: auto play video on source/stream change
has answer: http://stackoverflow.com/a/27747308
type: Question
type: AnsweredQuestion
tagged with: javascript
tagged with: html5-video

http://stackoverflow.com/a/27792842
score: 0
has comment: http://stackoverflow.com/comment/43995976
has comment: http://stackoverflow.com/comment/43995582
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27792760
has comment: http://stackoverflow.com/comment/43996191
has comment: http://stackoverflow.com/comment/43995424
answers question: http://stackoverflow.com/q/27792760
has body: var startdate = $('#txtFromDate').datepicker('getDate'); var enddate = $('#txtToDate').datepicker('getDate'); var calculate = (enddate - startdate)/1000/60/60/24; NOTE: Be careful that end date must contain greater value
type: Answer
has comment: http://stackoverflow.com/comment/43995312

http://stackoverflow.com/comment/43967727
comment on: http://stackoverflow.com/q/27700844
score: 0
type: QuestionComment
type: Comment
has text: [Perhaps a better example](http://www.geocodezip.com/v3_GoogleEx_directions-draggable2Xml.html?addr1=New%20Dehli,Dehli,%20India&addr2=Yamuna%20Nagar,%20Haryana,%20India)

http://stackoverflow.com/comment/43874171
has text: @VincentPride: Yeah, I'd *just* added a note about `Player.prototype` to the answer a few minutes before your comment, you might not have seen it. :-) Glad the second option works! :-)
type: Comment
comment on: http://stackoverflow.com/a/27731195
score: 0
type: AnswerComment

http://stackoverflow.com/q/27734535
has answer: http://stackoverflow.com/a/27735371
type: Question
has title: Change initial style value with animation
tagged with: javascript
tagged with: css-animations
has body: I have an element &lt;form class="fade-in-form"&gt;...&lt;/form&gt; with an animation .fade-in-login-form{ opacity: 0; -webkit-animation: fadein 2s; !important; -webkit-animation-delay: 3s; !important; } @-webkit-keyframes fadein { from { opacity:0; } to { opacity:1; !important; } } and I want the element to be invisible at first, but then fading in. The problem is that the form is invisible at first (opacity: 0;), then fades in, but after the animation flashes to be invisible again! Why doesn't the animation overwrite the initial value of opacity: 0; with opacity: 1;? And how can I achieve what I want? If the solution requires Javascript: I prefer AngularJS over jQuery.
has answer: http://stackoverflow.com/a/27734682
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27734786
type: UnansweredQuestion

http://stackoverflow.com/comment/43749005
type: QuestionComment
has text: Here you go. The pattern you can see here is nice I agree. But all I want is a matrix chessboard style. http://jsfiddle.net/zwuLcntj/
score: 0
comment on: http://stackoverflow.com/q/27666936
type: Comment

http://stackoverflow.com/comment/43976859
has text: @Xero: On the contrary. We should force questioners to learn how to write their own code.
type: Comment
comment on: http://stackoverflow.com/a/27783416
score: 1
type: AnswerComment

angular-promise
tags question: http://stackoverflow.com/q/27736167
tags question: http://stackoverflow.com/q/27747623
tags question: http://stackoverflow.com/q/27728961
tags question: http://stackoverflow.com/q/27777402
tags question: http://stackoverflow.com/q/27742763
tag name: angular-promise
tags question: http://stackoverflow.com/q/27745183
tags question: http://stackoverflow.com/q/27801153
type: Tag
tags question: http://stackoverflow.com/q/27764898

http://stackoverflow.com/q/27798557
tagged with: css
has answer: http://stackoverflow.com/a/27800646
has comment: http://stackoverflow.com/comment/44005959
type: Question
has comment: http://stackoverflow.com/comment/44006175
tagged with: javascript
tagged with: jquery
has body: I want to design a webpage like this...can anyone help me..how to do this demo is here http://www.valentinagallo.us/site/#/home any help would be appreciated
score: 0
answer count: 1
has title: Divide page into two parts and scroll both parts into opposite direction
type: UnansweredQuestion

http://stackoverflow.com/q/27682751
tagged with: email
tagged with: parsing
favorite count: 0
tagged with: beautifulsoup
has title: How can I use BeautifulSoup or Slimit on a site to output the email address from a javascript variable
has comment: http://stackoverflow.com/comment/43780326
type: UnansweredQuestion
has body: I have this example website: http://www.example.com/whatever.asp?profile=1 For each profile number I have a different email in this Java script code. I want to parse or regex the email address. The position of emails depends on length. However with this python code only I can parse mple@email.com and not example@email.com url=urllib.urlopen('http://www.example.com/whatever.asp?profile=1') contents= url.read() soup = BeautifulSoup(contents) js_content= soup.findAll("script")[0].text reg = '(<)?(\w+@\w+(?:\.\w+)+)(?(1)>)' match= re.search(reg,js_content) print match.group() Any help? Thanks.
tagged with: python
has comment: http://stackoverflow.com/comment/43780128
has answer: http://stackoverflow.com/a/27682843
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/27682895
has comment: http://stackoverflow.com/comment/43780237
linked to: http://stackoverflow.com/q/27690305
tagged with: javascript
has comment: http://stackoverflow.com/comment/43780246
answer count: 2
upvote count: 1

http://stackoverflow.com/comment/43791181
type: Comment
score: 2
comment on: http://stackoverflow.com/a/27688968
type: AnswerComment
has text: Or just use event delegation with `.on()`.

http://stackoverflow.com/a/27737184
answers question: http://stackoverflow.com/q/27737139
has comment: http://stackoverflow.com/comment/43895565
has body: The following loads one image at a time and checks if it is the correct size, if not it loads the next one. It stops once the correct image has been loaded. // A bunch of images var arrImages = ["http://i.imgur.com/cKUVXuQ.jpg","http://i.imgur.com/Ei598tR.jpg","http://i.imgur.com/W92PhqU.jpg"]; // Loads image with index i var loadImage = function(i){ extension = arrImages[i].slice(-(3)).toLowerCase(); if (extension == "jpg"){ // Test image size var newImg = new Image(); newImg.src = arrImages[i]; newImg.onload = function(){ if (this.width &gt; 600 &amp;&amp; this.height &gt; 900){ // All right! That's the one. Set it as src on my web page $("#MyImgBg").attr("src",this.src); }else{ if(i &lt; arrImages.length){ // This is not the one, load next one. loadImage(i+1); } } } }else{ if(i &lt; arrImages.length){ // Wrong file extension, try next one. loadImage(i+1); } } alert(i); } loadImage(0); // Start with first image
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27737139
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43895638
has comment: http://stackoverflow.com/comment/43908982
type: Answer

http://stackoverflow.com/a/27800600
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44013525
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44016516
has comment: http://stackoverflow.com/comment/44014051
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/27800139
has body: If you are only going to get one value per category you can check it in your PHP code and if its value is zero not add it to your series data array. Without seeing your code that generates your data I cannot be more specific. If you are using a SQL query to get the values can you have it only return non-zero entries? Something like this psuedocode: SELECT vendor, deviceCount FROM devices WHERE deviceCount &gt; 0 I did some testing and you can do it from within the chart itself - just not without modifying some code. Use the chart.events.load hook: events: { load: function () { var theChart = this; var theSeries = this.series; var removeIndex = []; var weight = 0; for (var key in theSeries) { var aSeries = theSeries[key]; if (aSeries.data[0].y == 0) { removeIndex.push(parseInt(key)); } } for (var i in removeIndex) { var iRemove = removeIndex[i] - weight; theChart.series[iRemove].remove(); weight = weight + 1; } } } The tricky part is the weight item. When you remove an indexed item the total index shrinks. The bulk of this is just a loop. This is a very verbose set of code and you can collapse it down to be much smaller. This code loops through each series in your chart and it is assuming you only have one point per series. It then checks if the value of that single point is 0. If it is we add the index of that series to removeIndex array. The next loop going through the removeIndex array and actually removes the series. Live demo.
answers question: http://stackoverflow.com/q/27800139
has comment: http://stackoverflow.com/comment/44013627

http://stackoverflow.com/comment/50034024
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27708802
type: AnswerComment
has text: I'm using it on a form submission. So my code looks more like ` ... `. But you could bind it to button clicks or blur events on the text box and prevent form submission if the date is invalid.

http://stackoverflow.com/comment/43854828
type: Comment
type: QuestionComment
has text: could try JSON.stringify(JSON.stringify({"test":"test"}));
comment on: http://stackoverflow.com/q/27721562
score: 0

http://stackoverflow.com/comment/43799720
has text: Did you like the answer you chose as "accepted"?
comment on: http://stackoverflow.com/q/27659587
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/a/28424474
type: Answer
has body: You wont be able to just bind a label to a polyline. It will need additional coordinates based on the line you will want to bind it to. Checkout the example on fiddle that includes a helper function called "bindLabelEx" that handles the polyline labeling for you: https://jsfiddle.net/jZv7W/158/ $(document).ready(function() { L.Polyline.include({ bindLabelEx: function (content, options) { if (!this.label || this.label.options !== options) { this.label = new L.Label(options, this); } var latlngs = this.getLatLngs(); var nPoint = latlngs.length; var lats = []; var lngs = []; for(var i = 0; i &lt; nPoint; i++) { lats.push(latlngs[i].lat); lngs.push(latlngs[i].lng); } var minLat = Math.min.apply(null, lats); var maxLat = Math.max.apply(null, lats); var minLng = Math.min.apply(null, lngs); var maxLng = Math.max.apply(null, lngs); var pointM = { lat: (minLat + maxLat) / 2, lng: (minLng + maxLng) / 2 }; this.label.setContent(content); this._showLabelAdded = true; this._showLabel({ latlng: pointM }); } }); L.RotatedMarker = L.Marker.extend({ _setPos: function(pos) { L.Marker.prototype._setPos.call(this, pos); if (L.DomUtil.TRANSFORM) { // use the CSS transform rule if available this._icon.style[L.DomUtil.TRANSFORM] += ' rotate(' + this.options.angle + 'deg)'; } else if (L.Browser.ie) { // fallback for IE6, IE7, IE8 var rad = this.options.angle * L.LatLng.DEG_TO_RAD, costheta = Math.cos(rad), sintheta = Math.sin(rad); this._icon.style.filter += ' progid:DXImageTransform.Microsoft.Matrix(sizingMethod=\'auto expand\', M11=' + costheta + ', M12=' + (-sintheta) + ', M21=' + sintheta + ', M22=' + costheta + ')'; } } }); L.rotatedMarker = function(pos, options) { return new L.RotatedMarker(pos, options); }; //example user location var userLocation = new L.LatLng(28.735, 77.524); var map = L.map('map').setView(userLocation, 10); L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'Map data &amp;copy; &lt;a href="http://openstreetmap.org"&gt;O…
answers question: http://stackoverflow.com/q/27678392
score: 0

http://stackoverflow.com/comment/43956913
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27773020
type: Comment
has text: Are windows for "two open webpages" related in some way (i.e. opener or parent)?

http://stackoverflow.com/q/27729445
has title: 403 Forbidden error in PHP Login
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/43872044
answer count: 0
has body: Whenever I click the submit button of my login, I'm taken to a blank page which has the texts "403 Forbidden", I feel that this may be due to the URL of my login page as it is "mywebsite.com8:8888/login/" and is hosted on a different port (I'm using Tornado web server). HTML Keep me signed in PHP <?php header('Access-Control-Allow-Origin: *'); ?> <?php if (isset($_POST['submit'])){ session_start(); error_reporting(0); $username = $_POST['username']; $password = md5($_POST['password']); $connection = mysql_connect("localhost", "moot", "lmlkmklmklmkl"); // Establishing Connection with Server $db = mysql_select_db("snamr", $connection); // Selecting Database from Server $sql="SELECT * FROM accs WHERE name='$username' and password='$password'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); $check = mysql_query("SELECT active FROM accs WHERE name = '$username'"); while($rows=mysql_fetch_assoc($check)){ $active = $rows['active']; } // If result matched $myusername and $mypassword, table row must be 1 row if($count!=1){ echo "Wrong Username or Password"; } elseif ($active == 0) { echo "Your account isn't active!"; } else { $_SESSION['username'] = $username; } $time = time(); $setLogged= mysql_query("UPDATE accs SET loginstatus = '$time' WHERE name = '$username'") or die(mysql_error()); } } ?> JAVASCRIPT WHICH LOADS THE PHP INTO HTML (good reasons for this) The login form along with the PHP works with all other files on my default port but when I take the code to my files hosted on port 8888 things go wrong. Hence why I think the main issue may be in the domain. Any solutions?
score: 0
has comment: http://stackoverflow.com/comment/43870873
type: Question
tagged with: tornado
has comment: http://stackoverflow.com/comment/43870474
tagged with: javascript
linked to: http://stackoverflow.com/q/7852225
has comment: http://stackoverflow.com/comment/43871120

http://stackoverflow.com/q/27714432
tagged with: javascript
has body: My code igniter app is giving me 404 (Not found) for all js files ($DOC_ROOT/javascript/), all images and css are working fine, javascript, images and css folders have the same permissions. my .htaccess file: Header unset ETag FileETag none Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT" Options All -Indexes AddOutputFilterByType DEFLATE text/html text/plain text/xml SetOutputFilter DEFLATE SetOutputFilter DEFLATE SetOutputFilter DEFLATE RewriteEngine On RewriteBase / RewriteCond $1 !^(index\.php|images|local_clientdata|clientdata|javascript|fckeditor|themes|install|css|files|sitemap\.xml|robots\.txt|info\.php|forum\/) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.*)$ index.php [E=CI_PATH:/$1,L] what am i doing wrong?
upvote count: 1
answer count: 1
tagged with: .htaccess
favorite count: 0
type: UnansweredQuestion
tagged with: php
downvote count: 0
score: 1
tagged with: codeigniter
type: Question
has answer: http://stackoverflow.com/a/28342353
has title: JavaScript Files - Not Found 404 - CodeIgniter - .htaccess

http://stackoverflow.com/q/27765326
has answer: http://stackoverflow.com/a/27765390
score: 0
possible better answer: http://stackoverflow.com/a/27765456
has answer: http://stackoverflow.com/a/27765456
downvote count: 1
has body: I need to be able to when the submit button is clicked a new tab must be open based on the anchor link coming from the database. I have been struggling for hours. this is my form Select Names Names Here is the php <?php $query="SELECT * FROM names_table ORDER BY RAND() LIMIT 1 "; $result=mysqli_query($connection,$query); if(!$result){echo "no results";} while($selected=mysqli_fetch_assoc($result)){ $link=$selected['name']; echo $ran_name= "Click here"; ?> // this code works but i dont want to be able to use Click here i want to be able to generate the results once the submit button is clicked , the submit button must open the new tab.I think javascript must be used but i dont know how.
has title: Opening a new link using submit button not anchor tag
has answer: http://stackoverflow.com/a/27765481
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27765390
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: web
favorite count: 0
answer count: 3
upvote count: 1
tagged with: php

drupal
type: Tag
tags question: http://stackoverflow.com/q/27680456
tags question: http://stackoverflow.com/q/27690517
tag name: drupal
tags question: http://stackoverflow.com/q/27653441

http://stackoverflow.com/q/27651125
possible better answer: http://stackoverflow.com/a/29228651
type: AnsweredQuestion
has title: LumX lx-select not updating ng-model
tagged with: angular-material
tagged with: material-design
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/29228651
has body: I started using the LumX framework recently, and I was trying to use their Selects directive here, but I'm not clear on their documentation. This is what I've got so far: &lt;lx-select ng-model="selectedPriority" placeholder="Priority" choices="priorities"&gt; &lt;lx-select-selected&gt; {{ $selected.name }} &lt;/lx-select-selected&gt; &lt;lx-select-choices&gt; {{ $choice.name }} &lt;/lx-select-choices&gt; &lt;/lx-select&gt; And this is how I'm defining priorities (within the controller for the div containing the lx-select) $scope.priorities = [ { name: 'Urgent', id: 1 }, { name: 'Very important', id: 2 }, { name: 'Not important', id: 3 }, { name: 'None', id: 4 } ]; Which does give me a list to select from, but the selectedPriority model never gets updated, so that whenever I try to use that value, it's always undefined. I can't even run the example they provide in the documentation page, but I'm not sure what I'm missing.
score: 0
has answer: http://stackoverflow.com/a/27712063
accepted answer: http://stackoverflow.com/a/27712063
tagged with: angularjs

http://stackoverflow.com/comment/43903622
has text: Well, hiding the progress bar is easy. I think your real question is "How do I detect validation failure and take action"
comment on: http://stackoverflow.com/q/27746217
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/43980771
score: 0
type: Comment
has text: continued....unless I delete line 9s code. I'll keep on working at it. Hmmm...Sorry I'm kind of new to this. I am trying to set the value of (2,7) to RTI in the first sheet named "Class Data" to every spreadsheet in a folder. and rename the 4th sheet in this spreadsheet to "RTI Data" Thanks so much for any help you can give.
comment on: http://stackoverflow.com/a/27783845
type: AnswerComment

http://stackoverflow.com/q/27715581
has comment: http://stackoverflow.com/comment/43843854
downvote count: 0
has comment: http://stackoverflow.com/comment/43843690
has answer: http://stackoverflow.com/a/27716998
favorite count: 0
type: UnansweredQuestion
tagged with: regex
upvote count: 6
has comment: http://stackoverflow.com/comment/43843588
has body: I have a nodejs script that reads in a file and counts word frequencies. I currently feed each line into a function: function getWords(line) { return line.match(/\b\w+\b/g); } This matches almost everything, except it misses contractions getWords("I'm") -&gt; {"I", "m"} However, I cannot just include apostrophes, as I would want matched apostrophes to be word boundaries: getWords("hey'there'") -&gt; {"hey", "there"} Is there a way capture contractions while still treating other apostrophes as word boundaries?
tagged with: node.js
has comment: http://stackoverflow.com/comment/43844686
score: 6
has comment: http://stackoverflow.com/comment/43843579
has comment: http://stackoverflow.com/comment/43843485
has comment: http://stackoverflow.com/comment/43843734
type: Question
tagged with: cpu-word
has comment: http://stackoverflow.com/comment/43844065
has answer: http://stackoverflow.com/a/27715859
tagged with: javascript
has title: How do I handle contractions with regex word boundaries in javascript
answer count: 2

http://stackoverflow.com/a/27769386
answers question: http://stackoverflow.com/q/27769247
upvote count: 1
has body: Object.keys returns the object properties that have their descriptors marked enumerable. In this case, parseInt is not enumerable: e.g. Object.getOwnPropertyDescriptor(global, 'parseInt') is { "writable":true, "enumerable":false, "configurable":true, "value": function parseInt(){ ...} }
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27769247
score: 1

http://stackoverflow.com/q/27672757
upvote count: 1
answer count: 1
tagged with: node.js
tagged with: bots
accepted answer: http://stackoverflow.com/a/28653091
has comment: http://stackoverflow.com/comment/45112889
type: AnsweredQuestion
has title: Node js steam trade bot
tagged with: javascript
favorite count: 0
type: Question
has body: I'm trying to make a trade bot, but I have a problem with it. When I make an offer to the bot and I want to accept it, the bot doesn't do anything. Decline is working very well, but the accept is not. https://github.com/seishun/node-steam-trade Here is my code: steam.on('tradeOffers', function(number) { if (number &gt; 0) { offers.getOffers({ get_received_offers: 1, active_only: 1, time_historical_cutoff: Math.round(Date.now() / 1000) }, function(error, body) { if(body.response.trade_offers_received){ body.response.trade_offers_received.forEach(function(offer) { if (offer.trade_offer_state == 2) { console.log(offer); if(offer.items_to_receive){ if(!offer.items_to_give){ offers.acceptOffer(offer.tradeofferid); }else { offers.declineOffer(offer.tradeofferid); } }else { offers.declineOffer(offer.tradeofferid); } } }); } }); } });
score: -1
has answer: http://stackoverflow.com/a/28653091
downvote count: 2
tagged with: steam

http://stackoverflow.com/q/27778637
answer count: 0
has comment: http://stackoverflow.com/comment/43969754
score: 0
tagged with: repeater
type: Question
tagged with: c#
tagged with: javascript
tagged with: user-controls
has comment: http://stackoverflow.com/comment/44004428
has body: I have a javascript method that get number of facebook likes for given URL. I put this function in user control and call this control in repeater for multi item. When I run the page, I get the number of likes for the first item in the repeater only. How can I solve this? &lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FacebookNoOfLikes.ascx.cs" Inherits="TELiveSports.FrontEnd.UserControls.FacebookNoOfLikes" %&gt; &lt;script type="text/javascript"&gt; function fetchLikeCount(url) { // alert(url); return $.Deferred(function (defer) { $.ajax({ dataType: 'jsonp', url: 'https://api.facebook.com/method/fql.query?callback=callback', data: { query: 'SELECT like_count FROM link_stat WHERE url="' + url + '"', format: 'JSON' } }).then(function (res) { try { var count = res[0].like_count; defer.resolve(count); } catch (e) { reject(); } }, reject); function reject() { defer.reject('-'); }; }).promise(); } function GetPageFaceLikes(controlName) { fetchLikeCount(document.getElementById(controlName).value).always(function (res) { $("#res").text(res); }); } &lt;asp:HiddenField runat="server" ID="lbl_URL" Value='&lt;%#Eval("ShareItemURL") %&gt;' /&gt; &lt;div id="res"&gt; &lt;script type="text/javascript"&gt; function pageLoad(){ GetPageFaceLikes('&lt;%= lbl_URL.ClientID %&gt;') }; &lt;/script&gt; &lt;/div&gt;
tagged with: asp.net
type: UnansweredQuestion
has title: Facebook Like count for multi URLs using javascript and user control

http://stackoverflow.com/a/27730368
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27728961
has body: I guess, the script is loading successfully but gapi.client is not available immediately. You need to provide handler to google api url on that purpose (some global function). angular.module('app', []) .controller('mainCtrl', function(googleClientLoader) { googleClientLoader.load().then( function() { console.debug(gapi.client); } ) }) .factory('googleClientLoader', function($q) { return { load: function() { var deferred = $q.defer() var script = document.createElement('script'); script.type = 'text/javascript' script.src = 'https://apis.google.com/js/client.js?onload=handleClientLoad'; window.handleClientLoad = function() { deferred.resolve('Google Client Library loaded'); } document.body.appendChild(script) return deferred.promise; } } })
answers question: http://stackoverflow.com/q/27728961
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/89094053
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27789946
has text: It's a good question because (x) and (x==true) ought to be the same thing, but this is a case where they are not.

http://stackoverflow.com/a/27849632
downvote count: 0
has body: Presuming you have enabled physics and have already assigned each of the coordinates in your path to regions of your stage. Moving in straight lines I would suggest Physics.Arcade.movetoXY(). The function returns the angle to the target location if you need to rotate your sprite. sprite.rotation = game.physics.arcade.moveToXY( sprite, target.x, target.y, 300 // speed, 500 // maxTimeToFinish(ms) ); If your sprite is drifting past the target and not stopping, be sure to include something like this in your main update() loop: player.body.velocity.x = 0; player.body.velocity.y = 0; As your example is only moving in straight line this method will work well. You can just use the xy position of your final tile and set your sprite moving. This method does not account for drag, acceleration and a few other variables your game might have. A lot of what to recommend depends on your use case. Patroling a tile path If you wanted the sprite to 'patrol' along a path then you would use a tween, as this offers the best performance. Tile-based complicated movement If your sprite was following a more complicated path such as avoiding obsticles or following another game object, you would use a Phaser.Timer (for Pokemen-style, tile-by-tile movement) or your game's update() loop (for smooth movement), to run a function that calculates which direction to move in and then executes that move using a Phaser.Arcade.Physics method (moveToXY, accelerateToXy etc) to move. The best way to do this is with an A* path-finding algorithm, which work out a path for your sprite, taking into account obsticles, dead ends and difficult terrain to give the quickest path. rot.js is a library of tile-based methods, including an A* path finder. Tile-based character movement In tile-based movement with obstacle collisions be careful - the arcade collisions in Phaser fire upon contact with the target (including corner pixels), and this can make moving between obstacles or moving past openings difficult. You can …
type: AcceptedAnswer
upvote count: 13
accepted answer of: http://stackoverflow.com/q/27785355
type: Answer
score: 13
answers question: http://stackoverflow.com/q/27785355
has comment: http://stackoverflow.com/comment/72892653

http://stackoverflow.com/comment/43836030
type: Comment
type: QuestionComment
has text: But if you want *true* multithreading, I'm afraid the only solution is Web workers.
comment on: http://stackoverflow.com/q/27711751
score: 0

http://stackoverflow.com/comment/43700722
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27640753
has text: BTW, I assume `new BeginningDate` was a copying error, it's really `new Date`.
score: 0

http://stackoverflow.com/q/27679839
has comment: http://stackoverflow.com/comment/43774419
score: 2
has answer: http://stackoverflow.com/a/27680204
upvote count: 2
type: UnansweredQuestion
has body: I am using an AJAX call on my page which return table rows and on success adds them to a table in the page. Below is the code currently used: function GetDPRecords(Perso) { //alert(Perso); $Records = $('#DPRecords'); //alert($PersoFileName.val()+" | "+$ProcFromDate.val()+" | "+$ProcToDate.val()); $.ajax({ type: "GET", url: "SelectDPRecords.jsp", data: $('form#Search_Form').serialize() + "&amp;Personalized=" + Perso, beforeSend: function () { $Records.find("tr:gt(0)").remove(); $("&lt;tr&gt;&lt;td colspan='4'&gt;&lt;h3 style='margin: 4px 10px'&gt; Loading... &lt;/h3&gt;&lt;/td&gt;&lt;/tr&gt;").hide().appendTo($Records).show(400); }, success: function (data) { $Records.find("tr:gt(0)").remove(); $(data).hide().appendTo($Records).show(400); } }); } The issue is that I at times expect a large number of rows to be returned (1,000-5,000). I did a test run with 4,000 rows data returned and it caused the browser to be unresponsive for about 20 seconds. Any way to optimize the code and reduce the loading time?
type: Question
has comment: http://stackoverflow.com/comment/43774432
has comment: http://stackoverflow.com/comment/43775160
has comment: http://stackoverflow.com/comment/43774442
answer count: 3
has answer: http://stackoverflow.com/a/27679932
has answer: http://stackoverflow.com/a/27680071
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Speeding up Ajax success DOM manipulation
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43774471

http://stackoverflow.com/comment/44009459
has text: If Parse put some limitations on the middleware officially supported you can put the source code of the middleware itself in your code (if the license of the middleware let you do it).
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27778548
type: AnswerComment

knockout.js
tags question: http://stackoverflow.com/q/27686543
tags question: http://stackoverflow.com/q/27723040
tags question: http://stackoverflow.com/q/27711305
tags question: http://stackoverflow.com/q/27663011
tags question: http://stackoverflow.com/q/27729730
tags question: http://stackoverflow.com/q/27725333
tags question: http://stackoverflow.com/q/27753925
tags question: http://stackoverflow.com/q/27755724
tags question: http://stackoverflow.com/q/27764194
tags question: http://stackoverflow.com/q/27654895
tags question: http://stackoverflow.com/q/27739894
tags question: http://stackoverflow.com/q/27642386
tags question: http://stackoverflow.com/q/27670518
tag name: knockout.js
tags question: http://stackoverflow.com/q/27697623
tags question: http://stackoverflow.com/q/27768124
tags question: http://stackoverflow.com/q/27769992
tags question: http://stackoverflow.com/q/27652573
tags question: http://stackoverflow.com/q/27697229
tags question: http://stackoverflow.com/q/27665032
tags question: http://stackoverflow.com/q/27659587
tags question: http://stackoverflow.com/q/27702788
type: Tag
tags question: http://stackoverflow.com/q/27716384
tags question: http://stackoverflow.com/q/27758155
tags question: http://stackoverflow.com/q/27707378
tags question: http://stackoverflow.com/q/27770839
tags question: http://stackoverflow.com/q/27761901
tags question: http://stackoverflow.com/q/27770476

http://stackoverflow.com/comment/43910403
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27749507
has text: you either have the code out of order or you aren't calling it properly

http://stackoverflow.com/a/27776018
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/27772393
has body: CKEDITOR.editor.on is a method of a working editor instance, i.e. returned by CKEDITOR.replace, while CKEDITOR.editor is just editor constructor. Instead attach CKEDITOR.instanceReady event before CKEDITOR.replaceAll and use event data to attach more events to particular editor instances: CKEDITOR.on( 'instanceReady', function( evt ) { evt.editor.on( 'simpleuploads.startUpload', function( evt ) { ... } ); } ); CKEDITOR.replaceAll( 'js-ckeditor' );
accepted answer of: http://stackoverflow.com/q/27772393
score: 3

http://stackoverflow.com/q/27746349
tagged with: php
has body: I am very new to javascript and json. I am trying to display the events stored in my database into a calender. But its not getting displayed. This is my json-events.php <?php include("connect.php"); $year = date('Y'); $month = date('m'); $command = "SELECT * FROM planner"; $result = mysql_query($command) or die (mysql_error()); $bookings = array(); while ($row = mysql_fetch_array($result)) { echo "hi"; $start = date("Y-m-d", strtotime($row['from_time'])); $end = date("Y-m-d", strtotime($row['to_time'])); $id = $row['plan_id']; //$eventsArray['plan_id'] = (int)trim($myid); //$eventsArray['title'] = $row['title']; $title = $row['purpose']; //$title = $row['title']; //echo $title; //$eventsArray['company'] = $title; //$eventsArray['from_time'] = $start; //$eventsArray['to_time'] = $start; $url = "edit_calendar.php?calendarid=".$row['plan_id']; // $eventsArray['end'] = $end; // $eventsArray['allDay'] = false; // $events[] = $eventsArray; $bookings = array( 'id' => $id, 'title' => $title, 'start' => $start, 'end' => $end, 'url' => $url ); echo json_encode($bookings);} ?> and here i am linking that in calendar.js jsonEvents: function() { if($('#calendar_json').length) { $('#calendar_json').fullCalendar({ header: { left: 'month,agendaWeek,agendaDay', center: 'title', right: 'prev,next' }, buttonText: { prev: '', next: '' }, editable: true, firstDay: 1, // 0 - Sunday, 1 - Monday events: "json-events.php", eventDrop: function(event, delta) { alert(event.title + ' was moved ' + delta + ' days\n' + '(should probably update your database)'); } }); } and in my dashboard.php page JSON events fetched from a script But it just displays a calender not the data from database. Can somebody plz suggest When i echoed json-events, i get proper output {"id":"3","title":"sdfsfsd dsdsbfb","start":"2015-01-05","end":"2015-01-14","url":"edit_calendar.php?calendarid=3"} But in calender nothing is getting displayed
has comment: http://stackoverflow.com/comment/43903790
answer count: 0
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
score: 0
has title: fullcalendar data is not getting displayed
has comment: http://stackoverflow.com/comment/43904177
type: UnansweredQuestion

http://stackoverflow.com/a/27671980
type: Answer
has comment: http://stackoverflow.com/comment/43759128
answers question: http://stackoverflow.com/q/27671904
score: 0
has body: An other approach to your problem. I split the string upon the last space. Then rearrange the values and put them back into the copied array. Finally let sort do it's work. This navigates around the Vincent van Gogh problem. var reorderName = moonWalkers.slice(0); //copy the array for (var i=0; i &lt; reorderName.length; ++i){ var lastName = reorderName[i].substr(reorderName[i].lastIndexOf(" ")); var name = reorderName[i].substr(0, reorderName[i].lastIndexOf(" ")); //output is: Gogh, Vincent van var fullName = lastName + ", " + name; //append that comma! reorderName[i] = fullName; reorderName.sort(); } return reorderName;
has comment: http://stackoverflow.com/comment/43759234

http://stackoverflow.com/a/27793176
answers question: http://stackoverflow.com/q/27792947
type: Answer
has body: Please check if this is what you need. var myApp = angular.module('myApp',[]); function MyCtrl($scope) { $scope.array = ['MON 5 10', ' TUE 6 11']; var data = { headers : [], rows : [] }; var array = $scope.array; for(var index in array){ data['headers'].push(array[index].trim().split(/\s+/)[0]); data['rows'].push(array[index].trim().split(/\s+/).splice(1)) } data['rows'] = data['rows'][0].map(function(col, i) { return data['rows'].map(function(row) { return row[i] }) }); $scope.data = data; } {{header}} {{item}} JS-Fiddle link
score: 0

http://stackoverflow.com/comment/44159005
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27757666
has text: What happens when you move the console logs inside the document.ready function
score: 0

http://stackoverflow.com/a/27791678
downvote count: 0
has body: That is how onmouseout works. You want to use onmouseleave
type: Answer
has comment: http://stackoverflow.com/comment/43993060
has comment: http://stackoverflow.com/comment/43993800
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27791656
answers question: http://stackoverflow.com/q/27791656
has comment: http://stackoverflow.com/comment/43993571
score: 3
type: AcceptedAnswer

http://stackoverflow.com/a/27713861
score: 0
answers question: http://stackoverflow.com/q/27684882
type: Answer
has body: there is no API by Google as such where you can set latitude and longitude as parameters in the request and get the timestamp in the response. There is a timezone API offered by Google but that too takes timestamp as a input parameter which is of no use in your case. The best option here is to use a third party API that takes the input parameters as latitude and longitude and gives the response in timestamp. You can use that result in a variable and display it inside a info window in your map. Here in a link to one such API for XML and this one for JSON.

http://stackoverflow.com/comment/43988378
type: Comment
has text: This was exactly what I was after. As a newcomer to angular I sometimes get a bit mixed up over what bits belong inline and which bits work way better in my js files
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27789011

http://stackoverflow.com/q/27667928
has title: jQuery-File-Upload doesn't return $_FILES
tagged with: php
answer count: 0
downvote count: 0
score: 1
tagged with: codeigniter
type: Question
has body: I'm using blueimp's jQuery File Upload to upload files and I'd like to write my own handler, however, it's not uploading files for some reason. I'm using CodeIgniter as framework. I want to check if the files are uploaded, however $_FILES (console.log( data.result );) gives [] instead of the cached file. I'm working on a localhost environment. My html <input type="file" data-type="process" class="filestyle" multiple="false" data-icon="false" data-classButton="btn btn-default" data-classInput="form-control v-middle inline input-s-lg" data-buttonText="Kies Excel" The js $(function(){ $('input:file[data-type=process]') .fileupload({ add: function (e, data) { if (data.autoUpload || (data.autoUpload !== false && $(this).fileupload('option', 'autoUpload'))) { $('#progress') .show() .addClass('fadeIn') .find('em').text('Uploaden'); data.process().done(function () { data.submit(); }); } }, progress: function (e, data) { var progress = parseInt(data.loaded / data.total * 100, 10); $('#progress .progress-bar').css( 'width', progress + '%'); }, done: function (e, data) { console.log( data.result ); } }); }); And finally the CI controler <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Ajax extends CI_Controller { public function __construct() { parent::__construct(); } public function _remap( $method ) { if( !$this->input->is_ajax_request() ) { show_404(); // redirect to the 404 if ajax wasn't used for this request } else { $this->$method(); // continue the method } } public function update_client_status() { $response = $_FILES; $this->output->set_content_type('application/json')->set_output( json_encode( $response ) ); } }
tagged with: javascript
tagged with: jquery
upvote count: 1
tagged with: file-upload
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/43940717
has text: There are lots of bug in your code.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27765023
score: 1

http://stackoverflow.com/q/27797601
has comment: http://stackoverflow.com/comment/44004007
accepted answer: http://stackoverflow.com/a/27798295
answer count: 1
has title: Is the scope being changed here or is it something else?
has comment: http://stackoverflow.com/comment/44004016
downvote count: 3
has answer: http://stackoverflow.com/a/27798295
upvote count: 4
type: AnsweredQuestion
tagged with: arrays
has body: I'm pretty inexperienced with JavaScript so I really have no idea what I'm doing wrong. This works perfectly: myarray = []; myarray.push(1); This works perfectly too: myarray = []; function example(){ myarray.push(1); } example(); This doesn't work at all: myarray = []; function example(){ myarray.push(1); } $(window).load(function(){ example(); }); Am I changing the scope or something with $(window).load(function(){...? How can I make example() execute like it did in the second snippet in the third snippet?
tagged with: javascript
score: 1
tagged with: variables
favorite count: 0
tagged with: scope
has comment: http://stackoverflow.com/comment/44004020
type: Question

http://stackoverflow.com/comment/43740687
score: 0
comment on: http://stackoverflow.com/q/27660408
type: Comment
type: QuestionComment
has text: look into using `postMessage` API. Also make sure iframe isn't from another domain

http://stackoverflow.com/q/27643829
has answer: http://stackoverflow.com/a/27644112
accepted answer: http://stackoverflow.com/a/27644112
has comment: http://stackoverflow.com/comment/43706412
tagged with: prototype
has comment: http://stackoverflow.com/comment/43706452
tagged with: scope
score: 0
tagged with: this
answer count: 1
tagged with: node.js
type: AnsweredQuestion
has title: 'this' inside prototype method not resolving as expected when inheritance
has body: I have a constructor which is an extension of a module (https://github.com/fluxxu/evalidator) in node.js. This extended constructor defines two more methods in the prototype, and **method B calls method A via 'this' keyword**. This constructor is used to initialize a property in another object, and when i invoke the method B from this property i get an error like 'main object' doesn't have method A: TypeError: Object function (){ superEvalidatorVar.method_B(); } has no method 'method_B' at Object.&lt;anonymous&gt; Here is the code: var EValidator = require('evalidator'); /** * EValidator extension object * @constructor */ function SuperEValidator(){ // EValidator Inheritance EValidator.apply(this, arguments); } SuperEValidator.prototype = Object.create(EValidator.prototype); SuperEValidator.prototype.constructor = SuperEValidator; SuperEValidator.prototype.method_A = function(){ console.log('method_A called'); }; SuperEValidator.prototype.method_B = function(){ this.method_A(); }; var superEvalidatorVar = new SuperEValidator(); var mainObject = { callingSuperEValidator: function(){ superEvalidatorVar.method_B(); } }; /*** Calling methods from MainObject ***/ mainObject.callingSuperEValidator.method_B(); // Throws Error! **The 'this' keyword at method_B of the extended constructor resolves to mainObject, why?? Set var me; at global level and set it to 'this' at PropertyObject Constructor, then inside method_B use 'me' instead 'this'. Inside method_B use 'PropertyObject.prototype' instead 'this' But i wonder if there's something bad happen i don't understand this behavior in SuperEValidator EDIT: The real purpose of all this is to rewrite the 'validate' method of a Mongoose Schema: PostSchema.methods.validate = function(cb){ // 'this' will have the value of the object (model) from which the function will be called evPost.validate_super(this, cb); };
type: Question
tagged with: javascript

http://stackoverflow.com/q/27718857
accepted answer: http://stackoverflow.com/a/27718961
tagged with: arrays
downvote count: 0
favorite count: 0
upvote count: 8
score: 8
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27718961
type: Question
has title: Pattern for "column total" of an array of arrays
has body: I am looking for a pattern to get the totals for each n-th item of arrays. Conceptually this would be like getting column totals of a data table. var dataRows = [ [10, 11, 12, 13], [20, 21, 22, 23], [30, 31, 32, 33] ] // The outcome should be: // [ 60, 63, 66, 69] I had some equivalent Python code on the server side, but decided it should be handled client side, thus in javascript. Here is the equivalent Python code: [sum(i) for i in zip(*data_rows)] How would you go about writing this? I am sure the code will be longer without zip, unpack and list comprehension, but can it be done elegantly? Also are there libraries that extend the core library of JS?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27719067
has answer: http://stackoverflow.com/a/27719067
answer count: 2

http://stackoverflow.com/comment/43879110
has text: That's true, but the OP's request makes little sense, and this code is almost certainly what should be done (this, or something like `Array.prototype.find()`)
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27733574
type: Comment

http://stackoverflow.com/a/27644893
has comment: http://stackoverflow.com/comment/43713154
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43709492
answers question: http://stackoverflow.com/q/27644335
upvote count: 1
has body: You can do this via jquery like this $.trim($("#textbox").val()); and you can do this on onblur event of textbox OR you can use Trim of C# when this value will be passed to controller value.Trim()
type: Answer

http://stackoverflow.com/a/27650989
has body: Use to left. div { width: 300px; height: 100px; background: linear-gradient(to left, #0000FF, #0000FF 20px, #EEEEEE 21px); } &lt;div&gt;&lt;/div&gt; Using JavaScript. var elem = document.getElementsByTagName('div')[0]; elem.style.width = '300px'; elem.style.height = '100px'; elem.style.background = 'linear-gradient(to left, #0000FF, #0000FF 20px, #EEEEEE 21px)'; &lt;div&gt;&lt;/div&gt;
accepted answer of: http://stackoverflow.com/q/27650969
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43719160
has comment: http://stackoverflow.com/comment/43719095
has comment: http://stackoverflow.com/comment/43719251
has comment: http://stackoverflow.com/comment/43719213
has comment: http://stackoverflow.com/comment/43719259
has comment: http://stackoverflow.com/comment/43719231
type: Answer
has comment: http://stackoverflow.com/comment/43719203
upvote count: 2
answers question: http://stackoverflow.com/q/27650969

http://stackoverflow.com/q/27730697
has comment: http://stackoverflow.com/comment/43872821
has answer: http://stackoverflow.com/a/27730899
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27737095
has body: I am building an MVC 4 web application and using Google Charts, the thing is, it won't be all the time online, so i would like to know if there is a way to check if http://www.google.com/jsapi is accessible to load or not the charts, or if there is a way around to not load the charts like a condition in javascript.
possible better answer: http://stackoverflow.com/a/27730899
accepted answer: http://stackoverflow.com/a/27737095
has title: How to not Load Google Charts in Offline mode
has comment: http://stackoverflow.com/comment/43872844
tagged with: asp.net-mvc-4
type: AnsweredQuestion
type: Question
answer count: 2
tagged with: google-visualization
tagged with: javascript

http://stackoverflow.com/comment/43962150
score: 0
comment on: http://stackoverflow.com/q/27774783
has text: @yopefonic: How can the code return 0? `else if (position = bar.compute())` cannot return 0 it would go to else. Then `else if (position = baz.compute())` cannot return 0 it would go to else which in turn returns `'some defalut'`. If the code returns 0 it's not in the logic you've posted.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43982896
comment on: http://stackoverflow.com/a/27784952
has text: ...or is there a fundamentally better approach to gauging the client-side performance of a web application?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27732858
has comment: http://stackoverflow.com/comment/43877887
tagged with: ajax
has comment: http://stackoverflow.com/comment/43877383
has comment: http://stackoverflow.com/comment/43877407
has title: Rails ajax first request not showing up unless I refresh the page
has answer: http://stackoverflow.com/a/27733149
accepted answer: http://stackoverflow.com/a/27733149
has comment: http://stackoverflow.com/comment/43877650
has comment: http://stackoverflow.com/comment/43878035
has comment: http://stackoverflow.com/comment/43877317
has comment: http://stackoverflow.com/comment/43877527
tagged with: ruby-on-rails
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43877306
tagged with: javascript
type: Question
score: 0
has body: I have a view that has a form to create a new post using Ajax, and it also renders all the posts and adds the newly added post to them. The problem is when I post the very first post, the page does not show it unless I refresh, then if I refresh it shows up and when I add more posts Ajax works fine. Here is the view index.html.erb : &lt;%= link_to('Logout', destroy_user_session_path, :method =&gt; :delete) %&gt; &lt;%= link_to 'Edit my account', edit_user_registration_path %&gt; &lt;%= form_tag search_posts_path, method: :get do %&gt; &lt;%= text_field_tag :search, params[:search] %&gt; &lt;%= submit_tag "Search", name: nil %&gt; &lt;% end %&gt; &lt;b&gt; Study requests &lt;/b&gt; &lt;%= form_for(@post, remote: true) do |f| %&gt; &lt;%=f.label :Course_name %&gt; &lt;%=f.select :course_name, options_for_select(course_names) %&gt;&lt;br/&gt; &lt;%=f.label :Course_number %&gt; &lt;%=f.select :course_number, options_for_select(course_numbers) %&gt; &lt;br/&gt; &lt;%=f.submit %&gt; &lt;% end %&gt; &lt;%= render @posts %&gt; The partial is _post.html.erb : div id="post"&gt; &lt;%= post.user_name%&gt; &lt;/div&gt; Controller : def index @posts = Post.all.order('id DESC') @post = Post.new end def create @post = current_user.posts.build(post_params) @post.save respond_to do |format| format.html { redirect_to @post, notice: "Study request successfully added" } format.js {} format.json { render json: @post, status: :created, location: @post } end end And finally my create.js.erb : $("&lt;%= escape_javascript(render @post) %&gt;").prependTo("#post");
answer count: 1

http://stackoverflow.com/a/40788807
downvote count: 0
type: Answer
has body: On cordova project directory $ cordova platform add browser to add browser as platform $ cordova run browser to run in browser or $ cordova emulate browser has the same effect on either case a browser pops up with the corresponding url. You can run multiple projects on browser. You should restart the server after every change in the code to take effect (with pronegap serve no restart is required). This works on plugins that have implemented browser support (pretty much all). To be sure that the plugin has browser support one of the following folders should exist cordova-project-dir/plugins/cordova-plugin-folder/src/browser cordova-project-dir/plugins/cordova-plugin-folder/www/browser I know it is an old question, but I just stumbled upon the same problem and found the solution.
answers question: http://stackoverflow.com/q/27761467
score: 5
upvote count: 5

http://stackoverflow.com/comment/44012165
type: Comment
has text: @M.H. Do you have the pictures on the website? Maybe your URLS should start with "/".
comment on: http://stackoverflow.com/a/27801608
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43860765
comment on: http://stackoverflow.com/a/27724093
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/67995/discussion-between-paceaux-and-user1027620).
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43866040
score: 1
type: AnswerComment
has text: Works great, I just had to change the display line to elem.style.display = reg.test(text) ? 'table-row' : 'none';
type: Comment
comment on: http://stackoverflow.com/a/27727044

http://stackoverflow.com/a/27745704
answers question: http://stackoverflow.com/q/27745060
has comment: http://stackoverflow.com/comment/43905554
upvote count: 1
has comment: http://stackoverflow.com/comment/43907016
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43906005
has comment: http://stackoverflow.com/comment/43904676
has comment: http://stackoverflow.com/comment/43905843
type: Answer
has comment: http://stackoverflow.com/comment/43905782
has body: Pure JS variation of @Mohamed's answer (not tested): window.onload = function() { var selector = document.querySelector(".thumbnail li img"); selector.addEventListener("click", function() { var img = document.querySelector(".block-2-image img"); img.setAttribute("src", selector.getAttribute("src")); }); }

http://stackoverflow.com/q/27671593
type: UnansweredQuestion
type: Question
has title: how to get regular blinking on a automatically refreshing div
tagged with: blink
has comment: http://stackoverflow.com/comment/43758234
has comment: http://stackoverflow.com/comment/43760005
score: 0
has body: I am working on making a webpage that displays multiple temperatures. When a temperature value goes out of limits (too hot/cold) its background blinks red. The way I've gotten it to work so far, is that a python script generates text files that include temperature values. Text from temperature files are then loaded into the html script via div's that automatically refresh at 5 second intervals. When temperature level is out of range, a string of code is included in the text file which makes the div blink. Main Page Temperatures Temp01.txt: 25.5degC It works, but the blinks are too irregular (because of the div's automatic refreshing). Can anyone think of a way to create a toggle or something that makes all the out of limit temperatures blink at a regular interval? Note that the divs don't blink until they are out of range because python creates a text file with plain text (no script) when they are within range Temp02.txt:
tagged with: javascript
has comment: http://stackoverflow.com/comment/43757998
tagged with: http://stackoverflow.com/tag/html
answer count: 0

http://stackoverflow.com/comment/44305023
score: 2
has text: Thanks, but I think it would [only turn off debug log messages](https://github.com/angular/angular.js/blob/d3b1f502e3099d91042a1827a006ad112ea67d36/src/ng/log.js#L54)..
type: AnswerComment
comment on: http://stackoverflow.com/a/27952008
type: Comment

http://stackoverflow.com/comment/114986361
has text: It makes a lot more sense to use `find` and not `findIndex`, actually. In most cases when you want to update an object you just want to update one or two properties. It doesn't make sense to recreate the object on the fly when only one or two properties are supposed to be updated. That said, I'm not saying you should use `indexOf`. I guess what I want to say is that the other answer is better.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27641860

http://stackoverflow.com/q/27677692
has comment: http://stackoverflow.com/comment/59962074
linked to: http://stackoverflow.com/q/6382782
answer count: 1
downvote count: 1
tagged with: events
favorite count: 0
accepted answer: http://stackoverflow.com/a/27823828
has comment: http://stackoverflow.com/comment/44011031
linked to: http://stackoverflow.com/q/8191470
linked to: http://stackoverflow.com/q/17418532
has title: Performance Cost of PubSub / Excessive Events and Event Handlers in JavaScript?
has comment: http://stackoverflow.com/comment/43806700
has comment: http://stackoverflow.com/comment/44010727
linked to: http://stackoverflow.com/q/13512949
tagged with: publish-subscribe
upvote count: 27
tagged with: node.js
has answer: http://stackoverflow.com/a/27823828
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/257112
has body: Pub Sub / Event Driven architecture is a common practice in the world of Client &amp; Server side JavaScript. I have been tasked to architect a very large Web Application using Dojo as Front End and node.js as backend. Pub / Sub seems very appealing as it allows for a great deal of parallelism amongst teams. I am afraid though, if there will be performance consequences. I have a general question regarding the cost of Events and Event Handlers in JavaScript. I've already seen this, this, this, even this and this. But I still don't seem to see a general purpose answer. Independent of frameworks, suppose we have 2 methods publish() //Like jQuery's / Dojo's trigger(), EventEmitter's emit() and subscribe() //Like jQuery's / Dojo's / EventEmiter's / DOM's on() connect() live() addEventListener() Problem 1: What is the cost of each Event trigger? Case 1: Cleaner (Loosely Coupled) Code emphasizing Pub / Sub object.publish('message1', data); object.publish('message2', data); ... object.publish('message100', data); //All these are in separate files / modules subscribe (object, 'message1', function (data) { A()...}) subscribe (object, 'message2', function (data) { B()...}) subscribe (object, 'message100', function (data) { Z()...}) Case 2: Tightly Coupled code! But is it more performant? data.message = 'message1' object.publish('message', data) subscribe (object, 'message', function (data) { switch (data) { case 'message1': A(); break(); case 'message2': B(); break(); ... case 'message100': Z(); break(); } }) Problem 2: What is the cost of each Event listener? object.publish('event', data); Case 1: Again, Cleaner (Loosely Coupled) Code emphasizing Pub / Sub //A.js subscribe (object, 'event', function (data) { A(); }); //B.js subscribe (object, 'event', function (data) { B(); }); //C.js subscribe (object, 'event', function (data) { C(); }); Case 2: Again, Tightly Coupled code! But is it more performant? subscribe (object, 'event', function (data) { A(); B(); C(); }); Q1: Can so…
linked to: http://stackoverflow.com/q/5951301
type: Question
has comment: http://stackoverflow.com/comment/44010657
tagged with: performance
has comment: http://stackoverflow.com/comment/44010166
score: 26
tagged with: javascript

http://stackoverflow.com/q/27677861
accepted answer: http://stackoverflow.com/a/27678113
has answer: http://stackoverflow.com/a/27677998
type: Question
tagged with: function
tagged with: javascript
has comment: http://stackoverflow.com/comment/43770195
score: 0
answer count: 3
has body: Added: 12/30/14 - 7:00am(EST) This problem has been solved Below I have posted a link to a jsfiddle where you can see the finished product. In addition to the rotating plus sign, I have added a div that appears off screen, and with a click of the mouse, appears onscreen. This div can be filled with content. While the aforementioned sentence would cause most on this forum to exclaim: "No duh!" I mostly included this portion for those novices who may be stumbling across this post in the next few months. Hopefully, no one else will need to ask this question in the future. http://jsfiddle.net/amolner/gqe4tpqs/31/ Anyone is free to use the above code for any purposes. If anyone has any ways to improve the above code above for the benefit of those finding this post in the future, please feel free to tinker with it. Again, thank you to everyone who contributed thus far. So saved me a lot of headaches. Original text: Upon the first click, everything works the way that it is supposed to. The plus sign moves 45 degrees to the right, turning it into an "x." It is upon the second click where thinks go awry. It is upon the second click that I would like the x to move backwards 45 degrees so that it turns back into a "+" sign. Instead, it starts over at 0 and moves right 45 degrees. I've been at this a so long that I am embarrassed to say just how long. I have lines and lines of failed code but I feel the following is the closest I've come. If anyone could help, I would greatly appreciate it. title +
has comment: http://stackoverflow.com/comment/43770415
has answer: http://stackoverflow.com/a/27678113
has answer: http://stackoverflow.com/a/27678233
has title: Using two for loops within a javascript function javascript animation
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43770172
possible better answer: http://stackoverflow.com/a/27677998
tagged with: loops

http://stackoverflow.com/q/27750600
tagged with: list
has title: CSS list with multiple columns with horizontal scrolling and automatic column width and height
downvote count: 0
score: 1
type: Question
has body: I have an automatically generated list (the number of items and their width are not known beforehand): Page header One Two Three ... Ninety nine One hundred Page footer and I want the following layout: +-----------------------------------------+ | Page header | | | | +-------------------------------------+ | | |One Five Nine Thirteen .... | | | |Two Six Ten Fourteen .... | | | |Three Seven Eleven Fifteen Ninet| | | |Four Eight Twelve Sixteen One h| | | <[=======scrollbar=========]----------> | | | | Page footer | +-----------------------------------------+ <-- window (viewport) frame so that the list fills the window width and window height (except the header and footer height) and automatically resizes when the window resizes, the list is scrolled horizontally, with a horizontal scrollbar, the number of rows and columns is selected automatically, the width of columns is selected automatically by the widest element of the list, or maybe even automatically for each column as the widest element of this column. I know how to make a similar design for a fixed number of columns, but not for a number of columns automatically adjusting to the screen area. If the solution is not trivial, maybe there are ready .css or .js that does this?
tagged with: javascript
has answer: http://stackoverflow.com/a/27751074
tagged with: listview
accepted answer: http://stackoverflow.com/a/27751074
has answer: http://stackoverflow.com/a/27750834
answer count: 3
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27750834
favorite count: 0
has answer: http://stackoverflow.com/a/27750821
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/comment/43878504
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27731223
type: Comment
has text: `friends` is not an array, it's an object.

http://stackoverflow.com/comment/43757280
has text: @JohnKurlak Ofcourse that is why you have scope.destroy event and _the_ purpose of an angular based implementation. And in other case unsubscribing the event wires down to as a primary implementation requirement in any pub/sub design patterns.
comment on: http://stackoverflow.com/q/27670824
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27758934
has body: typeof Module might be undefined if Module is a local variable that happens to contain undefined. This code is meant to support a few cases, Module might be local or global, and defined or undefined. We want to avoid polluting the global scope, so we don't just do Module = ... if it's undefined. First, the usual case is emscripten-generated code in the global scope. In this case, Module may or may not be defined, and may be local but still undefined, so we need to handle both. Second, emscripten code may be just a module, like a game that uses ammo.js. In that case, the usage is function Ammo(Module) { // emscripten-generated code, uses the Module return something; } so Module in this case is a function local, given as a param already defined for us. We can't just declare var Module because that means Module is a local variable. So we need eval. For eval, we need a function that returns a value, because we need a try-catch. The try-catch uses Module, and will throw if Module is not a local (regardless of whether it contains undefined or not), which is exactly what we want. It's possible this code could be simplified, though!
has comment: http://stackoverflow.com/comment/43928760
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43929474
type: Answer
upvote count: 4
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27756466
score: 4
answers question: http://stackoverflow.com/q/27756466

http://stackoverflow.com/q/27791520
accepted answer: http://stackoverflow.com/a/27807838
tagged with: php
tagged with: laravel
has title: Error 405 Method Not Alowed Exception when post with AJAX with Laravel
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27807838
has comment: http://stackoverflow.com/comment/43992838
has body: I just want to send two variables to my controller with an onclick event in JS, I am using laravel framework and JQuery Ajax. My onclick call is: onclick="addArt(&lt;?php echo Session::get("ID") ?&gt;, &lt;?php echo $article-&gt;idArticle ?&gt;)" That goes to a function in my JS sheet: function addArt(idUser, idArt){ $.post( "addArt", { IDUser: idUser, IDArt: idArt}) .done(function( data ) { location.reload(); }) .fail(function(e) { console.log(e); }); } So my route is "addArt" and like always I have the route: Route::post('addArt',"CarsController@addArt"); Where in my controller I just add the article to the cart with a simple insert of laravel but I get an error 405 (Method Not Alowed). Can anyone please help me with this?
type: Question
has comment: http://stackoverflow.com/comment/43994641
possible better answer: http://stackoverflow.com/a/27807921
tagged with: javascript
has answer: http://stackoverflow.com/a/27807921
score: 0
answer count: 2
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/q/27796007
type: Question
has comment: http://stackoverflow.com/comment/44000762
type: AnsweredQuestion
has title: How to create table with javascript
has body: I would like to create table with javascript. I would like to ask user, for width and height of a table (1 cell is 1 unit). Then when table is created, if user clicks in to one of the cell, color changes. I have so code written, but I am pretty much stuck. HTML CODE: JAVASCRIPT: var width = parseInt(prompt("Put width", "here")); var height = parseInt(prompt("Put height", "here")); function myFunction() { var tabel = document.getElementById("chessboard"); for (i = 0; i < height; i++){ var row = tabel.insertRow(i); }; for (j = 0; j < width; j++){ var celica = document.getElementByTagName("tr").rows[j]; var x = celica.insertCell(j); }; }
downvote count: 0
answer count: 1
tagged with: javascript
score: 1
has answer: http://stackoverflow.com/a/27796120
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/27796120
upvote count: 1

http://stackoverflow.com/comment/44997548
type: Comment
comment on: http://stackoverflow.com/a/27979635
has text: @vonGiso did you manage to find a case where the tooltips didn't display as ive tested a few graphs now and the tooltips always display for all bars
type: AnswerComment
score: 0

user-interface
tags question: http://stackoverflow.com/q/27729956
tags question: http://stackoverflow.com/q/27762385
type: Tag
tags question: http://stackoverflow.com/q/27712178
tags question: http://stackoverflow.com/q/27710593
tag name: user-interface

http://stackoverflow.com/comment/43739692
score: 0
comment on: http://stackoverflow.com/a/27661611
type: Comment
has text: I've updated the answer. Also went down another path >_< dunno if it's helpful.
type: AnswerComment

http://stackoverflow.com/comment/43709629
comment on: http://stackoverflow.com/a/27642947
score: 0
type: AnswerComment
type: Comment
has text: If you are doing ajax call to the server anyway, with language as input, what is the problem to have your server method returns list of countries as well as some other result that you need?

buttonclick
type: Tag
tags question: http://stackoverflow.com/q/27799049
tag name: buttonclick

http://stackoverflow.com/q/27766220
tagged with: ajax
has comment: http://stackoverflow.com/comment/43943169
has comment: http://stackoverflow.com/comment/43943364
favorite count: 0
score: 2
has answer: http://stackoverflow.com/a/27766406
accepted answer: http://stackoverflow.com/a/27766406
downvote count: 0
tagged with: php
has comment: http://stackoverflow.com/comment/43943150
possible better answer: http://stackoverflow.com/a/27766311
type: Question
has body: Updated Post I have a solution for that problem which works with me so far (only tested on Firefox). My main goal was to dynamically update a Flot graph with Ajax. I also need to dynamically update the axis styles and you can do this by the tickFormatter option. To avoid the problems I previously had, I simply insert the desired return string in the PHP array and JSON encode that array. After returned to the Ajax function I create a new function using the javascript Function() constructor (Link). I hope this helps someone. Ajax $.ajax({ url: 'someControllerWhichCreatesJSONdata', data: 'some Value', type: 'post', cache: false, datatype: 'json' }) .success(function(data) { var datas = data[0]; // fetch data array var options = data[1]; // fetch options array var xReturn = options.xaxes[0].tickFormatter; // fetch return string var yReturn = options.yaxes[0].tickFormatter; var xFunc = new Function("val", "axis", xReturn); // create function var yFunc = new Function("val", "axis", yReturn); options.xaxes[0].tickFormatter = xFunc; // update tickFormatter with function options.yaxes[0].tickFormatter = yFunc; $.plot($("#yw0"), datas, options); }) .error(function(data) { $("#error").html(data.responseText); // show error in separate div }); PHP array $options = array( 'legend' =&gt; array( 'position' =&gt; 'nw', 'show' =&gt; true, 'margin' =&gt; 10, 'backgroundOpacity' =&gt; 0.5 ), 'grid' =&gt; array( 'clickable' =&gt; true, 'hoverable' =&gt; true ), 'pan' =&gt; array('interactive' =&gt; true), 'zoom' =&gt; array('interactive' =&gt; true), 'axisLabels' =&gt; array('show' =&gt; true), 'xaxes' =&gt; array( array( 'axisLabel' =&gt; 'someUnit', 'tickFormatter' =&gt; 'return "foo bar"' // enter whatever return value you need ) ), 'yaxes' =&gt; array( array( 'axisLabel' =&gt; 'someUnit', 'tickFormatter' =&gt; 'return "foo bar"' ) ) ); I skip the data array as it looks similar. Both arrays get combined and JSON encoded. public function actionSomeControllerWhichCreatesJSONdata() { $…
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27766311
linked to: http://stackoverflow.com/q/2001449
tagged with: http://stackoverflow.com/tag/json
upvote count: 2
answer count: 2
tagged with: flot
tagged with: javascript
has title: Properly returning a JSON object with an embedded JS function

http://stackoverflow.com/q/27670048
type: AnsweredQuestion
has title: Angular js not recognizing controller
has comment: http://stackoverflow.com/comment/43755083
has body: I apologize ahead of time if this is something stupid like a semi-colon, but I'm having a hard time getting angular to recognize my controller (im a newbie to angular). I get an error, Image Controller is undefined. Notes: I am using the angular file upload plugin and this is a web api 2.0 application. I have 2 Javascript files UniqueAPIStart, UniqueAPIImages UniqueAPIStart(Fixed): var UniqueAPI = angular.module('UniqueAPI', ['angularFileUpload']); UniqueAPIImages(Fixed): UniqueAPI.controller('ImageController', ['$scope', '$upload', function ($scope, $upload) { $scope.$watch('myFiles', function() { for (var i = 0; i &lt; $scope.myFiles.length; i++) { var file = $scope.myFiles[i]; $scope.upload = $upload.upload({ url: '/api/AdminImages', // upload.php script, node.js route, or servlet url //method: 'POST' or 'PUT', //headers: {'Authorization': 'xxx'}, // only for html5 //withCredentials: true, data: { myObj: $scope.myModelObj }, file: file, // single file or a list of files. list is only for html5 //fileName: 'doc.jpg' or ['1.jpg', '2.jpg', ...] // to modify the name of the file(s) //fileFormDataName: myFile, // file formData name ('Content-Disposition'), server side request form name // could be a list of names for multiple files (html5). Default is 'file' //formDataAppender: function(formData, key, val){} // customize how data is added to the formData. // See #40#issuecomment-28612000 for sample code }).progress(function(evt) { console.log('progress: ' + parseInt(100.0 * evt.loaded / evt.total) + '% file :' + evt.config.file.name); }).success(function(data, status, headers, config) { // file is uploaded successfully alert('file ' + config.file.name + 'is uploaded successfully. Response: ' + data); }).error(function (data, status) { alert(data.error); }); //.then(success, error, progress); // returns a promise that does NOT have progress/abort/xhr functions //.xhr(function(xhr){xhr.upload.addEventListener(...)}) // access or attach event listeners to //the underlyin…
has comment: http://stackoverflow.com/comment/43754901
type: Question
has comment: http://stackoverflow.com/comment/43755103
accepted answer: http://stackoverflow.com/a/27670200
has comment: http://stackoverflow.com/comment/43755076
tagged with: javascript
has comment: http://stackoverflow.com/comment/43755181
score: 0
has answer: http://stackoverflow.com/a/27670200
answer count: 1
tagged with: angularjs

http://stackoverflow.com/a/27747971
type: Answer
score: 0
type: AcceptedAnswer
has body: It turns out I was adding child nodes after the fact. I'm using D3 to make a multiparent tree. I realize I could use a network map for that, but I found the force layout to be erratic and difficult to tame. The issue was a parent node would point to another parent's child. This caused unexpected behavior. To make a multiparent tree you have to manage the extra link connections outside of the tree layout. http://bl.ocks.org/robschmuecker/6afc2ecb05b191359862
accepted answer of: http://stackoverflow.com/q/27726743
answers question: http://stackoverflow.com/q/27726743

http://stackoverflow.com/a/27736258
has comment: http://stackoverflow.com/comment/43886183
answers question: http://stackoverflow.com/q/27736121
score: 0
has comment: http://stackoverflow.com/comment/43885171
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43933524
has comment: http://stackoverflow.com/comment/43913163
has comment: http://stackoverflow.com/comment/43884507
has body: isn't allowed inside . So the browser is putting all the tags outside the elements. When you do $(".playerCodeChoice").remove() it removes all the s, but the s are left. The solution is to remove + " " from your JS. BTW, all that repeated code in the if/else block is bothersome. Use CSS classes to assign the styles: .playerCodeChoice div { width:20px; height:20px; border-radius:5px; box-shadow: 2px 2px 2px #888888; } .playerCodeChoice div.red { background-color: #B30C15; } .playerCodeChoice div.green { background-color: #0D822C } .... $("#playersFinalCode").append(" ");
type: Answer

http://stackoverflow.com/q/27784895
answer count: 1
favorite count: 0
tagged with: d3.js
has answer: http://stackoverflow.com/a/27785752
tagged with: line
has title: D3 JS - Uncaught TypeError: Cannot read property 'length' of undefined - seems related to data issue
accepted answer: http://stackoverflow.com/a/27785752
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I see that there are several problems of this nature listed. So I have the same issue: D3 - Uncaught TypeError: Cannot read property 'length' of undefined. This occurs on line 42: d: lineFun(ds.monthlySales) Any ideas gratefully received, Thanks, Jerry My Code and json follow: fm Facilities Management Properties Properties Properties [{ "content": [ { "category": "Furniture", "region": "West", "monthlySales": [{ "month":1, "sales":38 }, { "month":2, "sales":40 }, { "month":3, "sales":41 }, { "month":4, "sales":39 }, { "month":5, "sales":43 }, { "month":6, "sales":35 }] }] } ]
type: Question
tagged with: charts
tagged with: javascript
upvote count: 1

http://stackoverflow.com/comment/43926402
type: Comment
type: QuestionComment
has text: @EmptyData, could you pls also upvote my answer if it's helpful to you, thanks
comment on: http://stackoverflow.com/q/27756792
score: 0

http://stackoverflow.com/q/27723894
score: 1
tagged with: mysql
type: Question
downvote count: 0
tagged with: javascript
has body: I'm developing a web application using (MySQL)EAN stack. I saved png/jpg/pdf as BLOB in MySQL. Now, I can retrieve them as Buffer objects in Node.js by using Sequelize.js: exports.loadUploadedFiles = function(req, res) { db.File.findAll().success(function(files) { //res.send(files[0].dataValues.data.toString('ascii')); // I have tried to convert a Buffer to ascii and sent it to Angular.js, however, I still don't know how to transform them to a file link. res.send(files); // How can I return the Buffer objects to Angular.js }).error(function(err) { console.log(err); res.sendStatus(500); }); }; I have tried two approaches: Return the Buffer objects to Angular.js, then, find a way to generate downloadable links from them. Convert the Buffer objects to ascii by using bufferObject.toString('ascii'), then, find a way to transform these ascii to downloadable links I have been trying for a day and still can't figure it out in both approaches :( , any suggestion would be highly appreciated!
has answer: http://stackoverflow.com/a/27724494
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: How to convert a Buffer object to a file in Node.js?
upvote count: 1
tagged with: node.js

http://stackoverflow.com/q/27781617
answer count: 1
tagged with: fullpage.js
favorite count: 0
has body: I am using FullPage.js for my project. I want to pause my background video while leaving the section, and resume when I back again from start or point it was paused. To do that I've add the following code: onLeave: function(index, nextIndex, direction){ //after leaving section 2 if(index == 1 &amp;&amp; direction =='down'){ alert("Going to section 1! Video should be paused right now"); } else if(index == 2 &amp;&amp; direction == 'up'){ alert("Going to section 1! The video should be running!"); $('video').get(0).play(); } } and then as you can see under this words i tried to pause video onLeave. Still not succesful. But it worked perfectly with example where the alert is displayed. Don't know what to do. Any guidance will be much appreciated. Here's part of my page's JS file: $(document).ready(function() { function initialization(){ $('#fullpage').fullpage({ verticalCentered: false, sectionsColor: ['#282828', '#ffffff', '#ffffff', '#ffffff', '#0b974d'], anchors: ['home', 'finder', 'info', 'calc', 'contact'], menu: '#mainNav', responsive: 1024, scrollOverflow: true, touchSensitivity: 15, normalScrollElementTouchThreshold: 5, keyboardScrolling: true, animateAnchor: true, css3: true, scrollingSpeed: 1500, autoScrolling: true, scrollBar: false, easing: 'easeInQuart', easingcss3: 'ease', afterRender: function(){ //playing the video $('video').get(0).play(); } ,//afterRender End afterLoad: function(anchorLink, index){ if(anchorLink == 'finder'){ $('#mainNav').hasClass('menu-bg2'); $('#mainNav').removeClass('menu-bg2'); $('#mainNav').addClass('menu-bg1'); } else if(anchorLink == 'info'){ $('#mainNav').hasClass('menu-bg1'); $('#mainNav').removeClass('menu-bg1'); $('#mainNav').addClass('menu-bg2'); } else if(anchorLink == 'home'){ $('#mainNav').hasClass('menu-bg1'); $('#mainNav').hasClass('menu-bg2'); $('#mainNav').removeClass('menu-bg1'); $('#mainNav').removeClass('menu-bg2'); } else if(anchorLink == 'contact'){ $('#mainNav').hasClass('menu-bg2'); $('#mainNav').removeClass(…
has comment: http://stackoverflow.com/comment/43986697
has comment: http://stackoverflow.com/comment/43979978
downvote count: 2
has title: FullPage.js - pause/play video
score: -2
tagged with: video
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27788341
type: Question
upvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27788341

http://stackoverflow.com/comment/43915402
type: QuestionComment
comment on: http://stackoverflow.com/q/27752194
has text: so you need to get user time
score: 0
type: Comment

http://stackoverflow.com/q/27649658
has comment: http://stackoverflow.com/comment/49209704
favorite count: 0
tagged with: angularjs
upvote count: 4
has title: Unknown provider: $resourceProvider - AngularJS
type: AnsweredQuestion
downvote count: 0
type: Question
has body: Getting the following message on my angularjs app: Error: [$injector:unpr] Unknown provider: $resourceProvider <- $resource <- Item http://errors.angularjs.org/1.3.8/$injector/unpr?p0=%24resourceProvider%20%3C-%20%24resource%20%3C-%20Item at http://localhost:49717/Scripts/angular.js:63:12 at http://localhost:49717/Scripts/angular.js:3994:19 at Object.getService [as get] (http://localhost:49717/Scripts/angular.js:4141:39) at http://localhost:49717/Scripts/angular.js:3999:45 at getService (http://localhost:49717/Scripts/angular.js:4141:39) at Object.invoke (http://localhost:49717/Scripts/angular.js:4173:13) at Object.enforcedReturnValue [as $get] (http://localhost:49717/Scripts/angular.js:4035:37) at Object.invoke (http://localhost:49717/Scripts/angular.js:4182:17) at http://localhost:49717/Scripts/angular.js:4000:37 at getService (http://localhost:49717/Scripts/angular.js:4141:39) My app.js 'use strict'; var SalesApp = angular.module('SalesApp', ['ngRoute']). config(['$routeProvider', function ($routeProvider) { $routeProvider. when('/', { controller: ItemCtrl, templateUrl: 'item.html' }). otherwise({ redirectTo: '/' }); }]); SalesApp.factory('Item', function ($resource) { return $resource('/api/Item/:iid', { iid: '@iid' }, { update: { method: 'PUT' } }); }); var ItemCtrl = function ($scope, $location, Item) { $scope.items = Item.query(); }; Scripts that I load Can't figure out what could possibly have gone wrong? For the sake of simplicity I'm keeping the ItemCtrl in the app.js file, don't know how I would do it otherwise?
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/27649692
accepted answer: http://stackoverflow.com/a/27649692
answer count: 1

http://stackoverflow.com/comment/43943766
type: Comment
comment on: http://stackoverflow.com/q/27766362
type: QuestionComment
has text: subdata holds json sent by PHP in `req.body`
score: 0

http://stackoverflow.com/comment/43955599
comment on: http://stackoverflow.com/q/27772323
type: QuestionComment
type: Comment
has text: `(function(mark){ return function(){ console.log(mark); } })('test')` I believe this is what you mean?
score: 1

http://stackoverflow.com/a/28255333
type: Answer
answers question: http://stackoverflow.com/q/27645133
score: 0
has body: Js2coffee 2.0 is now out and fixes this. <a href="http://js2.coffee/#try:%0A%0A%20%20%24%28document%29.ready%28function%20%28%29%20%7B%0A%20%20%20%20if%20%28isPhoneDevice%29%20%7B%0A%20%20%20%20%20%20%2F%2Fmobile%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%2F%2Fdesktop%0A%20%20%20%20%20%20%2F%2F%20Initialize%20WOW.js%0A%20%20%20%20%20%20wow%20%3D%20new%20WOW%28%7B%0A%20%20%20%20%20%20%20%20offset%3A%2050%0A%20%20%20%20%20%20%7D%29%0A%20%20%20%20%20%20wow.init%28%29%3B%0A%20%20%20%20%7D%0A%20%20%7D%29%3B" rel="nofollow">Demo here. btw: as the site would point out, you have a global variable leak you may want to fix (using var wow = ...).

http://stackoverflow.com/comment/43943734
has text: var =$number['desc']; echo ' <a href="desc.php?var=<?= '.$var.' ?>">
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27766440
type: Comment

http://stackoverflow.com/q/27690013
has comment: http://stackoverflow.com/comment/43793597
has comment: http://stackoverflow.com/comment/43793675
accepted answer: http://stackoverflow.com/a/27690121
type: AnsweredQuestion
has title: Split an object into arrays
has comment: http://stackoverflow.com/comment/43793528
has comment: http://stackoverflow.com/comment/43793748
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/27690121
score: 0
has body: I'm currently writing a library using jQuery, and I'm facing a wall I can't pass alone. First, here is some code : (function($) { // default options var defaults = { option1: "what ever", option2: "what ever" }; // available methods var methods = { method1: function(param1) { console.log(param1); /* ... */ }, method2: function(param1, param2) { console.log(param1); console.log(param2); // gives undefined /* ... */ } }; // Where magic happens $.fn.pskChart = function(params) { if (methods[params] != undefined) { if (this.length &gt; 0) { return $(this).each(function(i) { return methods[params].apply($(this), Array.prototype.slice.call(arguments, 1)); }); } } else { $.error("Method " + params + " doesn't exist for pskChart"); } } })(jQuery); $("#sample").pskChart("method1", "param1"); // will work $("#sample").pskChart("method2", "param1", "param2"); // won't work This code is working in case I provide only two parameters (method and another parameter), but won't work if I have more parameters I understand that Array.prototype.slice.call(arguments, 1) returns only one object containing all the remaining arguments. In the second example, method2 will be called with only one parameter that contains ["param1","param2"] I would like to "split" this object in order to provide as many parameters I have. I feel like methods[params].apply($(this), Array.prototype.slice.call(arguments, 1)); but I have no clue how to fix it. Note that I could have an infinite (or at least big) number of parameters (in addition to the method, that will always be first). Playing with Array.slice would not be a great (nor proper) solution.
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27772211
tagged with: enquire.js
has body: I have a piece of code this piece of code that gets executed as part of changing routes in a Backbone app: mediaMatchUnRegister: function () { if (this.mediaMatchState.registered) { enquire.unregister(this.mediaMatchState.tabletAndUpQuery) .unregister(this.mediaMatchState.mobileQuery); this.mediaMatchState.registered = false; } } This all runs just fine, except under the following conditions: App is running in Chrome I have clicked the Print button on that page, which brought up the Chrome print preview dialog. If I haven't brought up the Chrome print preview dialog then it runs just fine. FF and IE, which don't have this dialog, don't have any problems with this. The issue is in enquire.js, specifically in the clear() method: clear : function() { each(this.handlers, function(handler) { handler.destroy(); }); this.mql.removeListener(this.listener); this.handlers.length = 0; //clear array }, If I haven't triggered the print preview dialog this.mql is a MediaQueryList. If I have triggered it then this.mql is now a MediaQueryListEvent. It then fails because this object does not seem to have the removeListener method. Has anyone else encountered this? Is the Chrome print preview dialog a red herring?
tagged with: backbone.js
type: UnansweredQuestion
tagged with: google-chrome
has answer: http://stackoverflow.com/a/29210956
tagged with: media-queries
type: Question
answer count: 1
tagged with: javascript
has title: emquire.js and Chrome print dialog issu
score: 0

http://stackoverflow.com/q/27801176
upvote count: 2
has answer: http://stackoverflow.com/a/27801267
accepted answer: http://stackoverflow.com/a/27801267
has comment: http://stackoverflow.com/comment/44011302
has body: related to How can I call a javascript constructor using call or apply? but not the same, I'm trying to apply the SO answers to John Resig's forcing a constructor when not called properly. function User(first, last){ if ( !(this instanceof User) ) // the line I want to replace, or remove the redundancy from: return new User(first, last); this.name = first + " " + last; } var name = "Resig"; var user = User("John", name); assert( user, "This was defined correctly, even if it was by mistake." ); assert( name == "Resig", "The right name was maintained." ); The target line of code means every time the constructor changes, someone has to remember to change the internal self-call arguments. I've already had a project trip over this issue 3 times in the last 3 days. All the examples in the linked question talk about passing the constructor, but what is the constructor in this case? It's not even finished being defined yet. but so far all attempts do not pass the test, or throw a stackoverflow. How do I make sure the constructor being called results in something that responds properly to instanceof User even when called without the new keyword, while eliminating the repetition of argument parameters?
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/44011351
has comment: http://stackoverflow.com/comment/44011001
possible better answer: http://stackoverflow.com/a/34222262
tagged with: resig
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/3362471
has title: can you use call or apply with new?
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44011415
has comment: http://stackoverflow.com/comment/44011049
has comment: http://stackoverflow.com/comment/44011237
has answer: http://stackoverflow.com/a/34222262
favorite count: 0

http://stackoverflow.com/a/27711546
accepted answer of: http://stackoverflow.com/q/27711424
type: Answer
has body: You really have too much code, it is not necessary for your purposes to bury a load() statement in an AJAX call. You could simply do this - $(document).ready(function(){ $('#containerWrapper').on('click', '.holder a', function (event) { event.preventDefault(); var url = "cart.php"; var page = $(this).attr('id'); $('#containerWrapper').load(url + " #containerWrapper", {page: page}); }); }); load() does allow you to send data to the requested page via a second arguement.
has comment: http://stackoverflow.com/comment/43840480
answers question: http://stackoverflow.com/q/27711424
type: AcceptedAnswer
score: 0

http://stackoverflow.com/a/27757699
answers question: http://stackoverflow.com/q/27757483
accepted answer of: http://stackoverflow.com/q/27757483
type: Answer
score: 2
downvote count: 0
has body: You actually are getting the behavior you desire, but i is always 4 at the end of your promises because it is incremented before any of the then handlers execute (your for loop is synchronous but your handlers are asynchronous). Normally promises passed to all are not resolved synchronously, but since you are creating a chain by thening of each promise your calls will only fire after the preceeding one has completed. On a side note: I am not super familiar with Parse's promise implementation, but you can probably save yourself creating an extra array and calling Parse.Promise.when by just returning the promise chain from your function: function createCards(qty) { // create a resolved promise that starts the "chain" // for Parse prommises use Parse.Promise.as(); var promiseChain = Parse.Promise.as(); // start the for loop for (i=0;i&lt;qty;i++) { // add another promise onto our chain // you can `then` or `catch` off of this // now if you want promiseChain = promiseChain.then(function () { // ... any additional logic card.save(); }); } return promiseChain; } // usage createCards(5) .then(function () { console.log('finished'); });
upvote count: 2
has comment: http://stackoverflow.com/comment/43929887
type: AcceptedAnswer

http://stackoverflow.com/q/27794166
has answer: http://stackoverflow.com/a/27794546
has answer: http://stackoverflow.com/a/27796347
has title: Getting "This" into a namespace in Javascript
answer count: 3
tagged with: this
downvote count: 0
favorite count: 0
tagged with: namespaces
accepted answer: http://stackoverflow.com/a/27794546
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43997452
has answer: http://stackoverflow.com/a/27794203
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43997553
has body: I'm sure this should be a simple question but I'm still learning so here it goes: I have some code to run a function on click to assign the clicked element's ID to a variable but I don't know how to pass the "this.id" value to the namespace without making a global variable (which I thought was bad). &lt;script&gt; fsa = (function() { function GetTemplateLoc() { templateId = document.activeElement.id; alert(templateId + templateId2); } return { GetTemplateLoc: GetTemplateLoc, } })(); //call the functions $(document).on('click', '.template', function () { fsa.GetTemplateLoc(); }); &lt;/script&gt; and HTML with random picture: &lt;img id="template-1" class="template" src="http://fc02.deviantart.net/fs70/f/2010/028/c/b/cb21eda885b4cc6ee3f549a417770596.png"/&gt; &lt;img id="template-2" class="template" src="http://fc02.deviantart.net/fs70/f/2010/028/c/b/cb21eda885b4cc6ee3f549a417770596.png"/&gt;
possible better answer: http://stackoverflow.com/a/27794203
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/27801622
accepted answer of: http://stackoverflow.com/q/27801534
answers question: http://stackoverflow.com/q/27801534
type: Answer
score: 2
downvote count: 0
has body: If you call bind with more than 2 arguments, then it will store those arguments. When you call the function returned by bind, then it will call it using those arguments. If you call bind with 2 or fewer arguments, then when you call the function returned by bind, it will call it with the arguments you pass at the time. This does not appear to be a correct implementation of bind. If you want a bind polyfill, then use the one from MDN
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/a/49695659
type: Answer
has body: this work perfectly //Option Select var range = []; for (var i=1; i&lt;$scope.totalItems+1; i++) { range.push({value:i}); } console.log(range);
answers question: http://stackoverflow.com/q/27694873
score: 0

http://stackoverflow.com/a/27704572
accepted answer of: http://stackoverflow.com/q/27659818
type: AcceptedAnswer
has body: What you need is a line chart with multiple x axes, like this: To use a multiple x chart in c3js, you must declare several xs values. I guessed you would need to add dates here and there, so I made the arrays containing data and dates global. The function at bottom pushes new dates and data to the arrays. To load those variables into c3js, use the concat function. //Declare three x axes, and a dataset for each axis. var periodOne = ['2013-01-01', '2013-01-04', '2013-01-07','2013-01-11','2013-01-15']; var periodTwo = ['2013-01-02', '2013-01-04', '2013-01-06','2013-01-08', '2013-01-10','2013-01-13', '2013-01-15','2013-01-18', '2013-01-22']; var periodThr = ['2013-01-05', '2013-01-10', '2013-01-15','2013-01-20', '2013-01-25']; var xOne = [12,31,14,13,34]; var xTwo = [11,13,14,23,63,27,21,19,15]; var xThr = [12,32,13,13,23]; var chart = c3.generate({ data: { xs:{ //Declare the axes 'Winter 08,09': 'x1', 'Winter 09,10': 'x2', 'Winter 10,11': 'x3' }, columns: [ ['x1'].concat(periodOne), ['x2'].concat(periodTwo), ['x3'].concat(periodThr), ['Winter 08,09'].concat(xOne), ['Winter 09,10'].concat(xTwo), ['Winter 10,11'].concat(xThr) ] }, axis: { x: { type: 'timeseries' } } }); //You don't need this for multiple x axes, it's just to push data to arrays function push(oneValue, oneDate, twoValue, twoDate, thrValue, thrDate){ periodOne[periodOne.length] = oneDate; xOne[xOne.length] = oneValue; periodTwo[periodTwo.length] = twoDate; xTwo[xTwo.length] = twoValue; periodThr[periodThr.length] = thrDate; xThr[xThr.length] = thrValue; chart.load({ columns: [ ['x1'].concat(periodOne), ['x2'].concat(periodTwo), ['x3'].concat(periodThr), ['Winter 08,09'].concat(xOne), ['Winter 09,10'].concat(xTwo), ['Winter 10,11'].concat(xThr) ] }); } //Use this function to push new data push(13, '2013-01-19', 23, '2013-01-24', 17, '2013-01-30');
has comment: http://stackoverflow.com/comment/43830880
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27659818
has comment: http://stackoverflow.com/comment/43838163
upvote count: 2

http://stackoverflow.com/comment/43817910
comment on: http://stackoverflow.com/q/27698714
type: Comment
score: 1
type: QuestionComment
has text: Does it behave the same if you exchange `open` for `thenOpen`? Note: CasperJS runs on top of PhantomJS which doesn't use node at all.

http://stackoverflow.com/comment/43938394
type: Comment
has text: It's in docs: http://docs.amcharts.com/3/javascriptstockchart/AmStockChart#dataDateFormat
comment on: http://stackoverflow.com/a/27756142
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43894118
type: Comment
type: QuestionComment
has text: @anpsmn: can you please see this link http://jsfiddle.net/t90096vs/
score: 0
comment on: http://stackoverflow.com/q/27739684

http://stackoverflow.com/q/27679904
linked to: http://stackoverflow.com/q/1000597
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43778194
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43774650
has body: I have a working text area that autoresize height according to input using JS function, I tried to add JS function to disable ENTER behavior adding new line but didn`t work. Post title http://jsfiddle.net/ihabovich/kepjdgnL/
upvote count: 1
tagged with: textarea
answer count: 1
has title: Prevent text area ENTER behavior with autoresize height to content
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27680043

http://stackoverflow.com/a/27755193
has comment: http://stackoverflow.com/comment/43921033
has comment: http://stackoverflow.com/comment/43921080
has comment: http://stackoverflow.com/comment/43921070
upvote count: 0
downvote count: 2
answers question: http://stackoverflow.com/q/27755168
type: Answer
score: -2
has comment: http://stackoverflow.com/comment/43921238
has comment: http://stackoverflow.com/comment/43921052
has comment: http://stackoverflow.com/comment/43921092
has body: You should consider using jquery for that. If you have you html on a string, then just do $('&lt;div&gt;' + myHtml + '&lt;/div&gt;').find('img').attr('src'); To parse it. If you are not using jquery, you could try something like: new DOMParser().parseFromString(myHtml, "text/html"); With plain js to get the dom.

http://stackoverflow.com/comment/43997479
type: QuestionComment
comment on: http://stackoverflow.com/q/27791940
has text: (a) Try [Bootlinting](https://github.com/twbs/bootlint) your page (b) Show us the ` ` code!
score: 0
type: Comment

http://stackoverflow.com/comment/43793700
comment on: http://stackoverflow.com/q/27689925
score: 0
has text: You can simplify this problem; Say `var a = ['fizz'], b, foo;` then consider `foo = a; foo[0] = 'buzz'; b = foo;` vs `foo = a.slice(0); foo[0] = 'buzz'; b = foo;` then finally look at what you have as `a` and `b` --- hint in the first `foo === a`, in the second `foo !== a`
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27799268
answers question: http://stackoverflow.com/q/27799256
upvote count: 4
score: 4
type: AcceptedAnswer
downvote count: 0
has body: In jQuery you need to use css method: $('#btn').css( 'font-weight', '700' ); jsFiddle
accepted answer of: http://stackoverflow.com/q/27799256
type: Answer

http://stackoverflow.com/q/27733843
has body: What i am trying to do here was to pass the form values to a function in controller via jquery ajax post upon submit. here's the code for the view &lt;form action="&lt;?php echo site_url('products/paypal')?&gt;" method="post" id="checkoutForm" name="checkoutForm"&gt; ... &lt;/form&gt; &lt;script type="text/javascript"&gt; ... $.post($('#checkoutForm').attr('action'), $('#checkoutForm').serialize()); ... &lt;/script&gt; The controller will process the post variables then should execute this line of code $this-&gt;paypal-&gt;pay(); that will redirect the user to other url. Here's the code for a function in the controller (products.php) public function paypal() { //... paypal configuration $this-&gt;paypal-&gt;pay(); //Proccess the payment } Here's the code for a function in the library (Paypal.php) function pay(){ #Convert the array to url encode variables $vars = http_build_query($this-&gt;config); if($this-&gt;config['production'] == TRUE){ header('LOCATION:'.$this-&gt;production_url.$vars); }else{ header('LOCATION:'.$this-&gt;sandbox_url.$vars); } } The problem is that the user is not being redirected. What could be the problem in this one? Thanks in advance.
type: AnsweredQuestion
tagged with: codeigniter
has title: The server immediately return to the ajax post without executing a code for redirect
type: Question
has answer: http://stackoverflow.com/a/27733955
accepted answer: http://stackoverflow.com/a/27733955
tagged with: javascript
duplicate of: http://stackoverflow.com/q/3513971
score: 0
answer count: 1
tagged with: jquery
tagged with: ajax
linked to: http://stackoverflow.com/q/3513971
tagged with: php

http://stackoverflow.com/comment/43732017
has text: 'cos there's a jQuery tag and the OP has jQuery code… not. Dunno what *attr* does these days, it used to be broken. Setting the selected attribute doesn't necessarily select the option, setting the selected property does, always.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27658012

http://stackoverflow.com/comment/43767567
comment on: http://stackoverflow.com/q/27675968
score: 0
type: Comment
type: QuestionComment
has text: @ckuijjer: add preloader before image load complete in each slide.

http://stackoverflow.com/q/27713760
has answer: http://stackoverflow.com/a/74033744
type: Question
has comment: http://stackoverflow.com/comment/43840558
linked to: http://stackoverflow.com/q/605434
tagged with: javascript
tagged with: markdown
answer count: 2
has comment: http://stackoverflow.com/comment/43839856
downvote count: 0
has answer: http://stackoverflow.com/a/27713876
has body: This is not a duplicate of this question. I want to make my own rules to a markdown parser like the one here in StackOverflow. That means, converting *italic* into italic. I know there are a lot of Parsers out there, but i don't understand them. The question previously mentioned doesn't really give me a lot to go on, it just links to more parsers and doesn't explain how they work. So I would like to know the basics, or the logic, of creating a whole markdown parser, and if you think explaining it to me it's not a pleasent task then don't. Thanks for understanding :)
favorite count: 0
score: 8
tagged with: parsing
upvote count: 8
has title: Create custom markdown parser with JavaScript
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27713876
possible better answer: http://stackoverflow.com/a/74033744

http://stackoverflow.com/a/61383688
answers question: http://stackoverflow.com/q/27709636
upvote count: 4
score: 4
has body: Also if you are searching for only values are empty within the object, Object.values({ key: 0, key2: null, key3: undefined, key4: '' }).some(e =&gt; Boolean(e)) // false Object.values({ key: 0, key2: null, key3: undefined, key4: "hello" }).some(e =&gt; Boolean(e)) // true Object.values({ key: 1, key2: "hello" }).some(e =&gt; Boolean(e)) // true
downvote count: 0
type: Answer

http://stackoverflow.com/q/27720175
has comment: http://stackoverflow.com/comment/43852641
type: UnansweredQuestion
tagged with: django
tagged with: python
has title: accessing input tag values from html in backend using post method
type: Question
has comment: http://stackoverflow.com/comment/43852515
tagged with: javascript
has answer: http://stackoverflow.com/a/27720536
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: Hi guys i am new to html and javascript. my application is to create a table from a list of list went from backend, after creating them dynamically(as length of the list is not known) i need to access some particular values of the table in python backend, when i tried to do this i am able to fetch the value in backend, but the value is not the desired value. The value which it returns is the last element of that table. given below is my code {% for result in list1 %} {{result.0}} {{result.1}} {% if result.1 == "HR_Interview" %} COL {% elif result.1 == "Internal_Interview" %} HR_Interview COL {% elif result.1 == "COL" %} CS {% elif result.1 == "CI" %} CIS {% elif result.1 == "CIS" %} Joining {% elif result.1 == "CS" %} CI {% elif result.1 == "Line_up" %} Internal_Interview HR_Interview COL {% endif %} {{result.2}} {{result.3}} {{result.4}} {{result.5}} {{result.6}} {{result.7}} {{result.8}} {{result.9}} {{result.10}} {{result.11}} {{result.12}} {{result.13}} {{result.14}} {{result.15}} {{result.16}} {{result.17}} this is a django application my application is when i press on the save button which is formed in every row i need to get that particular row's client name and candidate name kindly help me with this

http://stackoverflow.com/comment/44011893
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27801547
has text: you could also use a ` ` and call `form.submit` from the ``'s click handler if you really need POST.
score: 0

http://stackoverflow.com/q/27645876
accepted answer: http://stackoverflow.com/a/27646128
possible better answer: http://stackoverflow.com/a/27646048
has answer: http://stackoverflow.com/a/27646048
tagged with: decimalformat
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43709872
has comment: http://stackoverflow.com/comment/43709862
score: 0
has body: I have a number 10.625 In JavaScript 10.625.toFixed(2) //gives 10.63 In Java, Double.valueOf(new DecimalFormat("###.##").format(Double.valueOf("10.625"))) //gives 10.62 How I can achieve unique output both at client and server side?
tagged with: java
has answer: http://stackoverflow.com/a/27646173
has comment: http://stackoverflow.com/comment/43709855
type: Question
has comment: http://stackoverflow.com/comment/43709869
linked to: http://stackoverflow.com/q/5710394
has answer: http://stackoverflow.com/a/27646128
tagged with: javascript
has answer: http://stackoverflow.com/a/27646063
has comment: http://stackoverflow.com/comment/43709954
has title: Conflicts between toFixed() in JavaScript and DecimalFormat in Java

http://stackoverflow.com/a/27695610
type: Answer
has comment: http://stackoverflow.com/comment/43806640
answers question: http://stackoverflow.com/q/27695246
has comment: http://stackoverflow.com/comment/43804535
has body: Work it out from the inside out. First, you need to be able to take a single record and calculate a total. This means, getting a single table row, getting the quantity and price, and multiplying them together. var record = document.getElementById('shopTable').rows[0]; var quantity = parseInt(record.cells[2].children[0].value, 10); var price = parseFloat(record.cells[1].innerHTML); var recordTotal = quantity*price; Next step would be to implement this into a loop that does the same for each record in the data structure, and then finally rounds the result off to two decimal places. var records = document.getElementById('shopTable').rows, i, total = 0, quantity, price; for (i = 0; i < records.length; i++) { quantity = parseInt(records[i].cells[2].children[0].value, 10); price = parseFloat(records[i].cells[1].innerHTML); total += quantity * price; } total = total.toFixed(2); Runnable Example: var records = document.getElementById('shopTable').rows, i, total = 0, quantity, price; for (i = 0; i < records.length; i++) { quantity = parseInt(records[i].cells[2].children[0].value, 10); price = parseFloat(records[i].cells[1].innerHTML); total += quantity * price; } total = total.toFixed(2); document.getElementById('result').innerHTML = total; #result { color: green; } name... 2.56 name... 6.52 name... 5.26 n/a
score: 0

http://stackoverflow.com/comment/43836393
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27712014
type: Comment
has text: You can't scan a folder, you can get files with ajax, but there's no way to know what files are in a folder, short of trying every possible filename, using clientside code.

http://stackoverflow.com/q/27798126
type: Question
answer count: 5
linked to: http://stackoverflow.com/q/34339593
has answer: http://stackoverflow.com/a/27798313
has answer: http://stackoverflow.com/a/27798235
has answer: http://stackoverflow.com/a/58625431
tagged with: javascript
score: 48
tagged with: dom
has comment: http://stackoverflow.com/comment/44004830
accepted answer: http://stackoverflow.com/a/27798235
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/16245767
downvote count: 0
upvote count: 48
has answer: http://stackoverflow.com/a/71157307
has title: How to open the newly created image in a new tab?
tagged with: jquery
possible better answer: http://stackoverflow.com/a/54466127
has body: Below code creates the image in the bottom of the same page. How to display that image into a new tab/window instead of displaying in the same page? success: function (data) { var image = new Image(); image.src = "data:image/jpg;base64," + data.d; document.body.appendChild(image); }
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/54466127

http://stackoverflow.com/q/27716146
score: 0
has comment: http://stackoverflow.com/comment/43844444
answer count: 1
tagged with: javascript
has body: I am unable to access the constructor variable in RandObj.exampleFunction (this.name = "steven") in Example 1 due to the fact that the scoping of this in RandObj is limited to just the RandObj itself. This is because I have what I believe is a nested prototype going on, but I would like to keep this nested prototype since it is necessary for what I am trying to build out. I understand that I can access 'this.name' using example 2, but I would like to keep the structure that I have in example 1. //EXAMPLE 1 define(function() { 'use strict'; var Wrapper = function(nameIn) { this.name = nameIn; }; Wrapper.prototype = { RandObj: { exampleFunction: function() { this.name = "steven"; } } }; return Wrapper; }); //EXAMPLE 2 define(function() { 'use strict'; var Wrapper = function(nameIn) { this.name = nameIn; }; Wrapper.prototype = { exampleFunction: function() { this.name = "steven"; } }; return Wrapper; });
has title: how to access javascript constructor variables in nested prototype
has comment: http://stackoverflow.com/comment/43844698
type: UnansweredQuestion
type: Question
tagged with: prototypejs
has answer: http://stackoverflow.com/a/27716326

http://stackoverflow.com/a/27706384
answers question: http://stackoverflow.com/q/27705688
upvote count: 3
score: 3
downvote count: 0
type: Answer
has body: myVar must be declared outside the function to be visible in another functions includeFile.blade.php &lt;script&gt; var myVar; // Create global variable $(document).ready(function () { myVar = "Hello world"; }); &lt;/script&gt; default.blade.php @include('layouts.includeFile') &lt;script&gt; $(document).ready(function () { alert(myVar); }); &lt;/script&gt;

http://stackoverflow.com/comment/44046436
comment on: http://stackoverflow.com/q/27798822
score: 1
has text: You have to use a custom dimension in the user scope in addition to the user id (you can use the same value, the dimension is needed to expose the value in the interface). Bear in mind that you must not use anything that reveals the users identitiy (an id that you tie to your backend system is okay, though) and no unqiue device identifiers (IMEI and the like). Custom dimensions do not show up in standard reports, you need to create custom reports.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27757862
has answer: http://stackoverflow.com/a/27758712
upvote count: 1
has comment: http://stackoverflow.com/comment/43926665
downvote count: 1
type: Question
tagged with: flot
tagged with: javascript
tagged with: jquery
score: 0
has title: Why is my Flot plot function not working?
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43927180
has body: I'm trying to follow this tutorial to make a simple graph. However, I'm getting an empty divider when I load the page. Relevant code: I have page.php in the www directory, then the two .js files in www/js/flot
has comment: http://stackoverflow.com/comment/43926380

http://stackoverflow.com/a/27787848
has comment: http://stackoverflow.com/comment/43985792
answers question: http://stackoverflow.com/q/27787639
has comment: http://stackoverflow.com/comment/43985903
score: 0
has body: Try using returning a JSON array with the two return values: JavaScript: $.ajax({ url:'test', type:'POST', data:{id:id}, dataType:'json', cache:false, success: function(data){ $('#resp_top').html(data[0]).find('#top'); $('#resp_bot').html(data[1]).find('#bottom'); } }) PHP: echo "&lt;div id='top'&gt;".$top_content."&lt;/div&gt;"; echo "&lt;div id='bottom'&gt;".$bottom_content."&lt;/div&gt;"; echo json_encode(array("&lt;div id='top'&gt;".$top_content."&lt;/div&gt;", "&lt;div id='bottom'&gt;".$bottom_content."&lt;/div&gt;"));
type: Answer

sequelize.js
type: Tag
tags question: http://stackoverflow.com/q/27746571
tags question: http://stackoverflow.com/q/27685208
tags question: http://stackoverflow.com/q/27761772
tag name: sequelize.js
tags question: http://stackoverflow.com/q/27782774

http://stackoverflow.com/q/27783016
has title: How are these operators affecting this simple javascript program?
favorite count: 0
tagged with: while-loop
has comment: http://stackoverflow.com/comment/43976233
tagged with: operators
has comment: http://stackoverflow.com/comment/43975980
has body: This is probably embarrassingly obvious but I can't seem to figure it out: I've researched what all of these operators mean and commented out what I think they're doing. Apparently total = 55. I thought it would = 11. Where am I going wrong? Thanks a lot. var total = 0; var count = 1; while (count &lt;= 10) { // while "count" is less than or equal to 10 do... total += count; // total = total + count (total = 0 + count) count += 1; // count = 1 + 1 (adding 1 to count every loop until count is equal to 11) }; console.log(total); -&gt; 55 // total is 0 + count // when the program ends count = 11 // 0 + 11 = 11
downvote count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27783225
possible better answer: http://stackoverflow.com/a/27783186
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27783186
score: -2
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43976005
accepted answer: http://stackoverflow.com/a/27783225
tagged with: javascript

http://stackoverflow.com/a/27724093
answers question: http://stackoverflow.com/q/27723596
has comment: http://stackoverflow.com/comment/43860737
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43860542
has comment: http://stackoverflow.com/comment/43860237
has comment: http://stackoverflow.com/comment/43860754
has comment: http://stackoverflow.com/comment/43860479
has comment: http://stackoverflow.com/comment/43860698
has comment: http://stackoverflow.com/comment/43860765
accepted answer of: http://stackoverflow.com/q/27723596
has body: Regarding the heights, one approach would be to use the vh keyword, which is 1% of the height of the viewport. It's only valid in IE9 up, but as I'm guessing this is a mobile screenshot, you should be ok. You should also consider using flexbox, which works fine in mobile browsers, and it allows you to do vertical centering without all the messiness of display:table. ul{ display:flex; flex-direction: column; margin: 0; padding: 0; height: 100vh; border: 1px solid red; width:24em; } li{ display:flex; flex-direction: row; justify-content:space-around; align-items:center; } li &gt; div { flex-grow:1; flex-shrink:1; max-width: 50%; display:flex; flex-direction: column; justify-content: center; align-items: center; } li:nth-child(even){ background: gray; } ul &gt; li { height: 20vh; } Here's a dabblet: http://result.dabblet.com/gist/78afacb7e747b7e24e62/ba0f81dc9278ec743c58027e995a0f6c381329b8 http://dabblet.com/gist/78afacb7e747b7e24e62

http://stackoverflow.com/q/27716667
tagged with: fakeweb
favorite count: 0
has comment: http://stackoverflow.com/comment/43897526
tagged with: request
accepted answer: http://stackoverflow.com/a/27743477
tagged with: node.js
has title: How to return object instead of string for response with nock?
type: AnsweredQuestion
downvote count: 0
score: 7
has answer: http://stackoverflow.com/a/27743477
type: Question
has comment: http://stackoverflow.com/comment/43846023
answer count: 1
tagged with: javascript
has body: When I stub request with nock it returns String result instead of Object even with 'Content-Type': 'application/json': var response = { success: true, statusCode: 200, body: { "status": "OK", "id": "05056b27b82", } }; Test.BuildRequest(); Test.SendRequest(done); nock('https://someapi.com') // also tried // .defaultReplyHeaders({ // 'Content-Type': 'application/json', // 'Accept': 'application/json' // }) .post('/order') .reply(200, response.body, 'Content-Type': 'application/json', 'Accept': 'application/json'); checking: console.log(put.response.body); console.log(put.response.body.id); output: {"status":"OK","id":"05056b27b82"} undefined In code I use request module that returns Object with the same data. I tried also sinon (doesn't work for me) and fakeweb but got the same issue. My code, which i'm trying to test: var request = require('request'); // ... request(section.request, function (err, response, body) { if (err || _.isEmpty(response)) return result(err, curSyndication); //if (_.isString(body)) // body = JSON.parse(body); section.response.body = body; console.log(body.id); // =&gt; undefined (if uncomment previous code - 05056b27b82) _this.handleResponse(section, response, body, result); }); And it returns an object in real requests. PS. I could add next code in my response handler: if (_.isString(body)) body = JSON.parse(body); But some of queries returns xml string, and i'm not responsible for such changes. Fakeweb: fakeweb.registerUri({ uri: 'https://someapi.com/order', body: JSON.stringify({ status: "OK", id: "05056b27b82", }), statusCode: 200, headers: { 'User-Agent': 'My requestor', 'Content-Type': 'application/json', 'Accept': 'application/json' } }); Test.SendRequest(done); Same results. Updated: I read a couple of articles, that uses JSON Object, without parsing it (with nock), so it should returns JSON object, same way how request library do that.
has comment: http://stackoverflow.com/comment/43897373
tagged with: nock
has comment: http://stackoverflow.com/comment/43845879
has comment: http://stackoverflow.com/comment/43845739
linked to: http://stackoverflow.com/q/14689252
upvote count: 7

http://stackoverflow.com/a/27784180
has comment: http://stackoverflow.com/comment/43978552
upvote count: 1
has comment: http://stackoverflow.com/comment/43978426
type: Answer
has comment: http://stackoverflow.com/comment/43978660
downvote count: 0
has body: Consider you have following JSON data stored in a scope variable named data: $scope.data = { "array": [ 1, 2, 3 ], "boolean": true, "null": null, "number": 123, "object": { "a": "b", "c": "d", "e": "f" }, "string": "Hello World" } Then you write your HTML in the following way like: Boolean: {{data.boolean}} Number: {{data.number * 2}} Array: {{key}} : {{value}} Another way to bind Here you can stop your call. You can use enhanced angular service $interval for this: $scope.getData = function(){ var url = "{% static "" %}tmp/{{url_hash}}/{{url_json}}"; $http.get(url) .success(function(data, status, headers, config) { console.log(data); $interval.cancel($scope.intervalObject); // cancel the interval when data is loaded }); }; if (!$scope.data){ $scope.intervalObject = $interval($scope.getData, 2000); }
score: 1
has comment: http://stackoverflow.com/comment/43979246
answers question: http://stackoverflow.com/q/27784072

http://stackoverflow.com/comment/43976923
has text: @JosephMarikle It's still not appearing for some reason. Another thing I thought is that because the HTML is generated by the JavaScript I'd have to make sure the code is executed after the elements are generated since it's a SharePoint web part. Do you know if there's anyway to ensure this?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27782909

http://stackoverflow.com/comment/43973172
score: 0
type: Comment
type: QuestionComment
has text: That's odd! Do you by any chance have the CSS rule: `visibility:hidden` anywhere in your markup or CSS file?
comment on: http://stackoverflow.com/q/27781358

http://stackoverflow.com/a/27678039
type: Answer
has comment: http://stackoverflow.com/comment/43779905
score: 1
upvote count: 1
has body: Assuming that that you don't need eval_expression to be fully parsed for any other purpose (i.e., it's not part of expression), then the only thing you need to know is where the expression terminates. It's probably reasonable to assume that it has balanced parentheses, so it will span any sequence of tokens whose parentheses balance, which can be recognized with something like: balanced_paren_sequence: | balanced_paren_sequence balanced_paren_object ; /* Since jison has no wild cards, you need this complete list */ balanced_paren_object: '(' balanced_paren_sequence ')' | '+' | '-' | '*' | '/' | ... | `[` | `]` | '{' | '}' | ... | IDENTIFIER | CONSTANT | ... ; The list of possible RHS for balanced_paren_object will include every token in your language except ( and ). As shown, it includes other balanced pairs, like [/] and {/}. You could force these to balance as well, by adding rules analogous to the first production for balanced_paren_object, but that is only useful to improve error reporting; as written, the parser will accept certain incorrect constructs involving unbalanced brackets, but since you are not doing detailed parsing, your parser is going to end up accepting certain incorrect constructs anyway. You could inline the definition of balanced_paren_object into balanced_paren_sequence (and indeed, you could use eval_expression as the name of that non-terminal if there is only one type of expression whose detailed parse tree you don't need); I wrote it as above in a vague attempt to be legible.
downvote count: 0
answers question: http://stackoverflow.com/q/27677744
accepted answer of: http://stackoverflow.com/q/27677744
type: AcceptedAnswer

http://stackoverflow.com/q/27749521
type: Question
score: 5
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27749631
tagged with: ajax
has title: Abort a multiple file upload AJAX request
tagged with: abort
favorite count: 0
has answer: http://stackoverflow.com/a/27749631
type: AnsweredQuestion
upvote count: 5
has body: I am trying to abort a multiple file upload with a progress bar, showing the state of the process. What I want to achieve is to completely abort the multiple file upload on the abort button click; to stop the progress bar as well as to clear every file(s) that might have been uploaded during the course of the initially triggered multiple file upload process. Below is my code: var AJAX = $.ajax({ xhr: function() { var XHR = new window.XMLHttpRequest(); XHR.upload.addEventListener('progress', function(e) { if (e.lengthComputable) { var PROGRESS = Math.round((e.loaded/e.total)*100); $('#PROGRESS_BAR').text(PROGRESS); } }, false); return XHR; }, url : '/php.php', type : 'POST', data : DATA, cache : false, processData: false, contentType: false, beforeSend : function() { }, success : function() { } }); $(document).on('click', '.ABORT', function(e) { AJAX.abort(); }); I use the code above to dynamically upload images with a progress bar. I found lots of articles using .abort() to stop the process, but that seemed to only work browser side and not server side. In what way can I cease the upload completely as in: on both client and server side as .abort() does not enable me get the desirable result?

http://stackoverflow.com/comment/43899525
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27744197
type: QuestionComment
has text: @Dalorzo not 100% sure what you're asking.. I'm using chutzpah in visual studio, so I'm just right clicking and selecting "Open in browser". Is this what you're asking?

http://stackoverflow.com/q/27650044
accepted answer: http://stackoverflow.com/a/27650237
favorite count: 0
tagged with: angularjs
upvote count: 2
linked to: http://stackoverflow.com/q/25295882
has title: AngularJS : Wrapping an element into a custom template with an angular attribute directive
type: AnsweredQuestion
score: 2
type: Question
tagged with: angularjs-directive
tagged with: angular-ngmodel
downvote count: 0
tagged with: javascript
has body: Situation: I have an attribute directive that wraps it's element into a template. Here it is: app.directive("myCustomInput", function(){ return{ restrict: "A", replace: true, scope:{}, transclude: "element", template: " "+ " "+ ""+ " " } }); And I use it like: Problem: ng-model doesn't work Here is the plunker
has answer: http://stackoverflow.com/a/27650237
has comment: http://stackoverflow.com/comment/43717839
tagged with: transclusion
has comment: http://stackoverflow.com/comment/43722669
answer count: 1

http://stackoverflow.com/comment/43982125
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27785976
type: Comment
has text: Please edit the text, what happens instead of that you've expected?

http://stackoverflow.com/q/27761467
score: 1
favorite count: 0
tagged with: cordova
type: UnansweredQuestion
upvote count: 1
tagged with: audio
has answer: http://stackoverflow.com/a/27761555
type: Question
has body: due to issues with sound playing in apps builded with cordova (native wrapper) i decided to use cordova media plugin> http://plugins.cordova.io/#/package/org.apache.cordova.media Problem is that in this case i am not able test sound playing in the Chrome or Ripple browser emulator because i always get error: ReferenceError: Media is not defined So I imported cordova.js into app folder to avoid 404 error but i still getting this error. Is possible to solve it or i must test only on device? Thanks for any help.
has title: Cordova media plugin, how to test sound playing in browser? I always got ReferenceError: Media is not defined
downvote count: 0
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/40788807
tagged with: android

http://stackoverflow.com/q/27662410
accepted answer: http://stackoverflow.com/a/27662566
tagged with: if-statement
possible better answer: http://stackoverflow.com/a/27662628
has answer: http://stackoverflow.com/a/27662628
has title: HTML 5 toggling the contenteditable attribute with javascript
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/43741110
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/43741073
has body: enter code hereI am trying to make something editable online with a function like this function toggle_editable (div, cssclass) { var classToEdit = document.getElementsByClassName(cssclass) for (i = 0;classToEdit.length; i++) { if (classToEdit[i].contentEditable == false) { classToEdit[i].contentEditable = true ; } if (classToEdit[i].contentEditable == true) { classToEdit[i].contentEditable = false ; } } } classToEdit is a collection of HTML elements with the same class name or whatever document.getElementsByClassName(cssclass) returns when going through the debugger it jumps over the line classToEdit[i].contentEditable == true as well as over the line classToEdit[i].contentEditable == true and does not execute the code in the braces following the if statements this works however - meaning it sets the contenteditable property without hesitation classToEdit.contenteditable = true; as well as this classToEdit.contenteditable = false; (well obviously) also this seemed to have no effect classToEdit.contenteditable = !classToEdit.contenteditable ideas anyone? ps why is the loop
favorite count: 0
has answer: http://stackoverflow.com/a/27662566
type: Question
has comment: http://stackoverflow.com/comment/43741190
tagged with: contenteditable
answer count: 2
upvote count: 1

http://stackoverflow.com/comment/43994929
has text: i guess you miss things like that when you not slept in 2 days, thank you
type: AnswerComment
comment on: http://stackoverflow.com/a/27792444
score: 0
type: Comment

http://stackoverflow.com/q/27697265
tagged with: gs-vlookup
type: Question
tagged with: google-sheets
answer count: 1
has answer: http://stackoverflow.com/a/27727040
tagged with: spreadsheet
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/27727040
has body: Thus far I have the following working for Single column VlookUp for an array source data. What I made this for so when I am large amount of data from multiple sheets I wanted it to be static information being looked up and placed on the import area. I can use query inside the spreadsheet to accomplish what I want but it BOGS down my spreadsheet ALOT! Also on old sheets you do something like this: =arrayformula(VLookUp(A2:A,Data!A:K,{3,4,7,10}*sign(Row(A2:A)),false)) to retrieve Columns C,D,G,J of matching criteria of row from column A and in new sheets this is no longer possible. SAD FACE!!!! function finderLookUPReturnArray_(Sheet,Range,lookupItem,IndexOffset,IndexOffsetReturn) // finderLookUP(Ref Sheet, Ref Sheet Range, Current lookup Item, Ref Sheet Column for Current lookup Item , Ref Sheet Column for qualified Current lookup Item RETURN) { var newArray = new Array(); var data = SpreadsheetApp.getActive().getSheetByName(Sheet).getRange(Range).getValues(); //Syncs sheet by name and range into var for(var i = 0; i&lt;lookupItem.length; i++) { for(nn=0;nn&lt;data.length;nn++) { var Sending = ""; if (data[nn][IndexOffset]==lookupItem[i]) { var Sending = data[nn][IndexOffsetReturn]; newArray.push(Sending); break; } } if(isEmpty_(Sending)==true) { var Sending = "#N/A"; newArray.push(Sending); } } return newArray; } //------------------ function isEmpty_(string) { if(!string) return true; if(string == '') return true; if(string === false) return true; if(string === null) return true; if(string == undefined) return true; string = string+' '; // check for a bunch of whitespace if('' == (string.replace(/^\s\s*/, '').replace(/\s\s*$/, ''))) return true; return false; } Thanks!
has comment: http://stackoverflow.com/comment/43843424
has title: Adding Multiple Column to Google Script Vlookup function
type: AnsweredQuestion

http://stackoverflow.com/a/44199001
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/27721133
type: Answer
has body: here i am letting the user select interval of 10 days only..you can modify it according to your requirement. $(document).ready(function() { var minDate ; var maxDate; var mDate var j = jQuery.noConflict(); j( "#startTime" ).datepicker({ onSelect: function() { minDate = j( "#startTime" ).datepicker("getDate"); var mDate = new Date(minDate.setDate(minDate.getDate())); maxDate = new Date(minDate.setDate(minDate.getDate() + 10)); j("#endTime").datepicker("setDate", maxDate); j( "#endTime" ).datepicker( "option", "minDate", mDate); j( "#endTime" ).datepicker( "option", "maxDate", maxDate); } }); var tdate = new Date(); var ddate = new Date(tdate.setDate(tdate.getDate() + 10)); j("#startTime").datepicker("setDate", new Date()); j( "#endTime" ).datepicker(); j("#endTime").datepicker("setDate",ddate); }); Please Select Dates: Strat Date: End Date:

http://stackoverflow.com/a/27667463
has body: I changed the code like that : I created the new service below .factory('femmeService', function($timeout) { var dataFemme = []; db.transaction(function(tx) { tx.executeSql('SELECT * FROM datafemme', [], function(tx, results) { for (var i = 0; i &lt; results.rows.length; i++) { //dataFemme[results.rows.item(i).id] = { dataFemme[i] = { id: results.rows.item(i).id , 'code_patient': results.rows.item(i).code_patient }; } $timeout(function() { dataFemme; }, 3000); }); }); return { all: function() { return dataFemme; }, get: function(id) { return dataFemme[id]; } };}) And also changed the controller .controller('femmeListCtrl', function($scope, femmeService) { $scope.dataFemme = femmeService.all();}) And I have solved the problem
score: 0
answers question: http://stackoverflow.com/q/27661296
type: Answer

http://stackoverflow.com/a/27680264
score: 0
accepted answer of: http://stackoverflow.com/q/27680122
answers question: http://stackoverflow.com/q/27680122
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43775137
has body: Assuming data is is all the JSON you posted above, Here is a version, which is perhaps what you want: $.each( data['dialogueTexts'], function( key, val ) { alert(val['dialogueTextText']); }); if(data['dialogue']['backgroundURL'] != '') $('#content-container').css('background-image','url("'+data['dialogue']['backgroundURL']+'")');
has comment: http://stackoverflow.com/comment/43775200
has comment: http://stackoverflow.com/comment/43775224
type: Answer
has comment: http://stackoverflow.com/comment/43775188

http://stackoverflow.com/q/27711131
has title: AutoCOmplete not giving autocomplete undefined error in php
tagged with: autocomplete
has body: I am trying to add AutoComplete in my html JQUERY AUTOCOMPLETE FILE LINK Here is how i have added it &lt;script src="&lt;?php echo $site_root?&gt;js/autocomplete/jquery.ui.autocomplete.autoSelect.js"&gt;&lt;/script&gt; Trying to access using $("#username").autocomplete({ source: &lt;?php echo $username; ?&gt;, select: function(event, ui) { var username = ui.item.label; window.location = 'submissionForm.php?username=' + username; } }); I am getting This error Cannot read property 'autocomplete' of undefined What is wrong?
tagged with: javascript
has answer: http://stackoverflow.com/a/27711235
tagged with: jquery
has answer: http://stackoverflow.com/a/27711236
answer count: 2
possible better answer: http://stackoverflow.com/a/27711235
has comment: http://stackoverflow.com/comment/43834412
has comment: http://stackoverflow.com/comment/43834340
has comment: http://stackoverflow.com/comment/43834252
tagged with: php
accepted answer: http://stackoverflow.com/a/27711236
type: AnsweredQuestion
score: 0
type: Question

http://stackoverflow.com/comment/43954493
has text: I believe it is dynamically generated. I have tried your suggestion before with the same results. The only way I could get it to actually reload just #feed1 (which is a news feed) is by using `location.href=`. That's why I was trying to figure out a way to get it to remember the scroll position, that would solve my issue.
comment on: http://stackoverflow.com/a/27770922
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43935709
has text: But by element, you are talking about the whole string, `89TJQ` and `98TJQ` are not equivalent
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27762140

http://stackoverflow.com/a/27656680
type: Answer
has body: Instead of using ng-bind-html or ng-repeat why not stick with how AngularJS is doing it using select's ng-option directive? FORKED DEMO HTML JAVASCRIPT app.controller('MainCtrl', function($scope) { $scope.statuses = ['Draft', 'Pending', 'Live', 'Archived', 'Deleted']; $scope.query = { Statuses: ["Pending","Live"] }; }); Alternatively, if you wish to have a complex set options wherein you need some styling or disabling of options then you can use ng-repeat and ng-selected at the same time. DEMO HTML = 0">
answers question: http://stackoverflow.com/q/27656583
score: 0

http://stackoverflow.com/comment/43883927
type: Comment
has text: This might be a better question for Stackoverflow's sister site, programmers.stackexchange.com. I'll mention briefly: there is certainly a shared resource in `doGet()`, it's the `script` variable. As for `init()`, can you point to any JEE documentation that says there's any synchronization between `init()` and `doGet()`? This is basic stuff, you really need to learn more about multithreading if you can't see these issues.
comment on: http://stackoverflow.com/a/27733080
type: AnswerComment
score: 0

http://stackoverflow.com/q/27760441
has comment: http://stackoverflow.com/comment/43931961
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/43931927
tagged with: javascript
has title: loading different m3u playlist and mp3 on click
score: 0
has body: I am trying to make an audio player for my website that plays album playlist(m3u) and Individual mp3's on click. They're are going to be several playlist and mp3's so I need the song to auto go to the next song. And I need option to go to NEXT or PREVIOUS song I do believe that I have started writing the code for the playLast and playNext but I dont know how to script the function in order for me to assign it a button &lt;script&gt; var player; var intv; var slider; //Init // //////////////////////////// window.onload = function() { document.getElementById('btnlast').addEventListener('click',playLast, false); document.getElementById('btnPlay').addEventListener('click', playMusic, false); document.getElementById('btnPause').addEventListener('click', pauseMusic, false); document.getElementById('btnStop').addEventListener('click', stopMusic, false); document.getElementById('btnVolUp').addEventListener('click', volUp, false); document.getElementById('btnVolDown').addEventListener('click', volDown, false); player = document.getElementById('player'); slider = document.getElementById('sliderTime'); slider.addEventListener('change', reposition, false); } function reposition() { player.currentTime = slider.value; } //Volume Controls // // 0.0 Silent - 1.0 Full Volume ///////////////////////////// function volUp() { if(player.volume &lt; 1) { player.volume += 0.1; console.log(player.volume); } else { player.volume = 1; } } function volDown() { if(player.volume &gt; 0) { player.volume -= 0.1; console.log(player.volume); } else { player.volume = 0; } } //Music Play Controls // /////////////////////////// function playMusic() { player.play(); intv = setInterval(update, 100); slider.max = player.duration; } function update() { document.getElementById('songTime').innerHTML = millisToMins(player.currentTime); slider.value = player.currentTime; } function millisToMins(seconds) { var numminutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60); var numseconds = (((seconds % …
tagged with: media
type: UnansweredQuestion

http://stackoverflow.com/a/27751276
answers question: http://stackoverflow.com/q/27750932
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43913836
has body: Q1. Is my logic correct? My experience says your logic is incorrect. Because there isn't any need for a server side templating engine (in your case, jade) when we are using Angularjs. Angular itself is capable for rendering dynamic data. What you could do here is use node and express for building API end points for all the functionalities of your shopping cart and then write all the views (both frontend and backend) in Angular. Q2. Assuming I am trying to keep it up as an MVC structure, which parts correspond to M, V, C in this case? In angular View is the html page with directives and filters applied. So that represents the UI side of the application. Controllers are the brain for the views. Views get data from controllers to display. And controllers often fetch data from APIs using services or factories. Controller use an object called $scope to pass data into view. In angular world you can consider this $scope object as the view model. it glues both the view and controller. So in your example, /public /javascripts /item ..item.html // view ..item.js // controller (might include the services for item api calls or write a seperate js file for them)

http://stackoverflow.com/a/27713876
has comment: http://stackoverflow.com/comment/43872093
answers question: http://stackoverflow.com/q/27713760
has comment: http://stackoverflow.com/comment/43840572
type: Answer
score: 8
downvote count: 0
has comment: http://stackoverflow.com/comment/43852002
has comment: http://stackoverflow.com/comment/113865340
has comment: http://stackoverflow.com/comment/43865176
upvote count: 8
has comment: http://stackoverflow.com/comment/43859294
has body: A common way of doing this, is by using a RegExp expression, followed by the replace method. This is one way you could do this: "*This is italic*" .replace(/\*(.*?)\*/gi, '$1'); What is happening here is that you are searching for any sequence of characters surrounded by the two asteriks and capturing those characters so then you can put them between the HTML tags.
accepted answer of: http://stackoverflow.com/q/27713760
type: AcceptedAnswer

http://stackoverflow.com/a/27802360
answers question: http://stackoverflow.com/q/27799921
has comment: http://stackoverflow.com/comment/44013784
score: 0
type: Answer
has body: The number inserted in the textbox is the number of exponent it will generate. The sample is 3. 3X3X3 is 27. First no. Update: The Exponent in any number.

http://stackoverflow.com/a/27763130
type: Answer
has body: You have an extra closing parentheses in your window.location line. Should be window.location = "http://"+redirectpage +"?url="+ $(target).attr('href');
answers question: http://stackoverflow.com/q/27762935
has comment: http://stackoverflow.com/comment/43937235
score: 0

http://stackoverflow.com/a/27650616
downvote count: 0
has body: What about using a setTimout ? like with : var relativeStopPosition = 0.5; // half-way function aud_play_pause(_id) { var audio = document.getElementById("music"); if (audio.paused) { audio.play(); setTimeout(audio.pause.bind(audio), Date.now + relativeStopPosition * 1000* audio.duration ) ; } else { audio.pause(); } }
score: 1
answers question: http://stackoverflow.com/q/27650444
upvote count: 1
type: Answer

http://stackoverflow.com/q/27781807
has answer: http://stackoverflow.com/a/27781968
score: 3
tagged with: algorithm
upvote count: 3
has comment: http://stackoverflow.com/comment/43973710
type: Question
answer count: 2
tagged with: random
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27781988
has comment: http://stackoverflow.com/comment/43973819
has comment: http://stackoverflow.com/comment/43973606
tagged with: animation
has title: Animation theory (natural animations)
favorite count: 0
has body: I want, for example: to animate how a bird is flying through the sky, i am not talking about the animation of the wings, but how to animate an object random over a canvas. I use to animate those kind of objects with a lot of randomisation, for example: move [object] from a to b (random distance, random speed, random x, random y, etc.). But is that really the best way to do it? or is there any algorithm theory available on how to achieve the most natural behaviour. The animation can be a bird, but it could also be dust, or flying sand) (I hope my question is clear enough)
type: UnansweredQuestion

http://stackoverflow.com/comment/43978646
score: 0
type: Comment
type: QuestionComment
has text: The variable `c` holds the same value that `a` is holding. These are not references. P.S. `b` and `c` are being declared *without* `var`. You want to have `var a = 1, b = 2, c = a;`. Notice the commas.
comment on: http://stackoverflow.com/q/27784370

http://stackoverflow.com/a/27699785
type: Answer
has comment: http://stackoverflow.com/comment/43812625
accepted answer of: http://stackoverflow.com/q/27699717
answers question: http://stackoverflow.com/q/27699717
score: 0
has comment: http://stackoverflow.com/comment/43812677
has body: You need to get form from document here is what you should use var name = document.forms[0].name.value; var email = document.forms[0].email.value; var username = document.forms[0].username.value; var password = document.forms[0].password.value; This will only get html element var name=document.forms[0].name You need to get its value. var name=document.forms[0].name.value;
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43812684

http://stackoverflow.com/q/27788587
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27822733
score: 0
answer count: 2
has title: geometry.mergeVertices() only at render time
tagged with: three.js
possible better answer: http://stackoverflow.com/a/27825333
has answer: http://stackoverflow.com/a/27825333
type: AnsweredQuestion
has body: Is it possible to merge vertices only at render time? I'm doing a series of morphs which requires the vertex list to stay the same, however I want to merge the vertices to get a smooth reflection on a cube camera. Any one aware of a command similar to unmerge vertices?
has answer: http://stackoverflow.com/a/27822733

http://stackoverflow.com/comment/62903145
type: Comment
comment on: http://stackoverflow.com/a/27821586
has text: This looks like a bug in chrome. Works from time to time and unstable. Here is my question: http://stackoverflow.com/questions/37667075/play-mediarecorder-chunks-in-mediasource-html5-video-frozen
score: 1
type: AnswerComment

http://stackoverflow.com/q/27746337
type: AnsweredQuestion
has body: I'm new to jsPlumb and I'm having troubles with a connection that has the same source and target. I have to forbid these type of connections and I think the best way to do this is: when I finish creating the connection, if it has the same sourceId and targetId, delete the connection. I'm doing this: jsPlumb.bind('connection', function(info) { console.log('connection bind - From: ' + info.sourceId + ' To: ' + info.targetId); if (info.sourceId == info.targetId) { console.log('sourceId == targetId'); jsPlumb.detach(info); } }); But what happens is this The connection is deleted but it looks like the source endpoint is still there but, if I drag the item, the dot stays in the same place as if it has no reference to the item anymore, which is ok because the connection was deleted, but it's not ok because that dot shouldn't be there. Any inputs on this? Thank you.
has answer: http://stackoverflow.com/a/27797810
tagged with: jsplumb
has title: jsPlumb - detach connection with sourceId == targetId
type: Question
accepted answer: http://stackoverflow.com/a/27797810
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/27794475
score: 5
upvote count: 5
downvote count: 0
has body: Move your if condition inside ajax due to async nature of ajax: var status; $('#login').click(function(){ $.get("login.php", { uname: document.getElementById('uname').value, pass: document.getElementById('pass').value } ) .done(function( data ) { status=data; if(status=='y') { alert('yes!'); } else if(status=='n') { alert('no!'); } }); });
has comment: http://stackoverflow.com/comment/43998148
accepted answer of: http://stackoverflow.com/q/27794434
has comment: http://stackoverflow.com/comment/43997997
answers question: http://stackoverflow.com/q/27794434
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43998269
type: Answer
has comment: http://stackoverflow.com/comment/43998205
has comment: http://stackoverflow.com/comment/43998535

http://stackoverflow.com/a/27657856
score: 0
answers question: http://stackoverflow.com/q/27654895
has comment: http://stackoverflow.com/comment/43780715
has body: Your code has a lot of issues. Here is the fixed code: function SeatReservation(name, initialMeal) { var self = this; self.name = name; self.meal = ko.observable(initialMeal); self.formattedPrice = ko.computed(function () { var price = self.meal().price; return price ? "$" + price.toFixed(2) : "None"; }); }; function ReservationsViewModel() { var self = this; self.availableMeals = [ { mealName: "Standard (sandwich)", price: 20 }, { mealName: "Premium (lobster)", price: 34.95 }, { mealName: "Ultimate (whole zebra)", price: 290 } ]; self.seats = ko.observableArray([ new SeatReservation("Steve", self.availableMeals[0]), new SeatReservation("Bert", self.availableMeals[0]) ]); self.addSeat = function () { self.seats.push(new SeatReservation("", self.availableMeals[0])); } self.NetAmount = ko.computed(function() { var total = 0; for (var i = 0; i < self.seats().length; i++) { total = total + self.seats()[i].meal().price; } return total; }); }; ko.applyBindings(new ReservationsViewModel()); Your seat reservations Passenger name Meal Surcharge Reserve another seat Total: Your biggest mistake is the NetAmout function/observable. Knockout has the ko.computed() function that updates if any of the variables that he is referencing is an observable. Because the code work with the seats array, if you change any value of it the observable gets updated. You don't need the button. If you like to update based on the click event, you can try this: self.NetAmount = ko.observable(); self.GetTotal = function() { // here goes the NetAmount calculation. Once calculated, we // Set the value in the NetAmount observable. self.NetAmount(total); } Greetings!
type: Answer

http://stackoverflow.com/a/27773079
has comment: http://stackoverflow.com/comment/43957053
has comment: http://stackoverflow.com/comment/43957062
score: 1
has body: What you want is a two-way binding of a reference by not primitive type, see below: A: {{A.val}} B: {{B.val}} C: {{C.val}} Swithc to A Swithc to B Swithc to C var myApp = angular.module('myApp',[]); function MyCtrl($scope) { $scope.A = {val: 1}; $scope.B = {val: 2}; $scope.C = {val: 3}; $scope.switchToA = function() { $scope.editedVar = $scope.A; }; $scope.switchToB = function() { $scope.editedVar = $scope.B; }; $scope.switchToC = function() { $scope.editedVar = $scope.C; }; }
upvote count: 1
has comment: http://stackoverflow.com/comment/43957079
has comment: http://stackoverflow.com/comment/43957017
type: Answer
has comment: http://stackoverflow.com/comment/43957044
answers question: http://stackoverflow.com/q/27772920
downvote count: 0

http://stackoverflow.com/comment/43816975
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27701947
score: 0
has text: I missed that nested array, thanks.

http://stackoverflow.com/comment/43851469
has text: I do not see anything wrong with this code. The only reason you are not able to see things correctly could be because of the faulty markup being rendered on the page. Please check you markup carefully. You must be missing something there.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27719711

show-hide
tags question: http://stackoverflow.com/q/27733682
tags question: http://stackoverflow.com/q/27646852
tags question: http://stackoverflow.com/q/27671241
type: Tag
tags question: http://stackoverflow.com/q/27774696
tag name: show-hide

http://stackoverflow.com/comment/43829864
type: QuestionComment
has text: This totally works, although it may not be best practice to use this method, in our SPA this is what we need. I don't know hot to mark this as an answer since this is a comment.
comment on: http://stackoverflow.com/q/27696962
score: 0
type: Comment

http://stackoverflow.com/q/27707112
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27707284
has answer: http://stackoverflow.com/a/62230022
has body: So I've got the following code: $(document).ready(function(){ if(window.location.hash) { $('body,html').animate({ scrollTop: $(window.location.hash).offset().top }, 1000); } }) Which I've built with the help of code taken from StackOverflow. I call the page at url#destination so actually it should scroll to the element whose ID is the page Hash. The element exists and the page scrolls down, but not to the exact element offset, but a bit more above. It could be just fine but I want it to work as I expected. So I now show you the console results: &gt;&gt;&gt;$("body").scrollTop() &gt;1155 &gt;&gt;&gt;$("#aboutus").offset().top &gt;1672.890625 Could someone explain this to me? Because I cannot understand anything here.
favorite count: 0
upvote count: 2
possible better answer: http://stackoverflow.com/a/62230022
accepted answer: http://stackoverflow.com/a/27707284
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/43826277
has title: jQuery .scrollTop not scrolling properly
type: Question

http://stackoverflow.com/a/27751539
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43914349
has comment: http://stackoverflow.com/comment/43914398
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27751438
type: Answer
accepted answer of: http://stackoverflow.com/q/27751438
has body: I just quickly sifted through the source of your website and I found a line in the function scrollPage() in script.js that I think is causing the problem: $('.navbar-brand').css({ 'padding-top': 19 + "px", 'padding-bottom': 19 + "px" }); This is just a hunch, though. You will have to investigate further by changing the value. When the web page is scrolled past a certain point, the above line is called, changing the padding around the logo. When I went into Chrome dev tools and scrolled the page, I noticed a uniform padding around the top and bottom of the element that looked like this, further indicating that it might be caused by that padding value:

http://stackoverflow.com/a/27760214
downvote count: 0
type: Answer
upvote count: 1
has body: You can likely simplify your situation since you only have 2 stylesheets. Assuming they are interchangeable you can just add an ID to the existing default link tag by hard coding it. If hard code impractical there are other ways to simply target the correct existing link tag &lt;link id="site_theme" href="path/to/css/styles_green.css" data-color="green"&gt; In JS: /* bind a click handler to some button */ $('#someButtonId').click(function () { /* define link tag as jQ object */ var $link = $('#site_theme'), /* current color stored in data attribute */ currColor = $link.data('color'), /* set new color*/ newColor = currColor === 'green' ? 'blue' : 'green'; /* modify the href for new theme color */ $link.attr('href', function (_, currHref) { return currHref.replace(currColor, newColor); /* store the newColor */ }).data('color', newColor); }); Above assumes that the colors are in the filenames of the css files. Subsequent clicks of the button will toggle back and forth between themes
score: 1
answers question: http://stackoverflow.com/q/27760098

http://stackoverflow.com/q/27716328
answer count: 1
has body: Okay I'm trying to set these objects in the user class, but for some reason it's not saving. It's very straight forward, or it seems like it should be: This gets user: var actionCompleted = results[i].get("ActionComplete"); var user = results[i].get("User"); This Gets Objects: var moneyLost = user.get("MoneyLost"); var daysRow = user.get("DaysInRow"); var daysWoken = user.get("DaysWoken"); var daysLate = user.get("DaysLate"); This Sets and Saves The Objects: user.set = ("MoneyLost", moneyLost + bountyVal); user.set = ("DaysInRow", daysRow++); user.set = ("DaysWoken", daysWoken++); user.save(user, { success: function(gameScore) { // Execute any logic that should take place after the object is saved. alert('New object created with objectId: ' + gameScore.id); }, error: function(gameScore, error) { // Execute any logic that should take place if the save fails. // error is a Parse.Error with an error code and message. alert('Failed to create new object, with error code: ' + error.message); } }); And This Sets and Saves More Objects: user.set = ("DaysInRow",0); user.set = ("DaysLate", daysLate++); user.save(user, { success: function(gameScore) { // Execute any logic that should take place after the object is saved. alert('New object created with objectId: ' + gameScore.id); }, error: function(gameScore, error) { // Execute any logic that should take place if the save fails. // error is a Parse.Error with an error code and message. alert('Failed to create new object, with error code: ' + error.message); } });
favorite count: 0
tagged with: parse-platform
score: -3
has comment: http://stackoverflow.com/comment/43846066
type: AnsweredQuestion
upvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/43858191
accepted answer: http://stackoverflow.com/a/27721675
tagged with: javascript
has title: Parse Background Job Not Saving Objects
downvote count: 3
has answer: http://stackoverflow.com/a/27721675

http://stackoverflow.com/comment/43978105
score: 1
comment on: http://stackoverflow.com/q/27784081
type: Comment
type: QuestionComment
has text: Strings are delimited by quotes (`"`). What is the one character that a string literal cannot contain? Right. What do you do to embed a quote in a string? Right. The same goes for regular expression literals, only that they are not delimited by quotes.

http://stackoverflow.com/comment/43978060
comment on: http://stackoverflow.com/q/27783698
score: 0
has text: guess the correct sentence would be "I found nothing!" :)
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27781956
has title: Ionic How to keep fixed background while browsing the views
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
score: 1
has body: I'm using a tabs template for an Ionic project and have set the a background image. However, when the transition throw states occurs, the background is also affected by the animation. I want that the background always stay fixed on entire application ( on transition throw states and sub-states). This project exemplifies the problem: link: http://codepen.io/anon/pen/ogYymB I also tried to assign the background property to the body but it doesn't work. So, does anybody know how to always keep the background image fixed and only animate the content ?
favorite count: 0
has answer: http://stackoverflow.com/a/27782668
tagged with: angularjs
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 3
has answer: http://stackoverflow.com/a/27782271
upvote count: 1
tagged with: ionic-framework
has answer: http://stackoverflow.com/a/29407189

http://stackoverflow.com/comment/43885236
comment on: http://stackoverflow.com/a/27736694
type: Comment
has text: I think we are saying the same thing. The variable `s` I referenced is the name, as far as I can tell from your code. The line `document.getElementsByTag("li")[0].setAttribute("data-artist", s);` I generated will use s to change your li tag ... as the div name changes.
score: 0
type: AnswerComment

http://stackoverflow.com/a/27767702
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27736710
type: Answer
answers question: http://stackoverflow.com/q/27736710
has body: So at the moment (jan 2015) this doesn't seem to be possible. Also confirmed by this answer Is there a way to load the lcov data inside webstorm? (on mocha-lcov-reporter repo)
score: 0

http://stackoverflow.com/comment/43928025
comment on: http://stackoverflow.com/q/27758580
type: Comment
type: QuestionComment
has text: References in php are different than in javascript. Also check out the array append feature. You don't need to do count minus 1, just use brackets with nothing inside.
score: 1

http://stackoverflow.com/comment/43878561
has text: |= ? Why hadn't I thought of this??? argh. Thanks. It doesn't asnwer as asked but it provides me with what I"m looking for.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27733470

http://stackoverflow.com/a/45058511
has body: Two years late, but this question seems to have a lot of views and should probably be answered. According to this question a gzipped response will always have lengthComputable set to false in Chrome. This makes a lot of sense because you may know how much more compressed data is coming down the pipe, but you can't have any idea how much that compressed data will expand to. This solution seems like a good one to me.
upvote count: 9
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/27767954
score: 9

http://stackoverflow.com/comment/43754315
score: 1
type: Comment
has text: Hey man thanks so much for the help! I've burned it down and started again. I'm recreating the job right now. Will update soon!
comment on: http://stackoverflow.com/a/27668330
type: AnswerComment

http://stackoverflow.com/q/27751032
has body: I have map1.svg and map2.svg. On index.php I have some options to select. If you select option 1 you see map 1, if you select option 2 you see map 2. I was doing it with php, but I'm not sure how to do it onclick (I am aware I am mixing js with php here and I shouldn't). I wanted to do something like: &lt;ul&gt; &lt;li&gt;&lt;a id="one" onclick="&lt;?php $option=1?&gt;"&gt;Option One&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a id="two" onclick="&lt;?php $option=2?&gt;"&gt;Option Two&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div&gt; &lt;?php if ($option == 1) { include("map1.svg"); } elseif ($option ==2) { include("map2.svg"); } ?&gt; &lt;/div&gt;
has title: Call different svg files with javascript
has comment: http://stackoverflow.com/comment/43913258
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
accepted answer: http://stackoverflow.com/a/27751249
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43913187
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27751249
tagged with: javascript
has comment: http://stackoverflow.com/comment/43913538

http://stackoverflow.com/comment/43767833
type: QuestionComment
type: Comment
has text: Er, it appears to me that the only thing this question has to do with the proposed dupe is the presence of the "performance" tag :-) It's a totally different language, this one involves no sorting, and so on.
score: 0
comment on: http://stackoverflow.com/q/27676638

http://stackoverflow.com/comment/43844550
type: QuestionComment
has text: Please don't name functions things like `handleCheckboxClick`. Name functions after what they do, not how they're used. In this case `toggleRelevantData` might be a better name.
score: 1
comment on: http://stackoverflow.com/q/27715343
type: Comment

http://stackoverflow.com/q/27769608
has title: how do I set my time to T00:00:00.000Z with JS
linked to: http://stackoverflow.com/q/3894048
type: Question
has comment: http://stackoverflow.com/comment/43950737
has comment: http://stackoverflow.com/comment/43950116
tagged with: javascript
has answer: http://stackoverflow.com/a/27770097
answer count: 2
linked to: http://stackoverflow.com/q/17509142
downvote count: 0
tagged with: angular-ui
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27771528
has body: I am using ui-calendar and I am trying to pass events without a time. Right now I get my date and time like this. var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); var WOD = new Date(y,m,d); now I also have a function that changes WOD to the day that is selected in the month view of the calendar like this. $scope.alertOnDayClick = function(d){ WOD = d; }; If I click on a day (Jan 22 2015 for this example) WOD = "2015-01-22T00:00:00.000Z" &lt;--This is what I want and works well. But if I don't select a day by default WOD = "2015-01-04T05:00:00.000Z" I want to make it so that my default date contains the time T00:00:00.000Z. I have tried var WOD = new Date(y,m,d,0,0,0,0) var WOD = date.UTF(y,m,d) var WOD = date.UTF(y,m,d,0,0,0,0) I also tried setting the default time to null I read this question Dealing with DateTime format for international application But I don't know if this is applicable and honestly I didn't fully understand how I would implement it All help is appreciated. UPDATE: After reading What is the best way to initialize a JavaScript Date to midnight? I tried var WOD = new Date(); WOD.setHours(0,0,0,0); But it still returns "2015-01-04T05:00:00.000Z" Which then makes the event stored on Jan 4 at 12am UPDATE: I tried: $scope.WOD = new Date(); $scope.WOD.setHours(0, 0, 0, 0); $scope.dangerMessage = ($scope.WOD); {{dangerMessage}} = "2015-01-04T05:00:00.000Z" UPDATE W/ Full controller var myAppModule = angular.module('MyApp', ['ui.calendar']); myAppModule.controller('MyController', function($scope,$compile,uiCalendarConfig) { var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); $scope.WOD = new Date(); $scope.WOD.setHours(0, 0, 0, 0); $scope.events = [ {title: 'All Day Event', start: new Date(y, m, 1)}, {title: 'Long Event', start: new Date(y, m, d), end: new Date(y, m, d)}, {id: 999, title: 'Repeating Event', start: new Date(y, m, d - 3, 16, 0), allDay: false}…
tagged with: angularjs
type: UnansweredQuestion
tagged with: datetime
upvote count: 1
has comment: http://stackoverflow.com/comment/43950136

http://stackoverflow.com/comment/43805098
type: Comment
has text: That's pretty cool, wasn't aware of "*will become new promise passed to the next then call*".
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27695862

http://stackoverflow.com/comment/54824929
has text: I have tried this, and the :submit is the only one working for me, even though it is running in ajax-mode with the CF7.
comment on: http://stackoverflow.com/a/27799147
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27645043
has title: Changing the class of a div
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27645088
type: Question
has answer: http://stackoverflow.com/a/27645129
answer count: 8
linked to: http://stackoverflow.com/q/190560
has answer: http://stackoverflow.com/a/27645053
accepted answer: http://stackoverflow.com/a/27645053
possible better answer: http://stackoverflow.com/a/27645143
has answer: http://stackoverflow.com/a/27645138
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27645091
has answer: http://stackoverflow.com/a/27645078
has answer: http://stackoverflow.com/a/27645140
tagged with: jquery
has answer: http://stackoverflow.com/a/27645143
has comment: http://stackoverflow.com/comment/43708457
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I want to change the background color of the div with id="sample" from red to green in 2 seconds.I added the javasript to add a class with a green background to the div after 2 seconds.But the added class fails to replace the background color of the div element.So is there any solution which can be applied here to change the background color in two seconds.Also i know it is possible,if we add an another class to toggle between the background colors.An another solution will be appreciated.

http://stackoverflow.com/a/27754067
has body: What about something like this? I know it changes your code a bit, but it works. Just change the filenames accordingly. Example of a filename that should be used: "userExperienceDesign.html" in order to make sure that the navigation menu works correctly Just erase the following line when running it from your own files: filename = "item3.html"; jsfiddle //URL to id to select active link var href = window.location.href; var filename = href.split('/').pop(); filename = "item3.html"; //Example of a filename that should be used: "staffAugmentation.html" in order to make sure that the navigation menu works correctly filename = filename.replace(/\..+$/, ''); $("#nav_" + filename).children("*").addClass("active"); if ($("#nav_" + filename).parent().parent("li")) { $("#nav_" + filename).parent().parent().children("*").addClass("active"); } //Fix subMenu widths: min width same as parent nav item and if right side of subMenu item surpasses parent ul's width, left offset compensates var navWidth = $("#nav").width(); var navLeft = $("#nav").offset().left; var navTotal = navWidth + navLeft; var subMenus = $("#nav").children("li").children("ul"); for (var i = 0; i < subMenus.length; i++) { var subMenu = subMenus.eq(i); subMenu.parent().children("span").css({"padding-right":30+"px"}); subMenu.parent().addClass("hasSubMenu"); subMenu.children("li").css({ "min-width": subMenu.parent().width() - 5 + "px" }); var subMenuWidth = subMenu.width(); var subMenuLeft = subMenu.offset().left; var subMenuTotal = subMenuWidth + subMenuLeft; if (navTotal < subMenuTotal) { var newOffsetLeft = navTotal - subMenuTotal; subMenu.css({ "left": subMenuLeft + newOffsetLeft + "px" }); } } $("#nav").click(function () { if ($(this).find("span").length > 0) { $(this).find("ul").toggle(); } }); html, body { padding:0px; margin:0px; background-color:grey; } #nav { position:absolute; list-style-type:none; padding:0px; margin-left:5px; margin-top:5px; background-color:white; font-size:20px; white-space:nowrap; }…
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27752825

http://stackoverflow.com/a/34001730
type: Answer
has body: got the exact same problem, and i still dont understand what that particular syntax means.. however, i managed to access this part of the object by force casting it into a string, by merely concatenating it to a string contant : if (error) { error.isError=1 errmsg=" "+error &lt;---- cast to string here error.msg=errmsg; &lt;---- then back into the object as a tring response.end(JSON.stringify(error)); db.end(); console.log("&lt;-"+error) return; }
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/27762602

http://stackoverflow.com/comment/43958173
has text: One example: Adding two numbers generates a different result than adding two strings (`3 + 3 === 6`, but `"3" + "3" === "33"`). Thus, the program must know what type the variables are in order to know which type of addition operator to use.
comment on: http://stackoverflow.com/q/27773667
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/43877707
type: Comment
type: QuestionComment
has text: I can't tinker and test this right now, but [here's documentation on how to set cookies in the browser](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) and [here's an NPM module for working with cookies](https://github.com/pillarjs/cookies). The basic idea is to set the user id and login token as you've tried, and then check them against the user record in MongoDB in the server-side route.
score: 1
comment on: http://stackoverflow.com/q/27732897

http://stackoverflow.com/comment/43817947
type: QuestionComment
comment on: http://stackoverflow.com/q/27702418
score: 0
has text: @Waki I've seen it, but as someone said, the link someone gave was about progress bar, it's not what I'm looking for.
type: Comment

http://stackoverflow.com/comment/43908292
type: Comment
type: QuestionComment
has text: Where is your `create.js.erb` located?
score: 0
comment on: http://stackoverflow.com/q/27748265

http://stackoverflow.com/comment/43923813
type: Comment
has text: I edited my question so that you can see the function handleCardDrop.
score: 0
comment on: http://stackoverflow.com/q/27756504
type: QuestionComment

http://stackoverflow.com/a/53115000
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27645619
has body: This is a modified version of Denys Séguret answer let shouldHandleKeyDown = true; let n = 0; document.addEventListener('keydown', function() { if (!shouldHandleKeyDown) return; shouldHandleKeyDown = false; document.getElementById('counter').innerHTML = ++n; }); document.addEventListener('keyup', function () { shouldHandleKeyDown = true; }); Counter Counter : 0

http://stackoverflow.com/comment/43905848
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27746571
type: QuestionComment
has text: Thanks. Ok I got it to work and show the authors, but only after I press the button twice...any idea why? I added this after foundBook.addAuthor(foundAuthor): foundBook.getAuthors().success(function(auth){books[foundBook.dataValues.id - 1].authors = auth;});

http://stackoverflow.com/a/27658347
upvote count: 0
has body: On Change of language drop down, if selected value in drop-down says Arabic, the add class to body then writes styles based on that class. changing all the properties of an elements will lead to performance issue, and not suggestible cheers. example as follows: body.direction_rtl textarea { direction:ltr; } "direction_rtl" you are adding class from script mention all the elements which needs be aligned to right to left
answers question: http://stackoverflow.com/q/27658259
type: Answer
has comment: http://stackoverflow.com/comment/43732605
score: -1
downvote count: 1

http://stackoverflow.com/q/27716635
answer count: 0
has comment: http://stackoverflow.com/comment/43845360
has body: I have made a custom demo plugin in phoneGap for iOS but it's not getting called. Here is what I have done so far: adobeCustom.js var cordova = require('cordova'); function AdobePlugin() {} AdobePlugin.prototype.editImage = function(imageUri, successCallback, errorCallback) { cordova.exec(successCallback, errorCallback, 'AdobePlugin', 'editImage', [imageUri]); } }; cordova.addConstructor(function() { if(!window.plugins) window.plugins = {}; window.plugins.adobePlugin = new AdobePlugin(); }); PGAdobeCreative.m //plugin file #import <AdobeCreativeSDKFoundation/AdobeCreativeSDKFoundation.h> #import <AdobeCreativeSDKImage/AdobeCreativeSDKImage.h> #import <AdobeCreativeSDKImage/AdobeUXImageEditorViewController.h> #import <AdobeCreativeSDKFoundation/AdobeUXAuthManager.h> #import "PGAdobeCreativeSDKFoundation.h" #import "NSObject+PropertiesAsDictionary.h" #import "NSArray+ItemAsDictionary.h" @interface PGAdobeCreativeSDKFoundation () <AdobeUXImageEditorViewControllerDelegate> @end @implementation PGAdobeCreativeSDKFoundation #define ADOBE_CSDK_CLIENT_ID @"5587f31263dc4f3id" #define ADOBE_CSDK_CLIENT_SECRET @"81292c83-eec7-key" - (void)editImage:(CDVInvokedUrlCommand *)command { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Image test" message:@"called" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; return; } @end index.html: Click here Where am I getting wrong? How do I solve this?
has comment: http://stackoverflow.com/comment/43845511
has title: phoneGap iOS custom plugin not called
type: Question
tagged with: ios
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43857109
tagged with: cordova
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43857099

http://stackoverflow.com/a/27700845
answers question: http://stackoverflow.com/q/27700630
has comment: http://stackoverflow.com/comment/43817106
has comment: http://stackoverflow.com/comment/43815760
score: 0
has body: As you have already included jQuery in your code, you can append new field with a pre-defined CSS class as: $('.container').append('&lt;input class="form-control" type="text" placeholder="something"/&gt;'); jQuery is easy debug then vanilla javascript. Hope this might help!
type: Answer

http://stackoverflow.com/q/27733726
tagged with: azure-mobile-services
tagged with: javascript
upvote count: 2
tagged with: azure
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Azure Mobile Service HTML 5 user auth shows Windows Security dialogue box in IE (.NET backend)
score: 2
downvote count: 0
has body: I am creating a HTML 5 app that uses a .net Azure Mobile Service and coming across a weird issue when trying to login a user on Internet Explorer (and only IE): It brings up a Windows Security dialogue box with the message : "The service (back-end url) is asking for your username and password. The service reports that it is from Service" Dismissing the dialogue box gives the error "Access is denied." I've tried entering my application key for the password (as you would do when testing the api) but that did not work. I've set up CORS correctly as I can make calls that only require the application key and turned off intranet discovery. I even tried deploying to a azure website to see if was a local issue. No luck. Chrome &amp; firefox do not show the dialogue and does the callback as usual.
has answer: http://stackoverflow.com/a/33537129
type: Question
tagged with: internet-explorer

http://stackoverflow.com/comment/43841550
comment on: http://stackoverflow.com/a/27714712
type: Comment
has text: to answer one of my questions, speed doesn't seem to be a concern with the `JSON.parse(JSON.stringify(object));` method - checked using `console.log(Date.now());` which results in `before 1419986858403` and `after 1419986858404` ie 1 millisecond for a 21 column db with a couple of nested arrays... ymmv.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43956583
comment on: http://stackoverflow.com/q/27772251
type: Comment
has text: I think its a bug. Even if we use Em.Handlebars.compile, if give an error 'Cannot read property 'controller' of undefined'
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43775291
score: 0
has text: @tzafar dk why still doesn't work, or maybe should I clean cache first?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27679900

http://stackoverflow.com/comment/43970809
comment on: http://stackoverflow.com/a/27740946
score: 0
type: AnswerComment
type: Comment
has text: @RajaSekharReddyBolle I did some changes in my answer, check them out.

http://stackoverflow.com/comment/44012053
score: 0
type: Comment
has text: View source and you still wouldn't have the password. Look at the code. You'd only have the MD5 hash of the password.
type: AnswerComment
comment on: http://stackoverflow.com/a/27787807

http://stackoverflow.com/comment/43740548
has text: It seems you can get the relative path of the uploaded files, but not still not the absolute path for security reasons, so firstly you can't get the correct path, and secondly, `webkitdirectory` doesn't seem to accept a path as a value, it's a boolean attribute only as far as I can tell ?
score: 1
comment on: http://stackoverflow.com/q/27662263
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27682229
score: 4
upvote count: 4
accepted answer of: http://stackoverflow.com/q/27682194
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43779120
has comment: http://stackoverflow.com/comment/43779093
downvote count: 0
answers question: http://stackoverflow.com/q/27682194
type: Answer
has body: According to the ECMAScript standards, the syntax for a for-in loop is IterationStatement : for ( LeftHandSideExpression in Expression ) Statement And a LeftHandSideExpression can be a CallExpression, which furthermore can be a CallExpression . IdentifierName So, yes, according to the standards, it is a valid for-in loop. But is it confusing? Yes. Why not just do something like this: for (key in oObj[0].arr) { oObj[0].key = key; console.log(oObj[0].arr[key]); }
has comment: http://stackoverflow.com/comment/43779097

http://stackoverflow.com/comment/43984652
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27786716
score: 0
has text: You need to `grease(slider)`. You'll find `grease` in the squeak standard library. Also, is `tweetContent` HTML from a source that you trust?

http://stackoverflow.com/q/27760098
has title: I dont understand this jquery code
type: Question
has body: I'm making a website with two themes, green and blue. The default color is green and then you can click on a button to change to blue, so all text changes to blue. I searched a bit here on stackoverflow and Think the best resolution is someone that posted this code: function updateStyleSheet(filename) { newstylesheet = "Content/css/" + filename + ".css"; if ($("#dynamic_css").length == 0) { $("head").append("&lt;link&gt;") css = $("head").children(":last"); css.attr({ id: "dynamic_css", rel: "stylesheet", type: "text/css", href: newstylesheet }); } else { $("#dynamic_css").attr("href", newstylesheet); } } If I understand correct this should replace a current stylesheet of my website with a new one, getting the same result I want. I have 2 stylesheets; one named stylegreen.css and the other named styleblue.css. Where in the code above should I change to make this work, and to put in the html I should add script right? And the last thing is the button to make the change - how should that be?
answer count: 2
has answer: http://stackoverflow.com/a/27760202
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/43931668
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/43931259
upvote count: 2
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/27760214

http://stackoverflow.com/a/27728018
score: 1
has body: You have an extra } at the end of your second media query (right after the .Finish selector). Once removed it works as expected: Fiddle example
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27727855
answers question: http://stackoverflow.com/q/27727855
upvote count: 1
type: Answer

http://stackoverflow.com/q/27737236
score: 5
tagged with: javascript
has body: I cannot understand why this code is behaving as it is: for (var i = 1; i &lt; 3; i++) { var j; if (!j) { j = 1; } else { alert("why are we here? j shouldn't be defined but it's " + j); } } (jsFiddle) If I set j to null and check for null, it works the way I think it should. This isn't how Java, C#, C++, etc. work, hence, the confusion.
accepted answer: http://stackoverflow.com/a/27737255
favorite count: 0
possible better answer: http://stackoverflow.com/a/27737271
answer count: 3
has answer: http://stackoverflow.com/a/27737271
type: AnsweredQuestion
has title: Scope of uninitialized variable in JavaScript
linked to: http://stackoverflow.com/q/762011
has answer: http://stackoverflow.com/a/27737345
type: Question
downvote count: 5
upvote count: 10
has answer: http://stackoverflow.com/a/27737255

http://stackoverflow.com/comment/43959537
comment on: http://stackoverflow.com/q/27774245
type: Comment
has text: Basically its because firefox doesnot use webkit for browser development and support. Hence firefox use w3c complaint textContent attribute.
type: QuestionComment
score: 0

http://stackoverflow.com/q/27661190
has comment: http://stackoverflow.com/comment/87578828
linked to: http://stackoverflow.com/q/15657983
favorite count: 0
has comment: http://stackoverflow.com/comment/46176147
upvote count: 2
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/46287394
has comment: http://stackoverflow.com/comment/43738158
has comment: http://stackoverflow.com/comment/43748684
score: 2
answer count: 0
has comment: http://stackoverflow.com/comment/43738216
type: Question
has body: I have google drive picker on my html form. However, when I click the button I get the browser message that 'popup is blocked'. I need for this work without the user having to allow it. Can you please have a look at my code let me know how change it so that will work without the user having to enable popups Thanks Here is the code.. Choose from Google Drive $scope.onGoogleLoad = function () { var flag = false; $http.post('/api/controllers/googledownload/getClientkey'). success(function (data, status, header, config) { gapi.client.load('drive', 'v2', null); gapi.load('auth', { 'callback': onAuthApiLoad }); gapi.load('picker','1'); function onAuthApiLoad() { window.gapi.auth.authorize({ 'client_id': data.clientID, 'immediate': flag, 'scope': ['https://www.googleapis.com/auth/drive'] }, handleAuthResult); } function handleAuthResult(authResult) { if (authResult && !authResult.error) { oauthToken = authResult.access_token; createPicker(); } else { flag = true; onAuthApiLoad(); } } function createPicker() { var picker = new google.picker.PickerBuilder() .addView(new google.picker.DocsView()) .setOAuthToken(oauthToken) .setCallback(pickerCallback) .build(); picker.setVisible(true); } function pickerCallback(data) { if (data.action == google.picker.Action.PICKED) { $scope.showspinner = true; var doc = data.docs[0]; var fileId = doc.id; var request = gapi.client.drive.files.get({ 'fileId': fileId }); request.execute(function (resp) { var token = gapi.auth.getToken(); var fileData = { name: resp.title, link: resp.downloadUrl, accessToken: token.access_token, tokenType: token.token_type, mimeType: resp.mimeType }; var jsondata = JSON.stringify({ FileData: fileData }); $http.post('/api/controllers/files/CloudDownload', { googleFileData: fileData}). success(function (data, status, headers, config) { onFileUploadSuccess(data); }). error(function (data, status, header, config) { $scope.showspinner = false; }); }); } else if (data.action == google.picker.Action.CANCEL) { $scope.sh…
tagged with: javascript
has title: How to prevent the popup blocker for google API drive picker
downvote count: 0

http://stackoverflow.com/comment/43786963
has text: Fix the title of your post. The regexp is working fine. What is not working is your understanding of how `match` works.
type: QuestionComment
comment on: http://stackoverflow.com/q/27686537
type: Comment
score: 1

http://stackoverflow.com/comment/44227024
type: AnswerComment
has text: (1) Euler angles are not unique, so continuity will always be an issue. Maybe [ -pi, pi ] range will work better... (2) You could use `camera.getWorldDirection( result )`, and then compute the yaw yourself from `result.x` and `result.z`. Based on your continuity requirement, I think that is best approach in your case.
comment on: http://stackoverflow.com/a/27757062
type: Comment
score: 0

http://stackoverflow.com/comment/43918937
has text: hi also can you show how to use this slider in ebay, a script. i'm actaully confused about how to load the slider when it is in ebay template..
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27754032

http://stackoverflow.com/comment/43998603
type: Comment
has text: @JukkaK.Korpela I am asking for a workaround, as stated in the original question, so that I can use 'min' as the larger of the two numbers and decrement it with each step.
score: 0
comment on: http://stackoverflow.com/q/27794439
type: QuestionComment

http://stackoverflow.com/comment/43786346
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27683931
has text: @NeilLunn Yes :) just wanted to make sure if there is any direct geo spatial query that works this way... so far I havent found any such direct query :(
score: 0

http://stackoverflow.com/a/27715347
has comment: http://stackoverflow.com/comment/43842724
has body: $("div:not(.doneAnimated)") is what you are looking for. The :not() function can contain any CSS selector, so insert .doneAnimated into it.
answers question: http://stackoverflow.com/q/27715316
score: 0
type: Answer

http://stackoverflow.com/comment/43757160
type: QuestionComment
has text: There is an answer here: http://stackoverflow.com/a/17558885/151770 that would work but that's quite a bit of code...
score: 0
comment on: http://stackoverflow.com/q/27670824
type: Comment

http://stackoverflow.com/comment/87240405
type: AnswerComment
type: Comment
has text: not best but is definitely very likely; depends also on the scope of the problem. Writing 100% defensively is usually applicable in open ended public APIs or where you know the shape/signature of data is completely open-ended.
comment on: http://stackoverflow.com/a/27746373
score: 2

http://stackoverflow.com/comment/43709862
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27645876
has text: Yes, it is conflicting me on server and client side.
score: 0

http://stackoverflow.com/q/27657661
downvote count: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27691087
type: Question
has body: I'm developing a .NET application using twitter bootstrap. I'm loading an image in .aspx page and saving that page as html file. Here is my code: protected void Page_Load(object sender, EventArgs e) { string ISMfilePath = Server.MapPath("~/Download/"); string FileNamePath = @D:"/Export.html"; StreamWriter sWriter = File.CreateText(FileNamePath); StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); pnlData.RenderControl(htw); sWriter.WriteLine(sw.ToString()); sWriter.Close(); } &lt;asp:Panel ID="pnlData" runat="server" class="pnlData" style="background- color:White;"&gt; &lt;img src="mountain.jpg" alt="" style="width:128px;height:128px"/&gt; &lt;/asp:Panel&gt; I'm able to create a html file but mountain.jpg is not getting loaded in html page. Image is not saved in html page.
upvote count: 0
score: -2
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43731118
has title: Image is not saved while creating a html file
tagged with: asp.net
accepted answer: http://stackoverflow.com/a/27691087
favorite count: 0
has comment: http://stackoverflow.com/comment/43731120
tagged with: twitter-bootstrap

cryptography
tag name: cryptography
tags question: http://stackoverflow.com/q/27727024
type: Tag
tags question: http://stackoverflow.com/q/27729908
tags question: http://stackoverflow.com/q/27780086
tags question: http://stackoverflow.com/q/27690925

http://stackoverflow.com/comment/43860950
has text: var dataString = '{\n"State":"2"\n"IpAddr":"' + firstRServerIP + '"\n}'; This syntax works fine.
comment on: http://stackoverflow.com/a/27658603
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/76143623
has comment: http://stackoverflow.com/comment/134282571
has comment: http://stackoverflow.com/comment/134282378
has comment: http://stackoverflow.com/comment/134282395
score: -2
has comment: http://stackoverflow.com/comment/134282305
type: Answer
upvote count: 0
has body: Note that if you know the property names in advance, you can get multiple orders of magnitude of improvement by writing them out in an object literal: function cloneObject(obj) = { return { "property1": obj.property1, "property2": obj.property2, //Etc. } } Anything that involves a loop is going to be slow, so if there's an easy way to avoid the loop, do that instead. Here are the results of some tests I ran in the most recent (as of April 2023) version of Chrome: structuredClone(obj): 200 copies per ms. JSON.parse(JSON.stringify(obj)): 400 copies per ms. Getting the object's properties with Object.keys() and looping over them with a while loop, removing the first element from the list on each iteration: 2000 copies per ms. Getting the object's properties with Object.keys and looping over them with forEach(): 2100 copies per ms. Getting the object's properties with Object.keys() and looping over them with a traditional for loop: 2250 copies per ms. Looping over a predefined list of properties with for... of: 2300 copies per ms. {...obj}: 2500 copies per ms. Object.assign({}, obj): 3100 copies per ms. Object literal with predefined properties: 1 million copies per ms.
downvote count: 2
answers question: http://stackoverflow.com/q/27751121

http://stackoverflow.com/a/27748136
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27725461
has body: The issue was raised before in GitHub issue #10563. The immutability of returned objects/arrays from page context seems to be undocumented behavior: I think this is a "QVariant" behaviour: the returned object is immutable. I don't understand why, and it's not documented explicitly. The issue contains also some workarounds to convert an immutable object into a normal object like this: result = JSON.parse(JSON.stringify(result)); Before using the result or this: var resultStr = page.evaluate(function() { return JSON.stringify(result); }); var result = JSON.parse(resultStr);
has comment: http://stackoverflow.com/comment/43922598
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27725461

http://stackoverflow.com/comment/43977995
comment on: http://stackoverflow.com/q/27783878
type: QuestionComment
type: Comment
score: 1
has text: It's too late. What if user loses connection, or power? You need to rethink your process

http://stackoverflow.com/q/27677617
has answer: http://stackoverflow.com/a/27677718
type: AnsweredQuestion
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27677659
tagged with: ajax
has answer: http://stackoverflow.com/a/27677659
type: Question
tagged with: php
has comment: http://stackoverflow.com/comment/43769631
tagged with: image-uploading
has answer: http://stackoverflow.com/a/27677683
has body: I'm working on JS Ever ajax multiple image uploader. It works really great but one thing. I need the working page reload after all file finish upload. Yes, there's a function to do something after a file uploaded like : success, complete or done. But these callback is per file. It's mean if I add a reload function to it. The page will be reloaded right after the first file is finished upload. I've tried. complete:function(file,xhr){alert("ok")} It works! But it's 3 ok popups since I uploaded 3 files. I need only one "OK" alert after the 3rd file is upload. Please suggest. $('#uploader').JSAjaxFileUploader({ uploadUrl: 'upload.php', complete: function (file, xhr) { $(alert("ok")); } }); This is the DEMO.
score: 0
answer count: 3
tagged with: javascript
has title: How to refresh current page after ajax upload complete
accepted answer: http://stackoverflow.com/a/27677683

http://stackoverflow.com/q/27723406
has comment: http://stackoverflow.com/comment/43859271
type: Question
has comment: http://stackoverflow.com/comment/43858760
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27826928
tagged with: ssl
has comment: http://stackoverflow.com/comment/43867218
has answer: http://stackoverflow.com/a/27826928
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Making insecure images sources secure client-side
score: 0
has body: I let users on my VanillaForums forum choose whether or not to use the https protocol and I want to test if I can change image sources on the client's side using jQuery. I want this code to change the protocol in the image source links to // instead of http:// and load before the images have loaded, so I used .ready(): $(document).ready(function () { if (window.location.protocol == "https:") { var $imgs = $("img"); $imgs.each(function () { var img_src = $(this).prop("src"); if (img_src.indexOf("http://") &lt; 0) return; var new_img_src = img_src.replace("http:", ""); $(this).prop("src", new_img_src); }); } }); While it does work in changing the image sources, the URL bar still shows this: And the console gives a warning that http://someimageurl... is not secure. Do I need to move the code to the top of the page or will that not make a difference?

http://stackoverflow.com/a/57883911
has body: To disable all rules on a specific line: alert('foo'); // eslint-disable-line
downvote count: 0
upvote count: 14
type: Answer
answers question: http://stackoverflow.com/q/27732209
score: 14

http://stackoverflow.com/comment/43988587
comment on: http://stackoverflow.com/a/27762830
has text: I have a little problem: In my line::: this.click('#botonenviar'); I get this: TypeError: 'undefined' is not a function (evaluating 'this.click('input.submit')')
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27770945
type: Answer
answers question: http://stackoverflow.com/q/27770898
downvote count: 0
score: 1
upvote count: 1
has body: The problem here is that you have declared Person as an object, and you can't use new Person() with an object. To create a "class" in ES5 you create a function instead. var person = (function(){ var Person = function() { this.init = function() { console.log('Initing!') } }; return new Person(); })(); console.log(person); http://jsfiddle.net/758zL8v3/

http://stackoverflow.com/comment/43827246
comment on: http://stackoverflow.com/q/27707209
score: 0
type: Comment
type: QuestionComment
has text: @AllisonC you should begin with scoping your variables: always avoid assigning global variables, remember declaring them using `var` keyword or you'll be likely to have problems. In your case, `openings`, `photos_selected_opening` and `photos_selected_opening_value` are global and should not be, especially while iterating.

http://stackoverflow.com/q/27648074
has comment: http://stackoverflow.com/comment/43713978
has answer: http://stackoverflow.com/a/27648136
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43713910
tagged with: spring-mvc
has comment: http://stackoverflow.com/comment/43713729
type: Question
has title: send all text option in select with request
tagged with: javascript
has body: I use ajax to dynamically populate a drop-down select. Now i want to send all select option text with my request. ... xxx yyy .... i want send in request xxx , yyyy , ....
score: 0
has comment: http://stackoverflow.com/comment/43713803
has comment: http://stackoverflow.com/comment/43716467
answer count: 1
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/q/27727855
has comment: http://stackoverflow.com/comment/43867724
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43867684
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27728018
type: Question
has comment: http://stackoverflow.com/comment/43867757
has comment: http://stackoverflow.com/comment/43867705
score: 0
has body: everything works fine with the first and third media query but when my screen is in the middle one: @media only screen and (min-width: 481px) and (max-width: 600px) it doesn't work . @media only screen and (min-width: 300px) and (max-width: 480px) { // some css styles // } @media only screen and (min-width: 481px) and (max-width: 600px) { // some css styles // } @media only screen and (min-width: 601px) and (max-width: 1024px) { // some css styles // } New Responsive design web page
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27728018
has title: One of my media queries is not responding
has comment: http://stackoverflow.com/comment/43867698

http://stackoverflow.com/a/27738337
has body: \[|\] Try this.Replace by empty string.See demo. https://www.regex101.com/r/fG5pZ8/4 var re = /\[|\]/g; var str = '[[[{"Name":"A","No":"8000444284"}],{"Name":"B","No":"8485990983"}],{"Name":"C","No":"0000000000"}]'; var subst = ''; var result = str.replace(re, subst);
has comment: http://stackoverflow.com/comment/43887937
has comment: http://stackoverflow.com/comment/43887809
type: Answer
accepted answer of: http://stackoverflow.com/q/27738321
score: 3
has comment: http://stackoverflow.com/comment/43888029
upvote count: 3
has comment: http://stackoverflow.com/comment/43887911
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27738321

http://stackoverflow.com/q/27688349
type: Question
tagged with: canvas
upvote count: 1
has answer: http://stackoverflow.com/a/27688677
tagged with: javascript
favorite count: 0
has title: Storing large size images from canvas html5?
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: There js script loading and manipulation of the image using the library fabricjs. The dimensions of the canvas 600x350 pixels. If the canvas upload images smaller, and after I save the canvas with a file on disk, then everything is fine. But when I load the image into the canvas larger than the size of the canvas (viewport) and then save the file to disk, then why is scribbled image to the size of the canvas. Please tell me how to save the image from the canvas that is larger than the size of the canvas?
type: UnansweredQuestion
downvote count: 0
score: 1
tagged with: fabricjs

http://stackoverflow.com/q/27703531
type: Question
tagged with: testing
tagged with: protractor
tagged with: javascript
has title: Protractor click link and compare server response with file
upvote count: 3
answer count: 1
has body: I'm building a system where users upload files. I've managed to test the file uploading with Protractor, but now I need to verify that when requesting the raw file from the server the response is the same as the uploaded file. A user downloads the file by clicking a link, which triggers a normal GET request for the file. Since I'm dealing with plain text files, the downloaded file is not served as an attachment but instead displayed in the browser. The relevant PHP code is: header('Content-Type: text/plain'); header('Content-Length: ' . $file-&gt;getSize()); header('Content-Disposition: filename="file.txt"'); $file-&gt;openFile('rb')-&gt;fpassthru(); I've got two problems: How do I make protractor wait until the entire file has been downloaded? How do I compare the downloaded file to what I uploaded? Here's what I got so far: var path = require('path'); function uploadFile(filename) { var absolutPath = path.resolve(__dirname, filename); $('input#fileupload').sendKeys(absolutPath); } describe('Download', function() { it('should be exactly the same as an uploaded text file', function() { uploadFile('data/2.txt'); browser.wait(function() { return element(by.id('download-button')).isPresent(); }); element(by.id('download-button')).click(); // Wait until page is loaded // Compare uploaded file with downloaded file }); });
has comment: http://stackoverflow.com/comment/43834134
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: e2e-testing
score: 3
has answer: http://stackoverflow.com/a/27705560
linked to: http://stackoverflow.com/q/21935696
downvote count: 0

http://stackoverflow.com/comment/48485244
type: AnswerComment
has text: Could you please elaborate more your answer adding a little more description about the solution you provide?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/30189695

http://stackoverflow.com/comment/43869736
type: AnswerComment
type: Comment
has text: Hiding the inputs and styling the labels is keyboard inaccessible.
score: 1
comment on: http://stackoverflow.com/a/27727871

http://stackoverflow.com/comment/43897168
type: Comment
type: QuestionComment
has text: Why would you want to? Wouldn't that be a tad confusing? Sounds like you're looking for a factory pattern.
comment on: http://stackoverflow.com/q/27743164
score: 0

http://stackoverflow.com/a/27737845
has body: CSS Tricks to the rescue again: http://css-tricks.com/set-font-size-based-on-word-count/ Per that link you can detect/set word limits and then add an inline font size declaration to suit: $(function(){ var $quote = $(".post p:first"); var $numWords = $quote.text().split(" ").length; if (($numWords &gt;= 1) &amp;&amp; ($numWords &lt; 10)) { $quote.css("font-size", "36px"); } else if (($numWords &gt;= 10) &amp;&amp; ($numWords &lt; 20)) { $quote.css("font-size", "32px"); } else if (($numWords &gt;= 20) &amp;&amp; ($numWords &lt; 30)) { $quote.css("font-size", "28px"); } else if (($numWords &gt;= 30) &amp;&amp; ($numWords &lt; 40)) { $quote.css("font-size", "24px"); } else { $quote.css("font-size", "20px"); } });
answers question: http://stackoverflow.com/q/27737720
has comment: http://stackoverflow.com/comment/43887971
has comment: http://stackoverflow.com/comment/78121665
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43889655
upvote count: 3
has comment: http://stackoverflow.com/comment/43889703
score: 3

http://stackoverflow.com/comment/43704841
has text: I'm just wondering if there's a way to do this without having to reload the entire page. Also, should I change it to data-page, then?
comment on: http://stackoverflow.com/q/27643091
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27713854
tagged with: html5-filesystem
answer count: 0
score: 7
has comment: http://stackoverflow.com/comment/43987538
upvote count: 7
type: Question
tagged with: javascript
downvote count: 0
has comment: http://stackoverflow.com/comment/43989714
favorite count: 0
tagged with: google-chrome-app
has comment: http://stackoverflow.com/comment/43990208
type: UnansweredQuestion
has title: Chrome App SecurityError on file creation
has body: I have the following code: chrome.runtime.getPackageDirectoryEntry(function(directoryEntry) { directoryEntry.getFile("files/test.txt", {create: true, exclusive: false}, function(fileEntry) { console.log(fileEntry); }, function(error) { console.log(error); }); }); If the file does not exist and create is true I get an It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources. error. But if it does exist and create is false I get access to the file. What am I doing wrong?

http://stackoverflow.com/comment/43935666
type: Comment
has text: beats me... All I can offer is my `+1`.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27762197

http://stackoverflow.com/a/27666219
has body: You're almost certainly wasting your time worrying about these sort of optimizations. Calling this.myArray() isn't doing any significant calculation. Copying straight from the knockout source code, the logic that executes when invoking an observable or an observable array is as follows: function observable() { if (arguments.length &gt; 0) { // Write //[Omitted since not relevant here] } else { // Read ko.dependencyDetection.registerDependency(observable); return _latestValue; } } Other than the overhead of the function invocation and the small amount of work done by the dependency detection (which is likely basically just a noop function when you aren't calling from within a computed); the observable function just returns a reference to the array or whatever object it happens to be holding at the moment, and there's very little cost for an object reference. The length of the array simply isn't a factor. It doesn't "become a problem with bigger arrays", (at least the knockout part doesn't; the rest of the algorithm might depending on what you're doing) , and your caching of a value that knockout has already cached certainly isn't going to be a major performance gain. (It probably won't make it worse either; though I'd consider it a hit to readability since it's introducing new variables) As with any performance question; the standard disclaimers apply: you should only be concerned with this if you've demonstrated first that this is an area of the code that needs optimization, and secondly that it's this knockout invocation that is a significant performance issue. If that's your situation, sure you can do some benchmarking to see if caching the value improves your performance any, but based on how you phrased your question it seems that there is a more basic misunderstanding here.
score: 4
has comment: http://stackoverflow.com/comment/43750500
has comment: http://stackoverflow.com/comment/43759304
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43886676
type: Answer
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/43747402
accepted answer of: http://stackoverflow.com/q/27665032
has comment: http://stackoverflow.com/comment/43909822
answers question: http://stackoverflow.com/q/27665032

http://stackoverflow.com/a/27742407
answers question: http://stackoverflow.com/q/27741998
type: Answer
has comment: http://stackoverflow.com/comment/43922280
has body: Sublime Text 2 has settings which keep indentation consistent with the previous line, so if your comment has 1-space indentations: /* * Notice how all these lines, including the last one, * have an extra 1-space indentation at their start, * (it's what keeps the asterisks aligned) */ That 1-space indentation will continue until you hit backspace to get rid of it. You can change these settings manually, Edit %appdata%\Sublime Text 2\Packages/Default/Preferences.sublime-settings, line 59, from "auto_indent": true, to "auto_indent": false, You could alternatively change your User settings, %appdata%\Sublime Text 2\Packages/User/Preferences.sublime-settings to contain this new line.
score: 0

http://stackoverflow.com/comment/43838163
comment on: http://stackoverflow.com/a/27704572
type: Comment
has text: Setting axis range can be done this way - http://c3js.org/samples/api_axis_range.html and this way - http://c3js.org/samples/axes_y_range.html
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43844543
has text: @Selshas - yes, you can create an actual named function that calls `o.f()` and then use that with both `.addEventListener()` and `.removeEventListener()`.
type: Comment
comment on: http://stackoverflow.com/a/27716238
score: 1
type: AnswerComment

http://stackoverflow.com/q/27788991
type: Question
has body: In Chrome the drag event is fired and logged to the console. In Firefox and IE, it does not. Fiddle version: http://jsfiddle.net/korimako/e1wqafyr How do I set up a div to dispatch drag events and listen for them properly?
answer count: 2
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27789083
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: The drag event not firing in Firefox or IE
score: 6
has answer: http://stackoverflow.com/a/75069077
tagged with: draggable
upvote count: 6
has answer: http://stackoverflow.com/a/27789083
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/75069077

http://stackoverflow.com/comment/43997082
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27793855
has text: Use @thebjorn's solution

http://stackoverflow.com/q/27672800
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43761080
has title: Javascript working only locally, not after hosting the application
has comment: http://stackoverflow.com/comment/43761403
has body: I want a popup to be shown and then page to be redirected to another one on click of the button. The webpage is developed in C#. I have written following code which is working fine when I run the application locally. But when it is hosted the popup is not getting displayed though the page is getting redirected. ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "SomeAction", "alert('Action SUCCESSFUL'); window.location='" + VirtualPathUtility.GetDirectory(Request.Path) + "MyPage.aspx';", true);
has comment: http://stackoverflow.com/comment/43761245
answer count: 0
has comment: http://stackoverflow.com/comment/43761400
score: 0
type: Question
tagged with: c#
tagged with: javascript
has comment: http://stackoverflow.com/comment/43761495

http://stackoverflow.com/comment/43764690
has text: It would be much easier to have a submit button and then call your function onSubmit.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/27674798
type: QuestionComment

http://stackoverflow.com/a/27702678
type: Answer
has comment: http://stackoverflow.com/comment/43817941
score: 1
upvote count: 1
downvote count: 0
has body: Demo Fiddle Try this one $('.ageUrl li a').on('click', function(e){ e.preventDefault(); ageUrl = $(this).attr("href"); if($(this).parent('li').hasClass('selectedBg')){ $('.ageUrl li, .ageUrl li a').removeClass('selectedBg'); } else { //$(this).addClass('selectedBg'); $('.ageUrl li, .ageUrl li a').removeClass('selectedBg'); $(this).closest('li').addClass('selectedBg'); //$(this).closest('li').toggleClass('selectedBg') console.log(ageUrl); } }); $('.crossIconSel').on('click', function(){ alert('hi'); $('.ageUrl li, .ageUrl li a').removeClass('selectedBg, crossIconSel'); });
answers question: http://stackoverflow.com/q/27702623

http://stackoverflow.com/comment/54877019
has text: I think this is better way, passing object params as hidden: http://stackoverflow.com/questions/20632255/angularjs-pass-an-object-into-a-state-using-ui-router
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27647367
score: 0

http://stackoverflow.com/comment/126091620
has text: This answer is also outdated with the current versions of plugin/cordova
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27653423

session-timeout
type: Tag
tags question: http://stackoverflow.com/q/27700306
tag name: session-timeout

http://stackoverflow.com/comment/43822796
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27703505
has text: @HishamMuhd any problem please let me know.

http://stackoverflow.com/comment/43961484
type: AnswerComment
score: 0
type: Comment
has text: The first one doesn't work but thanks for your answer
comment on: http://stackoverflow.com/a/27775397

http://stackoverflow.com/q/27779021
has answer: http://stackoverflow.com/a/27779450
has body: I've made a menu which pushes the canvas to the right when clicking on it. But when you open the menu, and you choose a chapter to go to, the menu doesn't close automatically. So you're forced to push the menu button again to close the menu, but I want it to close it self after you chose a chapter. An other option is that the menu button or header is fixed. But when I do that, the button won't slide to the right when you push it, so you aren't able to push to close it... I hope I made my story understandable. Here's the JSFiddle HTML Menu Home Catering Menu Contact Show/Hide Left Slide Menu Show/Hide Right Slide Menu Show/Hide Top Slide Menu Show/Hide Bottom Slide Menu Show/Hide Left Push Menu Show/Hide Right Push Menu CSS .cbp-spmenu { position: fixed; background: #333; -webkit-box-shadow: inset -15px 0px 17px -7px rgba(0, 0, 0, 0.58); -moz-box-shadow: inset -15px 0px 17px -7px rgba(0, 0, 0, 0.58); box-shadow: inset -15px 0px 17px -7px rgba(0, 0, 0, 0.58); } .cbp-spmenu h3 { font-size: 1.9em; padding: 20px; margin: 0; font-weight: 300; font-family:'Amatic SC', cursive; color: white; } .cbp-spmenu a { display: block; font-size: 1.1em; font-weight: 300; font-family:'Amatic SC', cursive; color: white; text-decoration: none; } .cbp-spmenu a:hover { background: rgba(65, 65, 65, 0.3); } .cbp-spmenu a:active { } .cbp-spmenu-vertical { width: 240px; height: 100%; top: 0; z-index: 1000; } .cbp-spmenu-vertical a { padding: 1.2em; } .cbp-spmenu-left { left: -240px; } .cbp-spmenu-left.cbp-spmenu-open { left: 0px; } .cbp-spmenu-push { overflow-x: hidden; position: relative; left: 0; } .cbp-spmenu-push-toright { left: 240px; } .cbp-spmenu, .cbp-spmenu-push { -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; transition: all 0.3s ease; } @media screen and (max-height: 26.375em) { .cbp-spmenu-vertical { font-size: 90%; width: 190px; } .cbp-spmenu-left, .cbp-spmenu-push-toleft { left: -190px; } } body, html { border: none; margin: 0; padding: 0; background: #ccc; fo…
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27779551
tagged with: javascript
tagged with: fixed
answer count: 3
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27779714
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: menu
type: UnansweredQuestion
score: 1
has title: Close menu after click

http://stackoverflow.com/q/27750642
accepted answer: http://stackoverflow.com/a/27750702
score: 2
type: AnsweredQuestion
has body: I'm a three.js beginner. I'm attempting to add a sphere to the scene, using position coordinates returned from a JavaScript get request. A sphere created before the get request is rendered properly, but a sphere created and added to the scene in the callback function is not rendered - although if I debug and inspect the scene, both spheres exist as its children. My code: var sphere = new THREE.Mesh( new THREE.SphereGeometry(radius), sphereMaterial); sphere.position.set(-20,-20,-20); scene.add(sphere); // this sphere shows sphere2 = sphere.clone(); sphere2.position.set(50,50,50); // testing initializing outside $.get("{% /graph %}",function(data,status){ scene.add(sphere2); // this sphere does not show }); renderer.render(scene, camera); I tried initializing the second sphere inside and outside the callback, I've tried creating the new sphere instead of cloning, I'm not sure what else to try and I don't know what I'm missing.
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27750702
downvote count: 0
answer count: 1
tagged with: jquery
has title: Cannot render Three js objects added to the scene within a jQuery $.get request function
favorite count: 0
upvote count: 2
tagged with: three.js

http://stackoverflow.com/comment/43710556
type: QuestionComment
type: Comment
has text: I think you just need to adapt your save object a bit, other than that, your saving and loading in localstorage is good. See my answer and jsfiddle example there.
score: 0
comment on: http://stackoverflow.com/q/27646203

http://stackoverflow.com/comment/43906658
has text: Short answer: yes. Do you have the ability to check if a page exists (with your server)?
comment on: http://stackoverflow.com/q/27747765
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27763757
downvote count: 0
answers question: http://stackoverflow.com/q/27763737
type: Answer
upvote count: 1
has body: Check the current classname inside the function. $(".sp-left, .sp-right").each(function(){ var el = $(this); if (el.hasClass('sp-left')) { el.removeClass("sp-left").addClass("sp-right"); } else { el.removeClass("sp-right").addClass("sp-left"); } });
score: 1
has comment: http://stackoverflow.com/comment/43938435

http://stackoverflow.com/q/27655328
has comment: http://stackoverflow.com/comment/43780941
has comment: http://stackoverflow.com/comment/43780000
score: 0
has comment: http://stackoverflow.com/comment/43727485
answer count: 1
has comment: http://stackoverflow.com/comment/43726931
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43727006
has comment: http://stackoverflow.com/comment/43726845
tagged with: youtube
tagged with: youtube-javascript-api
has title: Unable to stop YouTube video using jQuery on IE
has body: For a website I am developing, I need to stop youtube videos(embedded using iframe) when a particular event occurs. So I tried some sample jQuery(very rough, so forgive me:P) as follows: But the video stops only works on Chrome and firefox. It doesn't stop on IE. I tried on IE 11 and 10. I know there are many questions around here regarding stopping youtube iframe and I have gone through most of them. But I cannot figure out where I'm wrong. Or if this cannot work in IE, can you give me any other suggestion(other than youtube api)? So I would appreciate any help you guys can give me!! EDIT: Please try this link - https://www.googledrive.com/host/0B58rEiAJ1HiaeEU2eWNHem5WM0U
has comment: http://stackoverflow.com/comment/43727121
has comment: http://stackoverflow.com/comment/43726914
has comment: http://stackoverflow.com/comment/43755789
type: Question
has answer: http://stackoverflow.com/a/27656195
has comment: http://stackoverflow.com/comment/43728047
tagged with: internet-explorer
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/27658973
has body: This is a technique using Expression Language in a JSP. Red Green Blue I do not like this solution, but it is simple to write here. I would not use this solution in a large site. Another solution is to set the values in a map using Java, then access the value in the JSP. Include this code in the JSP: <%@page contentType="text/html" pageEncoding="UTF-8" import="java.util.Map,java.util.HashMap"%> <% Map<String, String> sport = new HashMap<String, String>(); sport.put(request.getParameter("sport"), "selected"); request.setAttribute("sport", sport); %> Write the select group as: NFL NBA MLB I prefer to create simple JSPs that do not contain Java code. The best solution is to use a servlet behind the JSP and move all the Java code to the servlet, leaving the JSP very simple. The above code could be refactored and be split between the servlet and the JSP. This idea could be extended to handle multiple selection lists. It would be useful to create a larger map, named selected, that contains all the smaller maps for all the select groups. Map<String, String> toppings = new HashMap<String, String>(); if (request.getParameterMap().get("toppings") != null) { for (String value : request.getParameterMap().get("toppings")) { toppings.put(value, "selected"); } } Map<String, Map<String, String>> selected = new HashMap<String, Map<String, String>>(); selected.put("toppings", toppings); selected.put("sport", sport); request.setAttribute("selected", selected); The select groups would be modified to access the selected map first, then the group map. Sprinkles Fudge Snickers NFL NBA MLB This could be extended even further so that the selected map is filled automatically, but that requires a bean and annotations.
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27657718
answers question: http://stackoverflow.com/q/27657718
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27672032
has comment: http://stackoverflow.com/comment/43760647
has comment: http://stackoverflow.com/comment/43760725
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/43760071
score: 1
answers question: http://stackoverflow.com/q/27671711
has comment: http://stackoverflow.com/comment/43760791
accepted answer of: http://stackoverflow.com/q/27671711
downvote count: 0
type: AcceptedAnswer
has body: Here's a fiddle that shows a working example: http://jsfiddle.net/9f9w1trs/ As pointed out by Roamer-1888 you had an extra closing &lt;/div&gt; in there. You didn't include the code that actually compiles the template and populates it. The basic idea is that you define a template - like you did &lt;script id="project-template" type="x-handlebars-template"&gt; ....&lt;/script&gt; Then you "compile" the template (you can pre-compile them for performance reasons or if you'd like to only use the lightweight run-time library opposed to the full library). var source = $("#project-template").html(); var template = Handlebars.compile(source); and then you can populate your template with data ... var populatedHtml = template(projectData); and finally you add your populated HTML to the DOM $('#myContent').append(populatedHtml); Handlebars doesn't really care if you add it to a hidden div or not - it just replaces contents between {{}} ;)

http://stackoverflow.com/comment/43907453
type: Comment
type: QuestionComment
has text: probable dupe: http://stackoverflow.com/questions/439630/how-do-you-create-a-javascript-date-object-with-a-set-timezone-without-using-a-s ?
comment on: http://stackoverflow.com/q/27748127
score: 0

http://stackoverflow.com/q/27762007
has title: Call pointerUp Animation When Mouse Moves Away From Button
tagged with: javascript
type: Question
score: 0
answer count: 1
tagged with: winjs
has answer: http://stackoverflow.com/a/27762066
accepted answer: http://stackoverflow.com/a/27762066
has body: I have an anchor tag &lt;a&gt; with display:block; hooked up to a mousedown pointerDown animation. I'm currently running a pointerUp animation when the click event registers, which works great, until you press down the mouse button, drag your mouse off of the link, and the animation gets stuck. Is there an event listener that fires when your mouse button is still depressed but your cursor leaves the bounding box of an element? Or is there something else I can call that will "unpress" the button?
tagged with: windows-store-apps
type: AnsweredQuestion

http://stackoverflow.com/q/27652395
has body: I have When i insert html document.getElementsByTagName('textarea').value = " Content "; The html does not get rendered inside the Is there a way to render html inside textarea?
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27652404
has title: Insert html inside text area
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27652417

http://stackoverflow.com/a/27667210
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/27667160
has comment: http://stackoverflow.com/comment/43751916
has body: simply give an id to your a tag, and use following javascript function : function jump(id){ var top = document.getElementById(id).offsetTop; //Getting Y of target element window.scrollTo(0, top); //Go there. }​ and in onload of body tag, call the function by passing the id of the anchor tag
type: Answer
upvote count: 1

http://stackoverflow.com/comment/43855270
comment on: http://stackoverflow.com/a/27721557
score: 0
type: AnswerComment
type: Comment
has text: Just make your appointment an array and call var jsonString = JSON.stringify(appointment);

http://stackoverflow.com/a/27802636
has comment: http://stackoverflow.com/comment/44014658
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27802171
score: 4
has comment: http://stackoverflow.com/comment/44016150
type: Answer
answers question: http://stackoverflow.com/q/27802171
has body: You should not be using CSS to try to control the Isotope effects, as these can conflict with Isotope’s transitions, causing the weird effects you see. You should remove your .isotope styles and instead use the visibleStyle, hiddenStyle, and transitionDuration options when you initialize Isotope. var iso = new Isotope( '.isotope', { itemSelector: '.item', layoutMode: 'fitRows', hiddenStyle: { opacity: 0 /* , transform: 'scale(0.001)' -- disabled scaling */ }, visibleStyle: { opacity: 1 /* , transform: 'scale(1)' -- disabled scaling */ }, transitionDuration: '0.8s' }); You can read more about these on the Isotope options page. Here is a codepen with these changes applied. EDIT: Isotope doesn’t support turning off only the position transitions with any of the built in options (although you can turn off all transitions by setting transitionDuration to 0 or using the undocumented isLayoutInstant: true option), but you can overwrite the _positionItem function to force the behavior you want. Just place the following code at the beginning of your JavaScript: var positionFunc = Isotope.prototype._positionItem; Isotope.prototype._positionItem = function( item, x, y, isInstant ) { // ignore actual isInstant value, pass in `true` to the original function; positionFunc(item, x, y, true); }; Here is an updated codepen with this applied.

http://stackoverflow.com/a/27660652
has comment: http://stackoverflow.com/comment/43737542
type: Answer
score: 2
has body: You are only storing one of the touchend events, but in all likelihood, you need multiple events to properly emulate a finger swipe. For example, open this demo in a mobile device. You'll see that swiping the scrolling div results in multiple touchmove events being logged, which track your finger as it moves around the page. var log = document.getElementById('log'); var logEvent = function(ev) { var d = new Date(); var msg = document.createTextNode(d.getTime() + ' :: received ' + ev.type + '\n'); log.appendChild(msg); }; // stash away events on a carousel var element = document.getElementById('listener'); element.addEventListener('touchstart', logEvent, false); element.addEventListener('touchmove', logEvent, false); element.addEventListener('touchend', logEvent, false); #log, #listener { width: 40%; position: absolute; top: 5%; bottom: 5%; overflow-x: hidden; overflow-y: auto; } #listener { padding: 0 2%; border: 1px solid green; left: 2%; } #log { border: 1px solid blue; right: 2%; } I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I am a long scrolling div. I…
downvote count: 0
answers question: http://stackoverflow.com/q/27660474
upvote count: 2

http://stackoverflow.com/comment/43843759
score: 1
comment on: http://stackoverflow.com/q/27715813
type: Comment
type: QuestionComment
has text: @LJ_1102 You should post your comment as an answer.

http://stackoverflow.com/q/27659860
has answer: http://stackoverflow.com/a/27660602
has body: OUTLOOK: I have a website which has a page called questions.html . In the page , there are many questions with answers. Each question is a div element. The answers is also a div and are hidden initially and is visible only when a button is clicked. ATTEMPT & PROBLEM: I have done it successfully for one set of question and answer , but when I do the same for another set the whole system gets messy. When I click on the button on the second question div , the answer div of the first question div shows up. But I want the button on the second question div to open the answer div of the second question div. HTML : This is the 1st answer Click For Answer This is the 1st answer Click For Answer JavaScript : function show() { var div=document.getElementById("answer1"); var button=document.getElementById("button1"); div.style.display="block"; button.style.display="none"; } I also noticed that it happens because my variables div and button wont select the div with the next set of ids (answer2 and button2) MY APPROACH: So I thought of creating a new function for each set of question and answer div. But this seems very unprofessional. So is there any other way? Thanks for the help :)
type: AnsweredQuestion
has title: Javascript : one function , many divs
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27659941
has answer: http://stackoverflow.com/a/27660062
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43735450
has answer: http://stackoverflow.com/a/27659896
upvote count: 1
accepted answer: http://stackoverflow.com/a/27659896
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/43735444
possible better answer: http://stackoverflow.com/a/27660602
answer count: 4
has comment: http://stackoverflow.com/comment/43735968

http://stackoverflow.com/q/27651955
has answer: http://stackoverflow.com/a/27652104
accepted answer: http://stackoverflow.com/a/27652104
has comment: http://stackoverflow.com/comment/43720976
tagged with: javascript
has comment: http://stackoverflow.com/comment/43720994
score: 0
answer count: 1
tagged with: button
tagged with: bootstrap-modal
has comment: http://stackoverflow.com/comment/43721364
has body: I have 2 bootstrap models on the same page, the first modal opens and runs as expected. After saving the form data in the first modal, a button is visible to open up the second modal. The button however is not clickable: modal1 I've found a few that have had similar problems with two modals on the same page but there appears to be no common causes. How can I fix this? Preferably I would like the button to work. Iif for whatever reason it's not possible, I'm ok with JS automatically opening the second modal after the 1st one closes. I have also been unsuccessful with getting that to work. I've triple checked that all my tags are closed and correctly spaced. I've omitted a lot of the form content within the modals in the code below for purposes of brevity. I've also included my JS at the end of the page that directs the visibility of the modals. <img src="../0images/cropy.jpg" alt="Listing Image" width="400px" Cancel Save Image Click the button below to add your pdf file and data: modal1 × Listing Designation Designation Cancel Save Listing Chiudi Thank you in advance!
tagged with: twitter-bootstrap
type: AnsweredQuestion
has title: Button for the 2nd Bootstrap modal does not function (not clickable)
type: Question

http://stackoverflow.com/q/27681383
type: Question
linked to: http://stackoverflow.com/q/168214
has body: I want to save value in a textarea to MySQL database using PHP. And then I want to pass it to a variable in javascript The value in a textare could be like this: Hi I'm Son!! Nice to meet you So my 1st question is: How can I add the text to my database using php with the absence of special chars? (Like which encoding...) I'm gonna pass that text through an event of a hyperlink click. It's something like this: <?php echo 'Something'; ?> After all, the javascript I coded is like this: function passExample(Exa){ $("#ExampleShow").empty(); var node = document.createElement("p"); if (Exa=='') Exa=' (No example)'; var textnode = document.createTextNode(html_entity_decode(Exa)); node.appendChild(textnode); document.getElementById("ExampleShow").appendChild(node); } However, the result is not the way I wanted it to be. Line breaks are missing. And if I type some character like ''", it results in errors. How can I fix this?
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/129677
upvote count: 2
type: UnansweredQuestion
tagged with: php
score: 2
has title: TextArea saving to MySQL with php and showing out in html
has answer: http://stackoverflow.com/a/27681571

http://stackoverflow.com/q/27785455
type: Question
has comment: http://stackoverflow.com/comment/43981193
tagged with: javascript
has answer: http://stackoverflow.com/a/27785508
score: -1
upvote count: 2
downvote count: 3
has comment: http://stackoverflow.com/comment/43981084
answer count: 1
tagged with: jquery
has title: jQuery $('select-element').val() not reliable?
favorite count: 0
has comment: http://stackoverflow.com/comment/43981099
tagged with: http://stackoverflow.com/tag/html
has body: I am working with a &lt;select /&gt; element and I have to determine the value of the selected option. I have used jQuery for a while and I thought I knew how to do this before, but I am encountering unexpected results when no option is selected. Here is the JSFiddle that hopefully illustrates my difficulty (whenever the first/guiding option is selected). I tried the following: $(this).val(); $(this).find('option:selected').val(); $(this).find(':selected').val(); This line (below) practically ostracizes jQuery's priceless .val() function, but appears to reliably give me what I am looking for: $(this).find('option:selected').attr('value') Is there a reliable way to determine if the user has not selected a real option?! Note: I have a strong liking for jQuery's .val() function, so finally ended up doing this: $(this).find('option:selected[value]').val()
has comment: http://stackoverflow.com/comment/43980907
has comment: http://stackoverflow.com/comment/43981435
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43981101
has comment: http://stackoverflow.com/comment/43981141
has comment: http://stackoverflow.com/comment/43981013
has comment: http://stackoverflow.com/comment/43981006
has comment: http://stackoverflow.com/comment/43981155
tagged with: select
accepted answer: http://stackoverflow.com/a/27785508

http://stackoverflow.com/a/27700881
score: -1
answers question: http://stackoverflow.com/q/27700620
upvote count: 0
has comment: http://stackoverflow.com/comment/43814737
type: Answer
downvote count: 1
has body: The problem is probably that $scope.bill_total is not an object and therefore cannot be watched. You need to change it to something like $scope.bill_total = {value: 3}. Then when you update the value it should be updated correctly in your view. There should be no reason to call $scope.apply since you are within a digest cycle already. Make sure to change your html to : &lt;div id="total" class="col col-30 cart-item text-right text-black"&gt; Bill Total&lt;br/&gt; ${{ bill_total.value }} &lt;/div&gt;

http://stackoverflow.com/a/27720548
type: Answer
has comment: http://stackoverflow.com/comment/43853242
answers question: http://stackoverflow.com/q/27720489
downvote count: 0
has comment: http://stackoverflow.com/comment/43852870
score: 7
has body: Use document.querySelectorAll to retrieve a NodeList (see also the section "How can I convert NodeList to Array?") then cast it to an array and map a function that returns each element's value. var classesNodeList = document.querySelectorAll(".klass"); var classes = Array.prototype.slice.call(classesNodeList).map(function(element) { return element.value; }); Update As stated in the comment by Ginden, a shorter way to do this is to pass the NodeList to Array.prototype.map using Function.prototype.call var classesNodeList = document.querySelectorAll(".klass"); var classes = Array.prototype.map.call(classesNodeList, function(element) { return element.value; });
has comment: http://stackoverflow.com/comment/43912385
upvote count: 7
has comment: http://stackoverflow.com/comment/43853645
has comment: http://stackoverflow.com/comment/43853464

http://stackoverflow.com/a/27800030
answers question: http://stackoverflow.com/q/27797793
score: 0
type: Answer
has body: Benjamin's answer above is the best given, so I have accepted it. Nevertheless, for the sake of completeness, I wanted to show the (simpler, if less elegant) solution I used in the end, so that future readers can compare and contrast between the code in the question and the code below: &lt;script&gt; var initiateShowNextGuest = []; function showNextGuest(j) { document.getElementsByTagName('fieldset')[j].style.display = 'block'; } function initiateShowNextGuestFunction(i) { return function() { var j = i + 1; document.getElementsByTagName('fieldset')[i].getElementsByTagName('a')[0].addEventListener('click',function(){showNextGuest(j);},false); }; } function initiateShowNextGuests() { for (var i = 0; i &lt; 5; i++) { initiateShowNextGuest[i] = initiateShowNextGuestFunction(i); initiateShowNextGuest[i](); } } window.onload = initiateShowNextGuests(); &lt;/script&gt; In summary, the function initiateShowNextGuests() loops through (and then executes) initiateShowNextGuestFunction(i) 5 times, setting up the 5 anonymous functions which are manually written out in the code in the original question, while avoiding the closure-loop problem.

required
tag name: required
tags question: http://stackoverflow.com/q/27673406
tags question: http://stackoverflow.com/q/27731561
type: Tag

http://stackoverflow.com/q/27752138
has answer: http://stackoverflow.com/a/27752172
has comment: http://stackoverflow.com/comment/43915313
has comment: http://stackoverflow.com/comment/43915419
has body: EDIT: JSFiddle indicates the code itself is good. Can anyone give some insight into why it may not be executing properly as a chrome extension? I'm trying to make a simple To-do list Chrome extension for myself. Here is my code: HTML: To-Do-List TO DO LIST Add TO DO LIST: And the Javascript: When I enter text in the input field then click the button, nothing happens.
tagged with: append
type: AnsweredQuestion
has title: Code not working: Using Javascript to dynamically add items to a list in HTML
score: 0
has comment: http://stackoverflow.com/comment/43915304
accepted answer: http://stackoverflow.com/a/27752172
type: Question
answer count: 2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27752176
has comment: http://stackoverflow.com/comment/43915368
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27752176

http://stackoverflow.com/comment/44020947
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27789906
has text: Hi Elija. Thanks for trying to help out a d3 noob. I added a link to a jsfiddle to the question.
score: 0

http://stackoverflow.com/comment/43957609
has text: changed it and it worked, was focused on the ajax that i didn't notice the markup was wrong, thank you
comment on: http://stackoverflow.com/q/27773089
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27664184
has comment: http://stackoverflow.com/comment/43744204
score: 2
has title: jquery: stop infinite recursion?
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27664296
has answer: http://stackoverflow.com/a/27664260
has body: How do I stop the infinite recursion here so that a mousedown event can be triggered just once? should it be in a separate method? $(document).on('mouseover',function (e) { $(e.target).mousedown(function(e){ e.stopPropagation(); console.log('clicked'); $(e.target).trigger('mousedown'); //use hello(e); instead? return; }) }); $(document).on('mousedown', 'a', function(e){ hello(e); }); function hello(e){ console.log('got it'); } This seems to trigger a never ending loop. Basically I need to bind a mousedown handler on the currently element under the mouse, which will fire a mousedown event that another handler will be able to handle. The reason I am doing this is because the mouseover works on dynamically generated element so when this happens I need to bind a handler again as the on handler is not able to catch the newly generated element.
has comment: http://stackoverflow.com/comment/43744221
type: Question
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/43744181
has comment: http://stackoverflow.com/comment/43744243
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43744288

http://stackoverflow.com/q/27665028
has body: I am trying to create a like buttons for by blog posts. The problem I am facing is that I have no way to link up my like buttons with each blog post. Currently, all the like buttons share the same class and name attributes. I tried to use the following: <?php include_once('connectserver.php'); $query_blog = mysql_query("SELECT `category_x`,`sub_category_x`,`specified_sub_category_x`,`tag_1`,`tag_2`,`tag_3`,`title`,`contents`,`date_posted` FROM `posts` ORDER BY `date_posted` DESC"); while($get_rows = mysql_fetch_assoc($query_blog)) { $get_title = $get_rows['title']; $get_category = $get_rows['category_x']; $get_sub_category = $get_rows['sub_category_x']; $get_specified_sub_category = $get_rows['specified_sub_category_x']; $get_tag1 = $get_rows['tag_1']; $get_tag2 = $get_rows['tag_2']; $get_tag3 = $get_rows['tag_3']; $get_contents = $get_rows['contents']; $get_date_posted = $get_rows['date_posted']; $new_date = date('dS F Y', strtotime($get_date_posted)); echo " ".$get_title." "; echo " ".$new_date." BY | UpVote "; echo " ".$get_contents." "; echo " | POSTED IN ".strtoupper($get_category).", ".strtoupper($get_sub_category).", ".strtoupper($get_specified_sub_category)." | TAGGED ".strtoupper($get_tag1).", ".strtoupper($get_tag2).", ".strtoupper($get_tag3)." | "; echo " "; echo " "; } ?> This piece of code serves to increment the blog counter each time a new blog post is made so that I can link up my blog post with that unique name field. Is that even conceptually possible and if not, what other methods can I use to solve the issue. The above code snippet give me errors btw.
has answer: http://stackoverflow.com/a/27665188
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43745376
tagged with: php
type: Question
has title: Is it possible to embed PHP code within the class or name attributes of HTML tags?
tagged with: facebook-like
has comment: http://stackoverflow.com/comment/43747082
answer count: 3
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43745512
tagged with: javascript
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/27666047
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27665366

http://stackoverflow.com/a/27695632
accepted answer of: http://stackoverflow.com/q/27695459
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/43804606
score: 3
has body: I don't know why your IDs need brackets in them, but do this instead: $('.qty').change(function(){ var newQty = $(this).val(); $('.qty').val(newQty); }); The class selector will apply it to all elements that are of that class, no need for the each.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27695459
upvote count: 3

http://stackoverflow.com/a/27773201
type: Answer
has comment: http://stackoverflow.com/comment/78957029
has comment: http://stackoverflow.com/comment/49639513
has comment: http://stackoverflow.com/comment/78958598
has comment: http://stackoverflow.com/comment/49598090
has comment: http://stackoverflow.com/comment/49649507
has comment: http://stackoverflow.com/comment/49597846
upvote count: 15
has comment: http://stackoverflow.com/comment/49598367
type: AcceptedAnswer
has body: It works, when I host it in the server. The security restrictions causes it to fail.
has comment: http://stackoverflow.com/comment/49642943
score: 13
has comment: http://stackoverflow.com/comment/78958387
has comment: http://stackoverflow.com/comment/79038909
accepted answer of: http://stackoverflow.com/q/27754544
has comment: http://stackoverflow.com/comment/49645839
has comment: http://stackoverflow.com/comment/49599189
answers question: http://stackoverflow.com/q/27754544
has comment: http://stackoverflow.com/comment/49642616
downvote count: 2
has comment: http://stackoverflow.com/comment/79038241

http://stackoverflow.com/q/27756579
has comment: http://stackoverflow.com/comment/43925235
tagged with: javascript
has comment: http://stackoverflow.com/comment/43924819
favorite count: 0
possible better answer: http://stackoverflow.com/a/27767671
has comment: http://stackoverflow.com/comment/43925731
tagged with: cryptojs
tagged with: aes
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27757570
upvote count: 3
tagged with: encryption
has comment: http://stackoverflow.com/comment/43925479
has body: I am writing a Chrome extension which is using CryptoJS for some Apache Thrift work. I am currently trying to get CryptoJS working. I'm facing a problem with CryptoJS decryption of data encrypted by CryptoJS. I'm attaching a test case below, after the problem description. What is happening is the following, I have an array of "bytes": var bArr = [11,0,1,0,0,0,6,100,105,103,101,115,116,11,0,2,0,0,0,152,67,119,65,66,65,65,65,65,69,109,78,111,99,109,57,116,90,83,49,48,90,88,78,48,76,87,78,115,97,87,86,117,100,65,103,65,65,103,65,65,49,68,69,75,65,65,77,65,65,65,65,65,86,75,102,66,85,103,115,65,66,65,65,65,65,67,81,49,90,68,99,119,77,71,73,120,78,67,48,121,78,84,90,107,76,84,81,119,77,109,81,116,79,84,65,48,90,105,48,52,79,84,86,105,78,68,73,50,89,109,78,108,78,84,99,76,65,65,85,65,65,65,65,85,89,50,104,121,98,50,49,108,76,87,78,115,97,87,86,117,100,67,49,122,90,87,78,121,90,88,81,65,11,0,3,0,0,0,36,52,51,52,55,54,56,98,53,45,50,48,102,102,45,52,99,100,102,45,56,53,97,50,45,57,49,49,56,50,98,55,98,51,102,57,53,0]; var stringToEncode = String.fromCharCode.apply(null, bArr); I encrypt it with CryptoJS and then decrypt. First 25 bytes before encryption: 11,0,1,0,0,0,6,100,105,103,101,115,116,11,0,2,0,0,0,152,67,119,65,66,65 After the decryption: 11,0,1,0,0,0,6,100,105,103,101,115,116,11,0,2,0,0,0,194,152,67,119,65,66 The only difference is an additional 194 at position 20. All other bytes are exactly the same, except of padding, obviously. I'm trying to understand where is this coming from. More info regarding hat are these bytes. This is a Thrift structure with 3 fields, field 2 contains a Base64 representation of another, embedded Thrift struct. First 20 bytes of input exmplained: 11,0,1: Thrift field of type string, fid 1 0,0,0,6: int32 length of the value of fid 1 100,67,119,65,66,65: string "digest" 11,0,2: Thrift field of type string, fid 2 0,0,0,152: int32 length of the value of fid 2 67 ... until next byte 11: Base64 representation of the embedded struct Because of…
type: Question
score: 3
has title: CryptoJS AES CBC 256 decrypt adds additional byte in the middle of plaintext
accepted answer: http://stackoverflow.com/a/27757570
has comment: http://stackoverflow.com/comment/43925328
answer count: 2
has answer: http://stackoverflow.com/a/27767671
downvote count: 0

http://stackoverflow.com/comment/43979811
has text: @balexandre [From the last OP's comment](http://stackoverflow.com/questions/27784547/error-in-angular-js#comment43979784_27784804), I would say that he doesn't know that part :)
comment on: http://stackoverflow.com/a/27784804
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27701683
score: 2
type: AnsweredQuestion
upvote count: 2
tagged with: twitter-bootstrap
possible better answer: http://stackoverflow.com/a/27701885
has answer: http://stackoverflow.com/a/27701885
has title: Centering navbar-brand image with centered navbar
type: Question
accepted answer: http://stackoverflow.com/a/27701900
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27701848
favorite count: 0
has answer: http://stackoverflow.com/a/27701854
linked to: http://stackoverflow.com/q/10615872
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27701900
tagged with: css
has body: I'm just learning Bootstrap 3 and I want to use that in my website so it's still comfortable to access from mobile devices. I want to achieve something like this: but this is as far as I get. This is the code: jsfiddle .navbar-brand { position: absolute; width: 100%; left: 0; top: 0; text-align: center; margin: auto; height:30px; } .navbar-brand:hover, .navbar-brand:focus { text-decoration: none; } .navbar-brand > img { display: inline-block; margin:auto; } @media (min-width: 768px) { .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand { margin-left: -15px; } } .navbar .divider-vertical { height: 50px; margin: 0 9px; border-right: 1px solid #ffffff; border-left: 1px solid #f2f2f2; } .navbar-inverse .divider-vertical { border-right-color: #222222; border-left-color: #111111; } @media (max-width: 767px) { .navbar-collapse .nav > .divider-vertical { display: none; } } Home Product About Contact
answer count: 4

http://stackoverflow.com/a/27702115
answers question: http://stackoverflow.com/q/27701953
score: 1
has comment: http://stackoverflow.com/comment/43816934
upvote count: 1
has body: Your issue seems to be with trying to add an event listener inside your function every time there is a mouseup event. Try setting up that.saveTextButton.click(function () separately and just showing the button on mouseup. I had to fiddle with it a little not having all the vars your code needs but you should get the idea: var valid =true; //var valid =false; $('.documentpage').mouseup(function(e){ e.stopPropagation(); if($.trim(window.getSelection().toString()).length) { setTimeout(function () { //delaying to get selection //..other code that checks stuff... if(valid){ $('#saveTextButton').show(); } }, 100); } }); $('#saveTextButton').click(function(){ alert('function called'); }); .documentpage{ height:100px; width:1000px; background-color:#cccccc; } #saveTextButton{ display:none; } this is some test text
has comment: http://stackoverflow.com/comment/43816818
accepted answer of: http://stackoverflow.com/q/27701953
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43816860
has comment: http://stackoverflow.com/comment/43816785
type: Answer

http://stackoverflow.com/comment/43953808
comment on: http://stackoverflow.com/q/27746941
score: 0
type: QuestionComment
has text: difficult to "fiddle" with this - im not really sure which part of the jssor gallery code is causing me an issue (have to say, I'm trying to enhance here - there's nothing actually wrong with the original code!). I'll try to elucidate as I debug
type: Comment

http://stackoverflow.com/comment/43847061
has text: valueOf() returns the **primitive** value of a string, so `customHeader` == "xxxxx" evals to false
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27717065

http://stackoverflow.com/q/27699021
linked to: http://stackoverflow.com/q/13860671
has title: How to slow down an image slideshow in html?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27699049
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43811023
type: Question
has answer: http://stackoverflow.com/a/27709553
has body: Looking for a (simple) way to create a slideshow for my website I found the following question here: How to create image slideshow in html?. I borrowed the (corrected) code, adapted it to my needs and now I have what I wanted, but the transition between the images is too fast. It's not about the speed of the slideshow, but the blending or fading from one image into the next. The changes come too suddenly. I want them to happen gradually and smoothly. What can I add to it or how can I change it to slow it down? Here is it: Thank you for your help.
tagged with: slideshow
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/a/27662954
has comment: http://stackoverflow.com/comment/43775526
has body: You're asking jQuery to animate every time the user scrolls. And since this fires the scroll event: $('html, body').animate({ scrollTop: x }); You will scroll your page up and down endlessly. Use imagesLoaded: https://github.com/desandro/imagesloaded // are those images loaded yet? $('body').imagesLoaded(function() { var dh = $(document).height(); // set the html, body to bottom while you're at opacity 0 $('html, body').animate({ scrollTop: dh }, 0); // transition to opacity 1 $('body').addClass('loaded'); // animate to the top $('html, body').animate({ scrollTop: 0}, 2000); }); Adding a Loading State To add a loading state I'd do something like this. CSS body { opacity: 0; -webkit-transition: opacity 0.5s; -moz-transition: opacity: 0.5s; transition: opacity 0.5s; } body.loaded { opacity: 1; }
has comment: http://stackoverflow.com/comment/43769492
type: Answer
has comment: http://stackoverflow.com/comment/43810189
has comment: http://stackoverflow.com/comment/43799076
score: 1
has comment: http://stackoverflow.com/comment/43807316
has comment: http://stackoverflow.com/comment/43780403
has comment: http://stackoverflow.com/comment/43807788
has comment: http://stackoverflow.com/comment/43774061
has comment: http://stackoverflow.com/comment/43774382
has comment: http://stackoverflow.com/comment/43775279
has comment: http://stackoverflow.com/comment/43784746
accepted answer of: http://stackoverflow.com/q/27662882
has comment: http://stackoverflow.com/comment/43774477
has comment: http://stackoverflow.com/comment/43742987
has comment: http://stackoverflow.com/comment/43774119
answers question: http://stackoverflow.com/q/27662882
has comment: http://stackoverflow.com/comment/43800446
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/43973310
type: Comment
comment on: http://stackoverflow.com/a/27781678
score: 0
type: AnswerComment
has text: All values can be injected with javascript, it's his work to check the received value with php (or whatever server side language he is using).

http://stackoverflow.com/comment/43740911
type: QuestionComment
has text: @Scott i am not receiving any errors messages, it's actually saying the email has been sent once i have submitted, however i am not recieveing the email in my inbox
comment on: http://stackoverflow.com/q/27659786
score: 0
type: Comment

http://stackoverflow.com/comment/43959510
score: 0
type: Comment
type: QuestionComment
has text: can u please provide me that code? i'm new to this
comment on: http://stackoverflow.com/q/27774037

http://stackoverflow.com/q/27675327
has body: Here i selected 3 filters 1 from each chart and pasted that encoded url in url param. but when i press decode url button it is redrawing only middle chart filters but not the remaining once.. what should i do? thanks function encodeFunction() { var filters = []; for (var i = 0; i &lt; dc.chartRegistry.list().length; i++) { var chart = dc.chartRegistry.list()[i]; for (var j = 0; j &lt; chart.filters().length; j++) { filters.push({ChartID: chart.chartID(), Filter: chart.filters()[j]}); } } var urlParam = encodeURIComponent(JSON.stringify(filters)); alert(urlParam); } function decodeFunction() { //encoded url here var urlParam="%5B%7B%22ChartID%22%3A1%2C%22Filter%22%3A2012%7D%2C%7B%22ChartID%22%3A2%2C%22Filter%22%3A%5B1.0454545454545454%2C4.045454545454545%5D%7D%2C%7B%22ChartID%22%3A3%2C%22Filter%22%3A%22Mr%20B%22%7D%5D "; var filterObjects = JSON.parse(decodeURIComponent(urlParam)); for (var i = 0; i&lt; filterObjects.length; i++) { dc.chartRegistry.list()[filterObjects[i].ChartID-1].filter(filterObjects[i].Filter); } // dc.renderAll(); dc.redrawAll(); } here is the fiddle: js fiddle link
downvote count: 0
favorite count: 0
tagged with: d3.js
linked to: http://stackoverflow.com/q/20853794
has title: storing dc.js filters in URI and restoring them
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/27688531
upvote count: 1
has answer: http://stackoverflow.com/a/27709651
accepted answer: http://stackoverflow.com/a/27709651
has comment: http://stackoverflow.com/comment/43770599
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43827714
has answer: http://stackoverflow.com/a/27688531
tagged with: javascript
tagged with: dc.js
has comment: http://stackoverflow.com/comment/43765466

http://stackoverflow.com/q/27659885
favorite count: 0
tagged with: angularjs
has body: I created a filter mechanism on checkboxes to display a list of items, modified from an example about wine. I'm wondering if there is something I'm missing in terms of basic code structure that would make this solution a lot easier to understand (i.e. structure), especially around the filter check and the DOM in case I'm not using filters the way they are supposed to be used or if there is something I can do to eliminate lines of code. JS Fiddle HERE Category: {{cat}} Popularity {{w.name}} ({{w.categories}}) Number of results: {{filtered.length}} ... $scope.filterByCategory = function (wine) { if (!$.isEmptyObject($scope.filter)) { var checkThisArray = wine.categories; for (var i = 0; i < checkThisArray.length; i++) { if ($scope.filter.hasOwnProperty(checkThisArray[i])) { if($scope.filter[checkThisArray[i]]) { return true; } } } } return noFilter($scope.filter); };
answer count: 0
downvote count: 0
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43736418
type: Question
has title: Improve the structure of this Angular filter solution
tagged with: javascript
has comment: http://stackoverflow.com/comment/43736216
upvote count: 1

http://stackoverflow.com/q/27679005
score: 1
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27679263
tagged with: ember.js
tagged with: css
has body: Ember class attributes for falseys are not being assigned when rendering page. I have two button elements Yes / No. The inactive button has a class rendering the opacity : .3 That is working fine. However I need to set a default behavior on these buttons so that on rendering the page the Yes is inactive. Should be simple I just set the property accordingly. However it isn't adding the appropriate class for the false value. Hope it is clear what I am trying to do and what the problem is. Thank you for your time. I made a JSbin http://jsbin.com/vixayatuda/1/edit?html,css,js,output window.App = Ember.Application.create(); App.ApplicationController = Em.Controller.extend({ takingTrade: false, actions: { makeTrade: function() { this.set('takingTrade', true); }, makeNotTrade: function() { this.set('takingTrade', false); } } });
has title: Ember class attributes for falseys are not being assigned when rendering page
upvote count: 1
accepted answer: http://stackoverflow.com/a/27679263
type: AnsweredQuestion

http://stackoverflow.com/a/27792601
answers question: http://stackoverflow.com/q/27792552
score: 3
upvote count: 3
has body: Your onclick is fine, but getElementByID is not a function and is throwing your error. You are looking for getElementById function ThePush() { var name = document.getElementById('name').value; var pl = document.getElementById('PL1').value; var plw = document.getElementById('theplw').value; var al = document.getElementById('theal').value; //do stuff with these variables. }
type: Answer
has comment: http://stackoverflow.com/comment/43994796
downvote count: 0

http://stackoverflow.com/a/27651625
answers question: http://stackoverflow.com/q/27642386
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has body: Following your problem description I reproduced a test case here: http://jsfiddle.net/w2nae2dq/. @icktoofay is right for one part: it is better to use a computed observable (but it is not required per se). If you need to show the 2 decimal value to edit you will need a writable computed observable. If however, you only want to display the 2 decimal number and make the MyNumber value editable, check the fiddle for a demo. In any case, the problem with your code was one of type conversion. Indeed, when you first set the value of MyNumber it is a number. However, when a user enters a new value in the &lt;input&gt; (and thus updates MyNumber), this value is set as a string value, which makes it impossible for the text: binding to execute the toFixed method on. So your computed observable would look like this: self.MyNumberRounded = ko.computed(function() { return parseFloat(self.MyNumber()).toFixed(2); // note parseFloat }, self); And that's why Object doesn't support property :)
accepted answer of: http://stackoverflow.com/q/27642386
has comment: http://stackoverflow.com/comment/43740794

http://stackoverflow.com/q/27694873
upvote count: 7
answer count: 4
has comment: http://stackoverflow.com/comment/43803351
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/49695659
has answer: http://stackoverflow.com/a/27695119
has answer: http://stackoverflow.com/a/28689757
type: Question
has comment: http://stackoverflow.com/comment/43803659
possible better answer: http://stackoverflow.com/a/28689757
tagged with: arrays
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27695119
has comment: http://stackoverflow.com/comment/43803528
score: 7
has comment: http://stackoverflow.com/comment/43803102
has title: Convert array to objects using JavaScript/AngularJS
favorite count: 0
tagged with: angularjs
has body: I need convert arrays inside my parent array to objects to match my database model data. I have array like this: emails: Array[2] 0: "example@mail.com" 1: "otherexample@mail.com" id: 1 firstname: "Jane" lastname: "Doe What I want to achieve is to convert emails array to array of objects like this: emails: Array[2] 0: { name: "example@mail.com" } 1: { name: "otherexample@mail.com" } id: 1 firstname: "Jane" lastname: "Doe I tried to use this code to convert array to object but for some reason it fails (no data are displayed -> variable rv is empty): var rv = {}; for (var i = 0; i &lt; dbInfo.emails.length; ++i) if (dbInfo.emails[i] !== undefined) rv[i] = dbInfo.emails[i]; Does someone knows why my code fails and does someone knows solution for this type of problem? Thanks advance.
has answer: http://stackoverflow.com/a/27695082
linked to: http://stackoverflow.com/q/2250953

http://stackoverflow.com/a/27732844
answers question: http://stackoverflow.com/q/27732824
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Exactly how the comparator function will be called &mdash; that is, the sequence of values passed in &mdash; is not defined by the specification of the language. It completely depends on the particular JavaScript implementation and (probably) on the values in the array being sorted. Suffice to say that the sorting algorithm calls your function when it wants to compare two numbers, and that's that. The function is expected to return a value that's negative, zero, or positive, indicating that the ordering of the two numbers should be that the first one comes first, that either can come first, or that the second one should come first. A quick way to do that is to just subtract the second number from the first. The function in your sample code is an anonymous function. It needs no name because it will be bound to a symbol in the receiving function as a result of the function call itself. You can give the function a name if you want to.
score: 3
accepted answer of: http://stackoverflow.com/q/27732824
upvote count: 3

http://stackoverflow.com/a/29083097
upvote count: 1
answers question: http://stackoverflow.com/q/27758478
has comment: http://stackoverflow.com/comment/62054438
has comment: http://stackoverflow.com/comment/46573473
has body: As of jQuery 1.5.1, this is the recommended way of structuring AJAX requests: $.ajax({ dataType: "jsonp", url: "http://www.linkedin.com/countserv/count/share", data: { callback: "?", format: "jsonp", url: "http://www.example.com/" } }).done(function(data) { console.log(data.count); });
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/43896918
score: 0
type: AnswerComment
type: Comment
has text: thanks this worked, but with -50px, how will i get my background-position to go back to its original value once you scroll back up?
comment on: http://stackoverflow.com/a/27742814

http://stackoverflow.com/q/27761903
has body: I'm trying to setup Dropzone in my Rails app to upload multiple images. Dropzone seems to appear on the page fine, but when I submit, the correct url is not uploaded to the database. The JSON returns {"message":"success","fileID":"/images/original/missing.png"}. It's using Paperclip's missing image url. Picture Model class Picture &lt; ActiveRecord::Base belongs_to :album has_attached_file :image, :path =&gt; ":rails_root/public/images/:id/:filename", :url =&gt; "/images/:id/:filename", :styles =&gt; { :small =&gt; "160x160&gt;" } do_not_validate_attachment_file_type :image end Pictures Controller def create @picture = Picture.create(picture_params) if @picture.save # send success header render json: { message: "success", fileID: @picture.image.url }, :status =&gt; 200 else # you need to send an error header, otherwise Dropzone # will not interpret the response as an error: render json: { error: @picture.errors.full_messages.join(',')}, :status =&gt; 400 end end pictures.js $(document).ready(function(){ // disable auto discover Dropzone.autoDiscover = false; // grap our upload form by its id $("#new_picture").dropzone({ // restrict image size to a maximum 1MB maxFilesize: 1, // changed the passed param to one accepted by // our rails app paramName: "picture[image]", // show remove links on each image upload addRemoveLinks: true }); }); pictures/_form &lt;%= simple_form_for(@picture, :html =&gt; {:class =&gt; 'dropzone', multipart: true}) do |f| %&gt; &lt;%= f.error_notification %&gt; &lt;div class="form-inputs"&gt; &lt;%= f.input :title %&gt; &lt;%= f.input :description %&gt; &lt;%= f.input :album_id %&gt; &lt;/div&gt; &lt;%= f.label :pictures, :class =&gt; 'control-label' %&gt; &lt;div class="controls"&gt; &lt;%= f.file_field "images[]"%&gt; &lt;/div&gt; &lt;div class="form-actions"&gt; &lt;%= f.button :submit %&gt; &lt;/div&gt; &lt;% end %&gt; Logs Started POST "/pictures" for ::1 at 2015-01-03 21:49:10 -0500 Value for params[:picture][:images] was set to nil, bec…
type: UnansweredQuestion
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/28009782
type: Question
tagged with: javascript
tagged with: paperclip
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/35170343
has title: Cannot upload images with Dropzone.js | Rails 4 and Paperclip

http://stackoverflow.com/q/27649508
has comment: http://stackoverflow.com/comment/43716349
has comment: http://stackoverflow.com/comment/43716378
accepted answer: http://stackoverflow.com/a/27649525
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: css
has comment: http://stackoverflow.com/comment/43716355
has title: How can I attach a method to an object to change CSS
type: AnsweredQuestion
has body: I wanted to make a method so that I could dynamically change CSS of an element without the longhanded methods document.getElementsByTagName("div")[0].style.borderColor = "red" and implement something like happens in the jQuery library. However, when I try to attach a css method to an element like this var __shorthandCss = function(sel){ var el = document.querySelectorAll(sel)[0]; el.css = function(attrs){ for (var attr in attrs){ el.style[attr] = attrs[attr]; } }; }; I get the error: Uncaught TypeError: Cannot read property 'css' of undefined What have I done wrong here? Have I gone about this in completely the wrong manner? var __shorthandCss = function(sel) { var el = document.querySelectorAll(sel)[0]; console.log(el); el.css = function(attrs) { for (var attr in attrs) { console.log(attr, attrs) el.style[attr] = attrs[attr]; } }; }; var trig = function() { __shorthandCss("#a").css({ "borderColor": "red" }); console.log(a); }; document.getElementById("b").addEventListener("click", trig); div { border: 1px solid black; padding: 5px; width: 150px; } JS Bin change border test div
has answer: http://stackoverflow.com/a/27649525
type: Question
score: 0
has comment: http://stackoverflow.com/comment/43716340

http://stackoverflow.com/q/27658487
has comment: http://stackoverflow.com/comment/43732736
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43732706
has comment: http://stackoverflow.com/comment/43732732
type: Question
has comment: http://stackoverflow.com/comment/43732779
has comment: http://stackoverflow.com/comment/43732731
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has title: To get all the row values using ajax
has comment: http://stackoverflow.com/comment/43732822
has body: In the below code I have a table with textbox and dropdownlist and I can create new rows dynamically. Now I want to get all the row values. I tried the following code but it is only getting the first row. $(function () { $("#Button1").click(function (event) { // Prevents Form Submission as you want to save data via AJAX event.preventDefault(); $.ajax({ type: "POST", url: "NewFile.aspx/InsertData", data: "{'Quantity':'" + $("#<%=txtQty.ClientID%>").val() + "','ProductID':'" + $("#<%=ddlProduct.ClientID%>").val() + "'}", contentType: "application/json; charset=utf-8", dataType: "json", async: "true", cache: "false", success: function (msg) { alert("Success"); // On success }, Error: function (x, e) { alert("Fail"); // On Error } }); }); }) <asp:DropDownList ID="ddlProduct" runat="server" Style="width: 100%; height:23px" ></asp:DropDownList> <asp:Button ID="Button1" Text="Save New" type="submit" ClientIDMode="Static" runat="server"></asp:Button>
answer count: 1
has answer: http://stackoverflow.com/a/27658568

http://stackoverflow.com/comment/43952227
type: Comment
has text: That makes sense. I did try that but I will try again and let you know. Cheers
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27770630

http://stackoverflow.com/comment/43701865
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27641315
has text: @BenjaminGruenbaum, the question you linked to seems to be more for when you have a static amount of different and specific things that you need to happen. In this case, that would be a lot of unnecessary code and would not work if the number of children is dynamic. The way he is doing it seems to work when I try it (see fiddle above)... could also be done with a recursive callback.
score: 0

http://stackoverflow.com/q/27766778
type: AnsweredQuestion
tagged with: gmaps4rails
possible better answer: http://stackoverflow.com/a/27767356
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/27767356
type: Question
tagged with: heroku
accepted answer: http://stackoverflow.com/a/27782982
has title: Heroku production : Gmaps is not defined - works in local
has body: On a simple page, I show a google map with one marker. In local, everythings works perfectly but, on Heroku I got an error in console : Uncaught ReferenceError: Gmaps is not defined this is related to handler = Gmaps.build('Google'); //and some other stuff Localy, this is working. But when I deployed this on heroku, it's like it can't load the JS. this is on the top of my file and the application.js //= require underscore //= require gmaps/google I'ts probably a simple error, maybe related to assets precompiled, but I'm not really an expert in this area
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/16766366
tagged with: javascript
has answer: http://stackoverflow.com/a/27782982

http://stackoverflow.com/comment/43770014
comment on: http://stackoverflow.com/q/27648881
score: 0
type: Comment
type: QuestionComment
has text: @aria, I found that ChildrenAsTriggers property is set to true by default on UpdatePanel. Still, by setting the property explicitly didn't solve this. Thanks btw.

http://stackoverflow.com/comment/43839833
type: QuestionComment
type: Comment
has text: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest
score: 0
comment on: http://stackoverflow.com/q/27713754

http://stackoverflow.com/comment/43956580
has text: _merge or extend give the same result. I might be doing something stupid but I have verified the incoming data so the error is from the controller code and not the front end. Push will not work as user may want to delete previously entered data.I am basically trying to add new objects in the array of objects that make up otherExp in my candidateProfile document.
comment on: http://stackoverflow.com/a/27772612
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43772788
type: QuestionComment
comment on: http://stackoverflow.com/q/27678937
has text: And is not closed. Have you checked the js console?
score: 1
type: Comment

http://stackoverflow.com/q/27698083
accepted answer: http://stackoverflow.com/a/27698889
score: 0
has comment: http://stackoverflow.com/comment/43811058
type: Question
has comment: http://stackoverflow.com/comment/43810837
answer count: 2
tagged with: arrays
has body: Test Seleziona l'ente COMUNE DI AGLIE' COMUNE DI AGRATE CONTURBIA Here's my simple web page with 2 options. The input tag is just for testing the POST data. Here's richiesta.php, that receives the POST data on change event (I followed this thread): <?php list($comparto, $ente) = explode("-", $_POST['data'], 2); echo "comparto: $comparto, ente: $ente"; ?> Here's what happens when I trigger the change event (from Firebug). POST is ok: Unfortunately the response has empty variables ($comparto and $ente): What's the problem with the explode/list function?
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27698783
has comment: http://stackoverflow.com/comment/43815396
has answer: http://stackoverflow.com/a/27698889
has title: POST two values and retrieve result of php function onchange
possible better answer: http://stackoverflow.com/a/27698783
linked to: http://stackoverflow.com/q/8027163
tagged with: explode
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/q/27773983
has comment: http://stackoverflow.com/comment/43959234
has title: Using YQL, how would you access certain elements of a requested webpage when it is returned as JSON?
has comment: http://stackoverflow.com/comment/43958743
linked to: http://stackoverflow.com/q/14220321
answer count: 0
has comment: http://stackoverflow.com/comment/43959080
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43958942
has comment: http://stackoverflow.com/comment/43959377
has comment: http://stackoverflow.com/comment/43959130
has comment: http://stackoverflow.com/comment/43959424
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43959288
has comment: http://stackoverflow.com/comment/43958923
has comment: http://stackoverflow.com/comment/43958910
type: Question
has body: Just using a random example with this webpage how would I be able to access and use the articleBody element of the page and then get the individual paragraph elements of the the articleBody? Meaning how would I get the paragraph elements as a string.
tagged with: yql
tagged with: javascript
has comment: http://stackoverflow.com/comment/43959443
score: 0

http://stackoverflow.com/q/27730150
favorite count: 0
tagged with: struts2
tagged with: ajax
accepted answer: http://stackoverflow.com/a/27738576
has body: Struts2 to ajax json response can we set it on jsp first and display jsp as response inside the ajax success here is the code it becomes very painful to write jsp/html tag using dynamic value in jquery so is there any way that after response we can display the html in jsp and that jsp is returned or display inside function(response){ }. $.post("add_cmt?content1="+comment_text+"&amp;postupload_id1="+getpID, { }, function(response){ $('#CommentPosted'+getpID).prepend("&lt;div&gt;"+'&lt;img src="images/'+comment_userid+"/"+comment_album+"/"+comment_pic +'" width="50" height="50" /&gt;'+"&lt;b&gt;"+comment_name+"&lt;/b&gt;"+" "+comment_text+"&lt;br/&gt;"+"few Seconds ago"+"&lt;/div&gt;"); });
has title: Struts2 to ajax json response how to set image on Jsp page
downvote count: 1
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27738576
score: -1
upvote count: 0
answer count: 1
tagged with: jsp
tagged with: javascript
tagged with: jquery

google-maps
tags question: http://stackoverflow.com/q/27785107
tag name: google-maps
tags question: http://stackoverflow.com/q/27802554
tags question: http://stackoverflow.com/q/27677511
tags question: http://stackoverflow.com/q/27782809
tags question: http://stackoverflow.com/q/27730642
tags question: http://stackoverflow.com/q/27793835
tags question: http://stackoverflow.com/q/27715150
tags question: http://stackoverflow.com/q/27755336
tags question: http://stackoverflow.com/q/27646351
tags question: http://stackoverflow.com/q/27786394
tags question: http://stackoverflow.com/q/27765446
tags question: http://stackoverflow.com/q/27650638
tags question: http://stackoverflow.com/q/27680744
tags question: http://stackoverflow.com/q/27690514
tags question: http://stackoverflow.com/q/27787618
tags question: http://stackoverflow.com/q/27658086
tags question: http://stackoverflow.com/q/27686811
tags question: http://stackoverflow.com/q/27662311
tags question: http://stackoverflow.com/q/27644833
tags question: http://stackoverflow.com/q/27743805
tags question: http://stackoverflow.com/q/27760133
tags question: http://stackoverflow.com/q/27770214
tags question: http://stackoverflow.com/q/27762581
tags question: http://stackoverflow.com/q/27680690
tags question: http://stackoverflow.com/q/27691601
tags question: http://stackoverflow.com/q/27765321
tags question: http://stackoverflow.com/q/27672398
tags question: http://stackoverflow.com/q/27641953
tags question: http://stackoverflow.com/q/27788677
tags question: http://stackoverflow.com/q/27790935
tags question: http://stackoverflow.com/q/27694183
tags question: http://stackoverflow.com/q/27742539
tags question: http://stackoverflow.com/q/27740631
type: Tag
tags question: http://stackoverflow.com/q/27684882
tags question: http://stackoverflow.com/q/27652768
tags question: http://stackoverflow.com/q/27731674
tags question: http://stackoverflow.com/q/27785991
tags question: http://stackoverflow.com/q/27648877
tags question: http://stackoverflow.com/q/27652225
tags question: http://stackoverflow.com/q/27718513
tags question: http://stackoverflow.com/q/27700844
tags question: http://stackoverflow.com/q/27679291
tags question: http://stackoverflow.com/q/27644999
tags question: http://stackoverflow.com/q/27713285
tags question: http://stackoverflow.com/q/27653261
tags question: http://stackoverflow.com/q/27667573
tags question: http://stackoverflow.com/q/27731258
tags question: http://stackoverflow.com/q/27748021
tags question: http://stackoverflow.com/q/27780902
tags question: http://stackoverflow.com/q/27664876

http://stackoverflow.com/q/27793288
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43995904
favorite count: 0
possible better answer: http://stackoverflow.com/a/27793313
accepted answer: http://stackoverflow.com/a/27793329
answer count: 4
has answer: http://stackoverflow.com/a/27793323
downvote count: 3
type: Question
tagged with: object
type: AnsweredQuestion
has title: Is there a .push like feature to dynamically add values to an object?
has comment: http://stackoverflow.com/comment/43995906
has body: When working with arrays you can dynamically add new values to the array by using the .push method. Is it possible to do the same when using objects? For example I have a text box and after the user has typed in something and click's add can you add the value to the object so it saves each one e.g Example: { message: "This is the first message", message: "This is the second message", message: "Third message etc" } Code: $(document).ready(function() { // var objArray = []; var objObject = {}; $('#icecream').on('click', function() { $(this).animate({'height': '200px'}, 300); }); $('#add').on('click', function() { var value = $('#icecream').val(); // objArray.push(value); // console.log(objArray); objObject = { message: value, } console.log(objObject); }); });
score: -3
has answer: http://stackoverflow.com/a/27793329
upvote count: 0
has answer: http://stackoverflow.com/a/27793319
has answer: http://stackoverflow.com/a/27793313

parse-platform
tags question: http://stackoverflow.com/q/27694844
tags question: http://stackoverflow.com/q/27741480
type: Tag
tags question: http://stackoverflow.com/q/27664131
tags question: http://stackoverflow.com/q/27732832
tags question: http://stackoverflow.com/q/27752769
tags question: http://stackoverflow.com/q/27657954
tags question: http://stackoverflow.com/q/27701162
tags question: http://stackoverflow.com/q/27726426
tags question: http://stackoverflow.com/q/27643307
tags question: http://stackoverflow.com/q/27767466
tags question: http://stackoverflow.com/q/27668758
tags question: http://stackoverflow.com/q/27745026
tags question: http://stackoverflow.com/q/27799917
tags question: http://stackoverflow.com/q/27707952
tags question: http://stackoverflow.com/q/27788069
tags question: http://stackoverflow.com/q/27641312
tags question: http://stackoverflow.com/q/27642063
tags question: http://stackoverflow.com/q/27740688
tags question: http://stackoverflow.com/q/27756009
tags question: http://stackoverflow.com/q/27643612
tags question: http://stackoverflow.com/q/27673036
tags question: http://stackoverflow.com/q/27735518
tags question: http://stackoverflow.com/q/27673798
tags question: http://stackoverflow.com/q/27759593
tags question: http://stackoverflow.com/q/27669687
tags question: http://stackoverflow.com/q/27743456
tags question: http://stackoverflow.com/q/27677966
tags question: http://stackoverflow.com/q/27704307
tags question: http://stackoverflow.com/q/27697585
tags question: http://stackoverflow.com/q/27744561
tags question: http://stackoverflow.com/q/27699368
tags question: http://stackoverflow.com/q/27709978
tags question: http://stackoverflow.com/q/27706376
tags question: http://stackoverflow.com/q/27777201
tags question: http://stackoverflow.com/q/27723121
tags question: http://stackoverflow.com/q/27657192
tags question: http://stackoverflow.com/q/27740615
tags question: http://stackoverflow.com/q/27737167
tags question: http://stackoverflow.com/q/27682089
tags question: http://stackoverflow.com/q/27757483
tags question: http://stackoverflow.com/q/27787785
tags question: http://stackoverflow.com/q/27713667
tags question: http://stackoverflow.com/q/27748368
tags question: http://stackoverflow.com/q/27798086
tags question: http://stackoverflow.com/q/27716328
tag name: parse-platform
tags question: http://stackoverflow.com/q/27680101
tags question: http://stackoverflow.com/q/27697237

http://stackoverflow.com/comment/43742987
has text: This adds a huge blank space on the top of my site, and doesn't animate at all. I added the `html, body { position: relative; }`
comment on: http://stackoverflow.com/a/27662954
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43738804
type: QuestionComment
type: Comment
has text: You can do data imports via the api, but you can only add data to existing transactions, not create transactions from scratch (for that you would rather use the measurement protocol).
comment on: http://stackoverflow.com/q/27655999
score: 0

http://stackoverflow.com/a/27720303
has body: You're almost there :) Try to change the init function, $(this) seems to be invalid because this context refering to the Widget object, not the dom..the dom should be $el Widget.prototype.init = function () { this.$el.append(' '); };
score: 1
answers question: http://stackoverflow.com/q/27719833
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/a/27768610
type: Answer
downvote count: 0
score: 1
has body: The answer is in the function parameters. Once those are put in then the data populated in the calendar. $(document).ready(function () { var events = []; $('#calendar').fullCalendar({ events: function(start, end, timezone, callback) { $.ajax({ url: source, type: 'POST', data: { }, success: function (doc) { events.push(doc); callback(events); } }); } }); });
accepted answer of: http://stackoverflow.com/q/27766405
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27766405

http://stackoverflow.com/q/27793098
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27793194
has comment: http://stackoverflow.com/comment/43995601
type: UnansweredQuestion
downvote count: 3
type: Question
has title: Can I pass a variable to an internally defined function?
has body: I'm trying to use a script I found online: http://fabricjs.com/particles/ And I'm having an issue where I want to define the number of particles to show outside that script as it changes. The line: var total = 1000 will need to change from time to time. I tried adding it to my classes but ended up with all sorts of errors that I spent hours trying to figure out, but ended up giving up on that. So, I've decided to use this original script and just try and change the number from the outside when I need to. Can I pass in a variable somehow? Edit: Here's a JSBin example of what I would like to do: http://jsbin.com/fasozewovi/1/edit?js Not sure if something like that is possible though.
score: -3
has comment: http://stackoverflow.com/comment/43995664
upvote count: 0
answer count: 1

http://stackoverflow.com/q/27750864
has body: I'm having a surprisingly hard time setting a default option for a radio button component in React. Here is my RadioToggle component: /** @jsx React.DOM */ var RadioToggle = React.createClass({ render: function () { var self = this; return ( &lt;div className="RadioToggle"&gt; {this.props.radioset.radios.map(function(radio, i){ return ( &lt;label className="__option" key={i}&gt; &lt;h3 className="__header"&gt;{radio.label}&lt;/h3&gt; {radio.checked ? &lt;input className="__input" type="radio" name={self.props.radioset.name} value={radio.value} defaultChecked /&gt; : &lt;input className="__input" type="radio" name={self.props.radioset.name} value={radio.value} /&gt; } &lt;span className="__label"&gt;&lt;/span&gt; &lt;/label&gt; ) }) } &lt;/div&gt; ); } }); module.exports = RadioToggle; And here is how I'm creating the component: &lt;RadioToggle radioset={ { name: "permission_level", radios: [ { label: "Parent", value: 1, checked: false }, { label: "Child", value: 0, checked: true } ]} }/&gt; The above code works, but we don't like generating almost identical code depending on the radio.checked option. The way the component is set up, I pass it a name and an array of radios to create, and for each object in the radios array use that data to create a radio button. In other cases I've been able to conditionally set attributes by putting ternary statements as the value, like below, but that doesn't work here. The problem with defaultChecked={radio.checked ? "checked" : ""} is that even with the output becoming checked="checked" on one radio button and checked on the other, it makes both radio buttons checked by default, resulting in the last one actually being checked. Again, the component above works, but I'm hoping someone with some more experience with React will have a cleaner way of doing it rather than generating almost identical elements except for that attribute.
downvote count: 0
accepted answer: http://stackoverflow.com/a/27750979
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/28298163
has comment: http://stackoverflow.com/comment/43928465
type: Question
has title: Conditionally setting html attributes in React.js
score: 9
answer count: 1
upvote count: 9
has answer: http://stackoverflow.com/a/27750979
tagged with: reactjs
tagged with: radio-button
type: AnsweredQuestion

http://stackoverflow.com/q/27736885
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/111102
tagged with: function
accepted answer: http://stackoverflow.com/a/27736903
downvote count: 0
tagged with: javascript
has body: I'm very new to JavaScript (and coding) and I'm studying through the book Head First JavaScript. From reading, I thought an anonymous function could be an argument since functions are values, but I think I might have this wrong. The following code, according to what I thought, should output 7. Instead it outputs, function () { return (m * n); }1 I've done similar things with strings and they don't process as expected either, according to my presumptions. Please tell me where I have gone wrong in my understanding of anonymous functions, the limits in the use of anonymous functions in javascript, and why we want to use anonymous functions ever, in general. Thanks so much.
has answer: http://stackoverflow.com/a/27737009
favorite count: 0
upvote count: 2
tagged with: anonymous
possible better answer: http://stackoverflow.com/a/27737009
has answer: http://stackoverflow.com/a/27736903
type: AnsweredQuestion
score: 2
has title: Anonymous functions don't work in Javascript? (Or maybe I just don't get anonymous functions)

http://stackoverflow.com/comment/43912592
type: Comment
has text: Oh, didnt even see the getUrl there! Going waay to fast. ill modify my code a bit to work with this. Thanks for the quickest answer i ever got!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27750708

http://stackoverflow.com/q/27661865
has title: ONSEN slider : relative links within pages accessed via slider menu
tagged with: javascript
tagged with: onsen-ui
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43741151
has comment: http://stackoverflow.com/comment/43741224
type: UnansweredQuestion
answer count: 0
has body: Onsen ui Slider works fine for calling simple pages. I managed to have somthing like so working: &lt;ons-list-item class="bottom-menu-item" ng-click="menu.setMainPage('dir_02/index.html', {closeMenu: true})"&gt; However the links to sub directories called from within dir_02/index.html will not work. For example the line below is part of the html of dir_02/index.html: link href="../cssdir/css/main.css" type="text/css" rel="stylesheet" The links in themselves are fine. They work if I launch my minisite directly from dir_02/index.html manually. As an aside, I also realized that f I put all the html files that dir_02/index.html can manually lead to via hyperlinks, at the root level (www), the manual hyperlinks work (if I click on them I get the intended page). BUT the slider disappears! However if I leave the files where they are supposed to be (that is, within the "dir02" folder, the link does no work. This is suprising since the link is written like so: href "someotherpage.html" It should be looking within the same directory , shouldn't it? But if I open it via the slider, the browser cannot find the file(s). Is there a workaround? Thanks, this is crucial to my project! :-)
type: Question

http://stackoverflow.com/comment/43752818
comment on: http://stackoverflow.com/q/27669001
has text: It should be noted that your issue could simply be solved by doing `this.innerHTML` instead !
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27784898
has comment: http://stackoverflow.com/comment/44441833
has body: If your controller class is NodeController, use only "Node" for the controller name in Url.Action: url: '@Url.Action("CallService", "Node")', You cannot synchronously return a value from an asynchronous function. Either pass a callback to CallService to be called on success or use jquery promise - http://api.jquery.com/promise/ We don't know what this.node.fill is or where it is defined. Likely, this.node is not defined at the time the assignment is executed.
score: 5
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27784889
type: Answer
accepted answer of: http://stackoverflow.com/q/27784889
upvote count: 5
downvote count: 0

http://stackoverflow.com/comment/43914833
score: 0
type: QuestionComment
type: Comment
has text: Multiple series is a common answer to this question.
comment on: http://stackoverflow.com/q/27751879

http://stackoverflow.com/q/27784776
tagged with: math
has comment: http://stackoverflow.com/comment/43979885
has comment: http://stackoverflow.com/comment/43990751
has answer: http://stackoverflow.com/a/27784977
score: 8
downvote count: 0
tagged with: javascript
has body: Consider the following triangle : I want to calculate angle X I have the following : var opposite = 2.5; var hypotenuse = 5; var sinOfAngleX = opposite / hypotenuse; // 0.5 So now I know that Math.sin(valueofAngleX) would return 0.5. But how do I get the value of an angle if I know the sine of the angle, using the Math() library? According to this tutorial, I need to do : var angleX = sin to the power of negative one of 0.5 but I don't know how to translate that into JS. I tried : var angleX = Math.pow(Math.sin(sinOfAngleX), -1); but it returns 2.085829642933488 which is obviously wrong. The correct answer should be 30 And in case all of the above is wrong to begin with, does anyone know how I can calculate angle X correctly using the JS Math() library? Thanks!
upvote count: 8
type: Question
type: AnsweredQuestion
tagged with: trigonometry
accepted answer: http://stackoverflow.com/a/27784977
favorite count: 0
has answer: http://stackoverflow.com/a/38658807
answer count: 2
has title: How do I calculate the angle of a right triangle using the Javascript Math library?
possible better answer: http://stackoverflow.com/a/38658807

http://stackoverflow.com/comment/43746349
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27665598
score: 2
has text: Also, it's not a good practice to append you anchor tag as string. Why don't you create an HTML element like `$(')` and then set it attributes.

http://stackoverflow.com/comment/43765849
type: Comment
comment on: http://stackoverflow.com/a/27671667
has text: OK thanks a lot for your answer.in my question I said when page run the first slide is exactly what I want but when time passes it's getting really bad
type: AnswerComment
score: 0

http://stackoverflow.com/a/27762660
has comment: http://stackoverflow.com/comment/122522560
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27760778
has body: Welcome to the world of Wordpress. Why not just delete the actual wp_enqueue_ files from function.php?? The only answer and explanation to this question is, if you are not the author of a plugin or theme, never make any type of modification to that plugin or theme. This also goes for Wordpress core files. The simple reason being, if you ever upgrade your theme/plugin/core, all your changes will be lost and cannot be retrieved. This is a very costly mistake The proper way In your case, you should use functions like wp_deregister_script() and wp_dequeue_script() to remove scripts you don't need. See this post on how to correctly remove scripts. This functions should go in either a custom plugin or a child theme. This should never go into the theme directly as this will be deleted when you update your theme. I hope this helps
upvote count: 2
answers question: http://stackoverflow.com/q/27760778
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/27642408
tagged with: angular-amd
has title: AngularAMD loading module does not work
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/27642808
upvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
has body: I'm trying to use angularAMD for a new project, but i can't get it to work. i have the following: main.js require.config({ baseUrl: "static/", paths: { 'angular': 'bower_components/angular/angular', 'angularAMD': 'bower_components/angularAMD/angularAMD', 'ngload': 'bower_components/angularAMD/ngload', 'ui-router': 'bower_components/angular-ui-router/release/angular-ui-router' }, shim: { 'ui-router': ['angular'], 'angularAMD': ['angular'], 'ngload': ['angularAMD'] }, deps: ['js/app'] }); app.js define(['angularAMD', 'ui-router'], function (angularAMD) { var app = angular.module('app', ['ui-router']); return angularAMD.bootstrap(app); }); index.html script tag &lt;script type="text/javascript" data-main="/static/js/main.js" src="/static/bower_components/requirejs/require.js"&gt;&lt;/script&gt; The issue is that i keep getting the Module Unavailable error. I'm probably doing something wrong, but if i check the example on the angularAMD homepage my setup seems alright.. Hope someone can give me a solution!
tagged with: requirejs
accepted answer: http://stackoverflow.com/a/27642808
type: AnsweredQuestion
downvote count: 1
type: Question

http://stackoverflow.com/q/27711673
type: Question
tagged with: javascript
score: 0
answer count: 1
has body: I'm trying to make a javascript, but I'm totally stuck. It is supposed to show a div for 5 seconds, hide it again, wait for 15 minutes, then show it again for 5 seconds, hide it again, wait again and all of that in an infinite loop. I played with some random nummers and this only changes how fast or slow it animates. Anyone got the key? I've been trying full time for the past 2 days. And I should mention I'm a beginner in javascript. The code so far: setInterval(function(){ $("#myDiv").show(10000); $("#myDiv").hide(10000); });
tagged with: show
tagged with: jquery
has title: Show div - hide div - wait 15 minutes - repeat
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27711730
has comment: http://stackoverflow.com/comment/43835399
type: AnsweredQuestion
tagged with: hide
has answer: http://stackoverflow.com/a/27711730

http://stackoverflow.com/comment/43768002
type: QuestionComment
score: 2
has text: I really wish people would have the courtesy and good sense to add a comment explaining why the checked down a question
comment on: http://stackoverflow.com/q/27676598
type: Comment

http://stackoverflow.com/a/27666388
upvote count: 0
score: -1
downvote count: 1
has body: Try this? window.onload = remember; var remember = function() { var name = localStorage.name; var pw = localStorage.pw; if(pw !== undefined &amp;&amp; name !== undefined) { document.sqrl.login_username.value = name; document.sqrl.secretkey.value = pw; } document.sqrl.onsubmit = function() { localStorage.name = document.sqrl.login_username.value; localStorage.pw = document.sqrl.secretkey.value; }; };
type: Answer
answers question: http://stackoverflow.com/q/27666344

http://stackoverflow.com/comment/43733693
has text: Also i tried with matrix rotation with `actor.physiMesh.matrix.makeRotationFromQuaternion((new THREE.Quaternion()).setFromEuler(new THREE.Euler(0, rot, 0, 'XYZ')));` but nothing :(
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27653572

http://stackoverflow.com/q/27792084
has answer: http://stackoverflow.com/a/27792149
score: -2
has answer: http://stackoverflow.com/a/27792542
tagged with: javascript
has title: How to Display name of image using onclick and this.title
downvote count: 2
has comment: http://stackoverflow.com/comment/43993783
has comment: http://stackoverflow.com/comment/44014843
has answer: http://stackoverflow.com/a/27792128
has comment: http://stackoverflow.com/comment/43993785
favorite count: 0
has body: My assignment is to display the image name on an image using onclick. I need to add an onClick handler to set the title property of the image to My New Title(Hint You can access the image title using this.title) This is my code, &lt;img src="tick1.gif" alt="tick1" onClick="setimagename(My New Title)';" /&gt; my instructor is not being much help as I keep asking what I'm missing but instead answers something else I know this is something simple, but I just cannot get it to work. Any ideas what I'm doing wrong ?
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27833595
upvote count: 0
has answer: http://stackoverflow.com/a/27792114
has comment: http://stackoverflow.com/comment/43995986
type: Question

http://stackoverflow.com/a/27756975
has body: So this works. Both the 2nd and 3rd select element are filtered by the 1st. The 3rd also filters out whatever was selected in the 2nd. As a side note and possibly helpful to anyone else trying to do something similar. I wanted to pre-populate the options with what the user had selected at a previous visit. The object is cached. Something that helped me do this but also was a little troubling was 'track by'. This post helped https://coderwall.com/p/p-glog/angularjs-using-trackby-with-filters-in-an-ng-repeat
accepted answer of: http://stackoverflow.com/q/27756331
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27756331
type: Answer
score: 0

http://stackoverflow.com/comment/66345380
has text: There is slight delay in display of facebook login button using this approach. I think loading of facebook api should be moved inside script tag after body.
comment on: http://stackoverflow.com/a/27724488
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/35013527
has body: I have a solution for you to get the domain in both Chrome and Opera, (in multiple nested cross-domain iframes), though unfortunately it is not possible in other browsers. You can use the 'window.location.ancestorOrigins' property. This snippet of code will work cross browser to get the closest possible page URL for you: https://gist.github.com/ocundale/281f98a36a05c183ff3f.js
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27728570
accepted answer of: http://stackoverflow.com/q/27728570
type: Answer

http://stackoverflow.com/comment/43791532
has text: Just check with alert if the radio button click is working after you checked all checkbox and uncheck some of them. To check radio button trigger function
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27687729
type: AnswerComment

http://stackoverflow.com/comment/43771523
type: AnswerComment
comment on: http://stackoverflow.com/a/27678489
type: Comment
score: 1
has text: OK, I think I get it. In my HTML, I might have the following code: . But my style sheet might have two styles, .first and .second. I can then use JQuery to change my html to . I'll give that a try. Thx!

http://stackoverflow.com/comment/43924023
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27756601
type: AnswerComment
has text: I'm not expert an in JS neither, but I guess that way return_element will be returned uninitiated, since return is instantaneous and callback is not.

http://stackoverflow.com/a/27649079
answers question: http://stackoverflow.com/q/27649067
has comment: http://stackoverflow.com/comment/43715593
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43715490
has comment: http://stackoverflow.com/comment/43715681
has body: .live() is deprecated as of v 1.7 and removed as of v 1.9. Use .on() instead: $("#bangunan-light-pagination").on('click', ".page-link", function(){ alert('This is Me'); }); Also as Marcel Gwerder pointed out you want to delegate the event listener to the parent, so notice the placement of .page-link: $("#bangunan-light-pagination").on('click', ".page-link", function(){ instead of $("#bangunan-light-pagination .page-link").on('click',function(){ FIDDLE
has comment: http://stackoverflow.com/comment/43715506
has comment: http://stackoverflow.com/comment/43715650
type: Answer
has comment: http://stackoverflow.com/comment/43715541
score: 0
accepted answer of: http://stackoverflow.com/q/27649067

http://stackoverflow.com/comment/43973137
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27780902
has text: When I fix your fiddle (include the Google Maps Javascript API v3), I get this javascript error: `Uncaught TypeError: Cannot read property 'replace' of undefined`
score: 0

http://stackoverflow.com/comment/43952665
type: Comment
has text: The equivalent in bluebird would be just the same, however `.defer` is not in primary documentation because its use is deprecated, for a good reason as it makes people use unnecessarily complicated and brittle code as you did here.
type: AnswerComment
comment on: http://stackoverflow.com/a/27757949
score: 0

http://stackoverflow.com/comment/87037207
has text: This help me a lot, since i already had an draggable="true" element outside my <a href >. So just adding a draggable="false" on the solved this for me. Thanks! +1
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/41768698

http://stackoverflow.com/comment/43861430
comment on: http://stackoverflow.com/q/27722349
score: 0
has text: Could it be something in the `.less` file, something in `styles.less`, that is causing the issue? I'd start by stripping it down to bare minimum style and let it compile that ... see where the issue actually is.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43724513
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27653704
type: QuestionComment
has text: It working fine for me http://jsfiddle.net/ny50h1nd/ what is your problem?

callback
tags question: http://stackoverflow.com/q/27679202
tag name: callback
tags question: http://stackoverflow.com/q/27681096
tags question: http://stackoverflow.com/q/27663125
tags question: http://stackoverflow.com/q/27739742
tags question: http://stackoverflow.com/q/27758979
tags question: http://stackoverflow.com/q/27747056
tags question: http://stackoverflow.com/q/27661938
tags question: http://stackoverflow.com/q/27732753
tags question: http://stackoverflow.com/q/27681445
tags question: http://stackoverflow.com/q/27672094
tags question: http://stackoverflow.com/q/27652392
tags question: http://stackoverflow.com/q/27800315
tags question: http://stackoverflow.com/q/27766646
tags question: http://stackoverflow.com/q/27772370
tags question: http://stackoverflow.com/q/27754687
tags question: http://stackoverflow.com/q/27706963
tags question: http://stackoverflow.com/q/27674321
tags question: http://stackoverflow.com/q/27722233
tags question: http://stackoverflow.com/q/27756059
tags question: http://stackoverflow.com/q/27796754
type: Tag

http://stackoverflow.com/a/27769055
accepted answer of: http://stackoverflow.com/q/27768959
has body: According to your JSON structure you should be able to access array as data.data .done(function (data) { console.log(data.data[0].descrizione_codice); });
answers question: http://stackoverflow.com/q/27768959
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43948853
has comment: http://stackoverflow.com/comment/60721871
type: Answer
has comment: http://stackoverflow.com/comment/60731368

http://stackoverflow.com/q/27646449
tagged with: tabs
has comment: http://stackoverflow.com/comment/43710805
type: AnsweredQuestion
has title: Jquery: How to click link when click any anywhere?
type: Question
has answer: http://stackoverflow.com/a/27646478
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/27646484
possible better answer: http://stackoverflow.com/a/27646478
accepted answer: http://stackoverflow.com/a/27646484
answer count: 2
downvote count: 3
upvote count: 1
has body: I have this code: Open in new tab When I click anywhere in website, the above link will be clicked. So, the new tab will be opened. How to do that ? I searched and tried a lot but failed.
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/43936800
type: QuestionComment
has text: UPDATE explain sorry: hi!, i have a problem with this code, in INSERT only insert the first item_price in every insert, in example i have three differents item_price, thanks for you help sorry for bad english
comment on: http://stackoverflow.com/q/27762824
score: 0
type: Comment

http://stackoverflow.com/a/27717123
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43846285
has comment: http://stackoverflow.com/comment/43846199
downvote count: 0
answers question: http://stackoverflow.com/q/27717038
has comment: http://stackoverflow.com/comment/43846182
has comment: http://stackoverflow.com/comment/43846849
has comment: http://stackoverflow.com/comment/43846616
has comment: http://stackoverflow.com/comment/43846985
has body: Modifying your code.. $.getScript(url, function (data, textStatus, jqxhr) { alert(data); // Data returned console.log(textStatus); // Success console.log(jqxhr.status); // 200 console.log("Load was performed."); $('textarea').val(data) // &lt;---------- ADD DATA TO TEXTAREA }); ALTERNATELY, You can do it using .load() function. $( "textarea" ).load( "path/to/myCss.css", function() { alert( "Load was performed." ); }); You dont have to use $.getScript(). Working Code Snippet: $( "textarea" ).load( "http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/black-tie/jquery-ui.css", function() { alert( "Load was performed." ); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;textarea&gt;&lt;/textarea&gt; Keep it simple. :)

linkedin-api
tags question: http://stackoverflow.com/q/27758478
tag name: linkedin-api
tags question: http://stackoverflow.com/q/27728151
type: Tag

http://stackoverflow.com/comment/44139392
has text: See [this](http://stackoverflow.com/questions/14874730/three-js-what-do-the-matrices-in-a-3d-object-represent) SO question explaining the different types of 3D matrices.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27716404

http://stackoverflow.com/q/27718996
tagged with: javascript
has comment: http://stackoverflow.com/comment/43850002
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43849725
tagged with: jquery
has comment: http://stackoverflow.com/comment/43852167
favorite count: 0
has body: I want to upgrade from requirejs version 2.0.0 to 2.1.5 Here is the code: define(['jquery', 'test.js'], function ($, test) { var test = new $.test({ //options }); .... }); test.js (function($) { var registerEvents = function() { //dosth }; $.test = function(options) { $(document).bind('ready', function() { registerEvents(); }); ... return test; } ... }); In version 2.0.0, requirejs holds the dom ready event till all resources are downloaded, so it worked correctly https://github.com/jrburke/requirejs/issues/249 When I upgrade to requirejs version 2.1.5, the registerEvents function will never be called. But supprisingly, if I change: $(document).bind('ready', function() { registerEvents(); }); To: $(document).ready(function() { registerEvents(); }); It worked fine So my question is: What are the difference between them? Edit: I am using jQuery v1.7.2 $(document).on('ready', function(){}) not working
has comment: http://stackoverflow.com/comment/43849780
has answer: http://stackoverflow.com/a/27719149
has comment: http://stackoverflow.com/comment/43849811
has comment: http://stackoverflow.com/comment/43849794
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43849837
has comment: http://stackoverflow.com/comment/43849750
has comment: http://stackoverflow.com/comment/43849834
upvote count: 3
accepted answer: http://stackoverflow.com/a/27719149
has comment: http://stackoverflow.com/comment/43849779
tagged with: requirejs
type: Question
score: 3
has title: What are the difference between $(document).bind('ready', function) and $(document).ready(function() {})
has comment: http://stackoverflow.com/comment/43849735
has comment: http://stackoverflow.com/comment/43849679
has comment: http://stackoverflow.com/comment/43849742

http://stackoverflow.com/comment/43971744
has text: `document.getElementsByClassName("adp-summary").innerHTML` fails because the return value of `getElementsByClassName()` is a node list, not a single element.
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/27780902

http://stackoverflow.com/comment/43713726
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27648113
has text: you check for it. trim the value and test first character

http://stackoverflow.com/q/27726725
answer count: 0
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I am trying to show more/less list items depending on the screen size. I want this to work on load and as the page is resized manually. It works fine if I directly use $(document).innerWidth() or document.documentElement.clientWidth, but if I set either of those to a variable and try to use that instead, it stops working. What gives? // Doesn't work var getWidth = document.documentElement.clientWidth; if (getWidth &lt;= 559) { // hide some list items } // Works if (document.documentElement.clientWidth &lt;= 559) { // hide some list items } Here is a jsbin example: http://jsbin.com/midice/1/edit?html,js,output
score: 1
has comment: http://stackoverflow.com/comment/43865474
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/43953875
has comment: http://stackoverflow.com/comment/43953873
has comment: http://stackoverflow.com/comment/43865787
has comment: http://stackoverflow.com/comment/43953877
has comment: http://stackoverflow.com/comment/43953874
has comment: http://stackoverflow.com/comment/43953872
upvote count: 1
has comment: http://stackoverflow.com/comment/43865560
has comment: http://stackoverflow.com/comment/43953876
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43865595
has title: Setting document.documentElement.clientWidth to a variable

qunit
tags question: http://stackoverflow.com/q/27803625
tags question: http://stackoverflow.com/q/27766213
tags question: http://stackoverflow.com/q/27695352
type: Tag
tags question: http://stackoverflow.com/q/27779557
tag name: qunit

http://stackoverflow.com/q/27706053
has comment: http://stackoverflow.com/comment/43823865
type: Question
has comment: http://stackoverflow.com/comment/43824195
tagged with: javascript
has comment: http://stackoverflow.com/comment/43916857
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/43823921
tagged with: css
answer count: 0
has body: I'm using the jQuery library 'transitions' for its extension in simply CSS tweening. The issue, however, comes when I simply try to hide or remove the backdrop (which causes the area around the appearing content to get darker). When I hide/remove the backdrop, the original site underneath it "flashes" with a bright color before returning to its original dark scheme. Webpage in question (just click one of the TV shows to make the backdrop appear, then click anywhere off of it to witness the removal + flashing) : Webpage in Question $(document).ready(function(){ $("#MetaContent").transition({scale:[0,0]}); $(".AMResultSelector").click(function(){ var Title = $(this).children("span").html(); var CoverPhoto = $(this).children("img").attr("src"); var Description = $(this).children("p").html(); $("#MetaTitle").html(Title); $("#MetaCoverPhoto").attr('src', CoverPhoto); $("#MetaSummary").html(Description); $("#AMMetaGoTo").children("a").attr("href", "/?Page=ViewAnime&amp;ID=" + $(this).attr("data-media-id")); //Center it setTimeout(function(){ var CWidth = $("#AMMetaPreviewBox").width(); var CHeight = $("#AMMetaPreviewBox").height(); var OffsetX = $("#MetaContent").width()/2; var OffsetY = $("#MetaContent").height()/2; console.log(OffsetX); $("#MetaContent").css("left", (CWidth/2 - OffsetX) + "px"); $("#MetaContent").css("top", (CHeight/2 - OffsetY) + "px"); }, 10); $("#AMMetaPreviewBox").show(); $("#MetaContent").transition({scale:[1,1]}, 200); }) $("#AMMetaPreviewBox").click(function(){ $("#MetaContent").transition({scale:[0,0]}, 200, function(){ $("#AMMetaPreviewBox").hide() }); }) }) &lt;/script&gt; I don't understand why this is happening... Browser: Google Chrome Version 39.0.2171.95 m
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43823962
has title: JavaScript animation causing bright screen flash

http://stackoverflow.com/comment/43899246
comment on: http://stackoverflow.com/q/27738692
type: Comment
type: QuestionComment
has text: Can you create a reproducible example? Hard to debug without your data.
score: 0

http://stackoverflow.com/comment/43783943
comment on: http://stackoverflow.com/q/27682055
score: 0
type: Comment
has text: An obvious solution would be to reference `users[0]` from the `findOne()` result. That's certainly more efficient than server-side contortions to achieve the same outcome.
type: QuestionComment

arrow-functions
tag name: arrow-functions
tags question: http://stackoverflow.com/q/27694914
tags question: http://stackoverflow.com/q/27670401
type: Tag
tags question: http://stackoverflow.com/q/27661306

http://stackoverflow.com/a/27792710
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27792361
has comment: http://stackoverflow.com/comment/64075189
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27792361
has body: You're calling a circleMarker method on your circleMarker object instance. That will never work. L.CircleMarker doesn't have a circleMarker method. This won't work: circleMarker.bindLabel(feature.properties['NAME'], { noHide: true }).circleMarker.addTo(map); This will: circleMarker.bindLabel(feature.properties['NAME'], { noHide: true }).addTo(map); And this will too: circleMarker.bindLabel(feature.properties['NAME'], { noHide: true }); circleMarker.addTo(map); But if you want to add a label without using L.CircleMarker you can simply do: onEachFeature: function (feature, layer) { layer.bindLabel(feature.properties['NAME'], { 'noHide': true }); } You're also loading your scripts in the incorrect order: &lt;script src="assets/leaflet-label/leaflet.label.js"&gt;&lt;/script&gt; &lt;script src="assets/leaflet-0.7.2/leaflet.js"&gt;&lt;/script&gt; Leaflet.label wants to extend classes from Leaflet, but it can't because Leaflet itself isn't loaded yet. So yes, you've loaded Leaflet.label, just not at the correct time. You could see this in your console, because Leaflet.label should throw an error when it doesn't find Leaflet. The correct way: &lt;script src="assets/leaflet-0.7.2/leaflet.js"&gt;&lt;/script&gt; &lt;script src="assets/leaflet-label/leaflet.label.js"&gt;&lt;/script&gt;
type: Answer
has comment: http://stackoverflow.com/comment/43996770
has comment: http://stackoverflow.com/comment/43996989
has comment: http://stackoverflow.com/comment/44013237

http://stackoverflow.com/q/27672246
has title: Chrome and Apple iphone emoticons in javascript/html
type: AnsweredQuestion
score: 0
accepted answer: http://stackoverflow.com/a/27672258
type: Question
tagged with: javascript
answer count: 1
has answer: http://stackoverflow.com/a/27672258
has body: I am displaying strings in javascript/html that have Apple iphone emoticons. Safari handles them. Chrome doesn't. What should I do?
tagged with: emoticons
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43814096
comment on: http://stackoverflow.com/q/27700620
score: 0
type: Comment
type: QuestionComment
has text: can you post the error thrown ?

http://stackoverflow.com/q/27727122
answer count: 1
has body: I've tried the .join() function jQuery has to animate more than one object at the same time. It failed my expectations. Here is my code. Please tell me why exactly this wouldn't work? $(document).ready(function() { animateRight(); var fourLevelMove = ["#CsecondObj", "#CnineObj"]; var fourLevelMoveone = fourLevelMove.join(); function animateRight() { $(fourLevelMoveone).animate({ 'marginLeft' : "+=220px" //moves left }, 900, 'swing', animateLeft); } function animateLeft() { $(fourLevelMoveone).animate({ 'marginLeft' : "-=220px" //moves right }, 900, 'swing', animateRight); } });
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27727140
type: Question
tagged with: jquery-animate
tagged with: javascript
tagged with: jquery
score: 0
has title: Animate more than one more div

http://stackoverflow.com/comment/44116675
comment on: http://stackoverflow.com/q/27761445
score: 0
type: Comment
has text: @2016rshah it was more of a general feeling than anything concrete so thought I'd put it as a comment rather than an answer, just in case it comes in useful.
type: QuestionComment

http://stackoverflow.com/comment/44003704
comment on: http://stackoverflow.com/a/27787820
type: AnswerComment
has text: @MrUpsidown already wrote this and I have accepted the answer. Thank you for the help.
score: 0
type: Comment

http://stackoverflow.com/comment/43769944
has text: look at my answer. I've posted a working example
score: 0
comment on: http://stackoverflow.com/q/27677458
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43782824
type: Comment
comment on: http://stackoverflow.com/a/27684226
score: 0
type: AnswerComment
has text: Hey still not working :( is there any way to check if the results is coming to the HTML file?

http://stackoverflow.com/comment/43873884
type: Comment
comment on: http://stackoverflow.com/a/27727871
score: 0
type: AnswerComment
has text: @danielnixon Good point. I have added a keyboard accessible alternative.

http://stackoverflow.com/comment/43824178
comment on: http://stackoverflow.com/q/27705996
score: 0
type: Comment
type: QuestionComment
has text: I can change list in the server controller to only find items with that specific user: Account.find({ user: req.user}) is that enough?

http://stackoverflow.com/comment/43922879
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27756032
has text: @ Pointy: No, it's not on the top, it's an overlay but with 1px more width than the red box. @ TiMESPLiNTER: This could be a rounding issue by CSS relative to the dimensions of the elements in your code. One option to avoid this is using pixel based dimensions like width: 250px

http://stackoverflow.com/a/27670340
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27670312
has body: The decimal representation has no way to keep track of leading zeros. If you wish to keep the leading zeros in the result, you need a fundamentally different approach (e.g. keeping the output as a string). Alternatively, if you know the width of the result a priori, you could just pad it with leading zeros on output.
downvote count: 0
has comment: http://stackoverflow.com/comment/43755445

http://stackoverflow.com/q/27795596
has comment: http://stackoverflow.com/comment/43999958
has body: It's possible to decode url in java which has been encoded in javascript js: params.url = encodeURIComponent(url); Does anyone know the correct way of doing this?
linked to: http://stackoverflow.com/q/6131520
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27795660
tagged with: java
has comment: http://stackoverflow.com/comment/43999928
type: Question
possible better answer: http://stackoverflow.com/a/27795660
tagged with: javascript
has answer: http://stackoverflow.com/a/27795638
linked to: http://stackoverflow.com/q/607176
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43999983
accepted answer: http://stackoverflow.com/a/27795638
has title: Decode url which has been encoded in javascript

http://stackoverflow.com/q/27733933
has comment: http://stackoverflow.com/comment/43879393
has body: I want to add class on siblings of target Element in javascript. I have done this before using jquery which is pretty easy. But In my current organization they do not use jquery and I need to done with javascript and that is very difficult for me. I have write some code that will attached a click function to an matched element but afterward I am not getting any login to how to make it happend. fiddle var elements= document.getElementsByTagName('*'),i; i=0; while(elements[i]){ if(elements[i].className=='c'){ elements[i].addEventListener('click',function(){ this.jsSiblings().jsAddClass('newClass') }) } i++ } Array.prototype.jsSiblings= function(){ //code } Array.prototype.jsAddClass=function(){ //code }
upvote count: 1
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27733990
linked to: http://stackoverflow.com/q/4378784
type: AnsweredQuestion
has title: find siblings and addclass using javascript only
score: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27733990

http://stackoverflow.com/a/27649403
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27649382
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: if(_("onee").checked = false &amp;&amp; _("two").checked = false){ change to if(_("onee").checked == false &amp;&amp; _("two").checked == false){... = is for assignment == is for value matching === is for value matching with type consideration
answers question: http://stackoverflow.com/q/27649382
score: 2

http://stackoverflow.com/q/27769338
possible better answer: http://stackoverflow.com/a/27769563
has answer: http://stackoverflow.com/a/27769563
tagged with: arrays
has body: In my Mongodb database I have a collection of documents of this type (Mongoose description): { colour: String, addedDate: {type: Date} } for example, here is a sample of the data: {colour: 'white', addedDate: '2014-09-24T23:00:00.000Z'} {colour: 'red', addedDate: '2014-09-24T23:00:00.000Z'} {colour: 'white', addedDate: '2013-11-24T23:00:00.000Z'} {colour: 'red', addedDate: '2012-09-24T23:00:00.000Z'} {colour: 'white', addedDate: '2014-01-24T23:00:00.000Z'} {colour: 'yellow', addedDate: '2014-09-24T23:00:00.000Z'}, I would like to get for certain colours (specified in an array), the documents with the latest 'addedDate' and store the result in an array. Here is my code: var Colour = require('../app/models/colour'); var colours = ['white', 'red']; var results = []; for (var i = 0; i&lt;colours.length; i++) { var name = colours[i]; (function(output, colour_name) { Colour.find({name: colour_name}) .sort('-addedDate').limit(1).exec( function (err, obj) { if (err) return console.log(err); output.push(obj); console.log('output LOG:' + output); } ); })(results, name); } // Now use the results array console.log('OUTPUT:' results); In the 'output LOG:' I get the array output as it should be (I am not showing here the _id for simplicity): output LOG: {colour: 'white', addedDate: '2014-09-24T23:00:00.000Z'} output LOG: {colour: 'white', addedDate: '2014-09-24T23:00:00.000Z'}, {colour: 'red', addedDate: '2014-09-24T23:00:00.000Z'} However, the final output is still empty. OUTPUT: How can I fill the 'results' array? In fact, I would like to pass it to a webpage, so I would like to collect all the results for those colours in advance before rendering the page.
tagged with: javascript
score: 0
answer count: 3
tagged with: mongoose
has answer: http://stackoverflow.com/a/27769779
has answer: http://stackoverflow.com/a/27769587
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27769779
has title: Fill array with results from Mongodb find()
type: Question
tagged with: mongodb

http://stackoverflow.com/comment/44007942
score: 0
type: QuestionComment
type: Comment
has text: That error doesn't relate to the code you've posted. See http://sscce.org/
comment on: http://stackoverflow.com/q/27799529

http://stackoverflow.com/a/27775702
has body: I had the same issue and I used the following: var tdata = new google.visualization.DataTable(); Then initialise headers of your table: tdata.addColumn('string', 'User'); tdata.addColumn('number', 'Rank'); tdata.addColumn('number', 'Age'); Then loop throught your dynamic data and do the following inside your loop: for (var i = 0; i &lt; usersTable.length; i++) { tdata.addRow([usersTable[i].name, parseInt(usersTable[i].rank), parseInt(usersTable[i].age) ]); } Then finally draw your Chart: chart.draw(tdata, options);
accepted answer of: http://stackoverflow.com/q/27775448
type: Answer
has comment: http://stackoverflow.com/comment/43963449
answers question: http://stackoverflow.com/q/27775448
score: 0
has comment: http://stackoverflow.com/comment/43965020
type: AcceptedAnswer

http://stackoverflow.com/comment/43905862
has text: Thanks for answer... I see in developers tools in network card: d3js and c3js are loaded as last javascripts then is loaded template. I had before working charts from http://www.chartjs.org/ same loaded like now and it was working properly...
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27747302

http://stackoverflow.com/a/27803543
upvote count: 4
has comment: http://stackoverflow.com/comment/44128145
has comment: http://stackoverflow.com/comment/44105485
has comment: http://stackoverflow.com/comment/44130100
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/27788107
has body: You can reverse the order of the elements in the document tree to make them overlap like you want. And then reverse their order using CSS, to place them in the right position again. This can be achieved, for example, using Flexible boxes: wrapper { display: flex; flex-direction: row-reverse; /* or `column-reverse` */ justify-content: flex-end; } ul { display: flex; list-style: none; padding: 0 0 0 1em; } ul.reversed { flex-direction: row-reverse; justify-content: flex-end; } li { border: 1px solid; margin-left: -1em; background: #fff; } Samantha Allison Rachael Rachael Allison Samantha Floating elements: wrapper { float: left; clear: both; } item { float: right; } ul { list-style: none; float: left; clear: both; padding: 0 0 0 1em; } li { float: left; border: 1px solid; margin-left: -1em; background: #fff; } ul.reversed > li { float: right; } Samantha Allison Rachael Rachael Allison Samantha Direction: wrapper { direction: rtl; text-align: left; } item { direction: ltr; } ul { list-style: none; padding: 0 0 0 1em; text-align: left; } li { display: inline-block; border: 1px solid; margin-left: -1em; background: #fff; } ul.reversed { direction: rtl; } ul.reversed > li { direction: ltr; } Samantha Allison Rachael Rachael Allison Samantha
has comment: http://stackoverflow.com/comment/44092370
type: Answer

http://stackoverflow.com/q/27673568
favorite count: 0
has comment: http://stackoverflow.com/comment/139635885
tagged with: chart.js
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
has body: Working with the Chart.js library. Everytime I make an AJAX call and update the chart with the new data the chart gets larger (feels like its now resizing properly or zooming in). I've tried to destroy the chart every time I redraw it, however I get a "Cannot read property 'destroy' of undefined" error. Here's my bit of code. myLine.destroy(); var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Bar(barChartData); myLine.canvas.width = 800; myLine.canvas.height = 500; I've also tried to fix this through the CSS, but the chart gets smaller instead in the canvas canvas { width: 100% !important; max-width: 800px; height: auto !important; } Thanks!
has answer: http://stackoverflow.com/a/39161297
tagged with: javascript
has answer: http://stackoverflow.com/a/30212952
answer count: 2
tagged with: canvas
has title: Chart.JS canvas gets larger every time drawn
downvote count: 0

http://stackoverflow.com/q/27748230
downvote count: 0
has body: I have a web application, where some internal pages use an EventSource to receive live updates from the server. The client code looks like this: var LiveClient = (function() { return { live: function(i) { var source = new EventSource("/stream/tick"); source.addEventListener('messages.keepalive', function(e) { console.log("Client "+ i + ' received a message.'); }); } }; })(); You can see a live demo on heroku: http://eventsourcetest.herokuapp.com/test/test/1. If you open the developer console, you will see a message printed every time an event is received. The problem is that when visiting internal links, the EventSource remains open, causing messages to be printed even after the visitor moves from one page to another - so if you visit the three links on the top, you will get messages from three sources. How can I close the previous connection after the user moves from one internal page to another? A hacky workaround that I tried was to use a global variable for the EventSource object, like this: var LiveClient = (function() { return { live_global: function(i) { // We set source as global, otherwise we were left // with sources remaining open after visiting internal // pages if (typeof source != "undefined" && source != null) { if (source.OPEN) { source.close(); console.log("Closed source"); } } source = new EventSource("/stream/tick"); source.addEventListener('messages.keepalive', function(e) { console.log("Client "+ i + ' received a message.'); }); } }; })(); Demo here: http://eventsourcetest.herokuapp.com/test/test_global/1, but I am looking for a solution that would avoid the use of a global variable if possible. The HTML code that is generated is: Page 1 | Page 2 | Page 3 | This is page 3 or with LiveClient.live_global(1); for the case with the global variable.
has answer: http://stackoverflow.com/a/27748364
type: AnsweredQuestion
tagged with: internal
score: 1
tagged with: global-variables
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
upvote count: 1
has title: How to avoid using a global variable, when closing an EventSource in internal links?
favorite count: 0
accepted answer: http://stackoverflow.com/a/27748364

http://stackoverflow.com/q/27659230
has body: My problem is that I can't make Masonry work with my Bootstrap columns (grid). Step 1 - I called for the Masonry in my like so : Step 2 - I wrote my bootstrap html (this is the part I want to apply Masonry on) : This is my wordpress post title Aymen Web Design 12-10-2014 Comments 24 The Bootstrap 3 grid system has four tiers of classes: xs (phones), sm (tablets), md (desktops), and lg (larger desktops). You can use nearly any combination of these classes to create more dynamic and flexible layouts. Read More Share me This is my wordpress post title Aymen Web Design 12-10-2014 Comments 24 The Bootstrap 3 grid system has four tiers of classes: xs (phones), sm (tablets), md (desktops), and lg (larger desktops). You can use nearly any combination of these classes to create more dynamic and flexible layouts. Read More Share me This is my wordpress post title Aymen Web Design 12-10-2014 Comments 24 The Bootstrap 3 grid system has four tiers of classes: xs (phones), sm (tablets), md (desktops), and lg (larger desktops). You can use nearly any combination of these classes to create more dynamic and flexible layouts. Read More Share me Step 3 - I added the javascript code above : var container = document.querySelector('#container'); var msnry = new Masonry( container, { // options columnWidth: 200, itemSelector: '.item' }); Step 4 I added .item class to col-lg-3 col-md-6 as yo ucan see in Step 1 But nothing happens, the columns don't take their right places as they should.
has comment: http://stackoverflow.com/comment/43734160
tagged with: masonry
tagged with: javascript
upvote count: 1
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/32099905
favorite count: 0
has title: Masonry doesn't work with Bootstrap 3
type: UnansweredQuestion
tagged with: css
tagged with: twitter-bootstrap
score: 1
type: Question

http://stackoverflow.com/comment/43952361
has text: What if I list all the attributes I want to sync, like brushSize & activeColor. Is there any way I can update my object "editor" with the new values from AppViewModel?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27770594
type: AnswerComment

http://stackoverflow.com/q/27739210
has body: UPDATE: In the end I used Java6 Normalizer to find out which characters are extensions of a-zA-Z. So now all weird characters get translated into those 50 ASCII letters. No noticable slowing down when typing/autocompleting. Using what algorithm does GAE Search API process strings? For optimization purposes (within browser) I need to mimic whatever processing is done to the "needle" string before it is matched against the indexes. Basically it means to translate "weird" characters into their "boring" (and lowercase) representations: ř,Ř => r ě,é,ë,Ě,É,Ë => e ... Is there some standardized (or at least "well known") translation table so I don't miss some characters?
tagged with: search
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/37855595
tagged with: google-cloud-datastore
has comment: http://stackoverflow.com/comment/43890443
has comment: http://stackoverflow.com/comment/43890490
tagged with: javascript
accepted answer: http://stackoverflow.com/a/37855595
has comment: http://stackoverflow.com/comment/43890877
tagged with: google-app-engine
has title: Search API: How come "Ondřej" matches "ondrej"? I need to mimic that in browser
score: 0
has answer: http://stackoverflow.com/a/27739404
type: AnsweredQuestion
tagged with: gae-search
possible better answer: http://stackoverflow.com/a/27739404

http://stackoverflow.com/a/27642247
has comment: http://stackoverflow.com/comment/43703198
has comment: http://stackoverflow.com/comment/43703595
type: AcceptedAnswer
downvote count: 0
has body: This expression [x * y * z].value makes no sense. Try this instead: function myFunction() { var x = document.getElementById("Section1").value; var y = document.getElementById("Section2").value; var z = document.getElementById("Section3").value; alert(x * y * z); } You can also use selectedIndex syntax: var section1 = document.getElementById("Section1"); var x = section1.options[section1.selectedIndex].value; // and so on.. But this is obviously less convenient.
answers question: http://stackoverflow.com/q/27642221
type: Answer
accepted answer of: http://stackoverflow.com/q/27642221
upvote count: 3
score: 3

http://stackoverflow.com/a/27661819
type: Answer
answers question: http://stackoverflow.com/q/27661755
accepted answer of: http://stackoverflow.com/q/27661755
type: AcceptedAnswer
has body: Simple answer - you can't. When the user leaves the page, the script is stopped. However, there's ways to work around that - some ideas: Have the URL never change, and do all interaction &amp; browsing with JavaScript (AJAX). It's not easy, but most websites that do something like what you want do it this way. Use frames / iframes. This is an old-fashioned solution, but would do the trick. Change only the frame with content, and the player stays playing in another frame or the outer page. Note - you can change URL in the browser nav bar using the History API - so people will feel like they go to different page and can eg. bookmark it, while really staying on the same one.
score: 0